[open-ils-commits] [GIT] Evergreen ILS branch master updated. 000ddbbe2f16c4e7ae0242f0032bc3c4f0cbfe14

Evergreen Git git at git.evergreen-ils.org
Thu Jun 9 13:22:09 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  000ddbbe2f16c4e7ae0242f0032bc3c4f0cbfe14 (commit)
       via  8a98c9ae0dbffbd7b650f39e6b21ad3a01c7009f (commit)
       via  1a4b30d72c65975899f3bb404102857ed121aa61 (commit)
       via  36a642ebabf5eaa3930eb69ebe6dc6282164c931 (commit)
      from  34906bd225de9752e12d4c85d54ebf3e45012b41 (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 000ddbbe2f16c4e7ae0242f0032bc3c4f0cbfe14
Author: Jason Etheridge <jason at esilibrary.com>
Date:   Thu Jun 9 13:29:19 2011 -0400

    syntax error
    
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>

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 0e73ad2..e07160a 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -1426,7 +1426,7 @@ INSERT INTO permission.perm_list ( id, code, description ) VALUES
  ( 507, 'ABORT_TRANSIT_ON_LOST', oils_i18n_gettext(507,
     'Allows a user to abort a transit on a copy with status of LOST', 'ppl', 'description')),
  ( 508, 'ABORT_TRANSIT_ON_MISSING', oils_i18n_gettext(508,
-    'Allows a user to abort a transit on a copy with status of MISSING', 'ppl', 'description'));
+    'Allows a user to abort a transit on a copy with status of MISSING', 'ppl', 'description')),
  ( 509, 'TRANSIT_CHECKIN_INTERVAL_BLOCK.override', oils_i18n_gettext(509,
     'Allows a user to override the TRANSIT_CHECKIN_INTERVAL_BLOCK event', 'ppl', 'description'));
 

commit 8a98c9ae0dbffbd7b650f39e6b21ad3a01c7009f
Author: Jason Etheridge <jason at esilibrary.com>
Date:   Thu Jun 9 13:29:00 2011 -0400

    pin a version number
    
    Signed-off-by: Jason Etheridge <jason 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 5ea5a86..7b34e66 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 ('0548', :eg_version); -- dbwells
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0549', :eg_version); -- phasefx/berick
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.transit-checkin-interval.sql b/Open-ILS/src/sql/Pg/upgrade/0549.data.transit-checkin-interval.sql
similarity index 95%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.data.transit-checkin-interval.sql
rename to Open-ILS/src/sql/Pg/upgrade/0549.data.transit-checkin-interval.sql
index 7ad9e73..ec7b584 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.transit-checkin-interval.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/0549.data.transit-checkin-interval.sql
@@ -7,7 +7,7 @@ BEGIN;
 
 
 -- check whether patch can be applied
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+SELECT evergreen.upgrade_deps_block_check('0549', :eg_version);
 
 INSERT INTO config.org_unit_setting_type ( name, label, description, datatype ) VALUES (
     'circ.transit.min_checkin_interval',

commit 1a4b30d72c65975899f3bb404102857ed121aa61
Author: Bill Erickson <berick at esilibrary.com>
Date:   Thu Jun 9 10:13:18 2011 -0400

    Unwrapped upgrade script for transit checkin interval setting/perm
    
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>

diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.transit-checkin-interval.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.transit-checkin-interval.sql
new file mode 100644
index 0000000..7ad9e73
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.transit-checkin-interval.sql
@@ -0,0 +1,53 @@
+-- Evergreen DB patch XXXX.data.transit-checkin-interval.sql
+--
+-- New org unit setting "circ.transit.min_checkin_interval"
+-- New TRANSIT_CHECKIN_INTERVAL_BLOCK.override permission
+--
+BEGIN;
+
+
+-- check whether patch can be applied
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+INSERT INTO config.org_unit_setting_type ( name, label, description, datatype ) VALUES (
+    'circ.transit.min_checkin_interval',
+    oils_i18n_gettext( 
+        'circ.transit.min_checkin_interval', 
+        'Circ:  Minimum Transit Checkin Interval',
+        'coust',
+        'label'
+    ),
+    oils_i18n_gettext( 
+        'circ.transit.min_checkin_interval', 
+        'In-Transit items checked in this close to the transit start time will be prevented from checking in',
+        'coust',
+        'label'
+    ),
+    'interval'
+);
+
+INSERT INTO permission.perm_list ( id, code, description ) VALUES (  
+    509, 
+    'TRANSIT_CHECKIN_INTERVAL_BLOCK.override', 
+    oils_i18n_gettext(
+        509,
+        'Allows a user to override the TRANSIT_CHECKIN_INTERVAL_BLOCK event', 
+        'ppl', 
+        'description'
+    )
+);
+
+-- add the perm to the default circ admin group
+INSERT INTO permission.grp_perm_map (grp, perm, depth, grantable)
+	SELECT
+		pgt.id, perm.id, aout.depth, TRUE
+	FROM
+		permission.grp_tree pgt,
+		permission.perm_list perm,
+		actor.org_unit_type aout
+	WHERE
+		pgt.name = 'Circulation Administrator' AND
+		aout.name = 'System' AND
+		perm.code IN ( 'TRANSIT_CHECKIN_INTERVAL_BLOCK.override' );
+
+COMMIT;

commit 36a642ebabf5eaa3930eb69ebe6dc6282164c931
Author: Bill Erickson <berick at esilibrary.com>
Date:   Thu Jun 9 10:03:10 2011 -0400

    Transit minimum checkin interval setting
    
    OK, here's the situation, a copy went away on a week's vacation...
    
    Support for preventing checkin of a copy that was put into transit "too
    recently".  The scenario that prompted the development is this:
    
    Copy at Branch A is checked in and put into transit to fill a hold at
    Branch B.  The copy is then accidentally checked in at Branch B.
    (Imagine a crate of items with a superbarcode gets checked in at
    Branch B and the copy in question was presumed to be in that crate).
    This puts the item on the holds shelf (assuming a hold transit) at
    Branch B and notifies the patrom the item is ready for pickup.
    However, the copy is still just embarking from Branch A.
    
    This new setting allows libraries to configure a minimum transit time.
    If a copy is put into transit and checked in during the configured
    interval, the checkin will return an (overridable) event that prevents
    checkin.  If the setting is not configured, this has no affect on
    checkin.
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>

diff --git a/Open-ILS/src/extras/ils_events.xml b/Open-ILS/src/extras/ils_events.xml
index 96021e6..0eb3f8a 100644
--- a/Open-ILS/src/extras/ils_events.xml
+++ b/Open-ILS/src/extras/ils_events.xml
@@ -980,6 +980,10 @@
         <desc xml:lang="en-US">Units cannot be created for the given item because its associated distribution does not have a call number.</desc>
     </event>
 
+    <event code='11103' textcode='TRANSIT_CHECKIN_INTERVAL_BLOCK'>
+        <desc xml:lang="en-US">Checkin attempted on item during minimum transit checkin interval.</desc>
+    </event>
+
 	<!-- ================================================================ -->
 
 </ils_events>
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 1479c1f..4d65617 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
@@ -2206,6 +2206,34 @@ sub checkout_noncat {
    }
 }
 
+# If a copy goes into transit and is then checked in before the transit checkin 
+# interval has expired, push an event onto the overridable events list.
+sub check_transit_checkin_interval {
+    my $self = shift;
+
+    # only concerned with in-transit items
+    return unless $U->copy_status($self->copy->status)->id == OILS_COPY_STATUS_IN_TRANSIT;
+
+    # no interval, no problem
+    my $interval = $U->ou_ancestor_setting_value($self->circ_lib, 'circ.transit.min_checkin_interval');
+    return unless $interval;
+
+    # capture the transit so we don't have to fetch it again later during checkin
+    $self->transit(
+        $self->editor->search_action_transit_copy(
+            {target_copy => $self->copy->id, dest_recv_time => undef}
+        )->[0]
+    ); 
+
+    my $seconds = OpenSRF::Utils->interval_to_seconds($interval);
+    my $t_start = DateTime::Format::ISO8601->new->parse_datetime(cleanse_ISO8601($self->transit->source_send_time));
+    my $horizon = $t_start->add(seconds => $seconds);
+
+    # See if we are still within the transit checkin forbidden range
+    $self->push_events(OpenILS::Event->new('TRANSIT_CHECKIN_INTERVAL_BLOCK')) 
+        if $horizon > DateTime->now;
+}
+
 
 sub do_checkin {
     my $self = shift;
@@ -2215,6 +2243,8 @@ sub do_checkin {
         OpenILS::Event->new('ASSET_COPY_NOT_FOUND')) 
         unless $self->copy;
 
+    $self->check_transit_checkin_interval;
+
     # the renew code and mk_env should have already found our circulation object
     unless( $self->circ ) {
 
@@ -2257,7 +2287,7 @@ sub do_checkin {
     $self->override_events unless $self->is_renewal;
     return if $self->bail_out;
     
-    if( $self->copy ) {
+    if( $self->copy and !$self->transit ) {
         $self->transit(
             $self->editor->search_action_transit_copy(
                 { target_copy => $self->copy->id, dest_recv_time => 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 e5db758..0e73ad2 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -1427,6 +1427,8 @@ INSERT INTO permission.perm_list ( id, code, description ) VALUES
     'Allows a user to abort a transit on a copy with status of LOST', 'ppl', 'description')),
  ( 508, 'ABORT_TRANSIT_ON_MISSING', oils_i18n_gettext(508,
     'Allows a user to abort a transit on a copy with status of MISSING', 'ppl', 'description'));
+ ( 509, 'TRANSIT_CHECKIN_INTERVAL_BLOCK.override', oils_i18n_gettext(509,
+    'Allows a user to override the TRANSIT_CHECKIN_INTERVAL_BLOCK event', 'ppl', 'description'));
 
 
 SELECT SETVAL('permission.perm_list_id_seq'::TEXT, 1000);
@@ -1986,6 +1988,7 @@ INSERT INTO permission.grp_perm_map (grp, perm, depth, grantable)
 			'VIEW_REPORT_OUTPUT',
 			'VIEW_STANDING_PENALTY',
 			'VOID_BILLING',
+            'TRANSIT_CHECKIN_INTERVAL_BLOCK.override',
 			'VOLUME_HOLDS');
 
 
@@ -8707,3 +8710,21 @@ INSERT INTO config.usr_setting_type
   oils_i18n_gettext('circ.collections.exempt', 'User is exempt from collections tracking/processing', 'cust', 'description'),
   'bool'
 );
+
+INSERT INTO config.org_unit_setting_type ( name, label, description, datatype ) VALUES (
+    'circ.transit.min_checkin_interval',
+    oils_i18n_gettext( 
+        'circ.transit.min_checkin_interval', 
+        'Circ:  Minimum Transit Checkin Interval',
+        'coust',
+        'label'
+    ),
+    oils_i18n_gettext( 
+        'circ.transit.min_checkin_interval', 
+        'In-Transit items checked in this close to the transit start time will be prevented from checking in',
+        'coust',
+        'label'
+    ),
+    'interval'
+);
+
diff --git a/Open-ILS/xul/staff_client/server/circ/util.js b/Open-ILS/xul/staff_client/server/circ/util.js
index 5351da1..64c4279 100644
--- a/Open-ILS/xul/staff_client/server/circ/util.js
+++ b/Open-ILS/xul/staff_client/server/circ/util.js
@@ -2662,7 +2662,8 @@ circ.util.checkin_via_barcode = function(session,params,backdate,auto_print,asyn
                     7010 /* COPY_ALERT_MESSAGE */,
                     7011 /* COPY_STATUS_LOST */,
                     7012 /* COPY_STATUS_MISSING */,
-                    7013 /* PATRON_EXCEEDS_FINES */
+                    7013 /* PATRON_EXCEEDS_FINES */,
+                    11103 /* TRANSIT_CHECKIN_INTERVAL_BLOCK */ 
                 ],
                 'text' : {
                     '1203' : function(r) {

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

Summary of changes:
 Open-ILS/src/extras/ils_events.xml                 |    4 ++
 .../lib/OpenILS/Application/Circ/Circulate.pm      |   32 +++++++++++-
 Open-ILS/src/sql/Pg/002.schema.config.sql          |    2 +-
 Open-ILS/src/sql/Pg/950.data.seed-values.sql       |   23 ++++++++-
 .../upgrade/0549.data.transit-checkin-interval.sql |   53 ++++++++++++++++++++
 Open-ILS/xul/staff_client/server/circ/util.js      |    3 +-
 6 files changed, 113 insertions(+), 4 deletions(-)
 create mode 100644 Open-ILS/src/sql/Pg/upgrade/0549.data.transit-checkin-interval.sql


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list