added to cvs
[Evergreen.git] / Open-ILS / src / javascript / backend / circ / circ_permit_renew.js
1 function go() {
2
3 /* load the lib script */
4 load_lib('circ_lib.js');
5
6 /* collect some useful variables */
7 var copy                                        = environment.copy;
8 var patron                              = environment.patron;
9 var patronStanding      = patron.standing.value.toLowerCase();
10 var patronProfile               = patron.profile.name.toLowerCase();
11 var copyStatus                  = copy.status.name.toLowerCase();
12 var patronItemsOut      = environment.patronItemsOut;
13 var patronFines         = environment.patronFines;
14 var isRenewal                   = environment.isRenewal;
15
16 var holds = copy.fetchHolds();
17 for( var i in holds ) {
18         var hold = holds[i];
19         if( hold && hold.usr != patron.id )
20                 return result.event = 'COPY_NEEDED_FOR_HOLD';
21 }
22
23 } go();