From: phasefx
Date: Thu, 29 Oct 2009 02:18:36 +0000 (+0000)
Subject: modified patch from Steve Callender; exposes the patron 'alias' field in the Receipt...
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=727be71d40f1eee13ce3d68e402272a7c5274321;p=evergreen%2Fmasslnc.git
modified patch from Steve Callender; exposes the patron 'alias' field in the Receipt Template Editor as %PATRON_ALIAS%. There's also a %PATRON_ALIAS_OR_FIRSTNAME% macro that will show the alias, or the first name if alias is unset
git-svn-id: svn://svn.open-ils.org/ILS/trunk@14662 dcc99617-32d9-48b4-a31d-7c20da2025e4
---
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 39214126ef..97078cbc07 100644
--- a/Open-ILS/xul/staff_client/chrome/content/util/print.js
+++ b/Open-ILS/xul/staff_client/chrome/content/util/print.js
@@ -165,6 +165,10 @@ util.print.prototype = {
catch(E){s = b; this.error.sdump('D_WARN','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
try{b = s; s = s.replace(/%STAFF_PROFILE%/,obj.data.hash.pgt[ params.staff.profile() ].name() ); }
catch(E){s = b; this.error.sdump('D_WARN','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
+ try{b = s; s = s.replace(/%PATRON_ALIAS_OR_FIRSTNAME%/,(params.patron.alias() == '' || params.patron.alias() == null) ? params.patron.first_given_name() : params.patron.alias());}
+ catch(E){s = b; this.error.sdump('D_WARN','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
+ try{b = s; s = s.replace(/%PATRON_ALIAS%/,(params.patron.alias() == '' || params.patron.alias() == null) ? '' : params.patron.alias());}
+ catch(E){s = b; this.error.sdump('D_WARN','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
try{b = s; s = s.replace(/%PATRON_FIRSTNAME%/,params.patron.first_given_name());}
catch(E){s = b; this.error.sdump('D_WARN','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
try{b = s; s = s.replace(/%PATRON_LASTNAME%/,params.patron.family_name());}
diff --git a/Open-ILS/xul/staff_client/server/circ/print_list_template_editor.js b/Open-ILS/xul/staff_client/server/circ/print_list_template_editor.js
index 78651e7755..a9c70f0344 100644
--- a/Open-ILS/xul/staff_client/server/circ/print_list_template_editor.js
+++ b/Open-ILS/xul/staff_client/server/circ/print_list_template_editor.js
@@ -24,6 +24,7 @@ circ.print_list_template_editor.prototype = {
this.test_patron = new au();
this.test_patron.family_name('Doe');
this.test_patron.first_given_name('John');
+ this.test_patron.alias('Curly');
this.test_card = new ac();
this.test_card.barcode('123456789');
this.test_patron.card( this.test_card );
@@ -262,7 +263,7 @@ circ.print_list_template_editor.prototype = {
+ document.getElementById('circStrings').getString('staff.circ.print_list_template.window.heading')
+ ''
+ '%SHORTNAME%, %TODAY%, %STAFF_FIRSTNAME%, %STAFF_LASTNAME%, '
- + '%PATRON_FIRSTNAME%, %LIBRARY%
'
+ + '%PATRON_FIRSTNAME%, %PATRON_ALIAS%, %PATRON_ALIAS_OR_FIRSTNAME%, %LIBRARY%
'
+ ''
+ document.getElementById('circStrings').getFormattedString('staff.circ.print_list_template.window.template_type', [template_type])
+ '
'