3 /* load the lib script */
4 load_lib('circ_lib.js');
7 /* collect some useful variables */
8 var patron = environment.patron;
9 var patronProfile = patron.profile.name.toLowerCase();
10 var patronItemsOut = environment.patronItemsOut;
11 var patronFines = environment.patronFines;
12 var isRenewal = environment.isRenewal;
15 log_debug('circ_permit_patron: permit circ on ' +
16 ', Patron:' + patron.id +
17 ', Patron Username:' + patron.usrname +
18 ', Patron Profile: ' + patronProfile +
19 ', Patron copies: ' + patronItemsOut +
20 ', Patron Library: ' + patron.home_ou.name +
21 ', Patron fines: ' + patronFines +
22 ', Is Renewal: ' + ( (isRenewal) ? "yes" : "no" ) +
26 if( isTrue(patron.barred) )
27 result.events.push('PATRON_BARRED');
30 /* define the items out limits */
42 'local system administrator' : {
50 /* Add profiles as necessary ... */
54 var profile = PROFILES[patronProfile];
56 if( patronItemsOut > 0 && patronItemsOut > profile.itemsOutLimit )
57 result.events.push('PATRON_EXCEEDS_CHECKOUT_COUNT');
59 log_warn("profile has no configured information: " + patronProfile);