[open-ils-commits] r14509 - in trunk/Open-ILS: examples src/perlmods/OpenILS/Application/Storage/CDBI src/perlmods/OpenILS/Application/Storage/Publisher src/sql/Pg src/sql/Pg/upgrade (miker)

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Oct 20 14:59:25 EDT 2009


Author: miker
Date: 2009-10-20 14:59:20 -0400 (Tue, 20 Oct 2009)
New Revision: 14509

Added:
   trunk/Open-ILS/src/sql/Pg/upgrade/0040.schema.force-hold-to-front.sql
Modified:
   trunk/Open-ILS/examples/fm_IDL.xml
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/action.pm
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm
   trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
   trunk/Open-ILS/src/sql/Pg/090.schema.action.sql
Log:
Adding support for pushing to the front of the hold queue with a cut_in_line
boolean field.  Setting this on an action.hold_request will cause the hold
to sort to the top of the queue in calls to open-ils.storage.action.hold_request.nearest_hold,
which is used to capture holds in priority order.

Currently, this field sorts /after/ the hold proximity.  When strict FIFO
holds are implemented, this sort will go to the front of the line, followed
by request_time and then proximity.



Modified: trunk/Open-ILS/examples/fm_IDL.xml
===================================================================
--- trunk/Open-ILS/examples/fm_IDL.xml	2009-10-20 18:37:45 UTC (rev 14508)
+++ trunk/Open-ILS/examples/fm_IDL.xml	2009-10-20 18:59:20 UTC (rev 14509)
@@ -2713,6 +2713,7 @@
 			<field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
 			<field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
 			<field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
+			<field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
 			<field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
 		</fields>
 		<links>

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/action.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/action.pm	2009-10-20 18:37:45 UTC (rev 14508)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/action.pm	2009-10-20 18:59:20 UTC (rev 14509)
@@ -97,7 +97,7 @@
 				     hold_type holdable_formats target cancel_time shelf_time
 				     phone_notify email_notify selection_depth cancel_note
 				     pickup_lib current_copy request_lib frozen thaw_date
-				     fulfillment_staff fulfillment_lib selection_ou/);
+				     fulfillment_staff fulfillment_lib selection_ou cut_in_line/);
 
 #-------------------------------------------------------------------------------
 

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm	2009-10-20 18:37:45 UTC (rev 14508)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm	2009-10-20 18:59:20 UTC (rev 14509)
@@ -273,6 +273,7 @@
             AND h.frozen IS FALSE
 		ORDER BY
 			p.prox,
+            CASE WHEN h.cut_in_line IS TRUE THEN 0 ELSE 1 END,
 			h.selection_depth DESC,
 			h.request_time
 		LIMIT $limit

Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql	2009-10-20 18:37:45 UTC (rev 14508)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql	2009-10-20 18:59:20 UTC (rev 14509)
@@ -51,7 +51,7 @@
     install_date    TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
 );
 
-INSERT INTO config.upgrade_log (version) VALUES ('0039'); -- mck9
+INSERT INTO config.upgrade_log (version) VALUES ('0040'); -- miker
 
 
 CREATE TABLE config.bib_source (

Modified: trunk/Open-ILS/src/sql/Pg/090.schema.action.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/090.schema.action.sql	2009-10-20 18:37:45 UTC (rev 14508)
+++ trunk/Open-ILS/src/sql/Pg/090.schema.action.sql	2009-10-20 18:59:20 UTC (rev 14509)
@@ -349,7 +349,8 @@
 	email_notify		BOOL				NOT NULL DEFAULT TRUE,
 	frozen			BOOL				NOT NULL DEFAULT FALSE,
 	thaw_date		TIMESTAMP WITH TIME ZONE,
-	shelf_time		TIMESTAMP WITH TIME ZONE
+	shelf_time		TIMESTAMP WITH TIME ZONE,
+    cut_in_line     BOOL
 );
 
 CREATE INDEX hold_request_target_idx ON action.hold_request (target);

Added: trunk/Open-ILS/src/sql/Pg/upgrade/0040.schema.force-hold-to-front.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0040.schema.force-hold-to-front.sql	                        (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0040.schema.force-hold-to-front.sql	2009-10-20 18:59:20 UTC (rev 14509)
@@ -0,0 +1,10 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0040'); -- miker
+
+ALTER TABLE action.hold_request ADD COLUMN cut_in_line BOOL;
+
+COMMIT;
+
+ALTER TABLE auditor.action_hold_request_history ADD COLUMN cut_in_line BOOL;
+



More information about the open-ils-commits mailing list