From: Bill Erickson Date: Fri, 18 Nov 2016 17:13:38 +0000 (-0500) Subject: LP#1642761 Hatch print config UI WIP X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=98769cc470c96651abf5c974379b20cb9f5f7e14;p=working%2FEvergreen.git LP#1642761 Hatch print config UI WIP Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/templates/staff/admin/workstation/t_print_config.tt2 b/Open-ILS/src/templates/staff/admin/workstation/t_print_config.tt2 index ce4d670fa0..a771b45e51 100644 --- a/Open-ILS/src/templates/staff/admin/workstation/t_print_config.tt2 +++ b/Open-ILS/src/templates/staff/admin/workstation/t_print_config.tt2 @@ -73,8 +73,255 @@
+
+

[% l('Printer Options') %]

+
+
+
+ +
+
+ +
+
+ [% l('Default: [_1]', + '{{printerOptions.defaultPrintColor}}') %] +
+
+
+
+
+ +
+
+ +
+
+ [% l('Default: [_1]', + '{{printerOptions.defaultPaperSource}}') %] +
+
+ +
+
+
+ +
+
+ +
+
+ [% l('Default: [_1]', + '{{printerOptions.defaultPaper}}') %] +
+
+ +
+
+
+ +
+
+ +
+
+ [% l('Default: [_1]', + '{{printerOptions.defaultPageOrientation}}') %] +
+
+ +
+
+
+ +
+
+ +
+
+ [% l('Default: [_1]', + '{{printerOptions.defaultCollation}}') %] +
+
+ +
+
+
+ +
+
+ +
+
+ [% l('Default: [_1]', + '{{printerOptions.defaultPrintQuality}}') %] +
+
+ +
+
+
+ +
+
+ +
+
+ [% l('Default: [_1]', + '{{printerOptions.defaultPrintSides}}') %] +
+
+ +
+
+
+ +
+
+ +
+
+ [% l('Default: [_1]', + '{{printerOptions.defaultCopies}}') %] +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ [% l('Default: [_1]', + '{{printerOptions.defaultMarginType}}') %] +
+
+ +
+
+ +
+
+ +
+
+
+ [% l('Left') %] + +
+
+
+
+ [% l('Right') %] + +
+
+
+
+ [% l('Top') %] + +
+
+
+
+ [% l('Bottom') %] + +
+
+
+ +
+
+
+
+ [% l('All Pages') %] + +
+
+ [% l('Page Range') %] + +
+
+
+ [% l('Start') %] + +
+
+
+
+ [% l('End') %] + +
+
+ +
+
+
+
+ +
-

[% l('Compiled Printer Settings') %]

+

[% l('Compiled Printer Settings') %]

{{printerConfString()}}
diff --git a/Open-ILS/src/templates/staff/css/style.css.tt2 b/Open-ILS/src/templates/staff/css/style.css.tt2 index 93881b6906..4e6f962a3c 100644 --- a/Open-ILS/src/templates/staff/css/style.css.tt2 +++ b/Open-ILS/src/templates/staff/css/style.css.tt2 @@ -128,6 +128,7 @@ table.list tr.selected td { /* deprecated? */ .pad-vert {padding : 20px 0px 10px 0px;} .pad-left {padding-left: 10px;} .pad-right {padding-right: 10px;} +.pad-right-min {padding-right: 5px;} .pad-all-min {padding : 5px; } .pad-all-min2 {padding : 2px; } .pad-all {padding : 10px; } diff --git a/Open-ILS/web/js/ui/default/staff/admin/workstation/app.js b/Open-ILS/web/js/ui/default/staff/admin/workstation/app.js index f0ea4fd4cf..571ae1df37 100644 --- a/Open-ILS/web/js/ui/default/staff/admin/workstation/app.js +++ b/Open-ILS/web/js/ui/default/staff/admin/workstation/app.js @@ -277,13 +277,26 @@ function($scope , egCore) { if (!$scope.printConfig[ctx]) { $scope.printConfig[ctx] = { context : ctx, - printer : pname + printer : pname, + autoMargins : true, + allPages : true, + pageRanges : [] } } } ); + + // load printer options for the first printer shown. + // TODO: rethink this in combo w/ print config stuff above.. + $scope.setPrinter($scope.printConfig['default'].printer); }); + + $scope.usingManualMargins = function(ctx) { + var conf = $scope.printConfig[ctx]; + return conf && conf.marginType; + } + $scope.printerConfString = function() { if ($scope.printConfigError) return $scope.printConfigError; if (!$scope.printConfig) return; @@ -310,6 +323,8 @@ function($scope , egCore) { $scope.setPrinter = function(name) { $scope.printConfig[$scope.context].printer = name; + egCore.hatch.getPrinterOptions(name).then( + function(options) {$scope.printerOptions = options}); } // for testing diff --git a/Open-ILS/web/js/ui/default/staff/services/hatch.js b/Open-ILS/web/js/ui/default/staff/services/hatch.js index c38920e0f6..242e252b09 100644 --- a/Open-ILS/web/js/ui/default/staff/services/hatch.js +++ b/Open-ILS/web/js/ui/default/staff/services/hatch.js @@ -221,6 +221,13 @@ angular.module('egCoreMod') ); } + service.getPrinterOptions = function(name) { + return service.attemptHatchDelivery({ + action : 'printer-options', + printer : name + }); + } + // launch the print dialog then attach the resulting configuration // to the requested context, then store the final values. service.configurePrinter = function(context, printer) {