[open-ils-commits] r16661 - in branches/rel_1_6_0/Open-ILS: src/perlmods/OpenILS/Application/Circ src/perlmods/OpenILS/Application/Storage/Publisher xul/staff_client/server/admin (miker)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Jun 10 15:16:32 EDT 2010


Author: miker
Date: 2010-06-10 15:16:27 -0400 (Thu, 10 Jun 2010)
New Revision: 16661

Modified:
   branches/rel_1_6_0/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm
   branches/rel_1_6_0/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm
   branches/rel_1_6_0/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml
Log:
Patch from James Fournie of SITKA:

There was some discussion about problems with holds fulfillment at the
holds roundtable at EG2010.  I am pleased to share this patch with the
community which has been thoroughly tested by the folks at
Thompson-Nicola Regional District Library.  (thanks guys!)

Background:

Evergreen's default out-of-the-box behaviour for holds fulfillment is
a gas-saving method.  Holds are fulfilled by proximity.  In a
multibranch library, holds are fulfilled at the local branch first.
Many libraries, particularly single branch libraries may be ok with
this, but it may be problematic for other libraries.

Imagine a scenario where you have a large central branch and a small
rural branch of the same library system.  At the large branch, there
are many copies of Popular New DVD with lots of holds.   There are no
copies at the rural branch.  Patrons at the small rural branch who
want to pick up Popular New DVD at their home branch may never get
their hold fulfilled because the copies will stay at the large branch
as long as there are holds for pickup there.

This patch adds an org unit setting that changes the opportunistic
check-in so that items checked in will be assigned to holds by request
date first, rather than proximity.   This setting can be applied to
any level of the org tree, so in some situations you may even want to
activate FIFO for large libraries, but leave the original setting for
smaller libraries with less traffic who want to keep their copies more
local.

Also credit to Jeff Godin who thought of the same patch and
contributed the setting name "holds FIFO" for the setting

[ NOTE:  Implications of mixed FIFO and non-FIFO environments that are
not sufficiently segregated by the use of Hard Boundaries for Holds
present a potenial for user confusion.  Beware that mixing FIFO and
non-FIFO settings within a resource-sharing group will likely result in
severe imbalance of hold fulfillment, though further configuration,
development, tuning and testing may be able to mitigate these issues.
 --miker ]



Modified: branches/rel_1_6_0/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm
===================================================================
--- branches/rel_1_6_0/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm	2010-06-10 19:15:55 UTC (rev 16660)
+++ branches/rel_1_6_0/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm	2010-06-10 19:16:27 UTC (rev 16661)
@@ -1574,10 +1574,12 @@
 	$logger->info("circulator: searching for best hold at org ".$user->ws_ou.
         " and copy $bc with a hold stalling interval of ". ($hold_stall_interval || "(none)"));
 
+    my $fifo = $U->ou_ancestor_setting_value($user->ws_ou, 'circ.hold_fifo');
+
 	# search for what should be the best holds for this copy to fulfill
 	my $best_holds = $U->storagereq(
 		"open-ils.storage.action.hold_request.nearest_hold.atomic",
-		$user->ws_ou, $copy->id, 10, $hold_stall_interval );
+		$user->ws_ou, $copy->id, 10, $hold_stall_interval, $fifo );
 
 	unless(@$best_holds) {
 

Modified: branches/rel_1_6_0/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm
===================================================================
--- branches/rel_1_6_0/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm	2010-06-10 19:15:55 UTC (rev 16660)
+++ branches/rel_1_6_0/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm	2010-06-10 19:16:27 UTC (rev 16661)
@@ -267,7 +267,10 @@
 	my $cp = shift;
 	my $limit = int(shift()) || 10;
 	my $age = shift() || '0 seconds';
+    my $fifo = shift();
 
+    my $holdsort = $fifo ? "h.request_time, h.selection_depth DESC, p.prox " : "p.prox, h.selection_depth DESC, h.request_time ";
+
 	my $ids = action::hold_request->db_Main->selectcol_arrayref(<<"	SQL", {}, $here, $cp, $age);
 		SELECT	h.id
 		  FROM	action.hold_request h
@@ -279,10 +282,7 @@
 		  	AND h.cancel_time IS NULL
 		  	AND (h.expire_time IS NULL OR h.expire_time > NOW())
             AND h.frozen IS FALSE
-		ORDER BY
-			p.prox,
-			h.selection_depth DESC,
-			h.request_time
+		ORDER BY $holdsort
 		LIMIT $limit
 	SQL
 	

Modified: branches/rel_1_6_0/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml
===================================================================
--- branches/rel_1_6_0/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml	2010-06-10 19:15:55 UTC (rev 16660)
+++ branches/rel_1_6_0/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml	2010-06-10 19:16:27 UTC (rev 16661)
@@ -206,6 +206,11 @@
                     desc : '&staff.server.admin.org_settings.opac.allow_pending_address.desc;',
                     type : 'bool'
                 },
+                'circ.holds_fifo' : {
+                    label : 'Holds: FIFO',
+                    desc : 'Force holds to a more strict First-In, First-Out capture',
+                    type : 'bool'
+                },
                 /*
                 'ui.circ.show_billing_tab_on_bills' : {
                     label : '&staff.server.admin.org_settings.ui.circ.show_billing_tab_on_bills;',



More information about the open-ils-commits mailing list