3 /* load the script library */
4 load_lib('circ_lib.js');
5 log_vars('circ_permit_patron');
9 /* make sure they are not barred */
10 if( isTrue(patron.barred) )
11 result.events.push('PATRON_BARRED');
14 /* ---------------------------------------------------------------------
15 Set up the limits for the various profiles.
16 values of -1 mean there is no limit
17 --------------------------------------------------------------------- */
19 PROFILES['class'] = { itemsOutLimit : 10 };
20 PROFILES['patrons'] = { itemsOutLimit : 10 };
21 PROFILES['restricted'] = { itemsOutLimit : 2 };
22 PROFILES['circulators'] = { itemsOutLimit : -1 };
23 PROFILES['local system administrator'] = { itemsOutLimit : -1 };
24 /* add profiles as necessary ... */
29 /* ---------------------------------------------------------------------
30 Check the items out count
31 --------------------------------------------------------------------- */
32 var profile = PROFILES[patronProfile];
34 if( patronItemsOut > 0 && patronItemsOut > profile.itemsOutLimit )
35 result.events.push('PATRON_EXCEEDS_CHECKOUT_COUNT');
37 log_warn("profile has no configured information: " + patronProfile);