From: Kyle Huckins Date: Thu, 16 May 2019 22:05:55 +0000 (+0000) Subject: lp1821950 Require Call Number Label YAOUS X-Git-Url: http://git.equinoxoli.org/?p=evergreen-equinox.git;a=commitdiff_plain;h=b21c2c4f65d18d92fa41152d3b648c81c9b6c4eb lp1821950 Require Call Number Label YAOUS - Add YAOUS to Require Call Number Labels in Copy Editor - Set new YAOUS to true - Don't display empty call number field warning if call numbers aren't required on the copy editor. - Properly enable/disable saving an item in the volcopy editor when CN label is empty, based on Require Call Number Label setting. Signed-off-by: Kyle Huckins Changes to be committed: modified: Open-ILS/src/sql/Pg/950.data.seed-values.sql new file: Open-ILS/src/sql/Pg/upgrade/XXXX.lp1821950-call-number-label-required-yaous.sql modified: Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js Signed-off-by: Terran McCanna Signed-off-by: Michele Morgan --- diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index ef95011..910e887 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -3331,6 +3331,15 @@ INSERT into config.org_unit_setting_type 'coust', 'description'), 'currency', null) +,( 'cat.require_call_number_labels', 'cat', + oils_i18n_gettext('cat.require_call_number_labels', + 'Require call number labels in Copy Editor', + 'coust', 'label'), + oils_i18n_gettext('cat.require_call_number_labels', + 'Define whether Copy Editor requires Call Number labels', + 'coust', 'description'), + 'bool', null) + ,( 'circ.min_item_price', 'finance', oils_i18n_gettext('circ.min_item_price', 'Minimum Item Price', @@ -5825,6 +5834,7 @@ INSERT INTO actor.org_unit_setting (org_unit, name, value) VALUES ( ,(1, 'cat.label.font.size', 10) ,(1, 'cat.label.font.weight', '"normal"') ,(1, 'circ.grace.extend', 'true') + ,(1, 'cat.require_call_number_labels', 'true') ; --220.schema.rating.sql (Default badge for popularity ranking) diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.lp1821950-call-number-label-required-yaous.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.lp1821950-call-number-label-required-yaous.sql new file mode 100644 index 0000000..a0c7870 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.lp1821950-call-number-label-required-yaous.sql @@ -0,0 +1,19 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); + +INSERT into config.org_unit_setting_type +( name, grp, label, description, datatype, fm_class ) VALUES +( 'cat.require_call_number_labels', 'cat', + oils_i18n_gettext('cat.require_call_number_labels', + 'Require call number labels in Copy Editor', + 'coust', 'label'), + oils_i18n_gettext('cat.require_call_number_labels', + 'Define whether Copy Editor requires Call Number labels', + 'coust', 'description'), + 'bool', null); + +INSERT INTO actor.org_unit_setting (org_unit, name, value) VALUES + (1, 'cat.require_call_number_labels', 'true'); + +COMMIT; \ No newline at end of file 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 bd75754..4a71013 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 @@ -682,7 +682,7 @@ function(egCore , $q) { ''+ '
'+ ''+ - '
{{empty_label_string}}
'+ + '
{{empty_label_string}}
'+ '
'+ '
'+ ''+ @@ -700,6 +700,9 @@ function(egCore , $q) { if (!$scope.callNumber.label()) $scope.callNumber.empty_label = true; $scope.empty_label = false; + egCore.org.settings('cat.require_call_number_labels').then(function(res) { + $scope.require_label = res['cat.require_call_number_labels']; + }); $scope.empty_label_string = window.empty_label_string; $scope.idTracker = function (x) { if (x && x.id) return x.id() }; @@ -1093,6 +1096,10 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore , } }; + egCore.org.settings('cat.require_call_number_labels').then(function(res) { + $scope.require_label = res['cat.require_call_number_labels']; + }); + $scope.new_lib_to_add = egCore.org.get(egCore.auth.user().ws_ou()); $scope.changeNewLib = function (org) { $scope.new_lib_to_add = org; @@ -1793,10 +1800,13 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore , itemSvc.copies, function (i) { if (!$scope.only_vols) { - if (i.duplicate_barcode || i.empty_barcode || i.call_number().empty_label) { + if (i.duplicate_barcode || i.empty_barcode) { + can_save = false; + } + if (i.call_number().empty_label && $scope.require_label) { can_save = false; } - } else if (i.call_number().empty_label) { + } else if (i.call_number().empty_label && $scope.require_label) { can_save = false; } }