[open-ils-commits] [GIT] Evergreen ILS branch master updated. 63cdb5ec73cb4d7c31852f5c3665ac6d17b6a711

Evergreen Git git at git.evergreen-ils.org
Mon Jul 25 17:25:57 EDT 2011


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  63cdb5ec73cb4d7c31852f5c3665ac6d17b6a711 (commit)
       via  5616e3c5ec026f9cef1aa9950ffa1625cbca1a2a (commit)
       via  be76579c500c9296fcf7c250688734822e4a7df9 (commit)
      from  70fde1d382583af2a0ac9c909660a10b55021701 (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 63cdb5ec73cb4d7c31852f5c3665ac6d17b6a711
Author: Bill Erickson <berick at esilibrary.com>
Date:   Mon Jul 25 17:24:13 2011 -0400

    Stamped upgrade script for checkout_fills_related_hold_exact_match
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index cb783e2..7984118 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -86,7 +86,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 ('0584', :eg_version); -- phasefx/berick
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0585', :eg_version); -- tsbere/berick
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.checkout_fills_related_hold_exact_match.sql b/Open-ILS/src/sql/Pg/upgrade/0585.checkout_fills_related_hold_exact_match.sql
similarity index 79%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.checkout_fills_related_hold_exact_match.sql
rename to Open-ILS/src/sql/Pg/upgrade/0585.checkout_fills_related_hold_exact_match.sql
index c720e36..611a2b0 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.checkout_fills_related_hold_exact_match.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/0585.checkout_fills_related_hold_exact_match.sql
@@ -1,6 +1,13 @@
+BEGIN;
+
+-- check whether patch can be applied
+SELECT evergreen.upgrade_deps_block_check('0585', :eg_version);
+
 INSERT into config.org_unit_setting_type
 ( name, label, description, datatype ) VALUES
 ( 'circ.checkout_fills_related_hold_exact_match_only',
     'Checkout Fills Related Hold On Valid Copy Only',
     'When filling related holds on checkout only match on items that are valid for opportunistic capture for the hold. Without this set a Title or Volume hold could match when the item is not holdable. With this set only holdable items will match.',
     'bool');
+
+COMMIT;

commit 5616e3c5ec026f9cef1aa9950ffa1625cbca1a2a
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Mon Jul 25 15:28:47 2011 -0400

    Unwrapped Upgrade Script
    
    for Checkout Fills Related Hold modifications
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.checkout_fills_related_hold_exact_match.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.checkout_fills_related_hold_exact_match.sql
new file mode 100644
index 0000000..c720e36
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.checkout_fills_related_hold_exact_match.sql
@@ -0,0 +1,6 @@
+INSERT into config.org_unit_setting_type
+( name, label, description, datatype ) VALUES
+( 'circ.checkout_fills_related_hold_exact_match_only',
+    'Checkout Fills Related Hold On Valid Copy Only',
+    'When filling related holds on checkout only match on items that are valid for opportunistic capture for the hold. Without this set a Title or Volume hold could match when the item is not holdable. With this set only holdable items will match.',
+    'bool');

commit be76579c500c9296fcf7c250688734822e4a7df9
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Mon Jul 25 15:26:08 2011 -0400

    Checkout Fills Related Hold modifications
    
    Two changes:
    
    1 - Check hold_copy_map for related holds
    
    This removes the "Title or Volume hold only" restriction, allowing any hold type to fill.
    This check happens first whenever the option is enabled.
    
    2 - Add new option for *only* checking hold_copy_map.
    
    This allows for non-holdable copies to not fill Title or Volume holds on checkout.
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
index 793b7fd..d61f75e 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
@@ -1681,8 +1681,17 @@ sub handle_checkout_holds {
 # ------------------------------------------------------------------------------
 # If the circ.checkout_fill_related_hold setting is turned on and no hold for
 # the patron directly targets the checked out item, see if there is another hold 
-# (with hold_type T or V) for the patron that could be fulfilled by the checked 
-# out item.  Fulfill the oldest hold and only fulfill 1 of them.
+# for the patron that could be fulfilled by the checked out item.  Fulfill the
+# oldest hold and only fulfill 1 of them.
+# 
+# For "another hold":
+#
+# First, check for one that the copy matches via hold_copy_map, ensuring that
+# *any* hold type that this copy could fill may end up filled.
+#
+# Then, if circ.checkout_fill_related_hold_exact_match_only is not enabled, look
+# for a Title (T) or Volume (V) hold that matches the item. This allows items
+# that are non-requestable to count as capturing those hold types.
 # ------------------------------------------------------------------------------
 sub find_related_user_hold {
     my($self, $copy, $patron) = @_;
@@ -1698,6 +1707,40 @@ sub find_related_user_hold {
         select => {ahr => ['id']}, 
         from => {
             ahr => {
+                ahcm => {
+                    field => 'hold',
+                    fkey => 'id'
+                }
+            }
+        }, 
+        where => {
+            '+ahr' => {
+                usr => $patron->id,
+                fulfillment_time => undef,
+                cancel_time => undef,
+               '-or' => [
+                    {expire_time => undef},
+                    {expire_time => {'>' => 'now'}}
+                ]
+            },
+            '+ahcm' => {
+                target_copy => $self->copy->id
+            },
+        },
+        order_by => {ahr => {request_time => {direction => 'asc'}}},
+        limit => 1
+    };
+
+    my $hold_info = $e->json_query($args)->[0];
+    return $e->retrieve_action_hold_request($hold_info->{id}) if $hold_info;
+    return undef if $U->ou_ancestor_setting_value(        
+        $self->circ_lib, 'circ.checkout_fills_related_hold_exact_match_only', $e);
+
+    # find the oldest unfulfilled hold that has not yet hit the holds shelf.
+    $args = {
+        select => {ahr => ['id']}, 
+        from => {
+            ahr => {
                 acp => {
                     field => 'id', 
                     fkey => 'current_copy',
@@ -1740,7 +1783,7 @@ sub find_related_user_hold {
         limit => 1
     };
 
-    my $hold_info = $e->json_query($args)->[0];
+    $hold_info = $e->json_query($args)->[0];
     return $e->retrieve_action_hold_request($hold_info->{id}) if $hold_info;
     return undef;
 }
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 cd16dde..55bcc41 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -2592,6 +2592,11 @@ INSERT into config.org_unit_setting_type
     oils_i18n_gettext('circ.checkout_fills_related_hold', 'When a patron checks out an item and they have no holds that directly target the item, the system will attempt to find a hold for the patron that could be fulfilled by the checked out item and fulfills it', 'coust', 'description'),
     'bool'),
 
+( 'circ.checkout_fills_related_hold_exact_match_only',
+    oils_i18n_gettext('circ.checkout_fills_related_hold_exact_match_only', 'Checkout Fills Related Hold On Valid Copy Only', 'coust', 'label'),
+    oils_i18n_gettext('circ.checkout_fills_related_hold_exact_match_only', 'When filling related holds on checkout only match on items that are valid for opportunistic capture for the hold. Without this set a Title or Volume hold could match when the item is not holdable. With this set only holdable items will match.', 'coust', 'description'),
+    'bool'),
+
 ( 'circ.selfcheck.auto_override_checkout_events',
     oils_i18n_gettext('circ.selfcheck.auto_override_checkout_events', 'Selfcheck override events list', 'coust', 'label'),
     oils_i18n_gettext('circ.selfcheck.auto_override_checkout_events', 'List of checkout/renewal events that the selfcheck interface should automatically override instead instead of alerting and stopping the transaction', 'coust', 'description'),

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

Summary of changes:
 .../lib/OpenILS/Application/Circ/Circulate.pm      |   49 ++++++++++++++++++-
 Open-ILS/src/sql/Pg/002.schema.config.sql          |    2 +-
 Open-ILS/src/sql/Pg/950.data.seed-values.sql       |    5 ++
 ...585.checkout_fills_related_hold_exact_match.sql |   13 +++++
 4 files changed, 65 insertions(+), 4 deletions(-)
 create mode 100644 Open-ILS/src/sql/Pg/upgrade/0585.checkout_fills_related_hold_exact_match.sql


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list