[open-ils-commits] [GIT] Evergreen ILS branch rel_2_1 updated. d1dc323481a52b1c04e5b3d4af1da171c01a6a24

Evergreen Git git at git.evergreen-ils.org
Wed May 9 14:27:03 EDT 2012


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_1 has been updated
       via  d1dc323481a52b1c04e5b3d4af1da171c01a6a24 (commit)
       via  a8fc7e7a84bd94d2cd5f89ff38901cc716192f08 (commit)
      from  7dfa704da0513dfa2ac25db19eb31910815efae6 (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 d1dc323481a52b1c04e5b3d4af1da171c01a6a24
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: Dan Scott <dscott at laurentian.ca>

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 a8fc7e7a84bd94d2cd5f89ff38901cc716192f08
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: Dan Scott <dscott at laurentian.ca>

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 6026a85..2c78b61 100644
--- a/Open-ILS/xul/staff_client/server/circ/copy_status.js
+++ b/Open-ILS/xul/staff_client/server/circ/copy_status.js
@@ -1020,9 +1020,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