3 log_debug('Checking permit circ on ' +
5 ' Patron:' + patron.id +
6 ' Patron Profile: ' + patron.profile +
7 ' Patron Standing: ' + patron.standing +
8 ' Patron copies: ' + patron_info.items_out +
9 ' Patron fines: ' + patron_info.fines );
12 /* Patron checks --------------------------------------------- */
13 if( ! patron.standing.match(/good/i) )
14 return result.event = 'PATRON_BAD_STANDING';
16 if( patron.profile.match(/patrons/i) && patron_info.items_out > 10 )
17 return result.event = 'PATRON_EXCEEDS_CHECKOUT_COUNT';
19 if( patron.profile.match(/staff/i) && patron_info.items_out > 30 )
20 return result.event = 'PATRON_EXCEEDS_CHECKOUT_COUNT';
23 /* Copy checks ------------------------------------------------ */
24 if( is_false( copy.circulate ) )
25 return result.event = 'COPY_CIRC_NOT_ALLOWED';
27 /* check for holds -------------------------------------------- */
28 fetch_hold_by_copy( copy.id );
29 if( hold && hold.usr != patron.id )
30 return result.event = 'COPY_NEEDED_FOR_HOLD';