[open-ils-commits] [GIT] Evergreen ILS branch rel_2_7 updated. 23c846c4c83541a41de267d92d72cb59e3537f57

Evergreen Git git at git.evergreen-ils.org
Mon Jun 15 15:16:44 EDT 2015


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, rel_2_7 has been updated
       via  23c846c4c83541a41de267d92d72cb59e3537f57 (commit)
       via  3f2da158a2070c1cb722b4bb18d94794cf5116b6 (commit)
       via  8edddd734d7843cbb920c2376b094a9abfd4ee99 (commit)
      from  bdbe1543d647e2a708001873b5154be568744ef8 (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 23c846c4c83541a41de267d92d72cb59e3537f57
Author: Mike Rylander <mrylander at gmail.com>
Date:   Fri Jun 12 14:29:02 2015 -0400

    LP#902255: Use simple alert box
    
    Instead of the generic communication error dialog, we'll use
    the simple yns_alert box instead.
    
    Signed-off-by: Mike Rylander <mrylander at gmail.com>
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
    Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>

diff --git a/Open-ILS/xul/staff_client/server/circ/util.js b/Open-ILS/xul/staff_client/server/circ/util.js
index d25d395..6975053 100644
--- a/Open-ILS/xul/staff_client/server/circ/util.js
+++ b/Open-ILS/xul/staff_client/server/circ/util.js
@@ -3572,7 +3572,13 @@ circ.util.checkin_via_barcode2 = function(session,params,backdate,auto_print,che
         } else /* UPDATE failed, and async */ if (check.ilsevent == 2001 && async) {
             check.what_happened = 'error';
             sound.special('checkin.error');
-            error.standard_network_error_alert(document.getElementById('circStrings').getString('staff.circ.checkin.possible_dupe_scan'));
+            error.yns_alert(
+                document.getElementById('circStrings').getString('staff.circ.checkin.possible_dupe_scan'),
+                document.getElementById('circStrings').getString('staff.circ.alert'),
+                document.getElementById('circStrings').getString('staff.circ.utils.msg.ok'),
+                null, null,
+                document.getElementById('circStrings').getString('staff.circ.confirm.msg')
+            );
         } else {
 
             if (check.ilsevent == null) { return null; /* handled */ }

commit 3f2da158a2070c1cb722b4bb18d94794cf5116b6
Author: Mike Rylander <mrylander at gmail.com>
Date:   Thu Jun 11 08:49:21 2015 -0400

    LP#902255: Correct "ILS Event at check in" logic
    
    In a classic case of "fix a bug to reveal another" it turn out that
    there was a small logic bug hiding in the check in hold-capture code.
    The result of this bug was that the wrong ILS Event object was being
    returned when we ran into the double-scan hold-capture situation by
    overwriting the correct one immediately after we construct it, which
    in turn prevented the previous commit from working as designed.
    
    We now return the correct ILS Event immediately so that we can
    properly detect the situation.  Two birds with one branch.
    
    Signed-off-by: Mike Rylander <mrylander at gmail.com>
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
    Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Utils/CStoreEditor.pm b/Open-ILS/src/perlmods/lib/OpenILS/Utils/CStoreEditor.pm
index 4ad858f..824b8ee 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Utils/CStoreEditor.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Utils/CStoreEditor.pm
@@ -812,13 +812,13 @@ sub runmethod {
             my $evt = OpenILS::Event->new(
                 'DATABASE_UPDATE_FAILED', payload => $arg, debug => "$err" );
             $self->event($evt);
+            return undef;
         }
 
         if( $err ) {
             $self->event( 
                 OpenILS::Event->new( 'DATABASE_QUERY_FAILED', 
                     payload => $arg, debug => "$err" ));
-            return undef;
         }
 
         return undef;

commit 8edddd734d7843cbb920c2376b094a9abfd4ee99
Author: Mike Rylander <mrylander at gmail.com>
Date:   Mon Jun 8 11:11:04 2015 -0400

    LP#902255: Protect against hold double-capture
    
    When the staff client is in Fast Scan (async) mode, it is possible
    to double-scan at checkin and cause two holds to be captured by the
    same item.  By creating a specially crafted unique index we ensure
    that the database rejects this situation.
    
    This protection would cause unhandled errors in the staff client, so
    we also register a new string to be displayed when this particular
    situation occurs, alerting staff to the possible double-scan of a
    barcode at checkin IFF they are using async mode.
    
    Signed-off-by: Mike Rylander <mrylander at gmail.com>
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
    Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>

diff --git a/Open-ILS/src/sql/Pg/090.schema.action.sql b/Open-ILS/src/sql/Pg/090.schema.action.sql
index ad78f50..cfb467c 100644
--- a/Open-ILS/src/sql/Pg/090.schema.action.sql
+++ b/Open-ILS/src/sql/Pg/090.schema.action.sql
@@ -413,6 +413,7 @@ CREATE INDEX hold_request_fulfillment_staff_idx ON action.hold_request ( fulfill
 CREATE INDEX hold_request_requestor_idx         ON action.hold_request ( requestor );
 CREATE INDEX hold_request_open_idx ON action.hold_request (id) WHERE cancel_time IS NULL AND fulfillment_time IS NULL;
 CREATE INDEX hold_request_current_copy_before_cap_idx ON action.hold_request (current_copy) WHERE capture_time IS NULL AND cancel_time IS NULL;
+CREATE UNIQUE INDEX hold_request_capture_protect_idx ON action.hold_request (current_copy) WHERE current_copy IS NOT NULL AND capture_time IS NOT NULL AND cancel_time IS NULL AND fulfillment_time IS NULL;
 
 
 CREATE TABLE action.hold_request_note (
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.disallow-double-capture.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.disallow-double-capture.sql
new file mode 100644
index 0000000..e644d35
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.disallow-double-capture.sql
@@ -0,0 +1,13 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+CREATE UNIQUE INDEX CONCURRENTLY
+    hold_request_capture_protect_idx ON action.hold_request (current_copy)
+    WHERE   current_copy IS NOT NULL -- sometimes null in old/bad data
+            AND capture_time IS NOT NULL
+            AND cancel_time IS NULL
+            AND fulfillment_time IS NULL;
+
+COMMIT;
+
diff --git a/Open-ILS/xul/staff_client/server/circ/util.js b/Open-ILS/xul/staff_client/server/circ/util.js
index 9e71c0c..d25d395 100644
--- a/Open-ILS/xul/staff_client/server/circ/util.js
+++ b/Open-ILS/xul/staff_client/server/circ/util.js
@@ -2629,7 +2629,7 @@ circ.util.checkin_via_barcode = function(session,params,backdate,auto_print,asyn
             JSAN.use('util.error'); var error = new util.error();
             try {
                 var check = req.getResultObject();
-                var r = circ.util.checkin_via_barcode2(session,params,backdate,auto_print,check);
+                var r = circ.util.checkin_via_barcode2(session,params,backdate,auto_print,check,async);
                 try {
                     error.work_log(
                         document.getElementById('circStrings').getFormattedString(
@@ -2735,7 +2735,7 @@ circ.util.checkin_via_barcode = function(session,params,backdate,auto_print,asyn
     }
 };
 
-circ.util.checkin_via_barcode2 = function(session,params,backdate,auto_print,check) {
+circ.util.checkin_via_barcode2 = function(session,params,backdate,auto_print,check,async) {
     try {
         JSAN.use('util.error'); var error = new util.error();
         JSAN.use('util.network'); var network = new util.network();
@@ -3569,6 +3569,10 @@ circ.util.checkin_via_barcode2 = function(session,params,backdate,auto_print,che
             check.what_happened = 'error';
             sound.special('checkin.error');
             error.standard_network_error_alert(document.getElementById('circStrings').getString('staff.circ.checkin.suggest_offline'));
+        } else /* UPDATE failed, and async */ if (check.ilsevent == 2001 && async) {
+            check.what_happened = 'error';
+            sound.special('checkin.error');
+            error.standard_network_error_alert(document.getElementById('circStrings').getString('staff.circ.checkin.possible_dupe_scan'));
         } else {
 
             if (check.ilsevent == null) { return null; /* handled */ }
diff --git a/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties b/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties
index 6a2aea1..415eb97 100644
--- a/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties
+++ b/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties
@@ -450,6 +450,7 @@ staff.circ.checkin.error=Check In Failed (in circ.util.checkin) (%1$s):
 # "Circulation" - check &staff.main.menu.circ.label; in lang.dtd
 # "Offline Interface" - check &staff.main.menu.circ.offline.label; in lang.dtd
 staff.circ.checkin.suggest_offline=Check In Failed.  If you wish to use the offline interface, in the top menubar select Circulation -> Offline Interface
+staff.circ.checkin.possible_dupe_scan=Check In May Have Failed.  Possible double-scan of the barcode.  Use Item Status to confirm Check In and possible Hold capture.
 staff.circ.checkin.renew_failed.error=Renew Failed for %1$s
 staff.circ.checkin.renew_failed.override=Override Renew Failure?
 staff.circ.renew.barcode=Barcode: %1$s

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

Summary of changes:
 .../src/perlmods/lib/OpenILS/Utils/CStoreEditor.pm |    2 +-
 Open-ILS/src/sql/Pg/090.schema.action.sql          |    1 +
 .../XXXX.schema.disallow-double-capture.sql        |   13 +++++++++++++
 Open-ILS/xul/staff_client/server/circ/util.js      |   14 ++++++++++++--
 .../server/locale/en-US/circ.properties            |    1 +
 5 files changed, 28 insertions(+), 3 deletions(-)
 create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.schema.disallow-double-capture.sql


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list