[open-ils-commits] [GIT] Evergreen ILS branch master updated. 754c0cca30d5042708a3859b233be303cff3a678

Evergreen Git git at git.evergreen-ils.org
Thu Apr 30 14:17:22 EDT 2020


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  754c0cca30d5042708a3859b233be303cff3a678 (commit)
       via  f7de08705a136b7ddc85057b645e19a132b0d57b (commit)
      from  7a66de5cc4036d3c153954292176d61b70ebd17f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 754c0cca30d5042708a3859b233be303cff3a678
Author: Ben Shum <ben at evergreener.net>
Date:   Thu Apr 30 14:16:19 2020 -0400

    LP#1869794: Stamping upgrade script
    
    Signed-off-by: Ben Shum <ben at evergreener.net>

diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index ac2df51d2a..5aed8bcd9e 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -92,7 +92,7 @@ CREATE TRIGGER no_overlapping_deps
     BEFORE INSERT OR UPDATE ON config.db_patch_dependencies
     FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates');
 
-INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1202', :eg_version); -- berick/dyrcona
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1203', :eg_version); -- phasefx/lstratton/bshum
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.hpprox-best-hold-sort-order b/Open-ILS/src/sql/Pg/upgrade/1203.hpprox-best-hold-sort-order
similarity index 92%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.hpprox-best-hold-sort-order
rename to Open-ILS/src/sql/Pg/upgrade/1203.hpprox-best-hold-sort-order
index 3d8555beb9..7e5742a7fb 100755
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.hpprox-best-hold-sort-order
+++ b/Open-ILS/src/sql/Pg/upgrade/1203.hpprox-best-hold-sort-order
@@ -1,6 +1,6 @@
 BEGIN;
 
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+SELECT evergreen.upgrade_deps_block_check('1203', :eg_version);
 
 ALTER TABLE config.best_hold_order ADD COLUMN owning_lib_to_home_lib_prox INT; -- copy owning lib <-> user home lib prox
 

commit f7de08705a136b7ddc85057b645e19a132b0d57b
Author: Jason Etheridge <jason at EquinoxInitiative.org>
Date:   Wed Feb 26 09:40:04 2020 -0500

    LP#1869794 new best hold sort order
    
    owning lib to requestee home lib proximity
    
    implementation, release notes and TechRef tweak
    
    Signed-off-by: Jason Etheridge <jason at EquinoxInitiative.org>
    Signed-off-by: Lindsay Stratton <lstratton at wlsmail.org>
    Signed-off-by: Ben Shum <ben at evergreener.net>

diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml
index e849f66e2c..9225c86a8b 100644
--- a/Open-ILS/examples/fm_IDL.xml
+++ b/Open-ILS/examples/fm_IDL.xml
@@ -2973,6 +2973,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 			<field reporter:label="Name" name="name" reporter:datatype="text"/>
 			<field reporter:label="Capture Lib to Pickup Lib Proximity" name="pprox" reporter:datatype="int" />
 			<field reporter:label="Circ Lib to Request Lib Proximity" name="hprox" reporter:datatype="int" />
+			<field reporter:label="Owning Lib to Patron Home Lib Proximity" name="owning_lib_to_home_lib_prox" reporter:datatype="int" />
 			<field reporter:label="Adjusted Circ Lib to Pickup Lib Proximity" name="aprox" reporter:datatype="int" />
 			<field reporter:label="Adjusted Capture Location to Pickup Lib Proximity" name="approx" reporter:datatype="int" />
 			<field reporter:label="Hold Priority" name="priority" reporter:datatype="int" />
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm
index 6c69acb937..4662c23401 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm
@@ -23,6 +23,7 @@ my $U = "OpenILS::Application::AppUtils";
 my %HOLD_SORT_ORDER_BY = (
     pprox => 'p.prox',
     hprox => 'actor.org_unit_proximity(%d, h.pickup_lib)',  # $cp->call_number->owning_lib
+    owning_lib_to_home_lib_prox => 'actor.org_unit_proximity(%d, au.home_ou)',  # $cp->call_number->owning_lib
     aprox => 'COALESCE(hm.proximity, p.prox)',
     approx => 'action.hold_copy_calculated_proximity(h.id, %d, %d)', # $cp,$here
     priority => 'pgt.hold_priority',
@@ -348,8 +349,9 @@ sub get_hold_sort_order {
     my $row = $dbh->selectrow_hashref(
         q!
         SELECT
-            cbho.pprox, cbho.hprox, cbho.aprox, cbho.approx, cbho.priority,
-            cbho.cut, cbho.depth, cbho.htime, cbho.shtime, cbho.rtime
+            cbho.pprox, cbho.hprox, cbho.owning_lib_to_home_lib_prox, cbho.aprox,
+            cbho.approx, cbho.priority, cbho.cut, cbho.depth, cbho.htime,
+            cbho.shtime, cbho.rtime
         FROM config.best_hold_order cbho
         WHERE id = (
             SELECT oils_json_to_text(value)::INT
@@ -378,6 +380,7 @@ sub build_hold_sort_clause {
 
     my %order_by_sprintf_args = (
         hprox => [$cp->call_number->owning_lib],
+        owning_lib_to_home_lib_prox => [$cp->call_number->owning_lib],
         approx => [$cp->id, $here],
         htime => [$cp->call_number->owning_lib, $cp->call_number->owning_lib],
         shtime => [$cp->call_number->owning_lib, $cp->call_number->owning_lib]
diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index 64fd79fa21..ac2df51d2a 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -1140,6 +1140,7 @@ CREATE TABLE config.best_hold_order(
     name        TEXT        UNIQUE,   -- i18n
     pprox       INT, -- copy capture <-> pickup lib prox
     hprox       INT, -- copy circ lib <-> request lib prox
+    owning_lib_to_home_lib_prox      INT, -- copy owning lib <-> user home lib prox
     aprox       INT, -- copy circ lib <-> pickup lib ADJUSTED prox on ahcm
     approx      INT, -- copy capture <-> pickup lib ADJUSTED prox from function
     priority    INT, -- group hold priority
@@ -1154,6 +1155,7 @@ CREATE TABLE config.best_hold_order(
 ALTER TABLE config.best_hold_order ADD CHECK ((
     pprox IS NOT NULL OR
     hprox IS NOT NULL OR
+    owning_lib_to_home_lib_prox IS NOT NULL OR
     aprox IS NOT NULL OR
     priority IS NOT NULL OR
     cut IS NOT NULL OR
diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
index a75734572c..ce54ebcf8a 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -16055,6 +16055,14 @@ INSERT INTO config.best_hold_order (
     1, 2, 3, 4, 5, 6, 7, 8
 );
 
+INSERT INTO config.best_hold_order (
+    name,
+    owning_lib_to_home_lib_prox, hprox, approx, pprox, aprox, priority, cut, depth, rtime
+) VALUES (
+    'Traditional with Holds-chase-home-lib-patrons',
+    1, 2, 3, 4, 5, 6, 7, 8, 9
+);
+
 INSERT INTO actor.org_unit_setting (
     org_unit, name, value
 ) VALUES (
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.hpprox-best-hold-sort-order b/Open-ILS/src/sql/Pg/upgrade/XXXX.hpprox-best-hold-sort-order
new file mode 100755
index 0000000000..3d8555beb9
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.hpprox-best-hold-sort-order
@@ -0,0 +1,30 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+ALTER TABLE config.best_hold_order ADD COLUMN owning_lib_to_home_lib_prox INT; -- copy owning lib <-> user home lib prox
+
+ALTER table config.best_hold_order DROP CONSTRAINT best_hold_order_check;
+
+-- At least one of these columns must contain a non-null value
+ALTER TABLE config.best_hold_order ADD CHECK ((
+    pprox IS NOT NULL OR
+    hprox IS NOT NULL OR
+    owning_lib_to_home_lib_prox IS NOT NULL OR
+    aprox IS NOT NULL OR
+    priority IS NOT NULL OR
+    cut IS NOT NULL OR
+    depth IS NOT NULL OR
+    htime IS NOT NULL OR
+    rtime IS NOT NULL
+));
+
+INSERT INTO config.best_hold_order (
+    name,
+    owning_lib_to_home_lib_prox, hprox, approx, pprox, aprox, priority, cut, depth, rtime
+) VALUES (
+    'Traditional with Holds-chase-home-lib-patrons',
+    1, 2, 3, 4, 5, 6, 7, 8, 9
+);
+
+COMMIT;
diff --git a/Open-ILS/web/js/dojo/openils/conify/BestHoldOrder.js b/Open-ILS/web/js/dojo/openils/conify/BestHoldOrder.js
index 52d2862e20..e4fd1c7564 100644
--- a/Open-ILS/web/js/dojo/openils/conify/BestHoldOrder.js
+++ b/Open-ILS/web/js/dojo/openils/conify/BestHoldOrder.js
@@ -114,8 +114,9 @@ if (!dojo._hasResource["openils.conify.BestHoldOrder"]) {
     /* We could get these from the IDL, but if we add more fields to that
      * later, we have no particular mechanism for determining what is or
      * isn't metadata. */
-    module.fields = ["pprox", "hprox", "aprox", "priority", "cut", "depth",
-        "htime", "rtime", "approx", "shtime"];
+    module.fields = ["pprox", "hprox", "owning_lib_to_home_lib_prox",
+        "aprox", "priority", "cut", "depth", "htime", "rtime", "approx",
+        "shtime"];
 
     module.init = function() {
         module.progress_dialog = dijit.byId("progress-dialog");
diff --git a/docs/RELEASE_NOTES_NEXT/Circulation/hold-sort-order-chase-home-lib-patrons.adoc b/docs/RELEASE_NOTES_NEXT/Circulation/hold-sort-order-chase-home-lib-patrons.adoc
new file mode 100644
index 0000000000..4d683cbcdd
--- /dev/null
+++ b/docs/RELEASE_NOTES_NEXT/Circulation/hold-sort-order-chase-home-lib-patrons.adoc
@@ -0,0 +1,5 @@
+New Hold Sort Order: Traditional with Holds-chase-home-lib-patrons
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+This is a new entry under Administration -> Server Administration -> Best-Hold Selection Sort Order in the staff client.  It prioritizes holds such that a given item, based on its owning library, will prefer patrons with a matching home library, no matter the pickup library.
+
diff --git a/docs/TechRef/Circ/custom-best-hold-selection.adoc b/docs/TechRef/Circ/custom-best-hold-selection.adoc
index 4670966bc7..277880429b 100644
--- a/docs/TechRef/Circ/custom-best-hold-selection.adoc
+++ b/docs/TechRef/Circ/custom-best-hold-selection.adoc
@@ -99,6 +99,7 @@ CREATE TABLE config.best_hold_order(
     name        TEXT        UNIQUE,   -- i18n (metadata)
     pprox       INT, -- copy capture <-> pickup lib prox
     hprox       INT, -- copy circ lib <-> request lib prox
+    owning_lib_to_home_lib_prox      INT, -- copy owning lib <-> user home lib prox
     aprox       INT, -- copy circ lib <-> pickup lib ADJUSTED prox on ahcm
     priority    INT, -- group hold priority
     cut         INT, -- cut-in-line
@@ -111,6 +112,7 @@ CREATE TABLE config.best_hold_order(
 ALTER TABLE config.best_hold_order ADD CHECK ((
     pprox IS NOT NULL OR
     hprox IS NOT NULL OR
+    owning_lib_to_home_lib_prox IS NOT NULL OR
     aprox IS NOT NULL OR
     priority IS NOT NULL OR
     cut IS NOT NULL OR
@@ -167,6 +169,14 @@ INSERT INTO config.best_hold_order (
     1, 2, 3, 4, 5, 6, 7, 8
 );
 
+INSERT INTO config.best_hold_order (
+    name,
+    owning_lib_to_home_lib_prox, hprox, approx, pprox, aprox, priority, cut, depth, rtime
+) VALUES (
+    'Traditional with Holds-chase-home-lib-patrons',
+    1, 2, 3, 4, 5, 6, 7, 8, 9
+);
+
 INSERT INTO config.org_unit_setting_type (
     name, label, description, datatype, fm_class, update_perm
 ) VALUES (

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/examples/fm_IDL.xml                       |  1 +
 .../Application/Storage/Publisher/action.pm        |  7 +++--
 Open-ILS/src/sql/Pg/002.schema.config.sql          |  4 ++-
 Open-ILS/src/sql/Pg/950.data.seed-values.sql       |  8 ++++++
 .../Pg/upgrade/1203.hpprox-best-hold-sort-order    | 30 ++++++++++++++++++++++
 .../web/js/dojo/openils/conify/BestHoldOrder.js    |  5 ++--
 .../hold-sort-order-chase-home-lib-patrons.adoc    |  5 ++++
 docs/TechRef/Circ/custom-best-hold-selection.adoc  | 10 ++++++++
 8 files changed, 65 insertions(+), 5 deletions(-)
 create mode 100755 Open-ILS/src/sql/Pg/upgrade/1203.hpprox-best-hold-sort-order
 create mode 100644 docs/RELEASE_NOTES_NEXT/Circulation/hold-sort-order-chase-home-lib-patrons.adoc


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list