]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/javascript/backend/circ/circ_permit_patron.js
95496884a25b1bdcec21f955a390eade8ba30920
[Evergreen.git] / Open-ILS / src / javascript / backend / circ / circ_permit_patron.js
1 function go() {
2
3 /* load the script library */
4 load_lib('circ/circ_lib.js');
5 load_lib('JSON_v1.js');
6 log_vars('circ_permit_patron');
7
8
9 if( isTrue(patron.barred) ) 
10         result.events.push('PATRON_BARRED');
11
12 var config = findGroupConfig(patronProfile);
13
14 if( config ) {
15
16     var limit = config.maxItemsOut;
17     if( limit >= 0 ) {
18         log_info('patron items out = ' + patronItemsOut +' limit = ' + limit);
19         if( !isTrue(isRenewal) && patronItemsOut >= limit ) {
20             result.events.push('PATRON_EXCEEDS_CHECKOUT_COUNT');
21         }
22     }
23     
24 } else {
25
26     log_warn("** profile has no configured information: " + patronProfile);
27 }
28
29
30
31 } go();
32
33