From: Galen Charlton Date: Tue, 26 Jan 2016 22:34:03 +0000 (-0500) Subject: webstaff: tweak setting default classification scheme in volcopy editor X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=b9f9da96a44a154c8fd4f37ccea690afcb66d5e8;p=evergreen%2Fequinox.git webstaff: tweak setting default classification scheme in volcopy editor With this patch, the volume/copy editor creation default for classification scheme now can have a value of "Use Library Setting". If this is in effect, the default classification scheme for new volumes is taken from the library setting. Signed-off-by: Galen Charlton Signed-off-by: Kathy Lussier --- diff --git a/Open-ILS/src/templates/staff/cat/volcopy/t_defaults.tt2 b/Open-ILS/src/templates/staff/cat/volcopy/t_defaults.tt2 index dc67634dca..df0a1d794f 100644 --- a/Open-ILS/src/templates/staff/cat/volcopy/t_defaults.tt2 +++ b/Open-ILS/src/templates/staff/cat/volcopy/t_defaults.tt2 @@ -27,7 +27,7 @@

[% l('Creation Defaults') %]

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 f347be7cbd..5ec7c28e27 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 @@ -661,6 +661,14 @@ function(egCore , $q) { $scope.struct[cn.id()] = [cp]; $scope.allcopies.push(cp); + if (!scope.defaults.classification) { + egCore.org.settings( + ['cat.default_classification_scheme'], + cn.owning_lib() + ).then(function (val) { + cn.label_class(val['cat.default_classification_scheme']); + }); + } } } else if (n < o && n >= $scope.orig_cn_count) { // removing var how_many = o - n; @@ -1088,26 +1096,35 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore , cn.isnew( true ); cn.prefix( $scope.defaults.prefix || -1 ); cn.suffix( $scope.defaults.suffix || -1 ); - cn.label_class( $scope.defaults.classification || 1 ); cn.owning_lib( proto.owner || egCore.auth.user().ws_ou() ); cn.record( $scope.record_id ); - if (proto.label) { - cn.label( proto.label ); - } else { - egCore.net.request( - 'open-ils.cat', - 'open-ils.cat.biblio.record.marc_cn.retrieve', - $scope.record_id, - $scope.defaults.classification || 1 - ).then(function(cn_array) { - if (cn_array.length > 0) { - for (var field in cn_array[0]) { - cn.label( cn_array[0][field] ); - break; + egCore.org.settings( + ['cat.default_classification_scheme'], + cn.owning_lib() + ).then(function (val) { + cn.label_class( + $scope.defaults.classification || + val['cat.default_classification_scheme'] || + 1 + ); + if (proto.label) { + cn.label( proto.label ); + } else { + egCore.net.request( + 'open-ils.cat', + 'open-ils.cat.biblio.record.marc_cn.retrieve', + $scope.record_id, + cn.label_class() + ).then(function(cn_array) { + if (cn_array.length > 0) { + for (var field in cn_array[0]) { + cn.label( cn_array[0][field] ); + break; + } } - } - }); - } + }); + } + }); var cp = new egCore.idl.acp(); cp.call_number( cn );