From: Bill Erickson Date: Wed, 16 Apr 2014 15:23:31 +0000 (-0400) Subject: browser staff : printing cont. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=9d5876e76cd951d642dfedd232b6b7e58718efd1;p=working%2FEvergreen.git browser staff : printing cont. Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/web/js/ui/default/staff/services/grid.js b/Open-ILS/web/js/ui/default/staff/services/grid.js index d524cabff0..a9f19180ca 100644 --- a/Open-ILS/web/js/ui/default/staff/services/grid.js +++ b/Open-ILS/web/js/ui/default/staff/services/grid.js @@ -431,7 +431,7 @@ angular.module('egGridMod', } grid.printCSV = function() { - egPrintStore.print('text/csv', grid.generateCSV()) + egPrintStore.print('text/plain', grid.generateCSV()) .then(function() { console.debug('print complete') }); } diff --git a/Open-ILS/web/js/ui/default/staff/services/printstore.js b/Open-ILS/web/js/ui/default/staff/services/printstore.js index d3c30816ff..501c026bc1 100644 --- a/Open-ILS/web/js/ui/default/staff/services/printstore.js +++ b/Open-ILS/web/js/ui/default/staff/services/printstore.js @@ -16,7 +16,7 @@ angular.module('egCoreMod') service.pending = []; service.socket = null; service.hatchAvailable = null; - service.hatchURL = 'ws://localhost:8080/hatch/'; // TODO: configuration/ssl + service.hatchURL = 'wss://localhost:8443/hatch'; service.hatchSend = function(msg) { @@ -102,27 +102,29 @@ angular.module('egCoreMod') } var srcMsg = service.messages[msgObj.msgid]; - delete service.messages[msgObj.msgid]; - srcMsg.deferred.resolve(msgObj); + if (srcMsg) { + delete service.messages[msgObj.msgid]; + srcMsg.deferred.resolve(msgObj); + } } } - service.browserPrint = function(mime, data) { + service.browserPrint = function(contentType, content) { // let our local print container handle printing - service.onBrowserPrint(mime, data); + service.onBrowserPrint(contentType, content); } - service.print = function(mime, data) { + service.print = function(contentType, content) { if (service.hatchAvailable === false) { - service.browserPrint(mime, data); + service.browserPrint(contentType, content); return $q.when(); } return service.hatchSend({ key : 'no-op', action : 'print', - mime : mime, - value : data, + content : content, + contentType : contentType //printer : printer // TODO: prefs, etc. }); }