[open-ils-commits] [GIT] Evergreen ILS branch master updated. 152c1f76c27fad50e1fbd4a494b7e0b251eb7b4f

Evergreen Git git at git.evergreen-ils.org
Tue Nov 15 14:53:42 EST 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  152c1f76c27fad50e1fbd4a494b7e0b251eb7b4f (commit)
       via  ca4ab76a356eca4d2043631d4d8c730f04f95f6d (commit)
      from  08609764ae1dca51fd68b76742bbf243de437a38 (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 152c1f76c27fad50e1fbd4a494b7e0b251eb7b4f
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Thu Sep 22 09:24:56 2011 -0400

    Throw out non-digit barcodes for strict check
    
    Characters like "." are valid for numbers, but not the algorithm.
    
    Thus, we need to throw out "16.00" despite the check for
    "16.00" == Number("16.00")
    returning true.
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/xul/staff_client/chrome/content/util/barcode.js b/Open-ILS/xul/staff_client/chrome/content/util/barcode.js
index 4d88807..8d30a20 100644
--- a/Open-ILS/xul/staff_client/chrome/content/util/barcode.js
+++ b/Open-ILS/xul/staff_client/chrome/content/util/barcode.js
@@ -11,6 +11,9 @@ util.barcode.EXPORT_TAGS    = { ':all' : util.barcode.EXPORT_OK };
 util.barcode.check = function(bc) {
     if (bc != Number(bc)) return false;
     bc = bc.toString();
+    // "16.00" == Number("16.00"), but the . is bad.
+    // Throw out any barcode that isn't just digits
+    if (bc.search(/\D/) != -1) return false;
     var last_digit = bc.substr(bc.length-1);
     var stripped_barcode = bc.substr(0,bc.length-1);
     return util.barcode.checkdigit(stripped_barcode).toString() == last_digit;

commit ca4ab76a356eca4d2043631d4d8c730f04f95f6d
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Thu Sep 22 09:16:31 2011 -0400

    Don't check barcode without strict enabled
    
    Item status was, unlike other interfaces, doing the strict check, THEN
    looking at the checkbox and if it was checked return.
    
    This caused issues when the barcode crashes out the strict checking.
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/xul/staff_client/server/circ/copy_status.js b/Open-ILS/xul/staff_client/server/circ/copy_status.js
index 510d13c..89e6287 100644
--- a/Open-ILS/xul/staff_client/server/circ/copy_status.js
+++ b/Open-ILS/xul/staff_client/server/circ/copy_status.js
@@ -1107,9 +1107,9 @@ circ.copy_status.prototype = {
 
     'test_barcode' : function(bc) {
         var obj = this;
-        var good = util.barcode.check(bc);
         var x = document.getElementById('strict_barcode');
         if (x && x.checked != true) { return true; }
+        var good = util.barcode.check(bc);
         if (good) {
             return true;
         } else {

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

Summary of changes:
 .../staff_client/chrome/content/util/barcode.js    |    3 +++
 .../xul/staff_client/server/circ/copy_status.js    |    2 +-
 2 files changed, 4 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list