From: Mike Rylander Date: Thu, 3 Mar 2016 19:12:37 +0000 (-0500) Subject: webstaff: Indicate when the user has an empty barcode, duplicate barcode, or empty... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=5b649a31610f49b5b26d09cef2505934a2f16f3c;p=working%2FEvergreen.git webstaff: Indicate when the user has an empty barcode, duplicate barcode, or empty call number label Signed-off-by: Mike Rylander --- diff --git a/Open-ILS/src/templates/staff/cat/volcopy/t_edit.tt2 b/Open-ILS/src/templates/staff/cat/volcopy/t_edit.tt2 index 9511963acd..e110bbfd43 100644 --- a/Open-ILS/src/templates/staff/cat/volcopy/t_edit.tt2 +++ b/Open-ILS/src/templates/staff/cat/volcopy/t_edit.tt2 @@ -1,4 +1,7 @@
+ + +
'+ '
'+ '
'+ @@ -310,14 +322,27 @@ function(egCore , $q) { function ( $scope , itemSvc , egCore ) { $scope.new_part_id = 0; $scope.barcode_has_error = false; + $scope.duplicate_barcode = false; + $scope.empty_barcode = false; + $scope.duplicate_barcode_string = window.duplicate_barcode_string; + $scope.empty_barcode_string = window.empty_barcode_string; $scope.nextBarcode = function (i) { $scope.focusNext(i, $scope.barcode); } $scope.updateBarcode = function () { - if ($scope.barcode != '') + if ($scope.barcode != '') { + $scope.empty_barcode = false; $scope.barcode_has_error = !Boolean(itemSvc.checkBarcode($scope.barcode)); + if ($scope.copy.isnew()) { + itemSvc.checkDuplicateBarcode($scope.barcode) + .then(function (state) { $scope.duplicate_barcode = state }); + } + } else { + $scope.empty_barcode = true; + } + $scope.copy.barcode($scope.barcode); $scope.copy.ischanged(1); if (itemSvc.currently_generating) @@ -384,7 +409,10 @@ function(egCore , $q) { '
'+ '
'+ + '
'+ + ''+ + '
{{empty_label_string}}
'+ + '
'+ '
'+ '