]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/javascript/backend/circ/circ_permit_hold.js
it seems it is SOFTWRLONG, not SOFTWARELONG
[Evergreen.git] / Open-ILS / src / javascript / backend / circ / circ_permit_hold.js
1 function go() {
2
3 load_lib('circ/circ_lib.js');
4 log_vars('circ_permit_hold');
5
6 if( isTrue(patron.barred) ) 
7         result.events.push('PATRON_BARRED');
8
9 if( isTrue(copy.ref) ) 
10         result.events.push('ITEM_NOT_HOLDABLE');
11
12 /* projected medium 
13         this needs to be expanded to check circ_modifiers as well
14 */
15
16 var mod = (copy.circ_modifier) ? copy.circ_modifier.toLowerCase() : "";
17
18 log_info("circ-modifier = "+mod);
19
20
21 if( mod == 'bestsellernh' )
22         result.events.push('ITEM_NOT_HOLDABLE');
23
24 var marcItemType = getMARCItemType();
25
26 if( ( marcItemType == 'g' || 
27                 marcItemType == 'i' || 
28                 marcItemType == 'j' || 
29                 mod == 'softwrlong' || 
30                 mod == 'music' || 
31                 mod == 'audiobook' || 
32                 mod == 'av' || 
33                 mod == 'cd' || 
34                 mod == 'dvd' || 
35                 mod == 'video' ) &&
36
37                 !isOrgDescendent(copy.circ_lib.shortname, patron.home_ou.id) ) {
38
39         log_info("This patron may not place a hold on the selected item");
40
41         result.events.push('ITEM_NOT_HOLDABLE');
42 }
43
44
45 } go();
46