]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/javascript/backend/circ/circ_permit_copy.js
re-organizing, testing, adding functions, adding group configs
[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 load_lib('circ_groups.js');
6 load_lib('../catalog/record_type.js');
7
8 log_vars('circ_permit_copy');
9
10
11 if( ! isTrue(copy.circulate) ) 
12         result.events.push('COPY_CIRC_NOT_ALLOWED');
13
14 if( isTrue(copy.ref) ) 
15         result.events.push('COPY_IS_REFERENCE');
16
17
18
19 if(copyStatus != 'Available' && 
20         copyStatus != 'On holds shelf' && copyStatus != 'Reshelving' ) {
21                 result.events.push('COPY_NOT_AVAILABLE');
22 }
23
24 var type = extractFixedField(marcXMLDoc, 'Type');
25 log_stdout('type = ' + type);
26
27 /* this should happen very rarely .. but it should at least require an override */
28 if( extractFixedField(marcXMLDoc, 'Type') == 'g' 
29         && copy.circ_lib != patron.home_ou.id )
30         result.events.push('CIRC_EXCEEDS_COPY_RANGE');
31
32
33         
34 } go();
35
36