From 41b92c3316529879bcb91c834eb71fcb2f6361d4 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 10 Feb 2017 17:06:57 -0500 Subject: [PATCH] LP#1646166 Hatch templated print content type repair Fixes a thinko in the Hatch code that set a bad default content type for template-driven HTML printing. Signed-off-by: Bill Erickson Conflicts: Open-ILS/web/js/ui/default/staff/services/print.js --- Open-ILS/web/js/ui/default/staff/services/print.js | 25 ++++++---------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/Open-ILS/web/js/ui/default/staff/services/print.js b/Open-ILS/web/js/ui/default/staff/services/print.js index f7ae5f8949..61842f8d9e 100644 --- a/Open-ILS/web/js/ui/default/staff/services/print.js +++ b/Open-ILS/web/js/ui/default/staff/services/print.js @@ -33,8 +33,12 @@ function($q , $window , $timeout , $http , egHatch , egAuth , egIDL , egOrg) { return service.getPrintTemplate(args.template) .then(function(content) { args.content = content; - if (!args.content_type) args.content_type = 'html'; - return service.print_content(args); + if (!args.content_type) args.content_type = 'text/html'; + service.getPrintTemplateContext(args.template) + .then(function(context) { + args.context = context; + return service.print_content(args); + }); }); } @@ -165,14 +169,6 @@ function($q , $window , $timeout , $http , egHatch , egAuth , egIDL , egOrg) { * DOM element). Having multiple egPrintContainers could result in chaos. */ -<<<<<<< HEAD -// FIXME: only apply print CSS when print commands are issued via the -// print container, otherwise using the browser's native print page -// option will always result in empty pages. Move the print CSS -// out of the standalone CSS file and put it into a template file -// for this directive. -======= ->>>>>>> 9ff498f... LP#1646166 Hatch print requires no print CSS .directive('egPrintContainer', ['$compile', function($compile) { return { restrict : 'AE', @@ -191,15 +187,6 @@ function($q , $window , $timeout , $http , egHatch , egAuth , egIDL , egOrg) { // DOM with print CSS. // Returns a promise reolved with the compiled HTML as a string. egPrint.ingest_print_content = function(type, content, printScope) { -<<<<<<< HEAD - - if (type == 'text/csv' || type == 'text/plain') { - // preserve newlines, spaces, etc. - content = '
' + content + '
'; - } - -======= ->>>>>>> 9ff498f... LP#1646166 Hatch print requires no print CSS $scope.elm.html(content); var sub_scope = $scope.$new(true); -- 2.11.0