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