]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/javascript/backend/circ/circ_permit_hold.js
fixed logic error created by log line (no brackets), removed alert line
[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 /* projected medium 
10         this needs to be expanded to check circ_modifiers as well
11 */
12
13 var mod = (copy.circ_modifier) ? copy.circ_modifier.toLowerCase() : "";
14
15 log_info("circ-modifier = "+mod);
16
17
18 if( mod == 'bestsellernh' )
19         result.events.push('ITEM_NOT_HOLDABLE');
20
21 if( ( getMARCItemType() == 'g' || 
22                 mod == 'audiobook' || 
23                 mod == 'av' || 
24                 mod == 'cd' || 
25                 mod == 'dvd' || 
26                 mod == 'video' ) &&
27
28                 !isOrgDescendent(copy.circ_lib.shortname, patron.home_ou.id) ) {
29
30         log_info("This patron may not place a hold on the selected item");
31
32         result.events.push('ITEM_NOT_HOLDABLE');
33 }
34
35
36 } go();
37