log_debug("circ_duration found a config for the copy");
result.durationRule = config.durationRule;
result.recurringFinesRule = config.recurringFinesRule;
- result.maxFine = config.maxFine;
+ result.maxFine = config.maxFine;
} else {
a : { /* Language material [Books] */
SIPMediaType : '001',
magneticMedia : 'f',
- durationRule : 'default'
- recurringFinesRule : 'default'
+ durationRule : 'default',
+ recurringFinesRule : 'default',
maxFine : 'default'
},
/* add more MARC item type configs as needed... */
'bestseller' : {
SIPMediaType : '001',
magneticMedia : 'f',
- durationRule : 'default'
- recurringFinesRule : 'default'
+ durationRule : 'default',
+ recurringFinesRule : 'default',
maxFine : 'default'
},
}
var currentLocation = environment.location;
var holdRequestLib = environment.requestLib;
var holdPickupLib = environment.pickupLib; /* hold pickup lib */
+var requestor = environment.requestor || patron;
groupList[child]);
}
+function isGroupDescendantId( parentName, childId ) {
+ log_debug("checking descendant ID p="+parentName + " c=" + childId);
+ return __isGroupDescendant(
+ groupList[parentName],
+ groupIDList[childId]);
+}
/**
} catch(e) {}
}
+ if(requestor.id != patron.id)
+ str+= ' Requestor='+requestor.usrname;
+
if(copy) {
str += ', Copy=' + copy.id;
str += ', Copy_Barcode=' + copy.barcode;
log_vars('circ_permit_hold');
+
if( isTrue(patron.barred) )
result.events.push('PATRON_BARRED');
result.events.push('ITEM_NOT_HOLDABLE');
+var config = findGroupConfig(patronProfile);
+
+if( config ) {
+
+ /* see if they have too many items out */
+ var limit = config.maxHolds;
+ var count = userHoldCount(patron.id);
+ if( limit >= 0 && count >= limit ) {
+ log_info("patron has " + count + " open holds");
+ result.events.push('MAX_HOLDS');
+ }
+}
+
+
} go();
result.events.push('PATRON_BARRED');
var config = findGroupConfig(patronProfile);
-/* inspect the config too see if this patron should be allowed */
+
+if( config ) {
+
+ var limit = config.maxItemsOut;
+ if( limit >= 0 ) {
+ log_info('patron items out = ' + patronItemsOut +' limit = ' + limit);
+ if( !isTrue(isRenewal) && patronItemsOut >= limit ) {
+ result.events.push('PATRON_EXCEEDS_CHECKOUT_COUNT');
+ }
+ }
+
+} else {
+
+ log_warn("** profile has no configured information: " + patronProfile);
+}
+
} go();