From: Bill Erickson Date: Mon, 17 Aug 2020 19:13:58 +0000 (-0400) Subject: LP1891550 Ang print context support; no-print contexts X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=aece3f0f9a5b6ed89498933c87d340d45dbb1458;p=evergreen%2Fpines.git LP1891550 Ang print context support; no-print contexts Adds support to the Angular server template admin page for forcing a print context for a given template. Adds support to the Angular print service for looking up the context of a print template when specified by name. Adds support to And and AngJS print settings interfaces for a "No-Print" context, which bypasses printing when used. Adds a new workstation setting for the Booking Capture server print template context. Signed-off-by: Bill Erickson Signed-off-by: Terran McCanna Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/eg2/src/app/share/print/print.component.ts b/Open-ILS/src/eg2/src/app/share/print/print.component.ts index 6af06bd8f9..bf0fb3a6d7 100644 --- a/Open-ILS/src/eg2/src/app/share/print/print.component.ts +++ b/Open-ILS/src/eg2/src/app/share/print/print.component.ts @@ -74,12 +74,32 @@ export class PrintComponent implements OnInit { return; } + // Load the configured print context. + let promise = Promise.resolve(); + if (printReq.templateName) { + promise = this.serverStore.getItem( + 'eg.print.template_context.' + printReq.templateName) + .then(setting => { + if (setting) { + printReq.printContext = setting; + } + }); + } + this.isPrinting = true; + promise.then(_ => { - this.applyTemplate(printReq).then(() => { - // Give templates a chance to render before printing - setTimeout(() => { - this.dispatchPrint(printReq).then(_ => this.reset()); + if (printReq.printContext === 'no-print') { + console.debug('Skipping print request with No-Print context'); + this.reset(); + return; + } + + this.applyTemplate(printReq).then(() => { + // Give templates a chance to render before printing + setTimeout(() => { + this.dispatchPrint(printReq).then(__ => this.reset()); + }); }); }); } diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/print-template.component.html b/Open-ILS/src/eg2/src/app/staff/admin/server/print-template.component.html index 1293bc1597..517ce6353d 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/server/print-template.component.html +++ b/Open-ILS/src/eg2/src/app/staff/admin/server/print-template.component.html @@ -64,6 +64,23 @@ + Force Print Context: + + + + + + + + + + + + + + + +