[open-ils-commits] r14663 - in branches/rel_1_6/Open-ILS/xul/staff_client: chrome/content/util server/circ (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Oct 28 22:27:11 EDT 2009
Author: phasefx
Date: 2009-10-28 22:27:09 -0400 (Wed, 28 Oct 2009)
New Revision: 14663
Modified:
branches/rel_1_6/Open-ILS/xul/staff_client/chrome/content/util/print.js
branches/rel_1_6/Open-ILS/xul/staff_client/server/circ/print_list_template_editor.js
Log:
backport changeset 14662: 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
Modified: branches/rel_1_6/Open-ILS/xul/staff_client/chrome/content/util/print.js
===================================================================
--- branches/rel_1_6/Open-ILS/xul/staff_client/chrome/content/util/print.js 2009-10-29 02:18:36 UTC (rev 14662)
+++ branches/rel_1_6/Open-ILS/xul/staff_client/chrome/content/util/print.js 2009-10-29 02:27:09 UTC (rev 14663)
@@ -164,6 +164,10 @@
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());}
Modified: branches/rel_1_6/Open-ILS/xul/staff_client/server/circ/print_list_template_editor.js
===================================================================
--- branches/rel_1_6/Open-ILS/xul/staff_client/server/circ/print_list_template_editor.js 2009-10-29 02:18:36 UTC (rev 14662)
+++ branches/rel_1_6/Open-ILS/xul/staff_client/server/circ/print_list_template_editor.js 2009-10-29 02:27:09 UTC (rev 14663)
@@ -24,6 +24,7 @@
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 @@
+ document.getElementById('circStrings').getString('staff.circ.print_list_template.window.heading')
+ '</h1>'
+ '<p>%SHORTNAME%, %TODAY%, %STAFF_FIRSTNAME%, %STAFF_LASTNAME%, '
- + '%PATRON_FIRSTNAME%, %LIBRARY%</p>'
+ + '%PATRON_FIRSTNAME%, %PATRON_ALIAS%, %PATRON_ALIAS_OR_FIRSTNAME%, %LIBRARY%</p>'
+ '<h1>'
+ document.getElementById('circStrings').getFormattedString('staff.circ.print_list_template.window.template_type', [template_type])
+ '</h1>'
More information about the open-ils-commits
mailing list