From ec421375864cd993a612047bf8af22e4a19778f9 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 6 Sep 2012 12:31:23 -0400 Subject: [PATCH] [SIGNED-OFF] Bug 2930 [REVISED] Put other name on checkout screen Content-Type: text/plain; charset="utf-8" This patch adds other name to the include which is used to display patron names and adds this include in several places where it can be used in place of direct output. The patron-title include has been modified to handle the two possible variable scopes throughout patron-related templates. This is a hack similar to having both circ-menu.tt and circ-menu.inc, but keeping both in the same file. Changes to some scripts were necessary to make the othernames variable available to the include. This patch also corrects some tags and fixes some incorrect capitalization (see Bug 2780). To test, view each of the pages affected by these template changes and confirm that the patron's name displays correctly, including their "other name." Signed-off-by: Marc Veron <veron@veron.ch> Followed instructions above, works as expected. --- .../prog/en/includes/patron-title.inc | 29 ++++++++++++++----- .../prog/en/modules/members/member.tt | 2 +- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc index c05c9be..ac2f388 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc @@ -1,10 +1,23 @@ -[% IF category_type == 'I' %] - [% surname %] [% IF othernames %] ([% othernames %]) [% END %] -[% ELSE %] - [% IF invert_name %] - [% surname %], [% firstname %] +[% IF ( borrower.borrowernumber ) %] + [% IF borrower.category_type == 'I' %] + [% borrower.surname %] [% IF borrower.othernames %] ([% borrower.othernames %]) [% END %] [% ELSE %] - [% firstname %] [% surname %] + [% IF invert_name %] + [% borrower.surname %], [% borrower.firstname %] [% IF borrower.othernames %] ([% borrower.othernames %]) [% END %] + [% ELSE %] + [% borrower.firstname %] [% IF borrower.othernames %] ([% borrower.othernames %]) [% END %] [% borrower.surname %] + [% END %] [% END %] -[% END %] -([% cardnumber %]) + ([% borrower.cardnumber %]) +[% ELSIF ( borrowernumber ) %] + [% IF category_type == 'I' %] + [% surname %] [% IF othernames %] ([% othernames %]) [% END %] + [% ELSE %] + [% IF invert_name %] + [% surname %], [% firstname %] [% IF othernames %] ([% othernames %]) [% END %] + [% ELSE %] + [% firstname %] [% IF othernames %] ([% othernames %]) [% END %] [% surname %] + [% END %] + [% END %] + ([% cardnumber %]) +[% END %] \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt index 7060cbf..b55fe5a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt @@ -62,7 +62,7 @@ <td>[% resultsloo.cardnumber %]</td> <td style="white-space: nowrap;"> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% resultsloo.borrowernumber %]"> - [% INCLUDE 'patron-title.inc' category_type = resultsloo.category_type firstname = resultsloo.firstname surname = resultsloo.surname othernames = resultsloo.othernames cardnumber = resultsloo.cardnumber invert_name = 1%] + [% INCLUDE 'patron-title.inc' borrowernumber = resultsloo.borrowernumber category_type = resultsloo.category_type firstname = resultsloo.firstname surname = resultsloo.surname othernames = resultsloo.othernames cardnumber = resultsloo.cardnumber invert_name = 1%] </a> <br /> [% IF ( resultsloo.streetnumber ) %][% resultsloo.streetnumber %] [% END %][% resultsloo.address %][% IF ( resultsloo.address2 ) %]<br />[% resultsloo.address2 %][% END %][% IF ( resultsloo.city ) %]<br />[% resultsloo.city %][% IF ( resultsloo.state ) %],[% END %][% END %][% IF ( resultsloo.state ) %] [% resultsloo.state %][% END %] [% IF ( resultsloo.zipcode ) %] [% resultsloo.zipcode %][% END %][% IF ( resultsloo.country ) %], [% resultsloo.country %][% END %]</td> <td>[% resultsloo.category_description %] ([% resultsloo.category_type %])</td> -- 1.7.2.5