]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/javascript/backend/circ/circ_permit_copy.js
first round of a circ script tester, fixed some typos
[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
6 /* collect some useful variables */
7 var copy                                        = environment.copy;
8 var patron                              = environment.patron;
9 var patronProfile               = patron.profile.name.toLowerCase();
10 var copyStatus                  = copy.status.name.toLowerCase();
11 var isRenewal                   = environment.isRenewal;
12
13
14 log_debug('circ_permit_copy: permit circ on ' +
15         ' Copy: '                                       + copy.id + 
16         ', Patron:'                                     + patron.id +
17         ', Patron Username:'            + patron.usrname +
18         ', Patron Library: '            + patron.home_ou.name +
19         ', Copy status: '                       + copyStatus +
20         ', Copy location: '             + copy.location.name +
21         ', Is Renewal: '                        + ( (isRenewal) ? "yes" : "no" ) +
22         '');
23
24
25
26 if( ! isTrue(copy.circulate) ) 
27         result.events.push('COPY_CIRC_NOT_ALLOWED');
28
29 if( isTrue(copy.ref) ) 
30         result.events.push('COPY_IS_REFERENCE');
31
32
33
34 if(copyStatus != 'available' && 
35         copyStatus != 'on holds shelf' && copyStatus != 'reshelving' ) {
36                 result.events.push('COPY_NOT_AVAILABLE');
37 }
38         
39         
40 } go();
41
42