[Patches] [PATCH] bug_6303: patron-title.inc to display properly title for borrowers of

koha-patchbot at kohaaloha.com koha-patchbot at kohaaloha.com
Thu Nov 17 12:50:03 NZDT 2011


From: Srdjan Jankovic <srdjan at catalyst.net.nz>
Date: Fri, 6 May 2011 16:34:10 +1200
Subject: [PATCH] bug_6303: patron-title.inc to display properly title for borrowers of
 category_type 'I'

---
 C4/Members.pm                                      |   19 ++++++++++-------
 circ/circulation.pl                                |    7 ++++-
 .../intranet-tmpl/prog/en/includes/circ-menu.inc   |    2 +-
 .../prog/en/includes/patron-title.inc              |    6 +++++
 .../prog/en/modules/circ/circulation.tt            |   21 ++++++++++---------
 .../prog/en/modules/members/boraccount.tt          |    4 +-
 .../prog/en/modules/members/member.tt              |    4 ++-
 .../prog/en/modules/members/messaging.tt           |    4 +-
 .../prog/en/modules/members/moremember.tt          |   10 +++++++-
 .../prog/en/modules/members/notices.tt             |    6 ++--
 .../prog/en/modules/members/readingrec.tt          |    4 +-
 .../intranet-tmpl/prog/en/modules/tools/viewlog.tt |    4 +-
 .../opac-tmpl/prog/en/includes/patron-title.inc    |    5 ++++
 koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt   |    7 ++++-
 .../opac-tmpl/prog/en/modules/opac-userupdate.tt   |    7 ++++-
 members/boraccount.pl                              |    3 +-
 members/messaging.pl                               |    7 +++++-
 members/moremember.pl                              |    7 +++--
 members/notices.pl                                 |    6 +++++
 members/readingrec.pl                              |    1 +
 opac/opac-user.pl                                  |    3 ++
 tools/viewlog.pl                                   |    3 ++
 22 files changed, 96 insertions(+), 44 deletions(-)
 create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc
 create mode 100644 koha-tmpl/opac-tmpl/prog/en/includes/patron-title.inc

diff --git a/C4/Members.pm b/C4/Members.pm
index a151e03..2fff232 100644
--- a/C4/Members.pm
+++ b/C4/Members.pm
@@ -352,7 +352,7 @@ sub GetMemberDetails {
     my $query;
     my $sth;
     if ($borrowernumber) {
-        $sth = $dbh->prepare("select borrowers.*,category_type,categories.description from borrowers left join categories on borrowers.categorycode=categories.categorycode where  borrowernumber=?");
+        $sth = $dbh->prepare("select borrowers.*,category_type,categories.description,enrolmentperiod from borrowers left join categories on borrowers.categorycode=categories.categorycode where  borrowernumber=?");
         $sth->execute($borrowernumber);
     }
     elsif ($cardnumber) {
@@ -379,13 +379,16 @@ sub GetMemberDetails {
     $borrower->{'flags'}     = $flags;
     $borrower->{'authflags'} = $accessflagshash;
 
-    # find out how long the membership lasts
-    $sth =
-      $dbh->prepare(
-        "select enrolmentperiod from categories where categorycode = ?");
-    $sth->execute( $borrower->{'categorycode'} );
-    my $enrolment = $sth->fetchrow;
-    $borrower->{'enrolmentperiod'} = $enrolment;
+    # For the purposes of making templates easier, we'll define a
+    # 'showname' which is the alternate form the user's first name if 
+    # 'other name' is defined.
+    if ($borrower->{category_type} eq 'I') {
+        $borrower->{'showname'} = $borrower->{'othernames'};
+        $borrower->{'showname'} .= " $borrower->{'firstname'}" if $borrower->{'firstname'};
+    } else {
+        $borrower->{'showname'} = $borrower->{'firstname'};
+    }
+
     return ($borrower);    #, $flags, $accessflagshash);
 }
 
diff --git a/circ/circulation.pl b/circ/circulation.pl
index 8c359b1..ea938de 100755
--- a/circ/circulation.pl
+++ b/circ/circulation.pl
@@ -627,9 +627,9 @@ my (undef, $roadttype_hashref) = &GetRoadTypes();
 my $address = $borrower->{'streetnumber'}.' '.$roadttype_hashref->{$borrower->{'streettype'}}.' '.$borrower->{'address'};
 
 my $fast_cataloging = 0;
-    if (defined getframeworkinfo('FA')) {
+if (defined getframeworkinfo('FA')) {
     $fast_cataloging = 1 
-    }
+}
 
 $template->param(
     lib_messages_loop => $lib_messages_loop,
@@ -644,6 +644,8 @@ $template->param(
     printername       => $printer,
     firstname         => $borrower->{'firstname'},
     surname           => $borrower->{'surname'},
+    showname          => $borrower->{'showname'},
+    category_type     => $borrower->{'category_type'},
     dateexpiry        => format_date($newexpiry),
     expiry            => format_date($borrower->{'dateexpiry'}),
     categorycode      => $borrower->{'categorycode'},
@@ -659,6 +661,7 @@ $template->param(
     country           => $borrower->{'country'},
     phone             => $borrower->{'phone'} || $borrower->{'mobile'},
     cardnumber        => $borrower->{'cardnumber'},
+    othernames        => $borrower->{'othernames'},
     amountold         => $amountold,
     barcode           => $barcode,
     stickyduedate     => $stickyduedate,
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc
index 129bd66..2e71a29 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc
@@ -1,5 +1,5 @@
 [% IF ( borrowernumber ) %]
-<div class="patroninfo"><h5>[% firstname %] [% surname %] ([% cardnumber %])</h5>
+<div class="patroninfo"><h5>[% INCLUDE 'patron-title.inc' %]</h5>
 <!--[if IE 6]>
 <style type="tex/css">img { width: expression(this.width > 140 ? 140: true);
 }</style>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc
new file mode 100644
index 0000000..d07a449
--- /dev/null
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc
@@ -0,0 +1,6 @@
+[% IF category_type == 'I' %]
+    [% surname %] [% IF othernames %] ([% othernames %]) [% END %]
+[% ELSE %]
+    [% firstname %] [% surname %]
+[% END %]
+([% cardnumber %])
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
index afa6ec5..2d7d709 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
@@ -1,9 +1,5 @@
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Koha › Circulation
-[% IF ( borrowernumber ) %]
-› Checking out to [% surname %], [% firstname %]
-([% cardnumber %])
-[% END %]</title>
+<title>Koha › Circulation [% IF ( borrowernumber ) %] › Checking out to [% INCLUDE 'patron-title.inc' %] [% END %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
 [% IF ( UseTablesortForCirc ) %]<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>[% END %]
 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
@@ -167,9 +163,13 @@ function refocus(calendar) {
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'circ-search.inc' %]
 
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> ›[% IF ( borrowernumber ) %] <a href="/cgi-bin/koha/circ/circulation.pl">Checkouts</a> › [% firstname %] [% surname %][% ELSE %] <strong>Checkouts</strong>[% END %]</div>
-
-
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> ›
+[% IF ( borrowernumber ) %]
+    <a href="/cgi-bin/koha/circ/circulation.pl">Checkouts</a> › [% INCLUDE 'patron-title.inc' %]
+[% ELSE %]
+    <strong>Checkouts</strong>
+[% END %]
+</div>
 [% IF ( CGIselectborrower ) %]
 <div id="doc" class="yui-t7">
 
@@ -461,7 +461,8 @@ No patron matched <span class="ex">[% message %]</span>
 	    <input type="button" value="Clear Screen" onclick="window.location = '/cgi-bin/koha/circ/circulation.pl'" />
     [% END %]
 
-    <label for="barcode">Checking out to [% firstname %] [% surname %] ([% cardnumber %]) </label>
+    <label for="barcode">Checking out to [% INCLUDE 'patron-title.inc' %]</label>
+
 	<div class="hint">Enter item barcode:</div>
 
     [% IF ( NEEDSCONFIRMATION ) %]
@@ -528,7 +529,7 @@ No patron matched <span class="ex">[% message %]</span>
 
     [% IF ( flagged ) %]
 		[% IF ( noissues ) %]
-		 <h4>Checking out to [% firstname %] [% surname %] ([% cardnumber %])</h4>
+		<h4>Checking out to [% INCLUDE 'patron-title.inc' %]</h4>
         <div id="circmessages" class="circmessage warning">
 		[% ELSE %]
         <div id="circmessages" class="circmessage attention">
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt
index 3545f86..c304b1a 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt
@@ -1,12 +1,12 @@
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Koha › Patrons › Account for [% firstname %] [% surname %]</title>
+<title>Koha › Patrons › Account for [% INCLUDE 'patron-title.inc' %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
 </head>
 <body>
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'patron-search.inc' %]
 
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  › Account for [% firstname %] [% surname %]</div>
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  › Account for [% INCLUDE 'patron-title.inc' %]</div>
 
 <div id="doc3" class="yui-t2">
    
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 9965362..f9454e9 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt
@@ -60,7 +60,9 @@
 							[% END %]
 							[% END %]
 							<td>[% resultsloo.cardnumber %]</td>
-							<td style="white-space: nowrap;"><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% resultsloo.borrowernumber %]">[% resultsloo.surname %], [% resultsloo.firstname %]</a> <br /> [% 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 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 %]</a> <br />
+                            [% 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>
 							<td>[% resultsloo.branchcode %]</td>
 							<td>[% resultsloo.dateexpiry %]</td>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/messaging.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/messaging.tt
index 2980a53..a5b34f3 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/messaging.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/messaging.tt
@@ -1,12 +1,12 @@
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Koha › Patrons › [% IF ( unknowuser ) %]Patron does not exist[% ELSE %]Patron Details for [% firstname %] [% surname %] ([% cardnumber %])[% END %]</title>
+<title>Koha › Patrons › [% IF ( unknowuser ) %]Patron does not exist[% ELSE %]Patron Details for [% INCLUDE 'patron-title.inc' %][% END %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
 </head>
 <body>
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'patron-search.inc' %]
 
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  › [% IF ( unknowuser ) %]Patron does not exist[% ELSE %]Patron Details for [% firstname %] [% surname %] ([% cardnumber %])[% END %] </div>
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  › [% IF ( unknowuser ) %]Patron does not exist[% ELSE %]Patron Details for [% INCLUDE 'patron-title.inc' %][% END %] </div>
 
 <div id="doc3" class="yui-t2">
    
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt
index f8073bb..cc199c8 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt
@@ -1,5 +1,11 @@
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Koha › Patrons › [% IF ( unknowuser ) %]Patron does not exist[% ELSE %]Patron Details for [% firstname %] [% surname %] ([% cardnumber %])[% END %]</title>
+<title>Koha › Patrons ›
+[% IF ( unknowuser ) %]
+    Patron does not exist
+[% ELSE %]
+    Patron Details for [% INCLUDE 'patron-title.inc' %]
+[% END %]
+</title>
 [% INCLUDE 'doc-head-close.inc' %]
 [% INCLUDE 'calendar.inc' %]
 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
@@ -119,7 +125,7 @@ function validate1(date) {
 <div id="breadcrumbs">
          <a href="/cgi-bin/koha/mainpage.pl">Home</a>
 › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
-› [% IF ( unknowuser ) %]Patron does not exist[% ELSE %]Patron Details for [% firstname %] [% surname %] ([% cardnumber %])[% END %]
+› [% IF ( unknowuser ) %]Patron does not exist[% ELSE %]Patron Details for [% INCLUDE 'patron-title.inc' %][% END %]
 </div>
 
 <div id="doc3" class="yui-t1">
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt
index 2bce08a..4ef4df0 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt
@@ -1,5 +1,5 @@
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Sent notices for [% firstname %] [% surname %]</title>
+<title>Sent notices for [% INCLUDE 'patron-title.inc' %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
 <script type="text/javascript" language="javascript">
@@ -19,7 +19,7 @@
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'patron-search.inc' %]
 
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  › Sent notices for [% firstname %] [% surname %]</div>
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  › Sent notices for [% INCLUDE 'patron-title.inc' %]</div>
 
 <div id="doc3" class="yui-t2">
    
@@ -27,7 +27,7 @@
 	<div id="yui-main">
 	<div class="yui-b">
 [% INCLUDE 'circ-toolbar.inc' %]
-<h1>Sent notices for [% firstname %] [% surname %]</h1>
+<h1>Sent notices for [% INCLUDE 'patron-title.inc' %]</h1>
 
     <table id="noticestable">
 	<thead>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt
index c61006b..1d83e9a 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt
@@ -1,5 +1,5 @@
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Circulation History for [% firstname %] [% surname %]</title>
+<title>Circulation History for [% INCLUDE 'patron-title.inc' %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.pager.js"></script>
@@ -21,7 +21,7 @@
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'patron-search.inc' %]
 
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  › Circulation History for [% firstname %] [% surname %]</div>
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  › Circulation History for [% INCLUDE 'patron-title.inc' %]</div>
 
 <div id="doc3" class="yui-t2">
    
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt
index c109744..3914d45 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt
@@ -201,7 +201,7 @@
 									for <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% object %]">Bibliographic Record [% object %]</a>
 								[% END %]
 								[% IF ( MEMBERS ) %]
-									for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% object %]">[% firstname %] [% surname %] ([% cardnumber %])</a>
+									for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% object %]">[% INCLUDE 'patron-title.inc' %]</a>
 								[% END %]
 								.
 							</div>
@@ -274,7 +274,7 @@
                                 for <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% object %]">Bibliographic Record [% object %]</a>
                             [% END %]
                             [% IF ( MEMBERS ) %]
-                                for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% object %]">[% firstname %] [% surname %] ([% cardnumber %])</a>
+                                for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% object %]">[% INCLUDE 'patron-title.inc' %]</a>
                             [% END %]
                             .
                         </div>
diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/patron-title.inc b/koha-tmpl/opac-tmpl/prog/en/includes/patron-title.inc
new file mode 100644
index 0000000..265125d
--- /dev/null
+++ b/koha-tmpl/opac-tmpl/prog/en/includes/patron-title.inc
@@ -0,0 +1,5 @@
+[% IF category_type == 'I' %]
+    [% surname %] [% IF othernames %] ([% othernames %]) [% END %]
+[% ELSE %]
+    [% firstname %] [% surname %]
+[% END %]
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt
index b5761bc..db39992 100644
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt
@@ -1,7 +1,7 @@
 [% INCLUDE 'doc-head-open.inc' %]
 [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha Online[% END %] Catalog › Library Home for
 [% FOREACH BORROWER_INF IN BORROWER_INFO %]
-    [% BORROWER_INF.firstname %] [% BORROWER_INF.surname %]
+    [% INCLUDE 'patron-title.inc' category_type = BORROWER_INF.category_type firstname = BORROWER_INF.firstname surname = BORROWER_INF.surname othernames = BORROWER_INF.othernames cardnumber = BORROWER_INF.cardnumber %]
 [% END %]
 [% INCLUDE 'doc-head-close.inc' %]
 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
@@ -93,7 +93,10 @@ $.tablesorter.addParser({
 	       </div>
 	[% END %]
     [% FOREACH BORROWER_INF IN BORROWER_INFO %]
-        <h2>Hello, [% BORROWER_INF.firstname %] [% BORROWER_INF.surname %] <span class="hint">(<a href="/cgi-bin/koha/opac-main.pl?logout.x=1">Click here</a> if you're not [% BORROWER_INF.title %] [% BORROWER_INF.firstname %] [% BORROWER_INF.surname %])</span></h2>
+        <h2>Hello, [% INCLUDE 'patron-title.inc' category_type = BORROWER_INF.category_type firstname = BORROWER_INF.firstname surname = BORROWER_INF.surname othernames = BORROWER_INF.othernames cardnumber = BORROWER_INF.cardnumber %]
+        <span class="hint">(<a href="/cgi-bin/koha/opac-main.pl?logout.x=1">Click here</a> if you're not
+        [% BORROWER_INF.title %] [% INCLUDE 'patron-title.inc' category_type = BORROWER_INF.category_type firstname = BORROWER_INF.firstname surname = BORROWER_INF.surname othernames = BORROWER_INF.othernames cardnumber = BORROWER_INF.cardnumber %])
+        </span></h2>
         
 		[% IF ( patronupdate ) %]<div class="dialog message"><h3>Thank you!</h3><p>Your corrections have been submitted to the library, and a staff member will update your record as soon as possible.</p></div>[% END %]
 		
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tt
index 12fb53c..c684733 100644
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tt
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tt
@@ -1,4 +1,7 @@
-[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha Online[% END %][% ELSE %]Koha Online[% END %] Catalog ›  Updating Details for [% FOREACH BORROWER_INF IN BORROWER_INFO %][% BORROWER_INF.firstname %] [% BORROWER_INF.surname %][% END %]
+[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha Online[% END %][% ELSE %]Koha Online[% END %] Catalog ›  Updating Details for
+[% FOREACH BORROWER_INF IN BORROWER_INFO %]
+    [% INCLUDE 'patron-title.inc' category_type = BORROWER_INF.category_type firstname = BORROWER_INF.firstname surname = BORROWER_INF.surname othernames = BORROWER_INF.othernames cardnumber = BORROWER_INF.cardnumber %]
+[% END %]
 [% INCLUDE 'doc-head-close.inc' %]
 </head>
 <body id="opac-userupdate">
@@ -11,7 +14,7 @@
 
 <div id="userupdatecontainer" class="container">
 [% FOREACH BORROWER_INF IN BORROWER_INFO %]
-<h3><a href="/cgi-bin/koha/opac-user.pl">[% BORROWER_INF.firstname %] [% BORROWER_INF.surname %]'s account</a> <img src="[% themelang %]../../images/caret.gif" width="16" height="16" alt=">" border="0" /> Your Personal Details</h3>
+<h3><a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' ifirstname = BORROWER_INF.firstname surname = BORROWER_INF.surname othernames = BORROWER_INF.othernames cardnumber = BORROWER_INF.cardnumber %]'s account</a> <img src="[% themelang %]../../images/caret.gif" width="16" height="16" alt=">" border="0" /> Your Personal Details</h3>
 
 [% IF ( OPACPatronDetails ) %]
 <form action="/cgi-bin/koha/opac-userupdate.pl" method="get">
diff --git a/members/boraccount.pl b/members/boraccount.pl
index b91684a..c83f565 100755
--- a/members/boraccount.pl
+++ b/members/boraccount.pl
@@ -101,11 +101,12 @@ $template->param(
     finesview           => 1,
     firstname           => $data->{'firstname'},
     surname             => $data->{'surname'},
+    othernames          => $data->{'othernames'},
     borrowernumber      => $borrowernumber,
     cardnumber          => $data->{'cardnumber'},
     categorycode        => $data->{'categorycode'},
     category_type       => $data->{'category_type'},
-    categoryname		 => $data->{'description'},
+    categoryname		=> $data->{'description'},
     address             => $data->{'address'},
     address2            => $data->{'address2'},
     city                => $data->{'city'},
diff --git a/members/messaging.pl b/members/messaging.pl
index 8791dcf..275884c 100755
--- a/members/messaging.pl
+++ b/members/messaging.pl
@@ -84,10 +84,15 @@ $template->param( messagingview               => 1,
                   message_queue               => $message_queue,
                   DHTMLcalendar_dateformat    => C4::Dates->DHTMLcalendar(), 
                   borrowernumber              => $borrowernumber,
+                  firstname                   => $borrower->{'firstname'},
+                  surname                     => $borrower->{'surname'},
+                  othernames                  => $borrower->{'othernames'},
+                  cardnumber                  => $borrower->{'cardnumber'},
+                  branchcode                  => $borrower->{'branchcode'},
                   branchname		      => GetBranchName($borrower->{'branchcode'}),
                   dateformat                  => C4::Context->preference("dateformat"),
                   categoryname                => $borrower->{'description'},
-                  $borrower->{'categorycode'} => 1,
+                  category_type               => $borrower->{'category_type'},
 );
 
 #$messaging_preferences->{'SMSnumber'}{'value'} = defined $borrower->{'smsalertnumber'}
diff --git a/members/moremember.pl b/members/moremember.pl
index b766f2f..07a0c8c 100755
--- a/members/moremember.pl
+++ b/members/moremember.pl
@@ -131,9 +131,6 @@ my $category_type = $data->{'category_type'};
 
 ### $category_type
 
-# in template <TMPL_IF name="I"> => instutitional (A for Adult& C for children) 
-$template->param( $data->{'categorycode'} => 1 ); 
-
 $debug and printf STDERR "dates (enrolled,expiry,birthdate) raw: (%s, %s, %s)\n", map {$data->{$_}} qw(dateenrolled dateexpiry dateofbirth);
 foreach (qw(dateenrolled dateexpiry dateofbirth)) {
 		my $userdate = $data->{$_};
@@ -445,6 +442,8 @@ if (C4::Context->preference('EnhancedMessagingPreferences')) {
     $template->param(SMSnumber     => defined $data->{'smsalertnumber'} ? $data->{'smsalertnumber'} : $data->{'mobile'});
 }
 
+# in template <TMPL_IF name="I"> => instutitional (A for Adult, C for children) 
+$template->param( $data->{'categorycode'} => 1 ); 
 $template->param(
     detailview => 1,
     AllowRenewalLimitOverride => C4::Context->preference("AllowRenewalLimitOverride"),
@@ -452,6 +451,7 @@ $template->param(
     CANDELETEUSER    => $candeleteuser,
     roaddetails     => $roaddetails,
     borrowernumber  => $borrowernumber,
+    othernames      => $data->{'othernames'},
     categoryname    => $data->{'description'},
     reregistration  => $reregistration,
     branch          => $branch,
@@ -473,6 +473,7 @@ $template->param(
     "dateformat_" . (C4::Context->preference("dateformat") || '') => 1,
     samebranch     => $samebranch,
     quickslip		  => $quickslip,
+    category_type   => $category_type,
 );
 
 #Get the slip news items
diff --git a/members/notices.pl b/members/notices.pl
index 088d5a8..c3c4f95 100755
--- a/members/notices.pl
+++ b/members/notices.pl
@@ -55,7 +55,13 @@ $template->param( %{$borrower} );
 
 $template->param(
 			QUEUED_MESSAGES 	=> $queued_messages,
+ 			BORROWER_INFO         	=> [ $borrower ],
+            firstname 		=> $borrower->{'firstname'},
+			surname 		=> $borrower->{'surname'},
+			othernames      => $borrower->{'othernames'},
+			cardnumber      => $borrower->{'cardnumber'},
 			borrowernumber 		=> $borrowernumber,
+            category_type   => $borrower->{'category_type'},
 			sentnotices 		=> 1
 		);
 output_html_with_http_headers $input, $cookie, $template->output;
diff --git a/members/readingrec.pl b/members/readingrec.pl
index e7586a0..adbff96 100755
--- a/members/readingrec.pl
+++ b/members/readingrec.pl
@@ -102,6 +102,7 @@ $template->param(
 						title => $data->{'title'},
 						initials => $data->{'initials'},
 						surname => $data->{'surname'},
+						othernames => $data->{'othernames'},
 						borrowernumber => $borrowernumber,
 						limit => $limit,
 						firstname => $data->{'firstname'},
diff --git a/opac/opac-user.pl b/opac/opac-user.pl
index a2f7d9b..3851f83 100755
--- a/opac/opac-user.pl
+++ b/opac/opac-user.pl
@@ -101,6 +101,9 @@ $template->param(   BORROWER_INFO     => \@bordat,
                     borrowernumber    => $borrowernumber,
                     patron_flagged    => $borr->{flagged},
                     OPACMySummaryHTML => (C4::Context->preference("OPACMySummaryHTML")) ? 1 : 0,
+                    surname           => $borr->{surname},
+                    showname          => $borr->{showname},
+                    patron_flagged    => $borr->{flagged},
                 );
 
 #get issued items ....
diff --git a/tools/viewlog.pl b/tools/viewlog.pl
index d689217..7ed17ce 100755
--- a/tools/viewlog.pl
+++ b/tools/viewlog.pl
@@ -73,14 +73,17 @@ if ($src eq 'circ') {   # if we were called from circulation, use the circulatio
     my $data = GetMember('borrowernumber'=>$borrowernumber);
     my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'});
     $template->param( picture => 1 ) if $picture;
+    
     $template->param(   menu            => 1,
                         title           => $data->{'title'},
                         initials        => $data->{'initials'},
                         surname         => $data->{'surname'},
+                        othernames      => $data->{'othernames'},
                         borrowernumber  => $borrowernumber,
                         firstname       => $data->{'firstname'},
                         cardnumber      => $data->{'cardnumber'},
                         categorycode    => $data->{'categorycode'},
+                        category_type   => $data->{'category_type'},
                         categoryname	=> $data->{'description'},
                         address         => $data->{'address'},
                         address2        => $data->{'address2'},
-- 
1.6.5




More information about the Patches mailing list