[open-ils-commits] [GIT] Evergreen ILS branch master updated. 73a0f2a6431d00026d4ce6f912ee210877b9cedf

Evergreen Git git at git.evergreen-ils.org
Mon Sep 26 14:32:41 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  73a0f2a6431d00026d4ce6f912ee210877b9cedf (commit)
       via  6d7ed210b38701d6ce7aa48c866f7d67ad5dcb8e (commit)
       via  8dc22762b47160e8ccc7e4ab3331f87bc330303a (commit)
       via  8a62edcb3599555413b08e05639003b8e62d613a (commit)
      from  27e89882761790636a4ebce6e9ae6dbf261b0553 (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 73a0f2a6431d00026d4ce6f912ee210877b9cedf
Merge: 6d7ed21 27e8988
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Mon Sep 26 14:29:30 2011 -0400

    Merge branch 'master' of git.evergreen-ils.org:Evergreen


commit 6d7ed210b38701d6ce7aa48c866f7d67ad5dcb8e
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Mon Sep 26 14:23:31 2011 -0400

    Stamping Upgrade Script for Suppress Transits
    
    In addition to stamping, this commit also makes a few trivial
    wording changes.
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index 7fa9257..2cbd5ef 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 ('0629', :eg_version); -- senator/miker
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0630', :eg_version); -- tsbere/dbwells
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,
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 69e71b4..2dfc497 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -3321,7 +3321,7 @@ INSERT into config.org_unit_setting_type
         'Suppress Hold Transits Group',
         'coust', 'label'),
     oils_i18n_gettext('circ.transit.suppress_hold',
-        'If set to a non-empty string Hold Transits will be suppressed between this OU and others with the same value. If set to an empty string transits will not be suppressed.',
+        'If set to a non-empty value, Hold Transits will be suppressed between this OU and others with the same value. If set to an empty value, transits will not be suppressed.',
         'coust', 'description'),
     'string', null)
 
@@ -3330,7 +3330,7 @@ INSERT into config.org_unit_setting_type
         'Suppress Non-Hold Transits Group',
         'coust', 'label'),
     oils_i18n_gettext('circ.transit.suppress_non_hold',
-        'If set to a non-empty string Non-Hold Transits will be suppressed between this OU and others with the same value. If set to an empty string transits will not be suppressed.',
+        'If set to a non-empty value, Non-Hold Transits will be suppressed between this OU and others with the same value. If set to an empty value, transits will not be suppressed.',
         'coust', 'description'),
     'string', null)
 
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.suppress_transits.sql b/Open-ILS/src/sql/Pg/upgrade/0630.data.suppress_transits.sql
similarity index 70%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.suppress_transits.sql
rename to Open-ILS/src/sql/Pg/upgrade/0630.data.suppress_transits.sql
index 8f551c3..d9d4c15 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.suppress_transits.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/0630.data.suppress_transits.sql
@@ -1,10 +1,14 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('0630', :eg_version);
+
 INSERT into config.org_unit_setting_type (name, grp, label, description, datatype) VALUES
 ( 'circ.transit.suppress_hold', 'circ',
     oils_i18n_gettext('circ.transit.suppress_hold',
         'Suppress Hold Transits Group',
         'coust', 'label'),
     oils_i18n_gettext('circ.transit.suppress_hold',
-        'If set to a non-empty string Hold Transits will be suppressed between this OU and others with the same value. If set to an empty string transits will not be suppressed.',
+        'If set to a non-empty value, Hold Transits will be suppressed between this OU and others with the same value. If set to an empty value, transits will not be suppressed.',
         'coust', 'description'),
     'string')
 ,( 'circ.transit.suppress_non_hold', 'circ',
@@ -12,6 +16,8 @@ INSERT into config.org_unit_setting_type (name, grp, label, description, datatyp
         'Suppress Non-Hold Transits Group',
         'coust', 'label'),
     oils_i18n_gettext('circ.transit.suppress_non_hold',
-        'If set to a non-empty string Non-Hold Transits will be suppressed between this OU and others with the same value. If set to an empty string transits will not be suppressed.',
+        'If set to a non-empty value, Non-Hold Transits will be suppressed between this OU and others with the same value. If set to an empty value, transits will not be suppressed.',
         'coust', 'description'),
     'string');
+
+COMMIT;

commit 8dc22762b47160e8ccc7e4ab3331f87bc330303a
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Fri Sep 23 19:30:20 2011 -0400

    Unwrapped Suppress Transits upgrade script
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.suppress_transits.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.suppress_transits.sql
new file mode 100644
index 0000000..8f551c3
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.suppress_transits.sql
@@ -0,0 +1,17 @@
+INSERT into config.org_unit_setting_type (name, grp, label, description, datatype) VALUES
+( 'circ.transit.suppress_hold', 'circ',
+    oils_i18n_gettext('circ.transit.suppress_hold',
+        'Suppress Hold Transits Group',
+        'coust', 'label'),
+    oils_i18n_gettext('circ.transit.suppress_hold',
+        'If set to a non-empty string Hold Transits will be suppressed between this OU and others with the same value. If set to an empty string transits will not be suppressed.',
+        'coust', 'description'),
+    'string')
+,( 'circ.transit.suppress_non_hold', 'circ',
+    oils_i18n_gettext('circ.transit.suppress_non_hold',
+        'Suppress Non-Hold Transits Group',
+        'coust', 'label'),
+    oils_i18n_gettext('circ.transit.suppress_non_hold',
+        'If set to a non-empty string Non-Hold Transits will be suppressed between this OU and others with the same value. If set to an empty string transits will not be suppressed.',
+        'coust', 'description'),
+    'string');

commit 8a62edcb3599555413b08e05639003b8e62d613a
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Tue Sep 13 21:50:11 2011 -0400

    Suppress Transits
    
    Add two new OU settings:
    
    circ.transit.suppress_hold
    circ.transit.suppress_non_hold
    
    If a transit would be generated between the current library and another and
    the appropriate setting is set for both end with the same value the transit
    will be suppressed. If either end is set to an empty string then transit
    suppression will be disabled, even if both ends are set to an empty string.
    
    In addition, transits from other locations will be received when their
    destination shares suppression with the current library.
    
    circ.transit.suppress_hold will cause holds to go to the hold shelf instead
    of into transit when in effect. Non-hold transits should not check it. This
    should be useful when multiple parts of a library share a hold shelf, but
    are split on the org tree.
    
    circ.transit.suppress_non_hold will cause items to reshelve instead of
    going into transit. Hold transits should not check it. This should be
    useful when multiple parts of a library are in the same building and have
    no need to transit items before reshelving/cataloging.
    
    In order to suppress *all* transits both settings need to be set.
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

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 6cefcd1..92cc110 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
@@ -538,6 +538,7 @@ my @AUTOLOAD_FIELDS = qw/
     clear_expired
     retarget_mode
     hold_as_transit
+    fake_hold_dest
 /;
 
 
@@ -2404,6 +2405,9 @@ sub do_checkin {
     if( $self->checkin_check_holds_shelf() ) {
         $self->bail_on_events(OpenILS::Event->new('NO_CHANGE'));
         $self->hold($U->fetch_open_hold_by_copy($self->copy->id));
+        if($self->fake_hold_dest) {
+            $self->hold->pickup_lib($self->circ_lib);
+        }
         $self->checkin_flesh_events;
         return;
     }
@@ -2478,11 +2482,15 @@ sub do_checkin {
                 $self->reshelve_copy(1);
                 $self->cancelled_hold_transit(1);
                 $self->notify_hold(0); # don't notify for cancelled holds
+                $self->fake_hold_dest(0);
                 return if $self->bail_out;
 
             } else {
 
                 # hold transited to correct location
+                if($self->fake_hold_dest) {
+                    $hold->pickup_lib($self->circ_lib);
+                }
                 $self->checkin_flesh_events;
                 return;
             }
@@ -2549,8 +2557,21 @@ sub do_checkin {
             }
     
             $logger->debug("circulator: circlib=$circ_lib, workstation=".$self->circ_lib);
-    
-            if( $circ_lib == $self->circ_lib and not ($self->hold_as_transit and $self->remote_hold) ) {
+
+            my $suppress_transit = 0;
+
+            if( $circ_lib != $self->circ_lib and not ($self->hold_as_transit and $self->remote_hold) ) {
+                my $suppress_transit_source = $U->ou_ancestor_setting($self->circ_lib, 'circ.transit.suppress_non_hold');
+                if($suppress_transit_source && $suppress_transit_source->{value}) {
+                    my $suppress_transit_dest = $U->ou_ancestor_setting($circ_lib, 'circ.transit.suppress_non_hold');
+                    if($suppress_transit_dest && $suppress_transit_source->{value} eq $suppress_transit_dest->{value}) {
+                        $logger->info("circulator: copy is within transit suppress group: ".$self->copy->barcode." ".$suppress_transit_source->{value});
+                        $suppress_transit = 1;
+                    }
+                }
+            }
+ 
+            if( $suppress_transit or ( $circ_lib == $self->circ_lib and not ($self->hold_as_transit and $self->remote_hold) ) ) {
                 # copy is where it needs to be, either for hold or reshelving
     
                 $self->checkin_handle_precat();
@@ -2712,6 +2733,18 @@ sub checkin_check_holds_shelf {
     $logger->info("circulator: we found a captured, un-fulfilled hold [".
         $hold->id. "] for copy ".$self->copy->barcode);
 
+    if( $hold->pickup_lib != $self->circ_lib and not $self->hold_as_transit ) {
+        my $suppress_transit_circ = $U->ou_ancestor_setting($self->circ_lib, 'circ.transit.suppress_hold');
+        if($suppress_transit_circ && $suppress_transit_circ->{value}) {
+            my $suppress_transit_pickup = $U->ou_ancestor_setting($hold->pickup_lib, 'circ.transit.suppress_hold');
+            if($suppress_transit_pickup && $suppress_transit_circ->{value} eq $suppress_transit_pickup->{value}) {
+                $logger->info("circulator: hold is within hold transit suppress group .. we're done: ".$self->copy->barcode." ".$suppress_transit_circ->{value});
+                $self->fake_hold_dest(1);
+                return 1;
+            }
+        }
+    }
+
     if( $hold->pickup_lib == $self->circ_lib and not $self->hold_as_transit ) {
         $logger->info("circulator: hold is for here .. we're done: ".$self->copy->barcode);
         return 1;
@@ -2856,7 +2889,19 @@ sub attempt_checkin_hold_capture {
 
     return 0 if $self->bail_out;
 
-    if( $hold->pickup_lib == $self->circ_lib && not $self->hold_as_transit ) {
+    my $suppress_transit = 0;
+    if( $hold->pickup_lib != $self->circ_lib and not $self->hold_as_transit ) {
+        my $suppress_transit_circ = $U->ou_ancestor_setting($self->circ_lib, 'circ.transit.suppress_hold');
+        if($suppress_transit_circ && $suppress_transit_circ->{value}) {
+            my $suppress_transit_pickup = $U->ou_ancestor_setting($hold->pickup_lib, 'circ.transit.suppress_hold');
+            if($suppress_transit_pickup && $suppress_transit_circ->{value} eq $suppress_transit_pickup->{value}) {
+                $suppress_transit = 1;
+                $self->hold->pickup_lib($self->circ_lib);
+            }
+        }
+    }
+
+    if( $suppress_transit or ( $hold->pickup_lib == $self->circ_lib && not $self->hold_as_transit ) ) {
 
         # This hold was captured in the correct location
         $copy->status(OILS_COPY_STATUS_ON_HOLDS_SHELF);
@@ -3024,7 +3069,20 @@ sub process_received_transit {
 
     my $transit = $self->transit;
 
-    if( $transit->dest != $self->circ_lib or ($self->hold_as_transit && $transit->copy_status == OILS_COPY_STATUS_ON_HOLDS_SHELF) ) {
+    # Check if we are in a transit suppress range
+    my $suppress_transit = 0;
+    if ( $transit->dest != $self->circ_lib and not ( $self->hold_as_transit and $transit->copy_status == OILS_COPY_STATUS_ON_HOLDS_SHELF ) ) {
+        my $suppress_setting = ($transit->copy_status == OILS_COPY_STATUS_ON_HOLDS_SHELF ?  'circ.transit.suppress_hold' : 'circ.transit.suppress_non_hold');
+        my $suppress_transit_circ = $U->ou_ancestor_setting($self->circ_lib, $suppress_setting);
+        if($suppress_transit_circ && $suppress_transit_circ->{value}) {
+            my $suppress_transit_dest = $U->ou_ancestor_setting($transit->dest, $suppress_setting);
+            if($suppress_transit_dest && $suppress_transit_dest->{value} eq $suppress_transit_circ->{value}) {
+                $suppress_transit = 1;
+                $self->fake_hold_dest(1) if $transit->copy_status == OILS_COPY_STATUS_ON_HOLDS_SHELF;
+            }
+        }
+    }
+    if( not $suppress_transit and ( $transit->dest != $self->circ_lib or ($self->hold_as_transit && $transit->copy_status == OILS_COPY_STATUS_ON_HOLDS_SHELF) ) ) {
         # - this item is in-transit to a different location
         # - Or we are capturing holds as transits, so why create a new transit?
 
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 ce0c907..69e71b4 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -3316,6 +3316,24 @@ INSERT into config.org_unit_setting_type
         'coust', 'description'),
     'interval', null)
 
+,( 'circ.transit.suppress_hold', 'circ',
+    oils_i18n_gettext('circ.transit.suppress_hold',
+        'Suppress Hold Transits Group',
+        'coust', 'label'),
+    oils_i18n_gettext('circ.transit.suppress_hold',
+        'If set to a non-empty string Hold Transits will be suppressed between this OU and others with the same value. If set to an empty string transits will not be suppressed.',
+        'coust', 'description'),
+    'string', null)
+
+,( 'circ.transit.suppress_non_hold', 'circ',
+    oils_i18n_gettext('circ.transit.suppress_non_hold',
+        'Suppress Non-Hold Transits Group',
+        'coust', 'label'),
+    oils_i18n_gettext('circ.transit.suppress_non_hold',
+        'If set to a non-empty string Non-Hold Transits will be suppressed between this OU and others with the same value. If set to an empty string transits will not be suppressed.',
+        'coust', 'description'),
+    'string', null)
+
 ,( 'circ.user_merge.deactivate_cards', 'circ',
     oils_i18n_gettext('circ.user_merge.deactivate_cards',
         'Patron Merge Deactivate Card',

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

Summary of changes:
 .../lib/OpenILS/Application/Circ/Circulate.pm      |   66 ++++++++++++++++++-
 Open-ILS/src/sql/Pg/002.schema.config.sql          |    2 +-
 Open-ILS/src/sql/Pg/950.data.seed-values.sql       |   18 +++++
 .../sql/Pg/upgrade/0630.data.suppress_transits.sql |   23 +++++++
 4 files changed, 104 insertions(+), 5 deletions(-)
 create mode 100644 Open-ILS/src/sql/Pg/upgrade/0630.data.suppress_transits.sql


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list