]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/javascript/backend/circ/circ_permit_patron.js
removed hold shelf check - that is now handled by the perl
[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
9 if( isTrue(patron.barred) ) 
10         result.events.push('PATRON_BARRED');
11
12
13 /* ---------------------------------------------------------------------
14         Check the items out count 
15         --------------------------------------------------------------------- */
16 var config = findGroupConfig(patronProfile);
17 if( config ) {
18         
19         var limit = config.maxItemsOut;
20         if( limit >= 0 ) {
21
22                 /* a renewal does not add to the itemsOut, so just make
23                         sure they are not already over the items out limit */
24                 if( isTrue(isRenewal) ) {
25                         if( patronItemsOut > limit ) {
26                                 result.events.push('PATRON_EXCEEDS_CHECKOUT_COUNT');
27                         }
28                 } else {
29                         if( patronItemsOut >= limit ) {
30                                 result.events.push('PATRON_EXCEEDS_CHECKOUT_COUNT');
31                         }
32                 }
33         }
34
35 } else {
36         log_warn("** profile has no configured information: " + patronProfile);
37 }
38
39
40 } go();
41
42