3 /* load the lib script */
4 load_lib('../circ/circ_lib.js');
5 log_vars('patron_penalty');
9 PROFILES['class'] = { fineLimit : 10, overdueLimit : 10 };
10 PROFILES['patrons'] = { fineLimit : 10, overdueLimit : 10 };
11 PROFILES['restricted'] = { fineLimit : 0, overdueLimit : 0 };
12 PROFILES['circulators'] = { fineLimit : -1, overdueLimit : -1 };
13 PROFILES['local system administrator'] = { fineLimit : -1, overdueLimit : -1 };
14 /* add profiles as necessary ... */
16 var profile = PROFILES[patronProfile];
20 /* check the fine limit */
21 if( profile.fineLimit > 0 && patronFines >= profile.fineLimit )
22 result.fatalEvents.push('PATRON_EXCEEDS_FINES');
24 /* check the overdue limit */
25 if( profile.overdueLimit > 0 && patronOverdueCount > profile.overdueLimit )
26 result.fatalEvents.push('PATRON_EXCEEDS_OVERDUE_COUNT');
29 log_warn("profile has no configured information: " + patronProfile);