[open-ils-commits] [GIT] Evergreen ILS branch rel_2_12 updated. 63e7aa2baecd28945103743c0c05e1387a92b364

Evergreen Git git at git.evergreen-ils.org
Wed Jul 19 11:55:54 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, rel_2_12 has been updated
       via  63e7aa2baecd28945103743c0c05e1387a92b364 (commit)
      from  688c826a5959deeb2fb71421278de4ce930e9823 (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 63e7aa2baecd28945103743c0c05e1387a92b364
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