From: Mike Risher Date: Tue, 24 Mar 2020 16:40:02 +0000 (+0000) Subject: lp1362743 holdings view duplicate barcodes X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7b599e36b6cceecf1661f4f0120335f8672abb09;p=evergreen%2Fpines.git lp1362743 holdings view duplicate barcodes Modify holdings view's "replace barcodes" UI so that it doesn't allow one to enter a duplicate barcode. Signed-off-by: Mike Risher Changes to be committed: modified: Open-ILS/src/templates/staff/cat/share/t_replace_barcode.tt2 modified: Open-ILS/web/js/ui/default/staff/cat/catalog/app.js Signed-off-by: Jason Etheridge --- 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 62f9c8b9db..7e859faebb 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 @@ -1,5 +1,6 @@
-
+ +

[% l('Replace Item Barcode') %]

@@ -19,10 +20,11 @@
+
{{duplicate_barcode_string}}
- +
diff --git a/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js b/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js index 414f3ea03a..5678a98260 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js +++ b/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js @@ -1045,11 +1045,27 @@ function($scope , $routeParams , $location , $window , $q , egCore , egHolds , e controller: ['$scope','$uibModalInstance', function($scope , $uibModalInstance) { + $scope.duplicate_barcode = false; $scope.isModal = true; $scope.focusBarcode = false; $scope.focusBarcode2 = true; $scope.barcode1 = cp.barcode(); + // check input to see if it's a duplicate barcode + $scope.checkCurrentBarcode = function() { + if (!$scope.duplicate_barcode_string) { + $scope.duplicate_barcode_string = window.duplicate_barcode_string; + } + var searchParams = { + deleted : 'f', + 'barcode' : $scope.barcode2, + id : { '!=' : $scope.copyId } + }; + egCore.pcrud.search('acp', searchParams).then(function (res) { + $scope.duplicate_barcode = res; + }); + } + $scope.updateBarcode = function() { $scope.copyNotFound = false; $scope.updateOK = false;