]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/javascript/backend/circ/circ_permit_copy.js
f29df8efa878fb109ddab0cbff1df31f5790f687
[Evergreen.git] / Open-ILS / src / javascript / backend / circ / circ_permit_copy.js
1 function go() {
2
3 /* load the lib script */
4 load_lib('circ/circ_lib.js');
5 log_vars('circ_permit_copy');
6
7
8 if( ! isTrue(copy.circulate) ) 
9         result.events.push('COPY_CIRC_NOT_ALLOWED');
10
11
12 if( ! isOrgDescendent( 'STATELIB', copy.circ_lib.id ) ) {
13         if( isTrue(copy.ref) ) 
14                 result.events.push('COPY_IS_REFERENCE');
15 }
16
17
18
19 if( ! isTrue(isRenewal) ) {
20         if(copyStatus != 'Available' && 
21                 copyStatus != 'On holds shelf' && copyStatus != 'Reshelving' ) {
22                         result.events.push('COPY_NOT_AVAILABLE');
23         } 
24
25         if( copyStatus == 'On holds shelf' )
26                         result.events.push('ITEM_ON_HOLDS_SHELF');
27 }
28
29
30 /* this should happen very rarely .. 
31         but it should at least require an override */
32
33
34 if( getMARCItemType() == 'g' && copy.circ_lib.id != currentLocation.id )
35         result.events.push('CIRC_EXCEEDS_COPY_RANGE');
36
37
38         
39 } go();
40
41