[open-ils-commits] r8811 - in trunk:
Evergreen/src/javascript/backend/circ
Open-ILS/src/javascript/backend/circ
Open-ILS/src/perlmods/OpenILS/Application/Circ
Open-ILS/src/perlmods/OpenILS/Utils
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Feb 21 19:40:18 EST 2008
Author: erickson
Date: 2008-02-21 19:09:41 -0500 (Thu, 21 Feb 2008)
New Revision: 8811
Modified:
trunk/Evergreen/src/javascript/backend/circ/circ_permit_hold.js
trunk/Open-ILS/src/javascript/backend/circ/circ_lib.js
trunk/Open-ILS/src/javascript/backend/circ/circ_permit_hold.js
trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm
trunk/Open-ILS/src/perlmods/OpenILS/Utils/PermitHold.pm
Log:
added hold permit flag for new holds to prevent max-holds checks on existing holds
Modified: trunk/Evergreen/src/javascript/backend/circ/circ_permit_hold.js
===================================================================
--- trunk/Evergreen/src/javascript/backend/circ/circ_permit_hold.js 2008-02-22 00:06:37 UTC (rev 8810)
+++ trunk/Evergreen/src/javascript/backend/circ/circ_permit_hold.js 2008-02-22 00:09:41 UTC (rev 8811)
@@ -10,10 +10,12 @@
/* non-staff members are allowed 50 open holds at most */
if( ! isStaffHold ) {
- var count = userHoldCount(patron.id);
- log_info("patron has " + count + " open holds");
- if( count >= 50 )
- result.events.push('MAX_HOLDS');
+ if(newHold) {
+ var count = userHoldCount(patron.id);
+ log_info("patron has " + count + " open holds");
+ if( count >= 50 )
+ result.events.push('MAX_HOLDS');
+ }
} else {
log_info("This is a staff-placed hold");
}
Modified: trunk/Open-ILS/src/javascript/backend/circ/circ_lib.js
===================================================================
--- trunk/Open-ILS/src/javascript/backend/circ/circ_lib.js 2008-02-22 00:06:37 UTC (rev 8810)
+++ trunk/Open-ILS/src/javascript/backend/circ/circ_lib.js 2008-02-22 00:09:41 UTC (rev 8811)
@@ -43,6 +43,7 @@
var holdRequestLib = environment.requestLib;
var holdPickupLib = environment.pickupLib; /* hold pickup lib */
var requestor = environment.requestor || patron;
+var newHold = environment.newHold;
Modified: trunk/Open-ILS/src/javascript/backend/circ/circ_permit_hold.js
===================================================================
--- trunk/Open-ILS/src/javascript/backend/circ/circ_permit_hold.js 2008-02-22 00:06:37 UTC (rev 8810)
+++ trunk/Open-ILS/src/javascript/backend/circ/circ_permit_hold.js 2008-02-22 00:09:41 UTC (rev 8811)
@@ -18,14 +18,20 @@
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');
+ if(newHold) {
+ log_info("This is a new hold, checking maxHolds...");
+ 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');
+ }
+ } else {
+ log_info("Ignoring maxHolds on existing hold...");
}
}
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm 2008-02-22 00:06:37 UTC (rev 8810)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm 2008-02-22 00:09:41 UTC (rev 8811)
@@ -1335,7 +1335,8 @@
title => $title,
title_descriptor => $title->fixed_fields, # this is fleshed into the title object
pickup_lib => $pickup_lib,
- request_lib => $request_lib
+ request_lib => $request_lib,
+ new_hold => 1
}
);
return 0;
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Utils/PermitHold.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Utils/PermitHold.pm 2008-02-22 00:06:37 UTC (rev 8810)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Utils/PermitHold.pm 2008-02-22 00:09:41 UTC (rev 8811)
@@ -34,6 +34,7 @@
_direct => {
requestLib => $$params{request_lib},
pickupLib => $$params{pickup_lib},
+ newHold => $$params{new_hold},
}
};
More information about the open-ils-commits
mailing list