From 3b311dfb1d6742880d17b479cf28552165e35d06 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Thu, 3 Mar 2016 14:12:37 -0500 Subject: [PATCH] LP#1570091: webstaff: indicate warning/error conditions in volcopy editor Indicate when the user has an empty barcode, duplicate barcode, or empty call number label. Signed-off-by: Mike Rylander Signed-off-by: Galen Charlton Signed-off-by: Bill Erickson --- .../templates/staff/cat/volcopy/t_edit.tt2 | 3 ++ .../js/ui/default/staff/cat/volcopy/app.js | 40 ++++++++++++++++++- 2 files changed, 41 insertions(+), 2 deletions(-) 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 @@
+ + +
'+ '
'+ '
'+ @@ -311,14 +323,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) @@ -385,7 +410,10 @@ function(egCore , $q) { '
'+ '
'+ + '
'+ + ''+ + '
{{empty_label_string}}
'+ + '
'+ '
'+ '