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

Evergreen Git git at git.evergreen-ils.org
Thu Aug 13 10:05:31 EDT 2020


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  aab2df83096e5f4890e021be2e8cfefc8a49854c (commit)
      from  30b7b0999d034148284a1d303d7588f013714eed (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 aab2df83096e5f4890e021be2e8cfefc8a49854c
Author: Mike Risher <mrisher at catalyte.io>
Date:   Wed Aug 5 21:34:12 2020 +0000

    lp1890498: Replace Item Barcode now warns about duplicate barcode
    
    Modify the Replace Item Barcode page so that it displays an error
    message when trying to replace a barcode with a barcode already
    in use.
    
    Signed-off-by: Mike Risher <mrisher at catalyte.io>
    Signed-off-by: Elaine Hardy <ehardy at georgialibraries.org>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/templates/staff/cat/share/t_replace_barcode.tt2 b/Open-ILS/src/templates/staff/cat/share/t_replace_barcode.tt2
index f15a831c76..62f9c8b9db 100644
--- a/Open-ILS/src/templates/staff/cat/share/t_replace_barcode.tt2
+++ b/Open-ILS/src/templates/staff/cat/share/t_replace_barcode.tt2
@@ -33,6 +33,9 @@
     <div class="alert alert-danger" ng-if="copyNotFound">
       [% l('Item Not Found') %]
     </div>
+    <div class="alert alert-danger" ng-if="duplicateBarcode">
+      [% l('Duplicate Barcode') %]
+    </div>
     <div class="alert alert-success" ng-if="updateOK">
       <span>[% l('Item Updated') %]</span>
       <span class="horiz-pad" ng-if="copyId">
diff --git a/Open-ILS/web/js/ui/default/staff/cat/item/replace_barcode/app.js b/Open-ILS/web/js/ui/default/staff/cat/item/replace_barcode/app.js
index 33d1cb6c61..d9d9d3db1a 100644
--- a/Open-ILS/web/js/ui/default/staff/cat/item/replace_barcode/app.js
+++ b/Open-ILS/web/js/ui/default/staff/cat/item/replace_barcode/app.js
@@ -14,9 +14,10 @@ function($scope , egCore) {
 
     $scope.updateBarcode = function() {
         $scope.copyNotFound = false;
+        $scope.duplicateBarcode = false;
         $scope.updateOK = false;
 
-        egCore.pcrud.search('acp', 
+        egCore.pcrud.search('acp',
             {deleted : 'f', barcode : $scope.barcode1})
         .then(function(copy) {
 
@@ -26,12 +27,22 @@ function($scope , egCore) {
                 return;
             }
 
-            $scope.copyId = copy.id();
-            copy.barcode($scope.barcode2);
+            egCore.pcrud.search('acp',
+                {deleted : 'f', barcode : $scope.barcode2})
+            .then(function(newBarcodeCopy) {
 
-            egCore.pcrud.update(copy).then(function(stat) {
-                $scope.updateOK = stat;
-                $scope.focusBarcode = true;
+                if (newBarcodeCopy) {
+                    $scope.duplicateBarcode = true;
+                    return;
+                }
+
+                $scope.copyId = copy.id();
+                copy.barcode($scope.barcode2);
+
+                egCore.pcrud.update(copy).then(function(stat) {
+                    $scope.updateOK = stat;
+                    $scope.focusBarcode = true;
+                });
             });
         });
     }

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

Summary of changes:
 .../staff/cat/share/t_replace_barcode.tt2          |  3 +++
 .../default/staff/cat/item/replace_barcode/app.js  | 23 ++++++++++++++++------
 2 files changed, 20 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list