]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/javascript/backend/circ/circ_permit_hold.js
updated hold permit to check correct lib, inserting location into script env
[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
16 if( mod == 'bestsellernh' )
17         result.events.push('ITEM_NOT_HOLDABLE');
18
19 if( ( getMARCItemType() == 'g' || 
20                 mod == 'audiobook' || 
21                 mod == 'av' || 
22                 mod == 'cd' || 
23                 mod == 'dvd' || 
24                 mod == 'video' ) &&
25
26                 !isOrgDescendent(copy.circ_lib.shortname, patron.home_ou.id) )
27
28         result.events.push('ITEM_NOT_HOLDABLE');
29
30 } go();
31