[open-ils-commits] [GIT] Evergreen ILS branch rel_3_5 updated. 1e048263333beb98bd9487fbc8191eddcb054098

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, rel_3_5 has been updated
       via  1e048263333beb98bd9487fbc8191eddcb054098 (commit)
      from  b4390e6d3b2a8110ae080e92d55f78f08d862d76 (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 1e048263333beb98bd9487fbc8191eddcb054098
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