]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/javascript/backend/circ/circ_permit_copy.js
cleaning up, testing
[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_lib.js');
5 log_vars('circ_permit_copy');
6
7
8
9 if( ! isTrue(copy.circulate) ) 
10         result.events.push('COPY_CIRC_NOT_ALLOWED');
11
12 if( isTrue(copy.ref) ) 
13         result.events.push('COPY_IS_REFERENCE');
14
15
16
17 if(copyStatus != 'available' && 
18         copyStatus != 'on holds shelf' && copyStatus != 'reshelving' ) {
19                 result.events.push('COPY_NOT_AVAILABLE');
20 }
21
22 /* this should happen very rarely .. but it needs to be protected */
23 if( recDescriptor.item_type == 'g'  /* projected medium */
24         && copy.circ_lib != patron.home_ou.id )
25         result.events.push('CIRC_EXCEEDS_COPY_RANGE');
26
27
28
29         
30 } go();
31
32