From: Mike Risher Date: Wed, 26 Feb 2020 00:31:27 +0000 (+0000) Subject: LP1821950 saving without a call number X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=53c33f0e5b0c8a3bde82fece6e964b289133f749;p=working%2FEvergreen.git LP1821950 saving without a call number (formerly lp1713164) Make changes so that it's not possible to save without a call number and make sure a message indicates why you can't save. (Unleass the library settings allow you to save without a call number.) Signed-off-by: Mike Risher Changes to be committed: modified: Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js --- diff --git a/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js b/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js index f19c4c998a..5562929cba 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js +++ b/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js @@ -757,15 +757,28 @@ function(egCore , $q) { }); } - $scope.$watch('callNumber.label()', function (v) { - $scope.label = v; - if ($scope.label == '') { - $scope.callNumber.empty_label = $scope.empty_label = true; + + $scope.$watch('callNumber.label()', function (label_text) { + $scope.label = label_text; + if ($scope.require_label == undefined) { + egCore.org.settings('cat.require_call_number_labels').then(function(res) { + $scope.require_label = res['cat.require_call_number_labels']; + setEmptyLabel(); + }); } else { - $scope.callNumber.empty_label = $scope.empty_label = false; + setEmptyLabel(); } - }); + function setEmptyLabel() { + if ($scope.require_label && + ($scope.label == '' || $scope.label == undefined)) { + $scope.callNumber.empty_label = $scope.empty_label = true; + } else { + $scope.callNumber.empty_label = $scope.empty_label = false; + } + } + }); + $scope.prefix = $scope.callNumber.prefix(); $scope.suffix = $scope.callNumber.suffix(); $scope.classification = $scope.callNumber.label_class();