Bug 2930 [REVISED] Put other name on checkout screen
authorOwen Leonard <oleonard@myacpl.org>
Thu, 6 Sep 2012 16:31:23 +0000 (12:31 -0400)
committerPaul Poulain <paul.poulain@biblibre.com>
Tue, 9 Oct 2012 10:23:39 +0000 (12:23 +0200)
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 <title> 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.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc
koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt

index c05c9be..ac2f388 100644 (file)
@@ -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
index 7060cbf..b55fe5a 100644 (file)
@@ -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>