[open-ils-commits] [GIT] Evergreen ILS branch rel_2_1 updated. c0f5d509c82fae387c47b11de4c581a8ad65e6e7

Evergreen Git git at git.evergreen-ils.org
Thu Jun 30 13:00:34 EDT 2011


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_1 has been updated
       via  c0f5d509c82fae387c47b11de4c581a8ad65e6e7 (commit)
      from  006d92392f05d6f4aa90d2e330b12836f185d10a (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 c0f5d509c82fae387c47b11de4c581a8ad65e6e7
Author: Jason Etheridge <jason at esilibrary.com>
Date:   Tue Jun 14 14:50:33 2011 -0400

    when using params.data keys as print macros, render bare numbers correctly, and treat nulls as empty strings
    
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/Open-ILS/xul/staff_client/chrome/content/util/print.js b/Open-ILS/xul/staff_client/chrome/content/util/print.js
index 4f9cbdd..ce0442d 100644
--- a/Open-ILS/xul/staff_client/chrome/content/util/print.js
+++ b/Open-ILS/xul/staff_client/chrome/content/util/print.js
@@ -294,9 +294,13 @@ util.print.prototype = {
                 if (typeof params.data != 'undefined') {
                     for (var i in params.data) {
                         var re = new RegExp('%'+i+'%',"g");
-                        if (typeof params.data[i] == 'string') {
+                        if (typeof params.data[i] == 'string' || typeof params.data[i] == 'number') {
                             try{b = s; s=s.replace(re, params.data[i]);}
                                 catch(E){s = b; this.error.standard_unexpected_error_alert('print.js, template_sub(): 3 string = <' + s + '>',E);}
+                        } else {
+                            /* likely a null, print as an empty string */
+                            try{b = s; s=s.replace(re, '');}
+                                catch(E){s = b; this.error.standard_unexpected_error_alert('print.js, template_sub(): 3 string = <' + s + '>',E);}
                         }
                     }
                 }

-----------------------------------------------------------------------

Summary of changes:
 .../xul/staff_client/chrome/content/util/print.js  |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list