From 6edcb4c8ba45722c6c16115b586818f2500320d7 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Sun, 9 Aug 2015 18:59:00 -0400 Subject: [PATCH] webstaff: browser client local admin additions * copy locations editor * copy locations groups * copy locations order * copy template editor * auto-print settings (new UI) Signed-off-by: Bill Erickson Signed-off-by: Galen Charlton Signed-off-by: Kathy Lussier --- .../staff/admin/local/config/auto_print.tt2 | 86 ++++++++++++++++++++++ .../src/templates/staff/admin/local/t_splash.tt2 | 50 +++++++++++-- Open-ILS/src/templates/staff/css/admin.css.tt2 | 7 ++ .../web/js/ui/default/staff/admin/local/app.js | 7 ++ .../default/staff/admin/local/config/auto_print.js | 75 +++++++++++++++++++ 5 files changed, 217 insertions(+), 8 deletions(-) create mode 100644 Open-ILS/src/templates/staff/admin/local/config/auto_print.tt2 create mode 100644 Open-ILS/web/js/ui/default/staff/admin/local/config/auto_print.js diff --git a/Open-ILS/src/templates/staff/admin/local/config/auto_print.tt2 b/Open-ILS/src/templates/staff/admin/local/config/auto_print.tt2 new file mode 100644 index 0000000000..a6b4725003 --- /dev/null +++ b/Open-ILS/src/templates/staff/admin/local/config/auto_print.tt2 @@ -0,0 +1,86 @@ +[% + WRAPPER "staff/base.tt2"; + ctx.page_title = l("Auto-Print Settings"); + ctx.page_app = "egAdminConfig"; + ctx.page_ctrl = 'AutoPrintCtl'; +%] + +[% BLOCK APP_JS %] + + +[% END %] + +
+
+ [% l('Auto-Print Settings') %] +
+
+ +
+ +
+ [% l('Disable Automatic Print Attempt Type List') %] +
+ +
+[% | l %]Disable automatic print attempts from staff client interfaces +for the receipt types in this list. Possible values: "Checkout", "Bill +Pay", "Hold Slip", "Transit Slip", and "Hold/Transit Slip". This is +different from the Auto-Print checkbox in the pertinent interfaces +in that it disables automatic print attempts altogether, rather than +encouraging silent printing by suppressing the print dialog. The +Auto-Print checkbox in these interfaces have no effect on the behavior +for this setting. In the case of the Hold, Transit, and Hold/Transit +slips, this also suppresses the alert dialogs that precede the print +dialog (the ones that offer Print and Do Not Print as options).[% END %] +
+ +
+
[% l('New Setting') %]
+
+ [% l('Disable auto-print attempts for these receipt/slip types') %] +
+
+ +
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ +
+ + + + +[% END %] diff --git a/Open-ILS/src/templates/staff/admin/local/t_splash.tt2 b/Open-ILS/src/templates/staff/admin/local/t_splash.tt2 index 701286bf23..63c1d35396 100644 --- a/Open-ILS/src/templates/staff/admin/local/t_splash.tt2 +++ b/Open-ILS/src/templates/staff/admin/local/t_splash.tt2 @@ -8,31 +8,49 @@
-
-
-
-
-
-
- +
+ +
+
+
diff --git a/Open-ILS/src/templates/staff/css/admin.css.tt2 b/Open-ILS/src/templates/staff/css/admin.css.tt2 index 1c9636594f..0de1df91b1 100644 --- a/Open-ILS/src/templates/staff/css/admin.css.tt2 +++ b/Open-ILS/src/templates/staff/css/admin.css.tt2 @@ -21,3 +21,10 @@ border-top: 2px solid #F5F5F5; } +#auto-print-container { + margin-top: 20px; +} + +#auto-print-container .row { + margin-top: 20px; +} diff --git a/Open-ILS/web/js/ui/default/staff/admin/local/app.js b/Open-ILS/web/js/ui/default/staff/admin/local/app.js index b3716f7535..8a520ddfa6 100644 --- a/Open-ILS/web/js/ui/default/staff/admin/local/app.js +++ b/Open-ILS/web/js/ui/default/staff/admin/local/app.js @@ -24,6 +24,13 @@ angular.module('egLocalAdmin', controller: 'EmbedXHTMLCtl', // non-conify resolve : resolver }); + + // non-conify routes come first + $routeProvider.when('/admin/local/asset/copy_locations', { + template: eframe_template, + controller: 'EmbedXHTMLCtl', // non-conify + resolve : resolver + }); // Conify page handler $routeProvider.when('/admin/local/:schema/:page', { diff --git a/Open-ILS/web/js/ui/default/staff/admin/local/config/auto_print.js b/Open-ILS/web/js/ui/default/staff/admin/local/config/auto_print.js new file mode 100644 index 0000000000..4097efbf41 --- /dev/null +++ b/Open-ILS/web/js/ui/default/staff/admin/local/config/auto_print.js @@ -0,0 +1,75 @@ + +angular.module('egAdminConfig', + ['ngRoute', 'ui.bootstrap', 'egCoreMod','egUiMod']) + +.controller('AutoPrintCtl', + ['$scope','egCore', +function($scope , egCore) { + + $scope.allowed_orgs = []; + $scope.cant_use_org = function(org_id) { + return $scope.allowed_orgs.indexOf(org_id) == -1; + } + + // The org setting stores the values as English words. + // Map those to scope-storable bools + var values_map = { + co_recpt : 'Checkout', + bill_recpt : 'Bill Pay', + hold_slip : 'Hold Slip', + transit_slip : 'Transit Slip', + hold_transit_slip : 'Hold/Transit Slip' + } + + // fetch and display values for the currently selected org unit + $scope.show_org_values = function(org) { + egCore.org.settings( + ['circ.staff_client.do_not_auto_attempt_print'], org.id() + ).then(function(values) { + list = values['circ.staff_client.do_not_auto_attempt_print'] || []; + angular.forEach(values_map, function(val, key) { + if (list.indexOf(val) > -1) { + $scope[key] = true; + } else { + $scope[key] = false; + } + }); + }); + } + + function fetch_data() { + // TODO: The XUL app tested the ADMIN_ORG_UNIT_SETTING_TYPE perm + // to see wher the user could change the print settings. There + // should be a separate, less powerful permission that allows + // users to change this value. + egCore.perm.hasPermAt(['ADMIN_ORG_UNIT_SETTING_TYPE'], true) + .then(function(settings) { + $scope.allowed_orgs = settings.ADMIN_ORG_UNIT_SETTING_TYPE; + }); + $scope.show_org_values(egCore.org.get(egCore.auth.user().ws_ou())); + } + + $scope.update_auto_print = function() { + $scope.in_flight = true; + var values = []; + angular.forEach(values_map, function(val, key) { + if ($scope[key]) { values.push(val) } + }); + + console.log('updating for ' + $scope.context_org.id()); + egCore.net.request( + 'open-ils.actor', + 'open-ils.actor.org_unit.settings.update', + egCore.auth.token(), + $scope.context_org.id(), + {"circ.staff_client.do_not_auto_attempt_print": values} + ).then(function() { + $scope.in_flight = false; // re-enable the submit button + }); + } + + // This is a standalone with page w/ no startup resolver. + // Kick off startup locally. + egCore.startup.go().then(fetch_data); + +}]) -- 2.11.0