LP#1646166 Hatch templated print content type repair 2_11_1_hatch
authorBill Erickson <berickxx@gmail.com>
Fri, 10 Feb 2017 22:06:57 +0000 (17:06 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Mon, 13 Feb 2017 18:05:56 +0000 (13:05 -0500)
Fixes a thinko in the Hatch code that set a bad default content type for
template-driven HTML printing.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Conflicts:
Open-ILS/web/js/ui/default/staff/services/print.js

Open-ILS/web/js/ui/default/staff/services/print.js

index f7ae5f8..61842f8 100644 (file)
@@ -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 = '<pre>' + content + '</pre>';
-                    }
-
-=======
->>>>>>> 9ff498f... LP#1646166 Hatch print requires no print CSS
                     $scope.elm.html(content);
 
                     var sub_scope = $scope.$new(true);