[open-ils-commits] [GIT] Evergreen ILS branch master updated. b287eedbf97e5ed0aa85c52cf194e826a80f4012
Evergreen Git
git at git.evergreen-ils.org
Wed Jul 19 11:54:17 EDT 2017
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, master has been updated
via b287eedbf97e5ed0aa85c52cf194e826a80f4012 (commit)
from 7d5f8536717b372ec5c63ec7ac5d41c8eb1ec955 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit b287eedbf97e5ed0aa85c52cf194e826a80f4012
Author: Bill Erickson <berickxx at gmail.com>
Date: Wed Apr 5 16:58:53 2017 -0400
LP#1680110 Webstaff circ.staff_client.receipt.* AOUS support
Support fetching and adding server-configured strings to print receipts
scope so they can be added to receipts.
Currently supported settings:
circ.staff_client.receipt.alert_text
circ.staff_client.receipt.event_text
circ.staff_client.receipt.footer_text
circ.staff_client.receipt.header_text
circ.staff_client.receipt.notice_text
Signed-off-by: Bill Erickson <berickxx at gmail.com>
Signed-off-by: Lynn Floyd <lfloyd at andersonlibrary.org>
Signed-off-by: Kathy Lussier <klussier at masslnc.org>
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 97f8333..de6e766 100644
--- a/Open-ILS/web/js/ui/default/staff/services/print.js
+++ b/Open-ILS/web/js/ui/default/staff/services/print.js
@@ -8,7 +8,16 @@ angular.module('egCoreMod')
['$q','$window','$timeout','$http','egHatch','egAuth','egIDL','egOrg','egEnv',
function($q , $window , $timeout , $http , egHatch , egAuth , egIDL , egOrg , egEnv) {
- var service = {};
+ var service = {
+ include_settings : [
+ 'circ.staff_client.receipt.alert_text',
+ 'circ.staff_client.receipt.event_text',
+ 'circ.staff_client.receipt.footer_text',
+ 'circ.staff_client.receipt.header_text',
+ 'circ.staff_client.receipt.notice_text'
+ ]
+ };
+
service.template_base_path = 'share/print_templates/t_';
@@ -52,6 +61,26 @@ function($q , $window , $timeout , $http , egHatch , egAuth , egIDL , egOrg , eg
scope.staff = egIDL.toHash(egAuth.user());
scope.current_location =
egIDL.toHash(egOrg.get(egAuth.user().ws_ou()));
+
+ return service.fetch_includes(scope);
+ }
+
+ // Retrieve org settings for receipt includes and add them
+ // to the print scope under scope.includes.<name>
+ service.fetch_includes = function(scope) {
+ // org settings for the workstation org are cached
+ // within egOrg. No need to cache them locally.
+ return egOrg.settings(service.include_settings).then(
+
+ function(settings) {
+ scope.includes = {};
+ angular.forEach(settings, function(val, key) {
+ // strip the settings prefix so you just have
+ // e.g. scope.includes.alert_text
+ scope.includes[key.split(/\./).pop()] = val;
+ });
+ }
+ );
}
service.last_print = {};
@@ -59,14 +88,14 @@ function($q , $window , $timeout , $http , egHatch , egAuth , egIDL , egOrg , eg
// Template has been fetched (or no template needed)
// Process the template and send the result off to the printer.
service.print_content = function(args) {
- service.fleshPrintScope(args.scope);
+ return service.fleshPrintScope(args.scope).then(function() {
+ var promise = egHatch.usePrinting() ?
+ service.print_via_hatch(args) :
+ service.print_via_browser(args);
- var promise = egHatch.usePrinting() ?
- service.print_via_hatch(args) :
- service.print_via_browser(args);
-
- return promise['finally'](
- function() { service.clear_print_content() });
+ return promise['finally'](
+ function() { service.clear_print_content() });
+ });
}
service.print_via_hatch = function(args) {
-----------------------------------------------------------------------
Summary of changes:
Open-ILS/web/js/ui/default/staff/services/print.js | 45 ++++++++++++++++----
1 files changed, 37 insertions(+), 8 deletions(-)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list