From 28242e62b746c6203f7d4502a05d55c2528a5c56 Mon Sep 17 00:00:00 2001 From: Mike Risher Date: Wed, 26 Feb 2020 00:31:27 +0000 Subject: [PATCH] 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 --- .../web/js/ui/default/staff/cat/volcopy/app.js | 28 +++++++++++++++------- 1 file changed, 20 insertions(+), 8 deletions(-) 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 2e41f03f28..fd0bc4743a 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 @@ -763,16 +763,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(); -- 2.11.0