]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/javascript/backend/circ/circ_item_config.js
removed some unused circ scripts
[Evergreen.git] / Open-ILS / src / javascript / backend / circ / circ_item_config.js
1 load_lib('circ/circ_lib.js');
2 log_debug('loading circ_item_config.js ...');
3
4
5 /* SIP media types
6 000 Other
7 001 Book
8 002 Magazine
9 003 Bound journal
10 004 Audio tape
11 005 Video tape
12 006 CD/CDROM
13 007 Diskette
14 008 Book with diskette
15 009 Book with CD
16 010 Book with audio tape
17 */
18
19 /* ----------------------------------------------------------------------------- 
20         Configure the duration rules for the various item types and circ modifiers
21         MARC Fixed Field info:
22         http://www.oclc.org/bibformats/en/fixedfield/
23         ----------------------------------------------------------------------------- */
24
25 var MARC_ITEM_TYPE_MAP = {
26         a : { /* Language material [Books] */
27                 SIPMediaType                    : '001',
28                 magneticMedia                   : 'f',
29                 durationRule                    : 'default'
30                 recurringFinesRule          : 'default'
31                 maxFine                                 : 'default'
32         },
33     /* add more MARC item type configs as needed... */
34 }
35
36 /* make 't' and 'a' share the same config info */
37 MARC_ITEM_TYPE_MAP.t = MARC_ITEM_TYPE_MAP.a;
38
39
40 var CIRC_MOD_MAP = {
41         'bestseller'                            : {
42                 SIPMediaType                    : '001',
43                 magneticMedia                   : 'f',
44                 durationRule                    : 'default'
45                 recurringFinesRule          : 'default'
46                 maxFine                                 : 'default'
47         },
48 }
49
50
51 /* this will set defaults even if no one asked for them */
52 log_debug("Calling getItemConfig() to force defaults..");
53 getItemConfig();
54
55
56 function getItemConfig() {
57
58         var config = null;
59         var marcType    = getMARCItemType();
60         var circMod             = copy.circ_modifier;
61
62     if( circMod ) {
63         config = CIRC_MOD_MAP[circMod];
64         if(!config) 
65             config = CIRC_MOD_MAP[circMod.toLowerCase()]
66     }
67
68     if(!config)
69                 config = MARC_ITEM_TYPE_MAP[marcType];
70
71     if(!config) {
72         config = {};
73                 config.SIPMediaType = '001';
74                 config.magneticMedia = 'f';
75                 config.durationRule     = 'default';
76                 config.recurringFinesRule = 'default';
77                 config.maxFine = 'default';
78     }
79
80     return config
81 }
82
83
84
85
86