From e7361c2a3f8125cd419cf1523e16825142859b9e Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Wed, 19 Jul 2017 10:37:16 -0400 Subject: [PATCH] webstaff: serial.default_display_grouping setting This wires the library org unit setting "Default display grouping for serials distributions presented in the OPAC." into the webstaff serials interface. It also defaults the display grouping to Chronological for new distributions in the absence of a setting. Signed-off-by: Jason Etheridge --- .../serials/directives/subscription_manager.js | 29 +++++++++++++--------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/Open-ILS/web/js/ui/default/staff/serials/directives/subscription_manager.js b/Open-ILS/web/js/ui/default/staff/serials/directives/subscription_manager.js index 9404be6f78..d7edbb8acd 100644 --- a/Open-ILS/web/js/ui/default/staff/serials/directives/subscription_manager.js +++ b/Open-ILS/web/js/ui/default/staff/serials/directives/subscription_manager.js @@ -74,18 +74,23 @@ function($scope , $q , egSerialsCoreSvc , egCore , egGridDataProvider , $scope.add_distribution(new_ssub); // since we know we want at least one distribution } $scope.add_distribution = function(ssub, grab_focus) { - var new_sdist = egCore.idl.toTypedHash(new egCore.idl.sdist()); - new_sdist._isnew = true; - new_sdist.subscription = ssub.id; - if (!angular.isArray(ssub.distributions)){ - ssub.distributions = []; - } - if (grab_focus) { - new_sdist._focus_me = true; - ssub._focus_me = false; - } - ssub.distributions.push(new_sdist); - $scope.add_stream(new_sdist); // since we know we want at least one stream + egCore.org.settings([ + 'serial.default_display_grouping' + ]).then(function(set) { + var new_sdist = egCore.idl.toTypedHash(new egCore.idl.sdist()); + new_sdist._isnew = true; + new_sdist.subscription = ssub.id; + new_sdist.display_grouping = set['serial.default_display_grouping'] || 'chron'; + if (!angular.isArray(ssub.distributions)){ + ssub.distributions = []; + } + if (grab_focus) { + new_sdist._focus_me = true; + ssub._focus_me = false; + } + ssub.distributions.push(new_sdist); + $scope.add_stream(new_sdist); // since we know we want at least one stream + }); } $scope.remove_pending_distribution = function(ssub, sdist) { var to_remove = -1; -- 2.11.0