Bug 18789: Send Koha::Patron object to the templates
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 1 Jun 2017 17:47:40 +0000 (14:47 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 16 Feb 2018 16:03:58 +0000 (13:03 -0300)
In order to simplify and make uniform the code, the controller scripts send
a Koha::Patron object to the templates instead of all attributes of a patron.

That will make the code much more easier to maintain and will be less
error-prone.

The variable "patron" sent to the templates is supposed to represent the
patron the librarian is editing the detail.

In the members module and some scripts of the circulation module, the
patron's detail are sent one by one to the template. That leads to
frustration from developpers (making sure everything is passed from all
scripts) and to regression (we got tone of bugs in the last year because
of this way to do).
With this patch set it will be easy access patron's detail, passing only
1 variable from the controllers.

Test plan:
Play with the patron and circulation module and make sur the detail of
the patron you are editing/seeing info are correctly displayed.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

78 files changed:
acqui/acqui-home.pl
acqui/booksellers.pl
admin/aqbudgets.pl
circ/branchtransfers.pl
circ/overdue.pl
circ/transferstoreceive.pl
circ/waitingreserves.pl
koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc
koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc
koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-address-style-de.inc
koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-address-style-fr.inc
koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-address-style-us.inc
koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-contact-style-de.inc
koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-contact-style-fr.inc
koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-contact-style-us.inc
koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style-de.inc
koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style-fr.inc
koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style-us.inc
koha-tmpl/intranet-tmpl/prog/en/includes/member-display-alt-address-style-de.inc
koha-tmpl/intranet-tmpl/prog/en/includes/member-display-alt-address-style-fr.inc
koha-tmpl/intranet-tmpl/prog/en/includes/member-display-alt-address-style-us.inc
koha-tmpl/intranet-tmpl/prog/en/includes/member-main-address-style-de.inc
koha-tmpl/intranet-tmpl/prog/en/includes/member-main-address-style-fr.inc
koha-tmpl/intranet-tmpl/prog/en/includes/member-main-address-style-us.inc
koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt
koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt
koha-tmpl/intranet-tmpl/prog/en/modules/circ/printslip.tt
koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstoreceive.tt
koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/deletemem.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/discharge.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/housebound.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/purchase-suggestions.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/routing-lists.tt
koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt
koha-tmpl/intranet-tmpl/prog/en/modules/reviews/reviewswaiting.tt
koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt
members/boraccount.pl
members/deletemem.pl
members/discharge.pl
members/files.pl
members/housebound.pl
members/mancredit.pl
members/maninvoice.pl
members/member-flags.pl
members/member-password.pl
members/moremember.pl
members/notices.pl
members/pay.pl
members/paycollect.pl
members/printfeercpt.pl
members/printinvoice.pl
members/purchase-suggestions.pl
members/readingrec.pl
members/routing-lists.pl
members/statistics.pl
members/summary-print.pl
opac/opac-detail.pl
opac/opac-reserve.pl
reserve/request.pl
reviews/reviewswaiting.pl
tools/viewlog.pl

index cbb8896..d23f082 100755 (executable)
@@ -72,10 +72,7 @@ foreach my $budget ( @{$budget_arr} ) {
 
     my $patron = Koha::Patrons->find( $budget->{budget_owner_id} );
     if ( $patron ) {
-        # FIXME should pass the entire object into budget_owner
-        $budget->{budget_owner_firstname} = $patron->firstname;
-        $budget->{budget_owner_surname} = $patron->surname;
-        $budget->{budget_owner_borrowernumber} = $patron->borrowernumber;
+        $budget->{budget_owner} = $patron;
     }
 
     if ( !defined $budget->{budget_amount} ) {
index b0ec728..99da78c 100755 (executable)
@@ -138,8 +138,7 @@ for my $vendor (@suppliers) {
                 $basket->{$_} ||= 0;
             }
             if ( $patron ) {
-                $basket->{authorisedby_firstname} = $patron->firstname;
-                $basket->{authorisedby_surname} = $patron->surname;
+                $basket->{authorisedby} = $patron;
             }
             if ($basket->{basketgroupid}) {
                 my $basketgroup = C4::Acquisition::GetBasketgroup($basket->{basketgroupid});
index f106a86..5aeb8b9 100755 (executable)
@@ -117,8 +117,7 @@ if ($op eq 'add_form') {
             exit;
         }
         $dropbox_disabled = BudgetHasChildren($budget_id);
-        my $patron = Koha::Patrons->find( $budget->{budget_owner_id} );
-        $budget->{budget_owner_name} = ( $patron ? $patron->firstname . ' ' . $patron->surname : '' );
+        $budget->{budget_owner} = Koha::Patrons->find( $budget->{budget_owner_id} );
     }
 
     # build budget hierarchy
index 1305c82..b9d357c 100755 (executable)
@@ -210,10 +210,7 @@ foreach my $code ( keys %$messages ) {
             $err{borrowernumber} = $messages->{'WasReturned'};
             my $patron = Koha::Patrons->find( $messages->{'WasReturned'} );
             if ( $patron ) { # Just in case...
-                $err{title}      = $patron->title;
-                $err{firstname}  = $patron->firstname;
-                $err{surname}    = $patron->surname;
-                $err{cardnumber} = $patron->cardnumber;
+                $err{patron} = $patron;
             }
         }
         $err{errdesteqholding} = ( $code eq 'DestinationEqualsHolding' );
index ff65712..fe3fdd0 100755 (executable)
@@ -300,27 +300,12 @@ if ($noreport) {
         push @overduedata, {
             patron                 => scalar Koha::Patrons->find( $data->{borrowernumber} ),
             duedate                => $data->{date_due},
-            borrowernumber         => $data->{borrowernumber},
             barcode                => $data->{barcode},
-            cardnumber             => $data->{cardnumber},
             itemnum                => $data->{itemnumber},
             issuedate              => output_pref({ dt => dt_from_string( $data->{issuedate} ), dateonly => 1 }),
-            borrowertitle          => $data->{borrowertitle},
-            surname                => $data->{surname},
-            firstname              => $data->{firstname},
-            streetnumber           => $data->{streetnumber},                   
-            streettype             => $data->{streettype},                     
-            address                => $data->{address},                        
-            address2               => $data->{address2},                       
-            city                   => $data->{city},                   
-            zipcode                => $data->{zipcode},                        
-            country                => $data->{country},
-            phone                  => $data->{phone},
-            email                  => $data->{email},
             biblionumber           => $data->{biblionumber},
             title                  => $data->{title},
             author                 => $data->{author},
-            branchcode             => $data->{branchcode},
             homebranchcode         => $data->{homebranchcode},
             holdingbranchcode      => $data->{holdingbranchcode},
             itemcallnumber         => $data->{itemcallnumber},
index de6a89a..10df07d 100755 (executable)
@@ -114,13 +114,7 @@ while ( my $library = $libraries->next ) {
             # we check if we have a reserv for this transfer
             my $holds = $item->current_holds;
             if ( my $first_hold = $holds->next ) {
-                my $patron = Koha::Patrons->find( $first_hold->borrowernumber );
-                # FIXME The full patron object should be passed to the template
-                $getransf{'borrowernum'}       = $patron->borrowernumber;
-                $getransf{'borrowername'}      = $patron->surname;
-                $getransf{'borrowerfirstname'} = $patron->firstname;
-                $getransf{'borrowermail'}      = $patron->email if $patron->email;
-                $getransf{'borrowerphone'}     = $patron->phone;
+                $getransf{patron} = Koha::Patrons->find( $first_hold->borrowernumber );
             }
             push( @transferloop, \%getransf );
         }
index 24e0347..5943ea5 100755 (executable)
@@ -130,11 +130,7 @@ while ( my $hold = $holds->next ) {
         $getreserv{'dotransfer'} = 1;
     }
 
-    my $borEmail = $patron->first_valid_email_address;
-
-    if ( $borEmail ) {
-        $getreserv{'borrowermail'}  = $borEmail;
-    }
+    $getreserv{patron} = $patron;
 
     if ($today > $calcDate) {
         if ($cancelall) {
index e8e22e8..92dda54 100644 (file)
@@ -40,7 +40,7 @@
                         <td>[% d.created | $KohaDates %]</td>
                         [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
                             <td>
-                                <a class="remove_restriction btn btn-default btn-xs" href="/cgi-bin/koha/members/mod_debarment.pl?borrowernumber=[% borrowernumber %]&amp;borrower_debarment_id=[% d.borrower_debarment_id %]&amp;action=del">
+                                <a class="remove_restriction btn btn-default btn-xs" href="/cgi-bin/koha/members/mod_debarment.pl?borrowernumber=[% patron.borrowernumber %]&amp;borrower_debarment_id=[% d.borrower_debarment_id %]&amp;action=del">
                                     <i class="fa fa-trash"></i> Remove
                                 </a>
                             </td>
@@ -53,7 +53,7 @@
     [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
         <p><a href="#" id="add_manual_restriction"><i class="fa fa-plus"></i> Add manual restriction</a></p>
         <form method="post" action="/cgi-bin/koha/members/mod_debarment.pl" class="clearfix">
-            <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
+            <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber %]" />
             <input type="hidden" name="action" value="add" />
             <fieldset class="rows" id="manual_restriction_form">
                 <legend>Add manual restriction</legend>
index bdcc8af..2b29bfc 100644 (file)
@@ -1,5 +1,5 @@
 [% USE Koha %]
-[% IF ( borrowernumber ) %]
+[% IF ( patron.borrowernumber ) %]
 <div class="patroninfo"><h5>[% INCLUDE 'patron-title.inc' %]</h5>
 <!--[if IE 6]>
 <style type="tex/css">img { width: expression(this.width > 140 ? 140: true);
@@ -9,7 +9,7 @@
     [% IF ( patronimages ) %]
         [% IF ( picture ) %]
             <li>
-                <img src="/cgi-bin/koha/members/patronimage.pl?borrowernumber=[% borrowernumber | uri %]" id="patronimage" alt="[% firstname | html %] [% surname | html %] ([% cardnumber | html %])" />
+                <img src="/cgi-bin/koha/members/patronimage.pl?borrowernumber=[% patron.borrowernumber | uri %]" id="patronimage" alt="[% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])" />
             </li>
         [% ELSE %]
             <li id="patronbasics">
         [% INCLUDE 'member-display-address-style-us.inc' %]
     [% END %]
 
-    [% IF ( phone || mobile || phonepro ) %]<li class="patronphone">
-    [% IF ( phone ) %]
-        <a href="tel:[% phone | url %]">[% phone | html %]</a>
+    [% IF ( patron.phone || patron.mobile || patron.phonepro ) %]<li class="patronphone">
+    [% IF ( patron.phone ) %]
+        <a href="tel:[% patron.phone | url %]">[% patron.phone | html %]</a>
     [% ELSE %]
-        [% IF ( mobile ) %]
-            <a href="tel:[% mobile | url %]">[% mobile | html %]</a>
+        [% IF ( patron.mobile ) %]
+            <a href="tel:[% patron.mobile | url %]">[% patron.mobile | html %]</a>
         [% ELSE %]
-            [% IF ( phonepro ) %]
-                <a href="tel:[% phonepro | url %]">[% phonepro | html %]</a>
+            [% IF ( patron.phonepro ) %]
+                <a href="tel:[% patron.phonepro | url %]">[% patron.phonepro | html %]</a>
             [% END %]
         [% END %]
     [% END %]</li>[% END %]
-    [% IF ( email ) %]
-        <li class="email"> <a href="mailto:[% email | url %]" title="[% email | html %]">[% email | html %]</a></li>
+    [% IF ( patron.email ) %]
+        <li class="email"> <a href="mailto:[% patron.email | url %]" title="[% patron.email | html %]">[% patron.email | html %]</a></li>
     [% ELSE %]
-        [% IF ( emailpro ) %]
-            <li class="email"> <a href="mailto:[% emailpro | url %]" title="[% emailpro | html %]">[% emailpro | html %]</a></li>
+        [% IF ( patron.emailpro ) %]
+            <li class="email"> <a href="mailto:[% patron.emailpro | url %]" title="[% patron.emailpro | html %]">[% patron.emailpro | html %]</a></li>
         [% END %]
     [% END %]
 
-    [% UNLESS ( address or address2 ) %]
+    [% UNLESS ( patron.address or patron.address2 ) %]
         <li><span class="empty" id="noaddressstored">No address stored.</span></li>
     [% END %]
-    [% UNLESS ( city ) %]
+    [% UNLESS ( patron.city ) %]
         <li><span class="empty" id="nocitystored">No city stored.</span></li>
     [% END %]
-    [% UNLESS ( phone or mobile or phonepro) %]
+    [% UNLESS ( patron.phone or patron.mobile or patron.phonepro) %]
         <li> <span class="empty">No phone stored.</span></li>
     [% END %]
-    [% UNLESS ( email or emailpro) %]
+    [% UNLESS ( patron.email or patron.emailpro) %]
         <li> <span class="empty">No email stored.</span></li>
     [% END %]
 
             [% END %]
         [% END %]
     [% END %][% END %]
-    <li class="patroncategory">Category: [% categoryname %] ([% categorycode %])</li>
-    <li class="patronlibrary">Home library: [% Branches.GetName( branchcode ) %]</li>
+    <li class="patroncategory">Category: [% patron.category.description %] ([% patron.categorycode %])</li>
+    <li class="patronlibrary">Home library: [% Branches.GetName( patron.branchcode ) %]</li>
 </ul></div>
 <div id="menu">
 <ul>
     [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
-        [% IF ( circview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% borrowernumber %]">Check out</a></li>
-        [% IF Koha.Preference('BatchCheckouts') && Koha.Preference('BatchCheckoutsValidCategories').split('\|').grep('^' _ categorycode _ '$').size > 0 %]
-          [% IF ( batch_checkout_view ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% borrowernumber %]&amp;batch=1">Batch check out</a></li>
+        [% IF ( circview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% patron.borrowernumber %]">Check out</a></li>
+        [% IF Koha.Preference('BatchCheckouts') && Koha.Preference('BatchCheckoutsValidCategories').split('\|').grep('^' _ patron.categorycode _ '$').size > 0 %]
+          [% IF ( batch_checkout_view ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% patron.borrowernumber %]&amp;batch=1">Batch check out</a></li>
         [% END %]
     [% END %]
     [% IF CAN_user_borrowers_edit_borrowers %]
-        [% IF ( detailview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">Details</a></li>
+        [% IF ( detailview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber %]">Details</a></li>
     [% END %]
     [% IF ( CAN_user_updatecharges ) %]
-        [% IF ( finesview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrowernumber %]">Fines</a></li>
+        [% IF ( finesview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber %]">Fines</a></li>
     [% END %]
     [% IF ( CAN_user_circulate_circulate_remaining_permissions  )  %]
-        [% IF Koha.Preference("RoutingSerials") %][% IF ( routinglistview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/routing-lists.pl?borrowernumber=[% borrowernumber %]">Routing lists</a></li>[% END %]
+        [% IF Koha.Preference("RoutingSerials") %][% IF ( routinglistview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/routing-lists.pl?borrowernumber=[% patron.borrowernumber %]">Routing lists</a></li>[% END %]
     [% END %]
     [% IF CAN_user_borrowers_edit_borrowers %]
         [% IF ( intranetreadinghistory ) %]
-            [% IF ( readingrecordview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/readingrec.pl?borrowernumber=[% borrowernumber %]">Circulation history</a></li>
+            [% IF ( readingrecordview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/readingrec.pl?borrowernumber=[% patron.borrowernumber %]">Circulation history</a></li>
         [% END %]
     [% END %]
     [% IF CAN_user_borrowers_edit_borrowers %]
         [% END %]
     [% END %]
     [% IF ( CAN_user_parameters ) %]
-        [% IF ( logview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/tools/viewlog.pl?do_it=1&amp;modules=MEMBERS&amp;modules=circulation&amp;object=[% borrowernumber %]&amp;src=circ">Modification log</a></li>
+        [% IF ( logview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/tools/viewlog.pl?do_it=1&amp;modules=MEMBERS&amp;modules=circulation&amp;object=[% patron.borrowernumber %]&amp;src=circ">Modification log</a></li>
     [% END %]
     [% IF CAN_user_borrowers_edit_borrowers %]
-       [% IF ( sentnotices ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/notices.pl?borrowernumber=[% borrowernumber %]">Notices</a></li>
+       [% IF ( sentnotices ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/notices.pl?borrowernumber=[% patron.borrowernumber %]">Notices</a></li>
     [% END %]
     [% IF CAN_user_borrowers_edit_borrowers %]
-        [% IF (  statisticsview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/statistics.pl?borrowernumber=[% borrowernumber %]">Statistics</a></li>
+        [% IF (  statisticsview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/statistics.pl?borrowernumber=[% patron.borrowernumber %]">Statistics</a></li>
     [% END %]
     [% IF CAN_user_borrowers_edit_borrowers %]
         [% IF ( EnableBorrowerFiles ) %]
-            [% IF ( borrower_files ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/files.pl?borrowernumber=[% borrowernumber %]">Files</a></li>
+            [% IF ( borrower_files ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/files.pl?borrowernumber=[% patron.borrowernumber %]">Files</a></li>
         [% END %]
     [% END %]
 
     [% IF CAN_user_borrowers_edit_borrowers %]
-        [% IF ( suggestionsview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/purchase-suggestions.pl?borrowernumber=[% borrowernumber %]">Purchase suggestions</a></li>
+        [% IF ( suggestionsview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/purchase-suggestions.pl?borrowernumber=[% patron.borrowernumber %]">Purchase suggestions</a></li>
     [% END %]
     [% IF CAN_user_borrowers_edit_borrowers && useDischarge %]
-        [% IF dischargeview %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/discharge.pl?borrowernumber=[% borrowernumber %]">Discharges</a></li>
+        [% IF dischargeview %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/discharge.pl?borrowernumber=[% patron.borrowernumber %]">Discharges</a></li>
     [% END %]
     [% IF Koha.Preference('HouseboundModule') %]
-        [% IF houseboundview %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/housebound.pl?borrowernumber=[% borrowernumber %]">Housebound</a></li>
+        [% IF houseboundview %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/housebound.pl?borrowernumber=[% patron.borrowernumber %]">Housebound</a></li>
     [% END %]
     [% IF Koha.Preference('ILLModule') %]
         <li><a href="/cgi-bin/koha/ill/ill-requests.pl?borrowernumber=[% borrowernumber %]">Interlibrary loans</a></li>
index dba4222..7856fc1 100644 (file)
@@ -8,7 +8,7 @@
                     <label for="B_address">
                 [% END %]
                 Address: </label>
-                    <input type="text" id="B_address" name="B_address" size="40" value="[% B_address %]" />
+                    <input type="text" id="B_address" name="B_address" size="40" value="[% patron.B_address %]" />
       [% IF ( mandatoryB_address ) %]<span class="required">Required</span>[% END %]
             </li>
         [% END %]
@@ -24,7 +24,7 @@
             <select name="B_streettype">
             <option value=""></option>
             [% FOR roadtype IN roadtypes %]
-                [% IF roadtype.authorised_value == B_streettype %]
+                [% IF roadtype.authorised_value == patron.B_streettype %]
                     <option value="[% roadtype.authorised_value %]" selected="selected">[% roadtype.lib %]</option>
                 [% ELSE %]
                     <option value="[% roadtype.authorised_value %]">[% roadtype.lib %]</option>
@@ -43,7 +43,7 @@
                     <label for="B_streetnumber">
                 [% END %]
                 Street Number: </label>
-                    <input type="text" id="B_streetnumber" name="B_streetnumber" size="5" value="[% B_streetnumber %]" />
+                    <input type="text" id="B_streetnumber" name="B_streetnumber" size="5" value="[% patron.B_streetnumber %]" />
                 [% IF ( mandatoryB_streetnumber ) %]<span class="required">Required</span>[% END %]
             </li>
         [% END %]
@@ -56,7 +56,7 @@
                     <label for="B_address2">
                 [% END %]
                 Address 2: </label>
-                    <input type="text" id="B_address2" name="B_address2" size="40" value="[% B_address2 %]" />
+                    <input type="text" id="B_address2" name="B_address2" size="40" value="[% patron.B_address2 %]" />
       [% IF ( mandatoryB_address2 ) %]<span class="required">Required</span>[% END %]
             </li>
         [% END %]
@@ -68,7 +68,7 @@
                                         <label for="B_zipcode">
                                 [% END %]
                                 ZIP/Postal code: </label>
-                    <input type="text" id="B_zipcode" name="B_zipcode" maxlength="10" size="10" value="[% B_zipcode %]" />
+                    <input type="text" id="B_zipcode" name="B_zipcode" maxlength="10" size="10" value="[% patron.B_zipcode %]" />
           [% IF ( mandatoryB_zipcode ) %]<span class="required">Required</span>[% END %]
                         </li>
         [% END %]
@@ -80,7 +80,7 @@
                     <label for="B_city">
                 [% END %]
                 City: </label>
-                <input type="text" id="B_city" name="B_city" size="20" value="[% B_city %]" />
+                <input type="text" id="B_city" name="B_city" size="20" value="[% patron.B_city %]" />
       [% IF ( mandatoryB_city ) %]<span class="required">Required</span>[% END %]
             </li>
         [% END %]
@@ -92,7 +92,7 @@
                     <label for="B_state">
                 [% END %]
                 State: </label>
-                <input type="text" id="B_state" name="B_state" size="20" value="[% B_state %]" />
+                <input type="text" id="B_state" name="B_state" size="20" value="[% patron.B_state %]" />
       [% IF ( mandatoryB_state ) %]<span class="required">Required</span>[% END %]
             </li>
         [% END %]
                     <label for="B_country">
                 [% END %]
                 Country: </label>
-                    <input type="text" id="B_country" name="B_country" size="20" value="[% B_country %]" />
+                    <input type="text" id="B_country" name="B_country" size="20" value="[% patron.B_country %]" />
       [% IF ( mandatoryB_country ) %]<span class="required">Required</span>[% END %]
             </li>
         [% END %]
                 <label for="B_phone">
                 [% END %]
                 Phone: </label>
-                    <input type="text" id="B_phone" name="B_phone" value="[% B_phone %]" />
+                    <input type="text" id="B_phone" name="B_phone" value="[% patron.B_phone %]" />
                 [% IF ( mandatoryB_phone ) %]<span class="required">Required</span>[% END %]
             </li>
         [% END %]
           <label for="B_email">
         [% END %]
         Email: </label>
-            <input type="text" id="B_email" name="B_email" size="45" value="[% B_email %]" />
+            <input type="text" id="B_email" name="B_email" size="45" value="[% patron.B_email %]" />
         [% IF ( mandatoryB_email ) %]<span class="required">Required</span>[% END %] </li>
         [% END %]
         [% UNLESS nocontactnote %]
                 <label for="contactnote">
                 [% END %]
                 Contact note: </label>
-                <textarea id="contactnote" name="contactnote" cols="40" rows="2">[% contactnote %]</textarea>
+                <textarea id="contactnote" name="contactnote" cols="40" rows="2">[% patron.contactnote %]</textarea>
         [% IF ( mandatorycontactnote ) %]<span class="required">Required</span>[% END %]
             </li>
         [% END %]
index 9c000fa..94f1dd7 100644 (file)
@@ -9,7 +9,7 @@
          <label for="B_streetnumber">
     [% END %]
     Street Number: </label>
-    <input type="text" id="B_streetnumber" name="B_streetnumber" size="5" value="[% B_streetnumber %]" />
+    <input type="text" id="B_streetnumber" name="B_streetnumber" size="5" value="[% patron.B_streetnumber %]" />
     [% IF ( mandatoryB_streetnumber ) %]<span class="required">Required</span>[% END %]
     </li>
 [% END %]
@@ -25,7 +25,7 @@
     <select name="B_streettype">
     <option value=""></option>
     [% FOR roadtype IN roadtypes %]
-        [% IF roadtype.authorised_value == B_streettype %]
+        [% IF roadtype.authorised_value == patron.B_streettype %]
             <option value="[% roadtype.authorised_value %]" selected="selected">[% roadtype.lib %]</option>
         [% ELSE %]
             <option value="[% roadtype.authorised_value %]">[% roadtype.lib %]</option>
@@ -44,7 +44,7 @@
         <label for="B_address">
     [% END %]
         Address: </label>
-        <input type="text" id="B_address" name="B_address" size="40" value="[% B_address %]" />
+        <input type="text" id="B_address" name="B_address" size="40" value="[% patron.B_address %]" />
     [% IF ( mandatoryB_address ) %]<span class="required">Required</span>[% END %]
         </li>
 [% END %]
@@ -57,7 +57,7 @@
         <label for="B_address2">
     [% END %]
     Address 2: </label>
-    <input type="text" id="B_address2" name="B_address2" size="40" value="[% B_address2 %]" />
+    <input type="text" id="B_address2" name="B_address2" size="40" value="[% patron.B_address2 %]" />
     [% IF ( mandatoryB_address2 ) %]<span class="required">Required</span>[% END %]
     </li>
 [% END %]
@@ -69,7 +69,7 @@
         <label for="B_zipcode">
     [% END %]
     ZIP/Postal code: </label>
-    <input type="text" id="B_zipcode" name="B_zipcode" maxlength="10" size="10" value="[% B_zipcode %]" />
+    <input type="text" id="B_zipcode" name="B_zipcode" maxlength="10" size="10" value="[% patron.B_zipcode %]" />
     [% IF ( mandatoryB_zipcode ) %]<span class="required">Required</span>[% END %]
     </li>
 [% END %]
@@ -81,7 +81,7 @@
         <label for="B_city">
     [% END %]
     City: </label>
-    <input type="text" id="B_city" name="B_city" size="20" value="[% B_city %]" />
+    <input type="text" id="B_city" name="B_city" size="20" value="[% patron.B_city %]" />
     [% IF ( mandatoryB_city ) %]<span class="required">Required</span>[% END %]
     </li>
 [% END %]
@@ -93,7 +93,7 @@
         <label for="B_state">
     [% END %]
         State: </label>
-        <input type="text" id="B_state" name="B_state" size="20" value="[% B_state %]" />
+        <input type="text" id="B_state" name="B_state" size="20" value="[% patron.B_state %]" />
     [% IF ( mandatoryB_state ) %]<span class="required">Required</span>[% END %]
     </li>
 [% END %]
         <label for="B_country">
     [% END %]
         Country: </label>
-        <input type="text" id="B_country" name="B_country" size="20" value="[% B_country %]" />
+        <input type="text" id="B_country" name="B_country" size="20" value="[% patron.B_country %]" />
     [% IF ( mandatoryB_country ) %]<span class="required">Required</span>[% END %]
     </li>
 [% END %]
        <label for="B_phone">
    [% END %]
    Phone: </label>
-   <input type="text" id="B_phone" name="B_phone" value="[% B_phone %]" />
+   <input type="text" id="B_phone" name="B_phone" value="[% patron.B_phone %]" />
    [% IF ( mandatoryB_phone ) %]<span class="required">Required</span>[% END %]
    </li>
 [% END %]
        <label for="B_email">
    [% END %]
        Email: </label>
-       <input type="text" id="B_email" name="B_email" size="45" value="[% B_email %]" />
+       <input type="text" id="B_email" name="B_email" size="45" value="[% patron.B_email %]" />
    [% IF ( mandatoryB_email ) %]<span class="required">Required</span>[% END %] </li>
 [% END %]
 [% UNLESS nocontactnote %]
         <label for="contactnote">
     [% END %]
         Contact note: </label>
-        <textarea id="contactnote" name="contactnote" cols="40" rows="2">[% contactnote %]</textarea>
+        <textarea id="contactnote" name="contactnote" cols="40" rows="2">[% patron.contactnote %]</textarea>
     [% IF ( mandatorycontactnote ) %]<span class="required">Required</span>[% END %]
         </li>
     [% END %]
index 9ae71c1..a4d77c3 100644 (file)
@@ -8,7 +8,7 @@
                     <label for="B_streetnumber">
                 [% END %]
                 Street Number: </label>
-                <input type="text" id="B_streetnumber" name="B_streetnumber" size="5" value="[% B_streetnumber %]" />
+                <input type="text" id="B_streetnumber" name="B_streetnumber" size="5" value="[% patron.B_streetnumber %]" />
                [% IF ( mandatoryB_streetnumber ) %]<span class="required">Required</span>[% END %]
             </li>
         [% END %]
@@ -24,7 +24,7 @@
         <select name="B_streettype">
         <option value=""></option>
         [% FOR roadtype IN roadtypes %]
-            [% IF roadtype.authorised_value == B_streettype %]
+            [% IF roadtype.authorised_value == patron.B_streettype %]
                 <option value="[% roadtype.authorised_value %]" selected="selected">[% roadtype.lib %]</option>
             [% ELSE %]
                 <option value="[% roadtype.authorised_value %]">[% roadtype.lib %]</option>
@@ -43,7 +43,7 @@
                     <label for="B_address">
                 [% END %]
                 Address: </label>
-                    <input type="text" id="B_address" name="B_address" size="40" value="[% B_address %]" />
+                    <input type="text" id="B_address" name="B_address" size="40" value="[% patron.B_address %]" />
       [% IF ( mandatoryB_address ) %]<span class="required">Required</span>[% END %]
             </li>
         [% END %]
@@ -55,7 +55,7 @@
                     <label for="B_address2">
                 [% END %]
                 Address 2: </label>
-                    <input type="text" id="B_address2" name="B_address2" size="40" value="[% B_address2 %]" />
+                    <input type="text" id="B_address2" name="B_address2" size="40" value="[% patron.B_address2 %]" />
       [% IF ( mandatoryB_address2 ) %]<span class="required">Required</span>[% END %]
             </li>
         [% END %]
@@ -67,7 +67,7 @@
                     <label for="B_city">
                 [% END %]
                 City: </label>
-                <input type="text" id="B_city" name="B_city" size="20" value="[% B_city %]" />
+                <input type="text" id="B_city" name="B_city" size="20" value="[% patron.B_city %]" />
       [% IF ( mandatoryB_city ) %]<span class="required">Required</span>[% END %]
             </li>
         [% END %]
@@ -79,7 +79,7 @@
                     <label for="B_state">
                 [% END %]
                 State: </label>
-                <input type="text" id="B_state" name="B_state" size="20" value="[% B_state %]" />
+                <input type="text" id="B_state" name="B_state" size="20" value="[% patron.B_state %]" />
       [% IF ( mandatoryB_state ) %]<span class="required">Required</span>[% END %]
             </li>
         [% END %]
@@ -91,7 +91,7 @@
                     <label for="B_zipcode">
                 [% END %]
                 ZIP/Postal code: </label>
-                    <input type="text" id="B_zipcode" name="B_zipcode" maxlength="10" size="10" value="[% B_zipcode %]" />
+                    <input type="text" id="B_zipcode" name="B_zipcode" maxlength="10" size="10" value="[% patron.B_zipcode %]" />
       [% IF ( mandatoryB_zipcode ) %]<span class="required">Required</span>[% END %]
             </li>
         [% END %]
                     <label for="B_country">
                 [% END %]
                 Country: </label>
-                    <input type="text" id="B_country" name="B_country" size="20" value="[% B_country %]" />
+                    <input type="text" id="B_country" name="B_country" size="20" value="[% patron.B_country %]" />
       [% IF ( mandatoryB_country ) %]<span class="required">Required</span>[% END %]
             </li>
         [% END %]
                 <label for="B_phone">
                 [% END %]
                 Phone: </label>
-                    <input type="text" id="B_phone" name="B_phone" value="[% B_phone %]" />
+                    <input type="text" id="B_phone" name="B_phone" value="[% patron.B_phone %]" />
                 [% IF ( mandatoryB_phone ) %]<span class="required">Required</span>[% END %]
             </li>
         [% END %]
           <label for="B_email">
         [% END %]
         Email: </label>
-            <input type="text" id="B_email" name="B_email" size="45" value="[% B_email %]" />
+            <input type="text" id="B_email" name="B_email" size="45" value="[% patron.B_email %]" />
         [% IF ( mandatoryB_email ) %]<span class="required">Required</span>[% END %] </li>
         [% END %]
         [% UNLESS nocontactnote %]
index 2b9fb71..2f3e4c3 100644 (file)
@@ -8,7 +8,7 @@
                 <label for="altcontactsurname">
                 [% END %]
                 Surname:</label>
-                    <input type="text" name="altcontactsurname" id="altcontactsurname" value="[% altcontactsurname %]" />
+                    <input type="text" name="altcontactsurname" id="altcontactsurname" value="[% patron.altcontactsurname %]" />
                 [% IF ( mandatoryaltcontactsurname ) %]<span class="required">Required</span>[% END %]
             </li>
         [% END %]
@@ -20,7 +20,7 @@
                 <label for="altcontactfirstname">
                 [% END %]
                 First name:</label>
-                    <input type="text" name="altcontactfirstname" id="altcontactfirstname" value="[% altcontactfirstname %]" />
+                    <input type="text" name="altcontactfirstname" id="altcontactfirstname" value="[% patron.altcontactfirstname %]" />
                 [% IF ( mandatoryaltcontactfirstname ) %]<span class="required">Required</span>[% END %]
             </li>
         [% END %]
@@ -32,7 +32,7 @@
                 <label for="altcontactaddress1">
                 [% END %]
                 Address:</label>
-                    <input type="text" name="altcontactaddress1" id="altcontactaddress1" value="[% altcontactaddress1 %]" size="40" />
+                    <input type="text" name="altcontactaddress1" id="altcontactaddress1" value="[% patron.altcontactaddress1 %]" size="40" />
                 [% IF ( mandatoryaltcontactaddress1 ) %]<span class="required">Required</span>[% END %]
             </li>
         [% END %]
@@ -44,7 +44,7 @@
                 <label for="altcontactaddress2">
                 [% END %]
                 Address 2:</label>
-                <input type="text" name="altcontactaddress2" id="altcontactaddress2" value="[% altcontactaddress2 %]" size="40" />
+                <input type="text" name="altcontactaddress2" id="altcontactaddress2" value="[% patron.altcontactaddress2 %]" size="40" />
                 [% IF ( mandatoryaltcontactaddress2 ) %]<span class="required">Required</span>[% END %]
             </li>
         [% END %]
@@ -56,7 +56,7 @@
                                 <label for="altcontactzipcode">
                                 [% END %]
                                 ZIP/Postal code:</label>
-                    <input type="text" name="altcontactzipcode" id="altcontactzipcode" value="[% altcontactzipcode %]" size="5" />
+                    <input type="text" name="altcontactzipcode" id="altcontactzipcode" value="[% patron.altcontactzipcode %]" size="5" />
                                 [% IF ( mandatoryaltcontactzipcode ) %]<span class="required">Required</span>[% END %]
                         </li>
         [% END %]
@@ -68,7 +68,7 @@
                 <label for="altcontactaddress3">
                 [% END %]
                 City:</label>
-                <input type="text" name="altcontactaddress3" id="altcontactaddress3" value="[% altcontactaddress3 %]" size="20" />
+                <input type="text" name="altcontactaddress3" id="altcontactaddress3" value="[% patron.altcontactaddress3 %]" size="20" />
                 [% IF ( mandatoryaltcontactaddress3 ) %]<span class="required">Required</span>[% END %]
             </li>
         [% END %]
@@ -80,7 +80,7 @@
                 <label for="altcontactstate">
                 [% END %]
                 State:</label>
-                <input type="text" name="altcontactstate" id="altcontactstate" value="[% altcontactstate %]" size="20" />
+                <input type="text" name="altcontactstate" id="altcontactstate" value="[% patron.altcontactstate %]" size="20" />
                 [% IF ( mandatoryaltcontactstate ) %]<span class="required">Required</span>[% END %]
             </li>
         [% END %]
@@ -92,7 +92,7 @@
                 <label for="altcontactcountry">
                 [% END %]
                 Country:</label>
-                    <input type="text" name="altcontactcountry" id="altcontactcountry" value="[% altcontactcountry %]" size="20" />
+                    <input type="text" name="altcontactcountry" id="altcontactcountry" value="[% patron.altcontactcountry %]" size="20" />
                 [% IF ( mandatoryaltcontactcountry ) %]<span class="required">Required</span>[% END %]
             </li>
         [% END %]
                 <label for="altcontactphone">
                 [% END %]
                 Phone:</label>
-                    <input type="text" name="altcontactphone" id="altcontactphone" value="[% altcontactphone %]" />
+                    <input type="text" name="altcontactphone" id="altcontactphone" value="[% patron.altcontactphone %]" />
                 [% IF ( mandatoryaltcontactphone ) %]<span class="required">Required</span>[% END %]
             </li>
         [% END %]
index ad3d4cd..50c1921 100644 (file)
@@ -8,7 +8,7 @@
         <label for="altcontactsurname">
     [% END %]
     Surname:</label>
-    <input type="text" name="altcontactsurname" id="altcontactsurname" value="[% altcontactsurname %]" />
+    <input type="text" name="altcontactsurname" id="altcontactsurname" value="[% patron.altcontactsurname %]" />
     [% IF ( mandatoryaltcontactsurname ) %]<span class="required">Required</span>[% END %]
     </li>
 [% END %]
@@ -20,7 +20,7 @@
         <label for="altcontactfirstname">
     [% END %]
         First name:</label>
-        <input type="text" name="altcontactfirstname" id="altcontactfirstname" value="[% altcontactfirstname %]" />
+        <input type="text" name="altcontactfirstname" id="altcontactfirstname" value="[% patron.altcontactfirstname %]" />
     [% IF ( mandatoryaltcontactfirstname ) %]<span class="required">Required</span>[% END %]
     </li>
 [% END %]
@@ -32,7 +32,7 @@
         <label for="altcontactaddress1">
     [% END %]
     Address:</label>
-    <input type="text" name="altcontactaddress1" id="altcontactaddress1" value="[% altcontactaddress1 %]" size="40" />
+    <input type="text" name="altcontactaddress1" id="altcontactaddress1" value="[% patron.altcontactaddress1 %]" size="40" />
     [% IF ( mandatoryaltcontactaddress1 ) %]<span class="required">Required</span>[% END %]
     </li>
 [% END %]
@@ -44,7 +44,7 @@
         <label for="altcontactaddress2">
     [% END %]
     Address 2:</label>
-    <input type="text" name="altcontactaddress2" id="altcontactaddress2" value="[% altcontactaddress2 %]" size="40" />
+    <input type="text" name="altcontactaddress2" id="altcontactaddress2" value="[% patron.altcontactaddress2 %]" size="40" />
     [% IF ( mandatoryaltcontactaddress2 ) %]<span class="required">Required</span>[% END %]
     </li>
 [% END %]
@@ -56,7 +56,7 @@
         <label for="altcontactzipcode">
     [% END %]
     ZIP/Postal code:</label>
-    <input type="text" name="altcontactzipcode" id="altcontactzipcode" value="[% altcontactzipcode %]" size="5" />
+    <input type="text" name="altcontactzipcode" id="altcontactzipcode" value="[% patron.altcontactzipcode %]" size="5" />
     [% IF ( mandatoryaltcontactzipcode ) %]<span class="required">Required</span>[% END %]
     </li>
 [% END %]
@@ -68,7 +68,7 @@
         <label for="altcontactaddress3">
     [% END %]
     City:</label>
-    <input type="text" name="altcontactaddress3" id="altcontactaddress3" value="[% altcontactaddress3 %]" size="20" />
+    <input type="text" name="altcontactaddress3" id="altcontactaddress3" value="[% patron.altcontactaddress3 %]" size="20" />
     [% IF ( mandatoryaltcontactaddress3 ) %]<span class="required">Required</span>[% END %]
     </li>
 [% END %]
@@ -80,7 +80,7 @@
         <label for="altcontactstate">
     [% END %]
     State:</label>
-    <input type="text" name="altcontactstate" id="altcontactstate" value="[% altcontactstate %]" size="20" />
+    <input type="text" name="altcontactstate" id="altcontactstate" value="[% patron.altcontactstate %]" size="20" />
     [% IF ( mandatoryaltcontactstate ) %]<span class="required">Required</span>[% END %]
     </li>
 [% END %]
@@ -92,7 +92,7 @@
         <label for="altcontactcountry">
     [% END %]
     Country:</label>
-    <input type="text" name="altcontactcountry" id="altcontactcountry" value="[% altcontactcountry %]" size="20" />
+    <input type="text" name="altcontactcountry" id="altcontactcountry" value="[% patron.altcontactcountry %]" size="20" />
     [% IF ( mandatoryaltcontactcountry ) %]<span class="required">Required</span>[% END %]
 </li>
 [% END %]
         <label for="altcontactphone">
     [% END %]
     Phone:</label>
-    <input type="text" name="altcontactphone" id="altcontactphone" value="[% altcontactphone %]" />
+    <input type="text" name="altcontactphone" id="altcontactphone" value="[% patron.altcontactphone %]" />
     [% IF ( mandatoryaltcontactphone ) %]<span class="required">Required</span>[% END %]
     </li>
 [% END %]
index 25fd731..7e7e790 100644 (file)
@@ -8,7 +8,7 @@
                 <label for="altcontactsurname">
                 [% END %]
                 Surname:</label>
-                    <input type="text" name="altcontactsurname" id="altcontactsurname" value="[% altcontactsurname %]" />
+                    <input type="text" name="altcontactsurname" id="altcontactsurname" value="[% patron.altcontactsurname %]" />
                 [% IF ( mandatoryaltcontactsurname ) %]<span class="required">Required</span>[% END %]
             </li>
         [% END %]
@@ -20,7 +20,7 @@
                 <label for="altcontactfirstname">
                 [% END %]
                 First name:</label>
-                    <input type="text" name="altcontactfirstname" id="altcontactfirstname" value="[% altcontactfirstname %]" />
+                    <input type="text" name="altcontactfirstname" id="altcontactfirstname" value="[% patron.altcontactfirstname %]" />
                 [% IF ( mandatoryaltcontactfirstname ) %]<span class="required">Required</span>[% END %]
             </li>
         [% END %]
@@ -32,7 +32,7 @@
                 <label for="altcontactaddress1">
                 [% END %]
                 Address:</label>
-                    <input type="text" name="altcontactaddress1" id="altcontactaddress1" value="[% altcontactaddress1 %]" size="40" />
+                    <input type="text" name="altcontactaddress1" id="altcontactaddress1" value="[% patron.altcontactaddress1 %]" size="40" />
                 [% IF ( mandatoryaltcontactaddress1 ) %]<span class="required">Required</span>[% END %]
             </li>
         [% END %]
@@ -44,7 +44,7 @@
                 <label for="altcontactaddress2">
                 [% END %]
                 Address 2:</label>
-                <input type="text" name="altcontactaddress2" id="altcontactaddress2" value="[% altcontactaddress2 %]" size="40" />
+                <input type="text" name="altcontactaddress2" id="altcontactaddress2" value="[% patron.altcontactaddress2 %]" size="40" />
                 [% IF ( mandatoryaltcontactaddress2 ) %]<span class="required">Required</span>[% END %]
             </li>
         [% END %]
@@ -56,7 +56,7 @@
                 <label for="altcontactaddress3">
                 [% END %]
                 City:</label>
-                <input type="text" name="altcontactaddress3" id="altcontactaddress3" value="[% altcontactaddress3 %]" size="20" />
+                <input type="text" name="altcontactaddress3" id="altcontactaddress3" value="[% patron.altcontactaddress3 %]" size="20" />
                 [% IF ( mandatoryaltcontactaddress3 ) %]<span class="required">Required</span>[% END %]
             </li>
         [% END %]
@@ -68,7 +68,7 @@
                 <label for="altcontactstate">
                 [% END %]
                 State:</label>
-                <input type="text" name="altcontactstate" id="altcontactstate" value="[% altcontactstate %]" size="20" />
+                <input type="text" name="altcontactstate" id="altcontactstate" value="[% patron.altcontactstate %]" size="20" />
                 [% IF ( mandatoryaltcontactstate ) %]<span class="required">Required</span>[% END %]
             </li>
         [% END %]
@@ -80,7 +80,7 @@
                 <label for="altcontactzipcode">
                 [% END %]
                 ZIP/Postal code:</label>
-                    <input type="text" name="altcontactzipcode" id="altcontactzipcode" value="[% altcontactzipcode %]" size="5" />
+                    <input type="text" name="altcontactzipcode" id="altcontactzipcode" value="[% patron.altcontactzipcode %]" size="5" />
                 [% IF ( mandatoryaltcontactzipcode ) %]<span class="required">Required</span>[% END %]
             </li>
         [% END %]
@@ -92,7 +92,7 @@
                 <label for="altcontactcountry">
                 [% END %]
                 Country:</label>
-                    <input type="text" name="altcontactcountry" id="altcontactcountry" value="[% altcontactcountry %]" size="20" />
+                    <input type="text" name="altcontactcountry" id="altcontactcountry" value="[% patron.altcontactcountry %]" size="20" />
                 [% IF ( mandatoryaltcontactcountry ) %]<span class="required">Required</span>[% END %]
             </li>
         [% END %]
                 <label for="altcontactphone">
                 [% END %]
                 Phone:</label>
-                    <input type="text" name="altcontactphone" id="altcontactphone" value="[% altcontactphone %]" />
+                    <input type="text" name="altcontactphone" id="altcontactphone" value="[% patron.altcontactphone %]" />
                 [% IF ( mandatoryaltcontactphone ) %]<span class="required">Required</span>[% END %]
             </li>
         [% END %]
index 3d65a42..b287c12 100644 (file)
@@ -1,16 +1,16 @@
-[% IF ( address or address2 ) %]
-    [% IF ( address ) %]
+[% IF ( patron.address or patron.address2 ) %]
+    [% IF ( patron.address ) %]
         [% SET roadtype_desc = '' %]
-        [% IF streettype %]
-            [% SET roadtype_desc = AuthorisedValues.GetByCode('ROADTYPE', streettype) %]
+        [% IF patron.streettype %]
+            [% SET roadtype_desc = AuthorisedValues.GetByCode('ROADTYPE', patron.streettype) %]
         [% END %]
-        <li class="patronaddress1">[% address %][%IF roadtype_desc %] [% roadtype_desc %][% END %][% IF streetnumber %] [% streetnumber %][% END %]</li>
+        <li class="patronaddress1">[% patron.address %][%IF roadtype_desc %] [% roadtype_desc %][% END %][% IF patron.streetnumber %] [% patron.streetnumber %][% END %]</li>
     [% END %]
-    [% IF ( address2 ) %]
-        <li class="patronaddress2">[% address2 %]</li>
+    [% IF ( patron.address2 ) %]
+        <li class="patronaddress2">[% patron.address2 %]</li>
     [% END %]
 [% END %]
-[% IF ( city ) %]<li class="patroncity">
-    [%IF (zipcode ) %][% zipcode %] [% END %][% city %][% IF ( state ) %]</br>[% state %][% END %]
-    [% IF ( country ) %]<br />[% country %][% END %]</li>
+[% IF ( patron.city ) %]<li class="patroncity">
+    [%IF ( patron.zipcode ) %][% patron.zipcode %] [% END %][% patron.city %][% IF ( patron.state ) %]</br>[% patron.state %][% END %]
+    [% IF ( patron.country ) %]<br />[% patron.country %][% END %]</li>
 [% END %]
index 14cc17b..494bd25 100644 (file)
@@ -1,19 +1,19 @@
-[% IF ( address or address2 ) %]
-    [% IF ( address ) %]
+[% IF ( patron.address or patron.address2 ) %]
+    [% IF ( patron.address ) %]
         [% SET roadtype_desc = '' %]
-        [% IF streettype %]
-            [% SET roadtype_desc = AuthorisedValues.GetByCode('ROADTYPE', streettype) %]
+        [% IF patron.streettype %]
+            [% SET roadtype_desc = AuthorisedValues.GetByCode('ROADTYPE', patron.streettype) %]
         [% END %]
-        <li class="patronaddress1">[% IF streetnumber %][% streetnumber %] [% END %]
+        <li class="patronaddress1">[% IF patron.streetnumber %][% patron.streetnumber %] [% END %]
         [%IF roadtype_desc %][% roadtype_desc %] [% END %]
-            [% address %]
+            [% patron.address %]
         </li>
     [% END %]
-    [% IF ( address2 ) %]
-        <li class="patronaddress2">[% address2 %]</li>
+    [% IF ( patron.address2 ) %]
+        <li class="patronaddress2">[% patron.address2 %]</li>
     [% END %]
 [% END %]
-[% IF ( city ) %]
-    <li class="patroncity">[%IF (zipcode ) %][% zipcode %] [% END %][% city %][% IF ( state ) %]</br>[% state %][% END %]
-    [% IF ( country ) %]<br />[% country %][% END %]</li>
+[% IF ( patron.city ) %]
+    <li class="patroncity">[%IF ( patron.zipcode ) %][% patron.zipcode %] [% END %][% patron.city %][% IF ( patron.state ) %]</br>[% patron.state %][% END %]
+    [% IF ( patron.country ) %]<br />[% patron.country %][% END %]</li>
 [% END %]
index 2e80d33..d7fb581 100644 (file)
@@ -1,16 +1,16 @@
-[% IF ( address or address2 ) %]
-    [% IF ( address ) %]
+[% IF ( patron.address or patron.address2 ) %]
+    [% IF ( patron.address ) %]
         [% SET roadtype_desc = '' %]
-        [% IF streettype %]
-            [% SET roadtype_desc = AuthorisedValues.GetByCode('ROADTYPE', streettype) %]
+        [% IF patron.streettype %]
+            [% SET roadtype_desc = AuthorisedValues.GetByCode('ROADTYPE', patron.streettype) %]
         [% END %]
-        <li class="patronaddress1">[% if (streetnumber) %][% streetnumber |html  %][% end %] [% address |html %] [% IF roadtype_desc %][% roadtype_desc |html  %] [% END %][% end %]</li>
+        <li class="patronaddress1">[% if (patron.streetnumber) %][% patron.streetnumber |html  %][% end %] [% patron.address |html %] [% IF roadtype_desc %][% roadtype_desc |html  %] [% END %][% end %]</li>
     [% END %]
-    [% IF ( address2 ) %]
-        <li class="patronaddress2">[% address2 |html  %]</li>
+    [% IF ( patron.address2 ) %]
+        <li class="patronaddress2">[% patron.address2 |html  %]</li>
     [% END %]
 [% END %]
-[% IF ( city ) %]<li class="patroncity">
-        [% city |html  %][% IF ( state ) %], [% state |html  %][% END %]
-        [% zipcode |html  %][% IF ( country ) %], [% country |html  %][% END %]</li>
+[% IF ( patron.city ) %]<li class="patroncity">
+        [% patron.city |html  %][% IF ( patron.state ) %], [% patron.state |html  %][% END %]
+        [% patron.zipcode |html  %][% IF ( patron.country ) %], [% patron.country |html  %][% END %]</li>
 [% END %]
index fc36c94..28ae475 100644 (file)
@@ -1,16 +1,16 @@
-[% IF ( B_address or B_address2 ) %]
-    [% IF ( B_address ) %]
+[% IF ( patron.B_address or patron.B_address2 ) %]
+    [% IF ( patron.B_address ) %]
         [% SET roadtype_desc = '' %]
-        [% IF B_streettype %]
-            [% SET roadtype_desc = AuthorisedValues.GetByCode('ROADTYPE', B_streettype) %]
+        [% IF patron.B_streettype %]
+            [% SET roadtype_desc = AuthorisedValues.GetByCode('ROADTYPE', patron.B_streettype) %]
         [% END %]
-        <li class="patronaddress1">[% B_address %][%IF roadtype_desc %] [% roadtype_desc %][% END %][% IF B_streetnumber %] [% B_streetnumber %][% END %]</li>
+        <li class="patronaddress1">[% patron.B_address %][%IF roadtype_desc %] [% roadtype_desc %][% END %][% IF patron.B_streetnumber %] [% patron.B_streetnumber %][% END %]</li>
     [% END %]
-    [% IF ( B_address2 ) %]
-        <li class="patronaddress2">[% B_address2 %]</li>
+    [% IF ( patron.B_address2 ) %]
+        <li class="patronaddress2">[% patron.B_address2 %]</li>
     [% END %]
 [% END %]
-[% IF ( B_city ) %]<li class="patroncity">
-    [%IF ( B_zipcode ) %][% B_zipcode %] [% END %][% B_city %][% IF ( B_state ) %]</br>[% B_state %][% END %]
-    [% IF ( B_country ) %]<br />[% B_country %][% END %]</li>
+[% IF ( patron.B_city ) %]<li class="patroncity">
+    [%IF ( patron.B_zipcode ) %][% patron.B_zipcode %] [% END %][% patron.B_city %][% IF ( patron.B_state ) %]</br>[% patron.B_state %][% END %]
+    [% IF ( patron.B_country ) %]<br />[% patron.B_country %][% END %]</li>
 [% END %]
index f2625bd..cad604c 100644 (file)
@@ -1,21 +1,21 @@
-[% IF ( B_address or B_address2 ) %]
-    [% IF ( B_address ) %]
+[% IF ( patron.B_address or patron.B_address2 ) %]
+    [% IF ( patron.B_address ) %]
         [% SET roadtype_desc = '' %]
-        [% IF B_streettype %]
-            [% SET roadtype_desc = AuthorisedValues.GetByCode('ROADTYPE', B_streettype) %]
+        [% IF patron.B_streettype %]
+            [% SET roadtype_desc = AuthorisedValues.GetByCode('ROADTYPE', patron.B_streettype) %]
         [% END %]
-        <li class="patronaddress1">[% IF B_streetnumber %][% B_streetnumber %][% END %]
+        <li class="patronaddress1">[% IF patron.B_streetnumber %][% patron.B_streetnumber %][% END %]
         [%IF roadtype_desc %][% roadtype_desc %] [% END %]
-            [% B_address %]
+            [% patron.B_address %]
         </li>
     [% END %]
-    [% IF ( B_address2 ) %]
-        <li class="patronaddress2">[% B_address2 %]</li>
+    [% IF ( patron.B_address2 ) %]
+        <li class="patronaddress2">[% patron.B_address2 %]</li>
     [% END %]
 [% END %]
-[% IF ( B_city ) %]
-    <li class="patroncity">[%IF ( B_zipcode ) %][% B_zipcode %] [% END %]
-    [% B_city %]
-    [% IF ( B_state ) %]</br>[% B_state %][% END %]
-    [% IF ( B_country ) %]<br />[% B_country %][% END %]</li>
+[% IF ( patron.B_city ) %]
+    <li class="patroncity">[%IF ( patron.B_zipcode ) %][% patron.B_zipcode %] [% END %]
+    [% patron.B_city %]
+    [% IF ( patron.B_state ) %]</br>[% patron.B_state %][% END %]
+    [% IF ( patron.B_country ) %]<br />[% patron.B_country %][% END %]</li>
 [% END %]
index 78830ff..f2c38aa 100644 (file)
@@ -1,16 +1,16 @@
-[% IF ( B_address or B_address2 ) %]
-    [% IF ( B_address ) %]
+[% IF ( patron.B_address or patron.B_address2 ) %]
+    [% IF ( patron.B_address ) %]
         [% SET roadtype_desc = '' %]
-        [% IF B_streettype %]
-            [% SET roadtype_desc = AuthorisedValues.GetByCode('ROADTYPE', B_streettype) %]
+        [% IF patron.B_streettype %]
+            [% SET roadtype_desc = AuthorisedValues.GetByCode('ROADTYPE', patron.B_streettype) %]
         [% END %]
-        <li class="patronaddress1">[% if (B_streetnumber) %][% B_streetnumber |html %][% end %] [% B_address |html %] [% IF roadtype_desc %][% roadtype_desc |html %] [% END %][% end %]</li>
+        <li class="patronaddress1">[% if (patron.B_streetnumber) %][% patron.B_streetnumber |html %][% end %] [% patron.B_address |html %] [% IF roadtype_desc %][% roadtype_desc |html %] [% END %][% end %]</li>
     [% END %]
-    [% IF ( B_address2 ) %]
-        <li class="patronaddress2">[% B_address2 |html %]</li>
+    [% IF ( patron.B_address2 ) %]
+        <li class="patronaddress2">[% patron.B_address2 |html %]</li>
     [% END %]
 [% END %]
-[% IF ( B_city ) %]<li class="patroncity">
-        [% B_city |html %][% IF ( B_state ) %], [% B_state |html %][% END %]
-        [% B_zipcode |html %][% IF ( B_country ) %], [% B_country |html %][% END %]</li>
+[% IF ( patron.B_city ) %]<li class="patroncity">
+        [% patron.B_city |html %][% IF ( patron.B_state ) %], [% patron.B_state |html %][% END %]
+        [% patron.B_zipcode |html %][% IF ( patron.B_country ) %], [% patron.B_country |html %][% END %]</li>
 [% END %]
index 754b37c..6bebd13 100644 (file)
@@ -12,7 +12,7 @@
       <select name="streettype">
         <option value=""></option>
         [% FOR roadtype IN roadtypes %]
-          [% IF roadtype.authorised_value == streettype %]
+          [% IF roadtype.authorised_value == patron.streettype %]
             <option value="[% roadtype.authorised_value %]" selected="selected">[% roadtype.lib %]</option>
           [% ELSE %]
             <option value="[% roadtype.authorised_value %]">[% roadtype.lib %]</option>
@@ -31,7 +31,7 @@
       <label for="address">
       [% END %]
       Address: </label>
-            <input type="text" id="address" name="address" size="35" value="[% address %]" />
+            <input type="text" id="address" name="address" size="35" value="[% patron.address %]" />
       [% IF ( mandatoryaddress ) %]<span class="required">Required</span>[% END %]
     </li>
         [% END %]
@@ -43,7 +43,7 @@
       <label for="streetnumber">
       [% END %]
       Street number: </label>
-        <input type="text" id="streetnumber" name="streetnumber" size="5" value="[% streetnumber %]" />
+        <input type="text" id="streetnumber" name="streetnumber" size="5" value="[% patron.streetnumber %]" />
 [% IF ( mandatorystreetnumber ) %]<span class="required">Required</span>[% END %]
     </li>
         [% END %]
@@ -55,7 +55,7 @@
       <label for="address2">
       [% END %]
       Address 2: </label>
-            <input type="text" id="address2" name="address2" size="35" value="[% address2 %]" />
+            <input type="text" id="address2" name="address2" size="35" value="[% patron.address2 %]" />
       [% IF ( mandatoryaddress2 ) %]<span class="required">Required</span>[% END %]
     </li>
         [% END %]
@@ -67,7 +67,7 @@
         <label for="zipcode">
       [% END %]
       ZIP/Postal code: </label>
-            <input type="text" name="zipcode" id="zipcode" size="10" value="[% zipcode %]" />
+            <input type="text" name="zipcode" id="zipcode" size="10" value="[% patron.zipcode %]" />
           [% IF ( mandatoryzipcode ) %]<span class="required">Required</span>[% END %]
     </li>
         [% END %]
         <label for="city">
       [% END %]
       City: </label>
-        <input type="text" id="city" name="city" size="20" value="[% city %]" />
+        <input type="text" id="city" name="city" size="20" value="[% patron.city %]" />
         [% IF cities.count %]or choose
         <select id="select_city" name="select_city">
             <option value="|||"></option>
             [% FOREACH c IN cities %]
-                [% IF c.city_name == city && c.city_state == state && c.city_zipcode == zipcode %]
+                [% IF c.city_name == patron.city && c.city_state == patron.state && c.city_zipcode == patron.zipcode %]
                 <option value="[% c.city_zipcode %]|[% c.city_name %]|[% c.city_state %]|[% c.city_country %]" selected="selected">
                 [% ELSE %]
                 <option value="[% c.city_zipcode %]|[% c.city_name %]|[% c.city_state %]|[% c.city_country %]">
         <label for="state">
       [% END %]
       State: </label>
-      <input type="text" name="state" id="state" size="20" value="[% state %]" />
+      <input type="text" name="state" id="state" size="20" value="[% patron.state %]" />
       [% IF ( mandatorystate ) %]<span class="required">Required</span>[% END %]
     </li>
         [% END %]
         <label for="country">
       [% END %]
       Country: </label>
-        <input type="text" name="country" id="country" size="20" value="[% country %]" />
+        <input type="text" name="country" id="country" size="20" value="[% patron.country %]" />
       [% IF ( mandatorycountry ) %]<span class="required">Required</span>[% END %]
     </li>
         [% END %]
index b67d96b..696b327 100644 (file)
@@ -8,7 +8,7 @@
             <label for="streetnumber">
         [% END %]
             Street number: </label>
-            <input type="text" id="streetnumber" name="streetnumber" size="5" value="[% streetnumber %]" />
+            <input type="text" id="streetnumber" name="streetnumber" size="5" value="[% patron.streetnumber %]" />
         [% IF ( mandatorystreetnumber ) %]<span class="required">Required</span>[% END %]
     [% END %]
 
@@ -23,7 +23,7 @@
         <select name="streettype">
            <option value=""></option>
         [% FOR roadtype IN roadtypes %]
-            [% IF roadtype.authorised_value == streettype %]
+            [% IF roadtype.authorised_value == patron.streettype %]
                 <option value="[% roadtype.authorised_value %]" selected="selected">[% roadtype.lib %]</option>
             [% ELSE %]
                 <option value="[% roadtype.authorised_value %]">[% roadtype.lib %]</option>
@@ -42,7 +42,7 @@
         <label for="address">
     [% END %]
     Address: </label>
-        <input type="text" id="address" name="address" size="35" value="[% address %]" />
+        <input type="text" id="address" name="address" size="35" value="[% patron.address %]" />
     [% IF ( mandatoryaddress ) %]<span class="required">Required</span>[% END %]
       </li>
 [% END %]
@@ -54,7 +54,7 @@
         <label for="address2">
     [% END %]
         Address 2: </label>
-        <input type="text" id="address2" name="address2" size="35" value="[% address2 %]" />
+        <input type="text" id="address2" name="address2" size="35" value="[% patron.address2 %]" />
     [% IF ( mandatoryaddress2 ) %]<span class="required">Required</span>[% END %]
     </li>
 [% END %]
@@ -66,7 +66,7 @@
         <label for="zipcode">
     [% END %]
     ZIP/Postal code: </label>
-    <input type="text" name="zipcode" id="zipcode" size="10" value="[% zipcode %]" />
+    <input type="text" name="zipcode" id="zipcode" size="10" value="[% patron.zipcode %]" />
     [% IF ( mandatoryzipcode ) %]<span class="required">Required</span>[% END %]
     </li>
 [% END %]
         <label for="city">
     [% END %]
     City: </label>
-    <input type="text" id="city" name="city" size="20" value="[% city %]" />
+    <input type="text" id="city" name="city" size="20" value="[% patron.city %]" />
     [% IF cities.count %]or choose
         <select id="select_city" name="select_city">
             <option value="|||"></option>
         [% FOREACH c IN cities %]
-            [% IF c.city_name == city && c.city_state == state && c.city_zipcode == zipcode %]
+            [% IF c.city_name == patron.city && c.city_state == patron.state && c.city_zipcode == patron.zipcode %]
                 <option value="[% c.city_zipcode %]|[% c.city_name %]|[% c.city_state %]|[% c.city_country %]" selected="selected">
             [% ELSE %]
                  <option value="[% c.city_zipcode %]|[% c.city_name %]|[% c.city_state %]|[% c.city_country %]">
         <label for="state">
     [% END %]
         State: </label>
-        <input type="text" name="state" id="state" size="20" value="[% state %]" />
+        <input type="text" name="state" id="state" size="20" value="[% patron.state %]" />
     [% IF ( mandatorystate ) %]<span class="required">Required</span>[% END %]
     </li>
 [% END %]
       <label for="country">
     [% END %]
     Country: </label>
-      <input type="text" name="country" id="country" size="20" value="[% country %]" />
+      <input type="text" name="country" id="country" size="20" value="[% patron.country %]" />
     [% IF ( mandatorycountry ) %]<span class="required">Required</span>[% END %]
     </li>
 [% END %]
index f50d816..f76d3fd 100644 (file)
@@ -8,7 +8,7 @@
       <label for="streetnumber">
       [% END %]
       Street number: </label>
-        <input type="text" id="streetnumber" name="streetnumber" size="5" value="[% streetnumber %]" />
+        <input type="text" id="streetnumber" name="streetnumber" size="5" value="[% patron.streetnumber %]" />
 [% IF ( mandatorystreetnumber ) %]<span class="required">Required</span>[% END %]
     </li>
         [% END %]
@@ -24,7 +24,7 @@
       <select name="streettype">
         <option value=""></option>
         [% FOR roadtype IN roadtypes %]
-          [% IF roadtype.authorised_value == streettype%]
+          [% IF roadtype.authorised_value == patron.streettype %]
             <option value="[% roadtype.authorised_value %]" selected="selected">[% roadtype.lib %]</option>
           [% ELSE %]
             <option value="[% roadtype.authorised_value %]">[% roadtype.lib %]</option>
@@ -43,7 +43,7 @@
       <label for="address">
       [% END %]
       Address: </label>
-            <input type="text" id="address" name="address" size="35" value="[% address %]" />
+            <input type="text" id="address" name="address" size="35" value="[% patron.address %]" />
       [% IF ( mandatoryaddress ) %]<span class="required">Required</span>[% END %]
     </li>
         [% END %]
@@ -55,7 +55,7 @@
       <label for="address2">
       [% END %]
       Address 2: </label>
-            <input type="text" id="address2" name="address2" size="35" value="[% address2 %]" />
+            <input type="text" id="address2" name="address2" size="35" value="[% patron.address2 %]" />
       [% IF ( mandatoryaddress2 ) %]<span class="required">Required</span>[% END %]
     </li>
         [% END %]
         <label for="city">
       [% END %]
       City: </label>
-        <input type="text" id="city" name="city" size="20" value="[% city %]" />
+        <input type="text" id="city" name="city" size="20" value="[% patron.city %]" />
         [% IF cities.count %]or choose
         <select id="select_city" name="select_city">
             <option value="|||"></option>
             [% FOREACH c IN cities %]
-                [% IF c.city_name == city && c.city_state == state && c.city_zipcode == zipcode %]
+                [% IF c.city_name == patron.city && c.city_state == patron.state && c.city_zipcode == patron.zipcode %]
                 <option value="[% c.city_zipcode %]|[% c.city_name %]|[% c.city_state %]|[% c.city_country %]" selected="selected">
                 [% ELSE %]
                 <option value="[% c.city_zipcode %]|[% c.city_name %]|[% c.city_state %]|[% c.city_country %]">
@@ -93,7 +93,7 @@
         <label for="state">
       [% END %]
       State: </label>
-      <input type="text" name="state" id="state" size="20" value="[% state %]" />
+      <input type="text" name="state" id="state" size="20" value="[% patron.state %]" />
       [% IF ( mandatorystate ) %]<span class="required">Required</span>[% END %]
     </li>
         [% END %]
         <label for="zipcode">
       [% END %]
       ZIP/Postal code: </label>
-            <input type="text" name="zipcode" id="zipcode" size="10" value="[% zipcode %]" />
+            <input type="text" name="zipcode" id="zipcode" size="10" value="[% patron.zipcode %]" />
       [% IF ( mandatoryzipcode ) %]<span class="required">Required</span>[% END %]
     </li>
         [% END %]
         <label for="country">
       [% END %]
       Country: </label>
-        <input type="text" name="country" id="country" size="20" value="[% country %]" />
+        <input type="text" name="country" id="country" size="20" value="[% patron.country %]" />
       [% IF ( mandatorycountry ) %]<span class="required">Required</span>[% END %]
     </li>
         [% END %]
index 4269613..be1682b 100644 (file)
@@ -7,21 +7,21 @@
 <div id="toolbar" class="btn-toolbar">
     [% IF CAN_user_borrowers_edit_borrowers %]
         [% IF ( guarantor ) %]
-            <a id="editpatron" class="btn btn-default btn-sm" href="/cgi-bin/koha/members/memberentry.pl?op=modify&amp;destination=circ&amp;borrowernumber=[% borrowernumber %]&amp;guarantorid=[% guarantor.borrowernumber %]&amp;categorycode=[% categorycode %]">
+            <a id="editpatron" class="btn btn-default btn-sm" href="/cgi-bin/koha/members/memberentry.pl?op=modify&amp;destination=circ&amp;borrowernumber=[% patron.borrowernumber %]&amp;guarantorid=[% guarantor.borrowernumber %]&amp;categorycode=[% patron.categorycode %]">
         [% ELSE %]
-            <a id="editpatron" class="btn btn-default btn-sm" href="/cgi-bin/koha/members/memberentry.pl?op=modify&amp;destination=circ&amp;borrowernumber=[% borrowernumber %]&amp;categorycode=[% categorycode %]">
+            <a id="editpatron" class="btn btn-default btn-sm" href="/cgi-bin/koha/members/memberentry.pl?op=modify&amp;destination=circ&amp;borrowernumber=[% patron.borrowernumber %]&amp;categorycode=[% patron.categorycode %]">
         [% END %]
         <i class="fa fa-pencil"></i> Edit</a>
     [% END %]
 
     [% IF CAN_user_borrowers_edit_borrowers %]
         [% IF adultborrower AND Koha.Preference("borrowerRelationship") %]
-            <a id="addchild" class="btn btn-default btn-sm" href="/cgi-bin/koha/members/memberentry.pl?op=add&amp;guarantorid=[% borrowernumber %]"><i class="fa fa-plus"></i> Add child</a>
+            <a id="addchild" class="btn btn-default btn-sm" href="/cgi-bin/koha/members/memberentry.pl?op=add&amp;guarantorid=[% patron.borrowernumber %]"><i class="fa fa-plus"></i> Add child</a>
         [% END %]
         [% IF CAN_user_borrowers_edit_borrowers %]
-            <a id="changepassword" class="btn btn-default btn-sm" href="/cgi-bin/koha/members/member-password.pl?member=[% borrowernumber %]"><i class="fa fa-lock"></i> Change password</a>
+            <a id="changepassword" class="btn btn-default btn-sm" href="/cgi-bin/koha/members/member-password.pl?member=[% patron.borrowernumber %]"><i class="fa fa-lock"></i> Change password</a>
         [% END %]
-        <a id="duplicate" class="btn btn-default btn-sm" href="/cgi-bin/koha/members/memberentry.pl?op=duplicate&amp;borrowernumber=[% borrowernumber %]&amp;categorycode=[% categorycode %]"><i class="fa fa-copy"></i> Duplicate</a>
+        <a id="duplicate" class="btn btn-default btn-sm" href="/cgi-bin/koha/members/memberentry.pl?op=duplicate&amp;borrowernumber=[% patron.borrowernumber %]&amp;categorycode=[% patron.categorycode %]"><i class="fa fa-copy"></i> Duplicate</a>
     [% END %]
 
     <div class="btn-group">
@@ -30,7 +30,7 @@
                 [% IF CAN_user_borrowers_edit_borrowers %]<li><a id="printsummary" href="#">Print summary</a></li>[% END %]
                 <li><a id="printslip" href="#">Print slip</a></li>
                 <li><a id="printquickslip" href="#">Print quick slip</a></li>
-                [% IF Borrowers.HasOverdues( borrowernumber ) %]
+                [% IF Borrowers.HasOverdues( patron.borrowernumber ) %]
                     <li><a id="print_overdues" href="#">Print overdues</a></li>
                 [% END %]
             </ul>
         <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">More <span class="caret"></span></button>
             <ul class="dropdown-menu">
                 [% IF CAN_user_borrowers_edit_borrowers %]
-                    <li><a id="renewpatron" href="/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% borrowernumber %]&amp;destination=[% destination %]&amp;reregistration=y">Renew patron</a></li>
+                    <li><a id="renewpatron" href="/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% patron.borrowernumber %]&amp;destination=[% destination %]&amp;reregistration=y">Renew patron</a></li>
                 [% ELSE %]
                     <li class="disabled"><a data-toggle="tooltip" data-placement="left" title="You are not authorized to renew patrons" id="renewpatron" href="#">Renew patron</a></li>
                 [% END %]
                 [% IF ( CAN_user_permissions ) %]
-                    <li><a id="patronflags" href="/cgi-bin/koha/members/member-flags.pl?member=[% borrowernumber %]">Set permissions</a></li>
+                    <li><a id="patronflags" href="/cgi-bin/koha/members/member-flags.pl?member=[% patron.borrowernumber %]">Set permissions</a></li>
                 [% ELSE %]
                     <li class="disabled"><a data-toggle="tooltip" data-placement="left" title="You are not authorized to set permissions" id="patronflags" href="#">Set permissions</a></li>
                 [% END %]
                 [% IF CAN_user_borrowers_edit_borrowers && useDischarge %]
-                    <li><a href="/cgi-bin/koha/members/discharge.pl?borrowernumber=[% borrowernumber %]">Discharge</a></li>
+                    <li><a href="/cgi-bin/koha/members/discharge.pl?borrowernumber=[% patron.borrowernumber %]">Discharge</a></li>
                 [% END %]
                 [% IF CAN_user_borrowers_edit_borrowers %]
                     [% IF ( NorwegianPatronDBEnable == 1 ) %]
@@ -98,7 +98,7 @@
                         <label for="message_type">Add a message for:</label>
                         <select name="message_type" id="message_type">
                             <option value="L">Staff - Internal note</option>
-                            <option value="B">OPAC - [% firstname | html %] [% surname | html %]</option>
+                            <option value="B">OPAC - [% patron.firstname | html %] [% patron.surname | html %]</option>
                         </select>
                     </div>
                     [% bor_notes = AuthorisedValues.Get( 'BOR_NOTES' ) %]
                     <div class="form-group">
                         <textarea rows="3" class="modal-textarea" name="borrower_message" id="borrower_message" ></textarea>
                     </div>
-                    <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
+                    <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber %]" />
                     <input type="hidden" name="batch" value="[% batch %]" />
                     <input type="hidden" name="branchcode" value="[% LoginBranchcode %]" />
                 </div>
index 42df563..b6fc28e 100644 (file)
                     [% END %]
                 </td>
                 <td>[% loop_budge.budget_name %]</td>
-                <td>[% IF ( loop_budge.budget_owner_borrowernumber ) %]
-                        <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loop_budge.budget_owner_borrowernumber %]">[% loop_budge.budget_owner_surname %], [% loop_budge.budget_owner_firstname %]</a>
+                <td>[% IF ( loop_budge.budget_owner ) %]
+                        <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loop_budge.budget_owner.borrowernumber %]">[% loop_budge.budget_owner.surname %], [% loop_budge.budget_owner.firstname %]</a>
                     [% ELSE %]
                         &nbsp;
                     [% END %]
index a7c81de..7931683 100644 (file)
                                         </td>
                                         <td>[% basket.expected_items %]</td>
                                         <td>
-                                            [% basket.authorisedby_firstname %]
-                                            [% basket.authorisedby_surname %]
+                                            [% IF basket.authorisedby %]
+                                                [% basket.authorisedby.firstname %]
+                                                [% basket.authorisedbysurname %]
+                                            [% END %]
                                         </td>
                                         <td><span title="[% basket.creationdate %]">[% basket.creationdate | $KohaDates %]</span></td>
                                         <td>
index a983972..e64c9e9 100644 (file)
 
     <li>
         <span class="label">Owner: </span>
-        [% IF ( budget_owner_name ) %]
+        [% IF  budget_owner %]
             <span  id="budget_owner_name">
-                <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% budget_owner_id %]">
-                    [% budget_owner_name %]
+                <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% budget_owner.borrowernumber %]">
+                    [% budget_owner.firstname %] [% budget_owner.surname %]
                 </a> |
             </span>
         [% END %]
         <a id="edit_owner" class="new_window" href="#"><i class="fa fa-search"></i> Select owner</a>
         <a id="remove_owner" href="#"><i class="fa fa-trash"></i> Remove owner</a>
         <input type="hidden" name="budget_owner_id" id="budget_owner_id"
-            value="[% budget_owner_id %]" />
+            value="[% budget_owner.borrowernumber %]" />
     </li>
 
 
index 3fc491c..451f252 100644 (file)
                                   <li>Item is already at destination library.</li>
                               [% END %]
                               [% IF ( errmsgloo.errwasreturned ) %]
-                                  <li>Item was on loan to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% errmsgloo.borrowernumber %]">
-                                  [% errmsgloo.firstname %] [% errmsgloo.surname %]
-                                  ([% errmsgloo.cardnumber %])</a> and has been returned.</li>
+                                  <li>Item was on loan to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% errmsgloo.patron.borrowernumber %]">
+                                  [% errmsgloo.patron.firstname %] [% errmsgloo.patron.surname %]
+                                  ([% errmsgloo.patron.cardnumber %])</a> and has been returned.</li>
                               [% END %]
                           [% END %]
                           </ul>
index 8395e7f..315f835 100644 (file)
@@ -6,7 +6,7 @@
 <title>Koha &rsaquo; Circulation &rsaquo; Transfers print receipt</title>
 [% ELSIF ( caller == 'members' ) %]
 <title>Koha &rsaquo; Patrons &rsaquo; Print receipt for [% borrowernumber %]</title>
-[% ELSIF ( title ) %]
+[% ELSIF ( title ) %][%# FIXME title is never defined %]
 <title>Koha &rsaquo; Patrons &rsaquo; [% title %]</title>
 [% END %]
 [% INCLUDE 'doc-head-close.inc' %]
index d18c3f4..2432618 100644 (file)
                             [% IF ( reser.itemtype ) %] (<b>[% reser.itemtype %]</b>)[% END %]
                             <br />Barcode: [% reser.barcode %]
                     </td>
-                    <td>[% IF ( reser.borrowername ) %]
-                        <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% reser.borrowernum %]">
-                            [% reser.borrowername %][%IF ( reser.borrowerfirstname ) %], [% reser.borrowerfirstname %][% END %]
+                    <td>[% IF ( reser.patron ) %]
+                        <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% reser.patron.borrowernumber %]">
+                            [% reser.patron.surname %][%IF ( reser.patron.firstname ) %], [% reser.patron.firstname %][% END %]
                         </a>
-                        [% IF ( reser.borrowerphone ) %]<br />[% reser.borrowerphone %][% END %]
-                            [% IF ( reser.borrowermail ) %]
+                        [% IF ( reser.patron.phone ) %]<br />[% reser.patron.phone %][% END %]
+                            [% IF ( reser.patron.email ) %]
                                 <br />
                                 [% BLOCK subject %]Hold:[% END %]
-                                <a href="mailto:[% reser.borrowermail %]?subject=[% INCLUDE subject %] [% reser.title |html %]">
-                                    [% reser.borrowermail %]
+                                <a href="mailto:[% reser.patron.email %]?subject=[% INCLUDE subject %] [% reser.title |html %]">
+                                    [% reser.patron.email %]
                                 </a>
                             [% END %]
                         [% ELSE %]
index 8a6efa7..c2ada83 100644 (file)
                             [% UNLESS ( item_level_itypes ) %][% IF ( reserveloo.itemtype ) %]&nbsp; (<b>[% reserveloo.itemtype %]</b>)[% END %][% END %]
                             <br />Barcode: [% reserveloo.barcode %]
                     </td>
-                    <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% reserveloo.borrowernum %]">[% reserveloo.borrowername %], [% reserveloo.borrowerfirstname %]</a>
-                        [% IF ( reserveloo.borrowerphone ) %]<br />[% reserveloo.borrowerphone %][% END %]
-                        [% IF ( reserveloo.borrowermail ) %]<br /><a href="mailto:[% reserveloo.borrowermail %]?subject=Hold waiting: [% reserveloo.title %]">
-                        [% reserveloo.borrowermail %]</a>[% END %]
+                    <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% reserveloo.patron.borrowernumber %]">[% reserveloo.patron.surname%], [% reserveloo.patron.firstname %]</a>
+                        [% IF ( reserveloo.patron.phone ) %]<br />[% reserveloo.patron.phone %][% END %]
+                        [% IF ( reserveloo.patron.first_valid_email_address ) %]<br /><a href="mailto:[% reserveloo.patron.first_valid_email_address %]?subject=Hold waiting: [% reserveloo.title %]">
+                        [% reserveloo.patron.first_valid_email_address %]</a>[% END %]
                     </td>
                     <td>[% Branches.GetName( reserveloo.homebranch ) %]</td>
                     <td>[% Branches.GetName( reserveloo.holdingbranch ) %]</td>
                             [% UNLESS ( item_level_itypes ) %][% IF ( overloo.itemtype ) %]&nbsp; (<b>[% overloo.itemtype %]</b>)[% END %][% END %]
                         <br />Barcode: [% overloo.barcode %]
                     </td>
-                    <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% overloo.borrowernum %]">[% overloo.borrowername %], [% overloo.borrowerfirstname %]</a><br />[% overloo.borrowerphone %]<br />
-                        [% IF ( overloo.borrowermail ) %]<a href="mailto:[% overloo.borrowermail %]?subject=Reservation: [% overloo.title |url %]">
-        [% overloo.borrowermail %]</a>[% END %]
+                    <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% overloo.patron.borrowernumber %]">[% overloo.patron.surname %], [% overloo.patron.firstname %]</a><br />[% overloo.patron.phone %]<br />
+                        [% IF ( overloo.patron.first_valid_email_address ) %]<a href="mailto:[% overloo.patron.first_valid_email_address %]?subject=Reservation: [% overloo.title |url %]">
+        [% overloo.patron.first_valid_email_address %]</a>[% END %]
                     </td>
                     <td>[% Branches.GetName( overloo.homebranch ) %]</td>
                     <td>[% Branches.GetName( overloo.holdingbranch ) %]</td>
index aef11d3..c13bbbb 100644 (file)
        <div id="yui-main">
        <div class="yui-b">
 [% INCLUDE 'members-toolbar.inc' %]
-<form action="/cgi-bin/koha/members/boraccount.pl" method="get"><input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber %]" /></form>
+<form action="/cgi-bin/koha/members/boraccount.pl" method="get"><input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber %]" /></form>
 
 <!-- The manual invoice and credit buttons -->
 <div class="statictabs">
 <ul>
-    <li class="active"><a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrowernumber %]">Account</a></li>
-       <li><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrowernumber %]" >Pay fines</a></li>
-       <li><a href="/cgi-bin/koha/members/maninvoice.pl?borrowernumber=[% borrowernumber %]" >Create manual invoice</a></li>
-       <li><a href="/cgi-bin/koha/members/mancredit.pl?borrowernumber=[% borrowernumber %]" >Create manual credit</a></li>
+    <li class="active"><a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber %]">Account</a></li>
+    <li><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber %]" >Pay fines</a></li>
+    <li><a href="/cgi-bin/koha/members/maninvoice.pl?borrowernumber=[% patron.borrowernumber %]" >Create manual invoice</a></li>
+    <li><a href="/cgi-bin/koha/members/mancredit.pl?borrowernumber=[% patron.borrowernumber %]" >Create manual credit</a></li>
 </ul>
 <div class="tabs-container">
 <!-- The table with the account items -->
index 660fd93..76b7bcd 100644 (file)
@@ -1,13 +1,13 @@
 [% SET footerjs = 1 %]
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Koha &rsaquo; Delete patron [% firstname %] [% surname %]</title>
+<title>Koha &rsaquo; Delete patron [% patron.firstname %] [% patron.surname %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
 </head>
 <body id="pat_deletemem" class="pat">
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'patron-search.inc' %]
 
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> &rsaquo; Delete patron [% firstname %] [% surname %]</div>
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> &rsaquo; Delete patron [% patron.firstname %] [% patron.surname %]</div>
 <div id="doc3" class="yui-t2">
    
    <div id="bd">
             [% END %]
             </ul>
     </div>
-    [% ELSIF op == 'delete_confirm' and borrowernumber %]
-        [%# TODO add "patron does not exist" unless borrowernumber %]
+    [% ELSIF op == 'delete_confirm' and patron %]
+        [%# TODO add "patron does not exist" unless patron %]
         <div class="dialog alert">
-            <h3>Are you sure you want to delete the patron [% firstname %] [% surname %]? This cannot be undone.</h3>
+            <h3>Are you sure you want to delete the patron [% patron.firstname %] [% patron.surname %]? This cannot be undone.</h3>
             <form action="/cgi-bin/koha/members/deletemem.pl">
                 <input type="hidden" name="csrf_token" value="[% csrf_token %]" />
-                <input type="hidden" name="member" value="[% borrowernumber %]"/>
+                <input type="hidden" name="member" value="[% patron.borrowernumber %]"/>
                 <input type="hidden" name="op" value="delete_confirmed" />
                 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
             </form>
             <form action="/cgi-bin/koha/members/moremember.pl">
-                <input type="hidden" name="borrowernumber" value="[% borrowernumber %]"/>
+                <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber %]"/>
                 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
             </form>
         </div>
index 960fc62..01b2e9d 100644 (file)
@@ -3,7 +3,7 @@
 [% USE Branches %]
 [% SET footerjs = 1 %]
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Koha &rsaquo; Patrons &rsaquo; [% UNLESS blocking_error  %]Discharge for [% firstname %] [% surname %] ([% cardnumber %])[% END %]</title>
+<title>Koha &rsaquo; Patrons &rsaquo; [% UNLESS blocking_error  %]Discharge for [% patron.firstname %] [% patron.surname %] ([% patron.cardnumber %])[% END %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
 </head>
 <body id="discharge" class="discharge">
@@ -13,7 +13,7 @@
 <div id="breadcrumbs">
          <a href="/cgi-bin/koha/mainpage.pl">Home</a>
 &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
-&rsaquo; [% UNLESS blocking_error  %]Discharge for [% firstname %] [% surname %] ([% cardnumber %])[% END %]
+&rsaquo; [% UNLESS blocking_error  %]Discharge for [% patron.firstname %] [% patron.surname %] ([% patron.cardnumber %])[% END %]
 </div>
 
 <div id="doc3" class="yui-t1">
 [% UNLESS can_be_discharged %]
     <p>Cannot edit discharge: the patron has checked out items.</p>
 [% ELSE %]
-    [% IF has_reserves %]
+    [% IF patron.holds.count %]
         <p>Borrower has reserves: they will be canceled if the discharge is generated.</p>
     [% END %]
     <form method="post">
         <input type="submit" value="Generate discharge" name="discharge" />
-        <input type="hidden" value="[% borrowernumber %]" name="borrowernumber" />
+        <input type="hidden" value="[% patron.borrowernumber %]" name="borrowernumber" />
     </form>
 [% END %]
 
index ae36321..cfbb3b3 100644 (file)
@@ -57,7 +57,7 @@
               <h4>Manage housebound profile</h4>
               <form id="editform" method="post" name="editform"
                     action="/cgi-bin/koha/members/housebound.pl">
-                <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
+                <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber %]" />
                 [% IF ( housebound_profile ) %]
                   <input type="hidden" name="method" value="updateconfirm" />
                 [% ELSE %]
                 <fieldset class="action">
                   <button type="submit" class="btn btn-default btn-sm"><i class="fa fa-save"></i> Save changes</button>
                   <a class="cancel btn btn-link btn-sm"
-                     href="/cgi-bin/koha/members/housebound.pl?borrowernumber=[% borrowernumber %]">
+                     href="/cgi-bin/koha/members/housebound.pl?borrowernumber=[% patron.borrowernumber %]">
                     Cancel
                   </a>
                 </fieldset>
                 [% ELSE %]
                   <input type="hidden" name="method" value="addvisitconfirm" />
                 [% END %]
-                <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
+                <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber %]" />
                 <fieldset class="rows" id="instance">
                   <legend>Delivery details</legend>
                   <ol>
                 <fieldset class="action">
                   <button type="submit" class="btn btn-default btn-sm"><i class="fa fa-save"></i> Save</button>
                   <a class="cancel"
-                     href="/cgi-bin/koha/members/housebound.pl?borrowernumber=[% borrowernumber %]">
+                     href="/cgi-bin/koha/members/housebound.pl?borrowernumber=[% patron.borrowernumber %]">
                     Cancel
                   </a>
                 </fieldset>
                   </li>
                 </ol>
                 <div class="action">
-                  <a class="btn btn-default btn-xs" href="/cgi-bin/koha/members/housebound.pl?borrowernumber=[% borrowernumber %]&method=update_or_create"><i class="fa fa-pencil"></i> Edit</a>
+                  <a class="btn btn-default btn-xs" href="/cgi-bin/koha/members/housebound.pl?borrowernumber=[% patron.borrowernumber %]&method=update_or_create"><i class="fa fa-pencil"></i> Edit</a>
                 </div>
               </div>
               <div>
                         </a>
                       </td>
                       <td class="actions">
-                        <a class="btn btn-default btn-xs" href="/cgi-bin/koha/members/housebound.pl?method=visit_update_or_create&visit_id=[% entry.id %]&borrowernumber=[% borrowernumber %]"><i class="fa fa-pencil"></i> Edit</a>
-                        <a class="delete btn btn-default btn-xs" href="/cgi-bin/koha/members/housebound.pl?method=visit_delete&visit_id=[% entry.id %]&borrowernumber=[% borrowernumber %]"><i class="fa fa-trash"></i> Delete</a>
+                        <a class="btn btn-default btn-xs" href="/cgi-bin/koha/members/housebound.pl?method=visit_update_or_create&visit_id=[% entry.id %]&borrowernumber=[% patron.borrowernumber %]"><i class="fa fa-pencil"></i> Edit</a>
+                        <a class="delete btn btn-default btn-xs" href="/cgi-bin/koha/members/housebound.pl?method=visit_delete&visit_id=[% entry.id %]&borrowernumber=[% patron.borrowernumber %]"><i class="fa fa-trash"></i> Delete</a>
                       </td>
                     </tr>
                     [% END %]
                 </table>
                 [% END %]
                 <div class="action">
-                  <a href="/cgi-bin/koha/members/housebound.pl?method=visit_update_or_create&borrowernumber=[% borrowernumber %]"
+                  <a href="/cgi-bin/koha/members/housebound.pl?method=visit_update_or_create&borrowernumber=[% patron.borrowernumber %]"
                     class="btn btn-default btn-sm">
                     <i class="fa fa-plus"></i> Add a new delivery
                   </a>
index 72adcf6..5f68a4c 100644 (file)
 <!-- The manual invoice and credit buttons -->
 <div class="statictabs">
 <ul>
-       <li><a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrowernumber %]">Account</a></li>
-       <li><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrowernumber %]" >Pay fines</a></li>
-       <li><a href="/cgi-bin/koha/members/maninvoice.pl?borrowernumber=[% borrowernumber %]" >Create manual invoice</a></li>
-    <li class="active"><a href="/cgi-bin/koha/members/mancredit.pl?borrowernumber=[% borrowernumber %]" >Create manual credit</a></li>
+    <li><a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber %]">Account</a></li>
+    <li><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber %]" >Pay fines</a></li>
+    <li><a href="/cgi-bin/koha/members/maninvoice.pl?borrowernumber=[% patron.borrowernumber %]" >Create manual invoice</a></li>
+    <li class="active"><a href="/cgi-bin/koha/members/mancredit.pl?borrowernumber=[% patron.borrowernumber %]" >Create manual credit</a></li>
 </ul>
 <div class="tabs-container">
 
 <form action="/cgi-bin/koha/members/mancredit.pl" method="post" id="mancredit">
-<input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber %]" />
+<input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber %]" />
 
 <fieldset class="rows">
 <legend>Manual credit</legend><ol>
@@ -43,7 +43,7 @@
     <li><label for="amount">Amount: </label><input type="number" name="amount" id="amount" required="required" value="" step="any" min="0" /> Example: 5.00</li>
 </ol></fieldset>
 
-<fieldset class="action"><input type="submit" name="add" value="Add credit" /> <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrowernumber %]">Cancel</a></fieldset>
+<fieldset class="action"><input type="submit" name="add" value="Add credit" /> <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber %]">Cancel</a></fieldset>
 </form>
 
 </div></div>
index 7817042..71eeb78 100644 (file)
 <!-- The manual invoice and credit buttons -->
 <div class="statictabs">
 <ul>
-       <li><a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrowernumber %]">Account</a></li>
-       <li><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrowernumber %]" >Pay fines</a></li>
-    <li class="active"><a href="/cgi-bin/koha/members/maninvoice.pl?borrowernumber=[% borrowernumber %]" >Create manual invoice</a></li>
-       <li><a href="/cgi-bin/koha/members/mancredit.pl?borrowernumber=[% borrowernumber %]" >Create manual credit</a></li>
+    <li><a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber %]">Account</a></li>
+    <li><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber %]" >Pay fines</a></li>
+    <li class="active"><a href="/cgi-bin/koha/members/maninvoice.pl?borrowernumber=[% patron.borrowernumber %]" >Create manual invoice</a></li>
+    <li><a href="/cgi-bin/koha/members/mancredit.pl?borrowernumber=[% patron.borrowernumber %]" >Create manual credit</a></li>
 </ul>
 <div class="tabs-container">
 
@@ -33,7 +33,7 @@
   ERROR an invalid itemnumber was entered, please hit back and try again
 [% END %]
 [% ELSE %]
-<form action="/cgi-bin/koha/members/maninvoice.pl" method="post" id="maninvoice"><input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber %]" />
+<form action="/cgi-bin/koha/members/maninvoice.pl" method="post" id="maninvoice"><input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber %]" />
        <fieldset class="rows">
        <legend>Manual invoice</legend>
        <ol>
@@ -55,7 +55,7 @@
     <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li>
     <li><label for="amount">Amount: </label><input type="number" name="amount" id="amount" required="required" value="" step="any" min="0" /> Example: 5.00</li>
        </ol></fieldset>
-<fieldset class="action"><input type="submit" name="add" value="Save" /> <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrowernumber %]">Cancel</a></fieldset>
+<fieldset class="action"><input type="submit" name="add" value="Save" /> <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber %]">Cancel</a></fieldset>
 </form>
 
 [% END %]
index f63db22..5c1bbf0 100644 (file)
@@ -2,7 +2,7 @@
 [% SET footerjs = 1 %]
 [% PROCESS 'permissions.inc' %]
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Koha &rsaquo; Patrons &rsaquo; Set permissions for [% surname %], [% firstname %]</title>
+<title>Koha &rsaquo; Patrons &rsaquo; Set permissions for [% patron.surname %], [% patron.firstname %]</title>
 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/treeview/jquery.treeview_[% KOHA_VERSION %].css"/>
 [% INCLUDE 'doc-head-close.inc' %]
 </head>
@@ -11,7 +11,7 @@
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'patron-search.inc' %]
 
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo; Set permissions for [% surname %], [% firstname %]</div>
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo; Set permissions for [% patron.surname %], [% patron.firstname %]</div>
 
 <div id="doc3" class="yui-t2">
    
@@ -22,9 +22,9 @@
 
 <form method="post" action="/cgi-bin/koha/members/member-flags.pl">
     <input type="hidden" name="csrf_token" value="[% csrf_token %]" />
-    <input type="hidden" name="member" id="borrowernumber" value="[% borrowernumber %]" />
+    <input type="hidden" name="member" id="borrowernumber" value="[% patron.borrowernumber %]" />
     <input type="hidden" name="newflags" value="1" />
-    <h1>Set permissions for [% surname %], [% firstname %]</h1>
+    <h1>Set permissions for [% patron.surname %], [% patron.firstname %]</h1>
     <!-- <ul id="permissionstree"><li class="root">All privileges<ul> -->
     <ul id="permissionstree" class="treeview-grey">
         <!-- <li class="folder-close">One level down<ul> -->
@@ -64,7 +64,7 @@
     <!-- </ul></li></ul> -->
     </ul>
 
-<fieldset class="action"><input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">Cancel</a></fieldset>
+<fieldset class="action"><input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber %]">Cancel</a></fieldset>
 
 </form>
 </div>
index d27001d..c32bdff 100644 (file)
@@ -2,7 +2,7 @@
 [% USE Branches %]
 [% SET footerjs = 1 %]
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Koha &rsaquo; Patrons &rsaquo; [% IF ( newpassword ) %]Password updated [% ELSE %]Update password for [% surname %], [% firstname %][% END %]</title>
+<title>Koha &rsaquo; Patrons &rsaquo; [% IF ( newpassword ) %]Password updated [% ELSE %]Update password for [% patron.surname %], [% patron.firstname %][% END %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
 </head>
 
@@ -10,7 +10,7 @@
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'patron-search.inc' %]
 
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo; <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% firstname %] [% surname %]</a> &rsaquo; [% IF ( newpassword ) %]Password Updated[% ELSE %]Change username and/or password[% END %]</div>
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo; <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber %]">[% patron.firstname %] [% patron.surname %]</a> &rsaquo; [% IF ( newpassword ) %]Password Updated[% ELSE %]Change username and/or password[% END %]</div>
 
 <div id="doc3" class="yui-t2">
 
@@ -26,8 +26,8 @@
 
 <form method="post" id="changepasswordf" action="/cgi-bin/koha/members/member-password.pl">
 <input type="hidden" name="destination" value="[% destination %]" />
-<input type="hidden" name="cardnumber" value="[% cardnumber %]" />
-<input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber %]" />
+<input type="hidden" name="cardnumber" value="[% patron.cardnumber %]" />
+<input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber %]" />
        [% IF ( errormsg ) %]
                <div class="dialog alert">
                <h4>The following errors have occurred:</h4>
        [% END %]
 
 
-    <fieldset class="brief"><legend>Change username and/or password for [% firstname %] [% surname %]</legend>
+    <fieldset class="brief"><legend>Change username and/or password for [% patron.firstname %] [% patron.surname %]</legend>
        <ol>
     <li><label for="newuserid">New username:</label>
-       <input type="hidden" name="member" value="[% borrowernumber %]" /><input type="text" id="newuserid" name="newuserid" size="20" value="[% userid %]" /></li>
+       <input type="hidden" name="member" value="[% patron.borrowernumber %]" /><input type="text" id="newuserid" name="newuserid" size="20" value="[% patron.userid %]" /></li>
     [% SET password_pattern = ".{" _ Koha.Preference('minPasswordLength') _ ",}" %]
     [% IF Koha.Preference('RequireStrongPassword') %]
         [% SET password_pattern = '(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{' _ Koha.Preference('minPasswordLength') _ ',}' %]
@@ -77,7 +77,7 @@
     <fieldset class="action">
         <input type="hidden" name="csrf_token" value="[% csrf_token %]" />
         <input type="submit" value="Save" />
-        <a class="cancel" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">Cancel</a>
+        <a class="cancel" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber %]">Cancel</a>
     </fieldset>
 </form>[% END %]
 
index d373666..607217a 100644 (file)
@@ -3,7 +3,7 @@
 [% USE Branches %]
 [% SET footerjs = 1 %]
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Koha &rsaquo; Patrons &rsaquo; [% IF ( opadd ) %]Add[% ELSIF ( opduplicate ) %]Duplicate[% ELSE %] Modify[% END %] patron [% IF (firstname) %][% firstname %] [% END %][% IF (surname) %][% surname %] [% END %]([%IF ( categoryname ) %][% categoryname %][% ELSE %][% IF ( I ) %]Organization[% END %][% IF ( A ) %]Adult[% END %][% IF ( C ) %]Child[% END %][% IF ( P ) %]Professional[% END %][% IF ( S ) %]Staff[% END %][% END %])</title>
+<title>Koha &rsaquo; Patrons &rsaquo; [% IF ( opadd ) %]Add[% ELSIF ( opduplicate ) %]Duplicate[% ELSE %] Modify[% END %] patron [% IF (firstname) %][% firstname %] [% END %][% IF (surname) %][% surname %] [% END %]([%IF patron %][% patron.category.description %][% ELSE %][% IF ( I ) %]Organization[% END %][% IF ( A ) %]Adult[% END %][% IF ( C ) %]Child[% END %][% IF ( P ) %]Professional[% END %][% IF ( S ) %]Staff[% END %][% END %])</title>
 [% INCLUDE 'doc-head-close.inc' %]
 </head>
 
index 35a8410..32e7533 100644 (file)
@@ -4,13 +4,13 @@
 [% USE Price %]
 [% SET footerjs = 1 %]
 [% INCLUDE 'doc-head-open.inc' %]
-    <title>Summary for [% firstname %] [% surname %] ([% cardnumber %])</title>
+    <title>Summary for [% patron.firstname %] [% patron.surname %] ([% patron.cardnumber %])</title>
     [% INCLUDE 'doc-head-close.inc' %]
 </head>
 
 <body id="pat_moremember-print" class="pat">
     <div id="main">
-        <h3><a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% cardnumber %]">Account summary: [% firstname %] [% surname %] ([% cardnumber %])</a></h3>
+        <h3><a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% patron.cardnumber %]">Account summary: [% patron.firstname %] [% patron.surname %] ([% patron.cardnumber %])</a></h3>
 
         <ul>
             [% IF Koha.Preference( 'AddressFormat' ) %]
             [% ELSE %]
                 [% INCLUDE 'member-display-address-style-us.inc' %]
             [% END %]
-            <li>[% IF ( phone ) %][% phone %][% ELSE %](no phone number on file)[% END %]</li>
-            <li>[% IF ( email ) %][% email %][% ELSE %](no primary email on file)[% END %]</li>
-            [% IF ( emailpro ) %]
-                <li>[% emailpro %]</li>
+            <li>[% IF ( patron.phone ) %][% patron.phone %][% ELSE %](no phone number on file)[% END %]</li>
+            <li>[% IF ( patron.email ) %][% patron.email %][% ELSE %](no primary email on file)[% END %]</li>
+            [% IF ( patron.emailpro ) %]
+                <li>[% patron.emailpro %]</li>
             [% END %]
-            <li>Registration date: [% dateenrolled | $KohaDates %]</li>
-            <li>Expiration date: [% dateexpiry | $KohaDates %]</li>
-            <li>Library: [% Branches.GetName( branchcode ) %]</li>
-            <li>Category: [% description %]</li>
+            <li>Registration date: [% patron.dateenrolled | $KohaDates %]</li>
+            <li>Expiration date: [% patron.dateexpiry | $KohaDates %]</li>
+            <li>Library: [% Branches.GetName( patron.branchcode ) %]</li>
+            <li>Category: [% patron.category.description %]</li>
         </ul>
 
         [% IF ( issues ) %]
index 83bcff0..e1af48d 100644 (file)
@@ -54,7 +54,7 @@
 [% END %]
 <div class="yui-g">
 
-    [% IF ( was_renewed ) %]<div class="dialog message">Patron's account has been renewed until [% dateexpiry | $KohaDates %]</div>[% END %]
+    [% IF ( was_renewed ) %]<div class="dialog message">Patron's account has been renewed until [% patron.dateexpiry | $KohaDates %]</div>[% END %]
 
     [% IF fines %]
     <div id="circmessages" class="circmessage attention">
                 <a href="#reldebarments" id="view_restrictions">View restrictions</a>
             </li>
         [% END %]
-        [% IF ( gonenoaddress ) %]<li class="blocker">Patron's address is in doubt.</li>[% END %]
+        [% IF ( patron.gonenoaddress ) %]<li class="blocker">Patron's address is in doubt.</li>[% END %]
         [% IF ( lost ) %]<li class="blocker">Patron's card has been reported lost.</li>[% END %]
         </ul>
     </div>
     [% END %]
 <h3>[% UNLESS ( I ) %]
-   [% title | html %] [% firstname | html %] [% END %] [% surname | html %] ([% cardnumber | html %])</h3>
+   [% patron.title | html %] [% patron.firstname | html %] [% END %] [% patron.surname | html %] ([% patron.cardnumber | html %])</h3>
  <div class="yui-u first">
 <div id="patron-information" style="padding : .5em;">
 
-    [% IF ( othernames ) %]&ldquo;[% othernames | html %]&rdquo;[% END %]
+    [% IF ( patron.othernames ) %]&ldquo;[% patron.othernames | html %]&rdquo;[% END %]
 
     <div class = "address">
         [% IF Koha.Preference( 'AddressFormat' ) %]
                    
        <div class="rows">
     <ol>
-        [% IF ( phone ) %]<li><span class="label">Primary phone: </span><a href="tel:[% phone %]">[% phone | html %]</a></li>[% END %]
-        [% IF ( phonepro ) %]<li><span class="label">Secondary phone: </span><a href="tel:[% phonepro %]">[% phonepro | html %]</a></li>[% END %]
-        [% IF ( mobile ) %]<li><span class="label">Other phone: </span><a href="tel:[% mobile %]">[% mobile | html %]</a></li>[% END %]
-        [% IF ( fax ) %]<li><span class="label">Fax: </span>[% fax |html %]</li>[% END %]
-        [% IF ( email ) %]<li class="email"><span class="label">Primary email:</span><a title="[% email %]" href="mailto:[% email | url %]">[% email | html %]</a></li>[% END %]
-        [% IF ( emailpro ) %]<li class="email"><span class="label">Secondary email: </span><a title="[% emailpro %]" href="mailto:[% emailpro | url %]">[% emailpro | html %]</a></li>[% END %]
+        [% IF ( patron.phone ) %]<li><span class="label">Primary phone: </span><a href="tel:[% patron.phone %]">[% patron.phone | html %]</a></li>[% END %]
+        [% IF ( patron.phonepro ) %]<li><span class="label">Secondary phone: </span><a href="tel:[% patron.phonepro %]">[% patron.phonepro | html %]</a></li>[% END %]
+        [% IF ( patron.mobile ) %]<li><span class="label">Other phone: </span><a href="tel:[% patron.mobile %]">[% patron.mobile | html %]</a></li>[% END %]
+        [% IF ( patron.fax ) %]<li><span class="label">Fax: </span>[% patron.fax |html %]</li>[% END %]
+        [% IF ( patron.email ) %]<li class="email"><span class="label">Primary email:</span><a title="[% patron.email %]" href="mailto:[% patron.email | url %]">[% patron.email | html %]</a></li>[% END %]
+        [% IF ( patron.emailpro ) %]<li class="email"><span class="label">Secondary email: </span><a title="[% patron.emailpro %]" href="mailto:[% patron.emailpro | url %]">[% patron.emailpro | html %]</a></li>[% END %]
         [% UNLESS ( I ) %]
-            [% IF ( initials ) %]<li><span class="label">Initials: </span>[% initials | html %]</li>[% END %]
-            [% IF ( dateofbirth ) %]<li><span class="label">Date of birth:</span>[% dateofbirth | $KohaDates %] ([% age %] years)</li>[% END %]
-            [% IF ( sex ) %]<li><span class="label">Gender:</span>
-                [% IF ( sex == 'F' ) %]Female[% ELSIF ( sex == 'M' ) %]Male[% ELSE %][% sex %][% END %]
+            [% IF ( patron.initials ) %]<li><span class="label">Initials: </span>[% patron.initials | html %]</li>[% END %]
+            [% IF ( patron.dateofbirth ) %]<li><span class="label">Date of birth:</span>[% patron.dateofbirth | $KohaDates %] ([% age %] years)</li>[% END %]
+            [% IF ( patron.sex ) %]<li><span class="label">Gender:</span>
+                [% IF ( patron.sex == 'F' ) %]Female[% ELSIF ( patron.sex == 'M' ) %]Male[% ELSE %][% patron.sex %][% END %]
             </li>[% END %]
         [% END %]
         [% IF guarantees %]
 </div>
       <div class="action">
         [% IF ( guarantor.borrowernumber ) %]
-        <a href="memberentry.pl?op=modify&amp;borrowernumber=[% borrowernumber %]&amp;step=1&amp;guarantorid=[% guarantor.borrowernumber %]">Edit</a>
+        <a href="memberentry.pl?op=modify&amp;borrowernumber=[% patron.borrowernumber %]&amp;step=1&amp;guarantorid=[% guarantor.borrowernumber %]">Edit</a>
         [% ELSE %]
-        <a href="memberentry.pl?op=modify&amp;borrowernumber=[% borrowernumber %]&amp;step=1">Edit</a>
+        <a href="memberentry.pl?op=modify&amp;borrowernumber=[% patron.borrowernumber %]&amp;step=1">Edit</a>
         [% END %]</div>
 
 </div>
             <fieldset class="brief">
             [% IF ( picture ) %]
                 <legend>Manage patron image</legend>
-                <div class="hint">To update the image for [% title | html %] [% surname | html %], select a new image file and click 'Upload.' <br />Click the 'Delete' button to remove the current image.
+                <div class="hint">To update the image for [% patron.title | html %] [% patron.surname | html %], select a new image file and click 'Upload.' <br />Click the 'Delete' button to remove the current image.
             [% ELSE %]
                 <legend>Upload patron image</legend>
-                <div class="hint">[% title %] [% firstname | html %] [% surname | html %] does not currently have an image available. To import an image for [% title %] [% surname | html %], enter the name of an image file to upload.
+                <div class="hint">[% patron.title %] [% patron.firstname | html %] [% patron.surname | html %] does not currently have an image available. To import an image for [% patron.title %] [% patron.surname | html %], enter the name of an image file to upload.
             [% END %]
                     <br />Only PNG, GIF, JPEG, XPM formats are supported.
                 </div>
                 <input type="hidden" id="image" name="filetype" value="image" />
-                <input type="hidden" id="cardnumber" name="cardnumber" value="[% cardnumber | html %]" />
-                <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
+                <input type="hidden" id="cardnumber" name="cardnumber" value="[% patron.cardnumber | html %]" />
+                <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber %]" />
                 <ol>
                     <li>
                        <label for="uploadfile">Select the file to upload: </label><input type="file" id="uploadfile" name="uploadfile" />
                     <input type="hidden" name="csrf_token" value="[% csrf_token %]" />
                     <input type="submit" value="Upload" class="submit" />
                     <input name="op" type="hidden" value="Upload" />
-                    [% IF ( picture ) %]<a id="delpicture" href="/cgi-bin/koha/tools/picture-upload.pl?op=Delete&amp;borrowernumber=[% borrowernumber %]&amp;csrf_token=[% csrf_token %]" class="delete">Delete</a>[% END %]
+                    [% IF ( picture ) %]<a id="delpicture" href="/cgi-bin/koha/tools/picture-upload.pl?op=Delete&amp;borrowernumber=[% patron.borrowernumber %]&amp;csrf_token=[% csrf_token %]" class="delete">Delete</a>[% END %]
                 </fieldset>
             </fieldset>
         </form>
   </ol>
 </div>
 </div>
-<div class="action"><a href="memberentry.pl?op=modify&amp;borrowernumber=[% borrowernumber %]&amp;step=4">Edit</a></div>
+<div class="action"><a href="memberentry.pl?op=modify&amp;borrowernumber=[% patron.borrowernumber %]&amp;step=4">Edit</a></div>
 [% END %]
 
 [% IF ( ExtendedPatronAttributes ) %]
     </div>
 [% END %]
 </div>
-<div class="action"><a href="memberentry.pl?op=modify&amp;borrowernumber=[% borrowernumber %]&amp;step=4">Edit</a></div>
+<div class="action"><a href="memberentry.pl?op=modify&amp;borrowernumber=[% patron.borrowernumber %]&amp;step=4">Edit</a></div>
 [% END %]
 [% END %]
 
 <h3>Patron messaging preferences</h3>
 [% INCLUDE 'messaging-preference-form.inc' %]
  [% IF ( SMSSendDriver ) %]
-      <div class="rows"> <ol><li><span class="label">SMS number:</span><a href="sms:[% SMSnumber %]">[% SMSnumber %]</a>
+      <div class="rows"> <ol><li><span class="label">SMS number:</span><a href="sms:[% patron.smsalertnumber %]">[% patron.smsalertnumber %]</a>
      </li></ol></div>
  [% END %]
 </div>
-<div class="action"><a href="memberentry.pl?op=modify&amp;borrowernumber=[% borrowernumber %]&amp;step=5">Edit</a></div>
+<div class="action"><a href="memberentry.pl?op=modify&amp;borrowernumber=[% patron.borrowernumber %]&amp;step=5">Edit</a></div>
 [% END %]
 
 </div>
  <h3>Library use</h3>
 <div class="rows"> 
 <ol>
-    <li><span class="label">Card number: </span>[% cardnumber %]</li>
-       <li><span class="label">Borrowernumber: </span> [% borrowernumber %]</li>
-    <li><span class="label">Category: </span>[% categoryname %] ([% categorycode %])</li>
-    <li><span class="label">Registration date: </span>[% dateenrolled | $KohaDates %]</li>
+    <li><span class="label">Card number: </span>[% patron.cardnumber %]</li>
+    <li><span class="label">Borrowernumber: </span> [% patron.borrowernumber %]</li>
+    <li><span class="label">Category: </span>[% patron.category.description %] ([% patron.categorycode %])</li>
+    <li><span class="label">Registration date: </span>[% patron.dateenrolled | $KohaDates %]</li>
     
     <li><span class="label">Expiration date: </span>
     [% IF ( was_renewed ) %]
-            <strong class="reregistrinfo">[% dateexpiry | $KohaDates %]</strong>
+            <strong class="reregistrinfo">[% patron.dateexpiry | $KohaDates %]</strong>
     [% ELSE %]
-            [% dateexpiry | $KohaDates %]
+            [% patron.dateexpiry | $KohaDates %]
     [% END %]
     </li>
     
         [% END %]
     </li>
 
-    [% IF ( sort1 ) %]<li><span class="label">Sort field 1:</span>[% AuthorisedValues.GetByCode('Bsort1', sort1) |html %]</li>[% END %]
-    [% IF ( sort2 ) %]<li><span class="label">Sort field 2:</span>[% AuthorisedValues.GetByCode('Bsort2', sort2) |html %]</li>[% END %]
-    <li><span class="label">Username: </span>[% userid |html  %]</li>
+    [% IF ( patron.sort1 ) %]<li><span class="label">Sort field 1:</span>[% AuthorisedValues.GetByCode('Bsort1', patron.sort1) |html %]</li>[% END %]
+    [% IF ( patron.sort2 ) %]<li><span class="label">Sort field 2:</span>[% AuthorisedValues.GetByCode('Bsort2', patron.sort2) |html %]</li>[% END %]
+    <li><span class="label">Username: </span>[% patron.userid |html  %]</li>
     <li><span class="label">Password: </span>
-    [% IF ( password ) %]
+    [% IF ( patron.password ) %]
         *******
     [% ELSE %]
-        <span class="problem"><a href="/cgi-bin/koha/members/member-password.pl?member=[% borrowernumber %]">Undefined</a></span>
+        <span class="problem"><a href="/cgi-bin/koha/members/member-password.pl?member=[% patron.borrowernumber %]">Undefined</a></span>
     [% END %] 
     </li>
-    [% IF ( borrowernotes ) %]<li><span class="label">Circulation note: </span>[% borrowernotes |html %]</li>[% END %]
-    [% IF ( opacnote ) %]<li><span class="label">OPAC note:</span>[% opacnote |html %]</li>[% END %]
+    [% IF ( patron.borrowernotes ) %]<li><span class="label">Circulation note: </span>[% patron.borrowernotes |html %]</li>[% END %]
+    [% IF ( patron.opacnote ) %]<li><span class="label">OPAC note:</span>[% patron.opacnote |html %]</li>[% END %]
     [% IF Koha.Preference( 'NorwegianPatronDBEnable' ) == 1 %]
         [% IF ( sync == 1 ) %]
             <li><span class="label">Activate sync: </span>Yes</li>
     [% END %]
     [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
       <li><span class="label">Check previous checkouts: </span>
-        [% IF ( checkprevcheckout == 'yes' ) %]
+        [% IF ( patron.checkprevcheckout == 'yes' ) %]
         Yes
-        [% ELSIF ( checkprevcheckout == 'no' ) %]
+        [% ELSIF ( patron.checkprevcheckout == 'no' ) %]
         No
         [% ELSE %]
         Inherited
     [% IF Koha.Preference('TranslateNotices') %]
         <li>
             <span class="label">Preferred language for notices: </span>
-            [% translated_language %]
+            [% patron.translated_language %]
         </li>
     [% END %]
        </ol>
        </div>
  </div>
-    <div class="action"><a href="memberentry.pl?op=modify&amp;borrowernumber=[% borrowernumber %]&amp;step=3">Edit</a></div>
+    <div class="action"><a href="memberentry.pl?op=modify&amp;borrowernumber=[% patron.borrowernumber %]&amp;step=3">Edit</a></div>
  
  <div id="patron-alternate-address" style="padding-top: 1em;">
     <h3>Alternate address</h3>
     [% END %]
 
     <div class="rows">  <ol>
-      [% IF ( B_phone ) %]<li><span class="label">Phone: </span><a href="tel:[% B_phone %]">[% B_phone |html  %]</a></li>[% END %]
-      [% IF ( B_email ) %]<li class="email"><span class="label">Email: </span><a title="[% B_email %]" href="mailto:[% B_email | url %]">[% B_email |html %]</a></li>[% END %]
-      [% IF ( contactnote ) %]<li><span class="label">Contact note: </span> [% contactnote |html %]</li>[% END %]
+      [% IF ( patron.B_phone ) %]<li><span class="label">Phone: </span><a href="tel:[% patron.B_phone %]">[% patron.B_phone |html  %]</a></li>[% END %]
+      [% IF ( patron.B_email ) %]<li class="email"><span class="label">Email: </span><a title="[% patron.B_email %]" href="mailto:[% patron.B_email | url %]">[% B_email |html %]</a></li>[% END %]
+      [% IF ( patron.contactnote ) %]<li><span class="label">Contact note: </span> [% patron.contactnote |html %]</li>[% END %]
       </ol>
     </div>
 </div>
-<div class="action"><a href="memberentry.pl?op=modify&amp;borrowernumber=[% borrowernumber %]&amp;step=6">Edit</a></div>
+<div class="action"><a href="memberentry.pl?op=modify&amp;borrowernumber=[% patron.borrowernumber %]&amp;step=6">Edit</a></div>
 
  <div id="patron-alternative-contact" style="padding-top: 1em;">
  <h3>Alternative contact</h3>
-   <div class="rows"> <ol><li><span class="label">Surname: </span>[% altcontactsurname | html %]</li>
-    <li><span class="label">First name: </span>[% altcontactfirstname | html %]</li>
-    <li><span class="label">Address: </span>[% altcontactaddress1 | html %]</li>
-    <li><span class="label">Address 2: </span>[% altcontactaddress2 | html %]</li>
-       <li><span class="label">City: </span>[% altcontactaddress3 | html %]</li>
-    [% IF ( altcontactstate ) %]<li><span class="label">State: </span>[% altcontactstate | html %]</li>[% END %]
-    <li><span class="label">ZIP/Postal code: </span>[% altcontactzipcode | html %]</li>
-       [% IF ( altcontactcountry ) %]<li><span class="label">Country: </span>[% altcontactcountry | html %]</li>[% END %]
-    [% IF ( altcontactphone ) %]<li><span class="label">Phone: </span><a href="tel:[% altcontactphone | url %]">[% altcontactphone | html %]</a></li>[% END %]
+   <div class="rows"> <ol><li><span class="label">Surname: </span>[% patron.altcontactsurname | html %]</li>
+    <li><span class="label">First name: </span>[% patron.altcontactfirstname | html %]</li>
+    <li><span class="label">Address: </span>[% patron.altcontactaddress1 | html %]</li>
+    <li><span class="label">Address 2: </span>[% patron.altcontactaddress2 | html %]</li>
+       <li><span class="label">City: </span>[% patron.altcontactaddress3 | html %]</li>
+    [% IF ( patron.altcontactstate ) %]<li><span class="label">State: </span>[% patron.altcontactstate | html %]</li>[% END %]
+    <li><span class="label">ZIP/Postal code: </span>[% patron.altcontactzipcode | html %]</li>
+       [% IF ( patron.altcontactcountry ) %]<li><span class="label">Country: </span>[% patron.altcontactcountry | html %]</li>[% END %]
+    [% IF ( patron.altcontactphone ) %]<li><span class="label">Phone: </span><a href="tel:[% patron.altcontactphone | url %]">[% patron.altcontactphone | html %]</a></li>[% END %]
     </ol></div>
 </div>
-<div class="action"><a href="memberentry.pl?op=modify&amp;borrowernumber=[% borrowernumber %]&amp;step=2">Edit</a></div>
+<div class="action"><a href="memberentry.pl?op=modify&amp;borrowernumber=[% patron.borrowernumber %]&amp;step=2">Edit</a></div>
 
 </div>
 </div>
     <fieldset class="action">
         <form action="/cgi-bin/koha/reserve/modrequest_suspendall.pl" method="post">
             <input type="hidden" name="from" value="borrower" />
-            <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
+            <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber %]" />
             <input type="submit" value="Suspend all holds" />
 
             [% IF Koha.Preference('AutoResumeSuspendedHolds') %]
     <fieldset class="action">
         <form action="/cgi-bin/koha/reserve/modrequest_suspendall.pl" method="post">
             <input type="hidden" name="from" value="borrower" />
-            <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
+            <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber %]" />
             <input type="hidden" name="suspend" value="0" />
             <input type="submit" value="Resume all suspended holds" />
        </form>
         /* Set some variable needed in circulation.js */
         var interface = "[% interface %]";
         var theme = "[% theme %]";
-        var borrowernumber = "[% borrowernumber %]";
+        var borrowernumber = "[% patron.borrowernumber %]";
         var branchcode = "[% Branches.GetLoggedInBranchcode() %]";
         var exports_enabled = "[% Koha.Preference('ExportCircHistory') %]";
         var AllowCirculate = [% (CAN_user_circulate_circulate_remaining_permissions)? 1 : 0 %]
index ba6b33e..18e64fc 100644 (file)
@@ -4,7 +4,7 @@
 [% USE Price %]
 [% SET footerjs = 1 %]
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Koha &rsaquo; Patrons &rsaquo; Pay Fines for  [% borrower.firstname |html %] [% borrower.surname |html %]</title>
+<title>Koha &rsaquo; Patrons &rsaquo; Pay Fines for  [% patron.firstname |html %] [% patron.surname |html %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
 </head>
 
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'patron-search.inc' %]
 
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo; Pay fines for [% borrower.firstname |html %] [% borrower.surname |html %]</div>
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo; Pay fines for [% patron.firstname |html %] [% patron.surname |html %]</div>
 
 <div id="doc3" class="yui-t2">
    
    <div id="bd">
        <div id="yui-main">
        <div class="yui-b">
-[% INCLUDE 'members-toolbar.inc' borrowernumber=borrower.borrowernumber %]
+[% INCLUDE 'members-toolbar.inc' borrowernumber=patron.borrowernumber %]
 
 <!-- The manual invoice and credit buttons -->
 <div class="statictabs">
 <ul>
-       <li><a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrower.borrowernumber %]">Account</a></li>
-    <li class="active"><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrower.borrowernumber %]" >Pay fines</a></li>
-       <li><a href="/cgi-bin/koha/members/maninvoice.pl?borrowernumber=[% borrower.borrowernumber %]" >Create manual invoice</a></li>
-       <li><a href="/cgi-bin/koha/members/mancredit.pl?borrowernumber=[% borrower.borrowernumber %]" >Create manual credit</a></li>
+    <li><a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber %]">Account</a></li>
+    <li class="active"><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber %]" >Pay fines</a></li>
+    <li><a href="/cgi-bin/koha/members/maninvoice.pl?borrowernumber=[% patron.borrowernumber %]" >Create manual invoice</a></li>
+    <li><a href="/cgi-bin/koha/members/mancredit.pl?borrowernumber=[% patron.borrowernumber %]" >Create manual credit</a></li>
 </ul>
 <div class="tabs-container">
 
 [% IF ( accounts ) %]
     <form action="/cgi-bin/koha/members/pay.pl" method="post" id="pay-fines-form">
-       <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrower.borrowernumber %]" />
+    <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber %]" />
 <p><span class="checkall"><a id="CheckAll" href="#"><i class="fa fa-check"></i> Select all</a></span> | <span class="clearall"><a id="CheckNone" href="#"><i class="fa fa-remove"></i> Clear all</a></span></p>
 <table id="finest">
 <thead>
 <input type="submit" id="paycollect" name="paycollect"  value="Pay amount" class="submit" />
 [% IF CAN_user_updatecharges_writeoff %]<input type="submit" name="woall"  id="woall" value="Write off all" class="submit" />[% END %]
 <input type="submit" id="payselected" name="payselected"  value="Pay selected" class="submit" />
-<a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrower.borrowernumber %]">Cancel</a>
+<a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber %]">Cancel</a>
 </fieldset>
 </form>
-[% ELSE %]
-    <p>[% borrower.firstname |html %] [% borrower.surname |html %] has no outstanding fines.</p>
+    <p>[% patron.firstname |html %] [% patron.surname |html %] has no outstanding fines.</p>
 [% END %]
 </div></div>
 
index 5813bab..39df143 100644 (file)
@@ -2,37 +2,37 @@
 [% USE Branches %]
 [% SET footerjs = 1 %]
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Koha &rsaquo; Patrons &rsaquo; Collect fine payment for  [% borrower.firstname %] [% borrower.surname %]</title>
+<title>Koha &rsaquo; Patrons &rsaquo; Collect fine payment for  [% patron.firstname %] [% patron.surname %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
 </head>
 
 <body id="pat_paycollect" class="pat">
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'patron-search.inc' %]
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo; <a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrower.borrowernumber %]">Pay fines for [% borrower.firstname %] [% borrower.surname %]</a> &rsaquo; [% IF ( pay_individual ) %]Pay an individual fine[% ELSIF ( writeoff_individual ) %]Write off an individual fine[% ELSE %][% IF ( selected_accts ) %]Pay an amount toward selected fines[% ELSE %]Pay an amount toward all fines[% END %][% END %]</div>
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo; <a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber %]">Pay fines for [% patron.firstname %] [% patron.surname %]</a> &rsaquo; [% IF ( pay_individual ) %]Pay an individual fine[% ELSIF ( writeoff_individual ) %]Write off an individual fine[% ELSE %][% IF ( selected_accts ) %]Pay an amount toward selected fines[% ELSE %]Pay an amount toward all fines[% END %][% END %]</div>
 
 <div id="doc3" class="yui-t2">
 
 <div id="bd">
 <div id="yui-main">
 <div class="yui-b">
-[% INCLUDE 'members-toolbar.inc' borrowernumber=borrower.borrowernumber %]
+[% INCLUDE 'members-toolbar.inc' borrowernumber=patron.borrowernumber %]
 
 
 <!-- The manual invoice and credit buttons -->
 <div class="statictabs">
 <ul>
     <li>
-    <a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrower.borrowernumber %]">Account</a>
+    <a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber %]">Account</a>
     </li>
     <li class="active">
-    <a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrower.borrowernumber %]" >Pay fines</a>
+    <a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber %]" >Pay fines</a>
     </li>
     <li>
-    <a href="/cgi-bin/koha/members/maninvoice.pl?borrowernumber=[% borrower.borrowernumber %]" >Create manual invoice</a>
+    <a href="/cgi-bin/koha/members/maninvoice.pl?borrowernumber=[% patron.borrowernumber %]" >Create manual invoice</a>
     </li>
     <li>
-    <a href="/cgi-bin/koha/members/mancredit.pl?borrowernumber=[% borrower.borrowernumber %]" >Create manual credit</a>
+    <a href="/cgi-bin/koha/members/mancredit.pl?borrowernumber=[% patron.borrowernumber %]" >Create manual credit</a>
     </li>
 </ul>
 <div class="tabs-container">
@@ -45,7 +45,7 @@
 [% IF ( pay_individual ) %]
     <form name="payindivfine" id="payindivfine" method="post" action="/cgi-bin/koha/members/paycollect.pl">
     <input type="hidden" name="csrf_token" value="[% csrf_token %]" />
-    <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrower.borrowernumber %]" />
+    <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber %]" />
     <input type="hidden" name="pay_individual" id="pay_individual" value="[% pay_individual %]" />
     <input type="hidden" name="itemnumber" id="itemnumber" value="[% itemnumber %]" />
     <input type="hidden" name="description" id="description" value="[% description %]" />
 </fieldset>
 
     <div class="action"><input type="submit" name="submitbutton" value="Confirm" />
-        <a class="cancel" href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrower.borrowernumber %]">Cancel</a></div>
+        <a class="cancel" href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber %]">Cancel</a></div>
     </form>
 [% ELSIF ( writeoff_individual ) %]
     <form name="woindivfine" id="woindivfine" action="/cgi-bin/koha/members/pay.pl" method="post" >
     <input type="hidden" name="csrf_token" value="[% csrf_token %]" />
     <fieldset class="rows">
     <legend>Write off an individual fine</legend>
-    <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrower.borrowernumber %]" />
+    <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber %]" />
     <input type="hidden" name="pay_individual" id="pay_individual" value="[% pay_individual %]" />
     <input type="hidden" name="itemnumber" id="itemnumber" value="[% itemnumber %]" />
     <input type="hidden" name="description" id="description" value="[% description %]" />
             </ol>
         </fieldset>
         <div class="action"><input type="submit" name="confirm_writeoff" id="confirm_writeoff" value="Write off this charge" />
-        <a class="cancel" href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrower.borrowernumber %]">Cancel</a></div>
+        <a class="cancel" href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber %]">Cancel</a></div>
     </form>
 [% ELSE %]
 
     <form name="payfine" id="payfine" method="post" action="/cgi-bin/koha/members/paycollect.pl">
     <input type="hidden" name="csrf_token" value="[% csrf_token %]" />
-    <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrower.borrowernumber %]" />
+    <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber %]" />
     <input type="hidden" name="selected_accts" id="selected_accts" value="[% selected_accts %]" />
     <input type="hidden" name="total" id="total" value="[% total %]" />
 
     </ol>
     </fieldset>
     <div class="action"><input type="submit" name="submitbutton" value="Confirm" />
-        <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrower.borrowernumber %]">Cancel</a></div>
+        <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber %]">Cancel</a></div>
     </form>
 [% END %]
 </div></div>
index 5027672..a6c5a3a 100644 (file)
@@ -1,8 +1,9 @@
 [% USE Koha %]
 [% USE KohaDates %]
+[% USE Branches %]
 [% SET footerjs = 1 %]
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Print receipt for [% cardnumber %]</title>
+<title>Print receipt for [% patron.cardnumber %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/printreceiptinvoice_[% KOHA_VERSION %].css" />
 [% INCLUDE 'blocking_errors.inc' %]
  </tr>
  <tr>
     <th colspan=4 class="centerednames">
-               [% IF ( branchname ) %]<h2>[% branchname %]</h2>[% END %]
+        <h2>[% Branches.GetName( patron.branchcode ) %]</h2>
        </th>
  </tr>
  <tr>
     <th colspan=4 >
-               Received with thanks from  [% firstname %] [% surname %] <br />
-        Card number : [% cardnumber %]<br />
+        Received with thanks from  [% patron.firstname %] [% patron.surname %] <br />
+        Card number : [% patron.cardnumber %]<br />
        </th>
  </tr>
   <tr>
index acb8fd2..62fb69d 100644 (file)
@@ -1,7 +1,8 @@
 [% USE Koha %]
+[% USE Branches %]
 [% SET footerjs = 1 %]
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Print receipt for [% cardnumber %]</title>
+<title>Print receipt for [% patron.cardnumber %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/printreceiptinvoice_[% KOHA_VERSION %].css" />
 </head>
   </tr>
   <tr>
     <th colspan="5" class="centerednames">
-               [% IF ( branchname ) %]<h2>[% branchname %]</h2>[% END %]
+        <h2>[% Branches.GetName( patron.branchcode ) %]</h2>
        </th>
   </tr>
   <tr>
     <th colspan="5" >
-        Bill to: [% firstname %] [% surname %] <br />
-        Card number: [% cardnumber %]<br />
+        Bill to: [% patron.firstname %] [% patron.surname %] <br />
+        Card number: [% patron.cardnumber %]<br />
        </th>
   </tr>
   <tr>
index 5484c2f..f95c009 100644 (file)
@@ -27,7 +27,7 @@
                 <h2>Purchase suggestions</h2>
 
                 <div id="toolbar" class="btn-toolbar">
-                    <a class="btn btn-default btn-sm" id="newsuggestion" href="/cgi-bin/koha/suggestion/suggestion.pl?op=add&amp;suggestedby=[% borrowernumber %]&amp;redirect=purchase_suggestions&amp;borrowernumber=[% borrowernumber %]"><i class="fa fa-plus"></i> New purchase suggestion</a>
+                    <a class="btn btn-default btn-sm" id="newsuggestion" href="/cgi-bin/koha/suggestion/suggestion.pl?op=add&amp;suggestedby=[% patron.borrowernumber %]&amp;redirect=purchase_suggestions&amp;borrowernumber=[% patron.borrowernumber %]"><i class="fa fa-plus"></i> New purchase suggestion</a>
                 </div>
 
                 [% IF suggestions %]
index 8ca27f4..dd32e0c 100644 (file)
     <div class="dialog alert">Staff members are not allowed to access patron's checkout history</div>
 [% ELSIF is_anonymous %]
     <div class="dialog alert">This is the anonymous patron, so no circulation history is displayed. To get a list of anonymized loans, please run a report.</div>
-[% ELSIF ( privacy == 2)  %]
+[% ELSIF ( patron.privacy == 2)  %]
     <div class="dialog message">This patron has set the privacy rules to never keeping a circulation history.</div>
 [% ELSIF ( !loop_reading ) %]
     <div class="dialog message">This patron has no circulation history.</div>
 [% ELSE %]
-<form action="/cgi-bin/koha/members/readingrec.pl" method="get"><input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber %]" /></form>
+<form action="/cgi-bin/koha/members/readingrec.pl" method="get"><input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber %]" /></form>
 
 
 <div id="tabs" class="toptabs">
index 1cec765..1959e2f 100644 (file)
@@ -57,7 +57,7 @@
                       </strong>
                     </a>
                     <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
-                    <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
+                    <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber %]" />
                   </td>
                 </tr>
                 [% END %]
@@ -67,7 +67,7 @@
           [% ELSE %]
           <p>Patron does not belong to any subscription routing lists.</p>
           <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
-                    <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
+                    <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber %]" />
                     [% END %]
 
 </div>
index 1cd3618..8504cf5 100644 (file)
@@ -17,7 +17,7 @@
 <script type="text/javascript">
     // <![CDATA[
 var MSG_CONFIRM_DELETE_HOLD   = _("Are you sure you want to cancel this hold?");
-var patron_homebranch = "[% Branches.GetName( borrower_branchcode ) |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]";
+var patron_homebranch = "[% Branches.GetName( patron.branchcode ) |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]";
 var override_items = {[% FOREACH bibitemloo IN bibitemloop %][% FOREACH itemloo IN bibitemloo.itemloop %][% IF ( itemloo.override ) %]
     [% itemloo.itemnumber %]: {
         homebranch: "[% Branches.GetName( itemloo.homebranch ) |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
@@ -195,7 +195,7 @@ function checkMultiHold() {
     });
 
 
-[% UNLESS ( borrowernumber || borrowers || noitems ) %]
+[% UNLESS ( patron || patron.borrowernumber || borrowers || noitems ) %]
     [% IF ( CircAutocompl ) %]
     $( "#patron" ).autocomplete({
         source: "/cgi-bin/koha/circ/ysearch.pl",
@@ -265,7 +265,7 @@ function checkMultiHold() {
     <h1>Confirm holds</h1>
   [% END %]
 
-  [% UNLESS borrowernumber OR noitems %]
+  [% UNLESS patron OR patron.borrowernumber OR noitems %]
     [% IF ( messageborrower ) %]
       <div class="dialog alert"><h3>Patron not found</h3><p>No patron with this name, please, try another</p> </div>
     [% END %]
@@ -298,29 +298,29 @@ function checkMultiHold() {
       <h3>Cannot place hold</h3>
       <ul>
         [% IF ( exceeded_maxreserves ) %]
-          <li><strong>Too many holds: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borrowerfirstname %] [% borrowersurname %] </a> can only place a maximum of [% maxreserves %] total holds.</li>
+          <li><strong>Too many holds: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber %]">[% patron.firstname %] [% patron.surname %] </a> can only place a maximum of [% maxreserves %] total holds.</li>
         [% ELSIF ( exceeded_holds_per_record ) %]
-          <li><strong>Too many holds for this record: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borrowerfirstname %] [% borrowersurname %] </a> can only place a maximum of [% max_holds_for_record %] hold(s) on this record.</li>
+          <li><strong>Too many holds for this record: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber %]">[% patron.firstname %] [% patron.surname %] </a> can only place a maximum of [% max_holds_for_record %] hold(s) on this record.</li>
         [% ELSIF ( alreadypossession ) %]
-          <li> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borrowerfirstname %] [% borrowersurname %]</a> <strong>is already in possession</strong> of one item.</li>
+          <li> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber %]">[% patron.firstname %] [% patron.surname %]</a> <strong>is already in possession</strong> of one item.</li>
         [% ELSIF ( alreadyreserved ) %]
-          <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borrowerfirstname %] [% borrowersurname %]</a> <strong>already has a hold</strong> on this item.</li>
+          <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber %]">[% patron.firstname %] [% patron.surname %]</a> <strong>already has a hold</strong> on this item.</li>
         [% ELSIF ( ageRestricted ) %]
           <li><strong>Age restricted</strong></li>
         [% ELSIF ( none_available ) %]
           <li> <strong>No items are available</strong> to be placed on hold.</li>
         [% ELSIF ( maxreserves ) %]
-          <li><strong>Too many holds: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borrowerfirstname %] [% borrowersurname %] </a> has too many holds.</li>
+          <li><strong>Too many holds: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber %]">[% patron.firstname %] [% patron.surname %] </a> has too many holds.</li>
         [% END %]
       </ul>
     [% ELSE %]
         <h3>Cannot place hold on some items</h3>
         [% IF ( exceeded_maxreserves ) %]
-          <li><strong>Too many holds: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borrowerfirstname %] [% borrowersurname %] </a> can place [% new_reserves_allowed %] of the requested [% new_reserves_count %] holds for a maximum of [% maxreserves %] total holds.</li>
+          <li><strong>Too many holds: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber %]">[% patron.firstname %] [% patron.surname %] </a> can place [% new_reserves_allowed %] of the requested [% new_reserves_count %] holds for a maximum of [% maxreserves %] total holds.</li>
         [% ELSIF ( exceeded_holds_per_record ) %]
             [% FOREACH biblioloo IN biblioloop %]
                 [% IF (biblioloo.tooManyHoldsForThisRecord) %]
-                    <li><strong>Too many holds for <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber %]"> [% biblioloo.title %]</a>: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borrowerfirstname %] [% borrowersurname %] </a> can only place a maximum of [% max_holds_for_record %] hold(s) on this record.</li>
+                    <li><strong>Too many holds for <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber %]"> [% biblioloo.title %]</a>: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber %]">[% patron.firstname %] [% patron.surname %] </a> can only place a maximum of [% max_holds_for_record %] hold(s) on this record.</li>
                 [% END %]
             [% END %]
         [% END %]
@@ -329,22 +329,22 @@ function checkMultiHold() {
     </div>
 [% END %]
 
-[% IF ( expiry || diffbranch || restricted || ( amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') ) ) %]
+[% IF ( expiry || diffbranch || patron.is_debarred || ( amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') ) ) %]
 <div class="dialog message"><ul>
     [% IF ( expiry ) %]
-    <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borrowerfirstname %] [% borrowersurname %]</a>: <strong>Account has expired</strong></li>
+    <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber %]">[% patron.firstname %] [% patron,surname %]</a>: <strong>Account has expired</strong></li>
     [% END %]
 
-    [% IF restricted %]
-    <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]#reldebarments">[% borrowerfirstname %] [% borrowersurname %]</a>: <strong>Patron has restrictions</strong></li>
+    [% IF patron.is_debarred %]
+    <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber %]#reldebarments">[% patron.firstname %] [% patron.surname %]</a>: <strong>Patron has restrictions</strong></li>
     [% END %]
 
     [% IF amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') %]
-    <li><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrowernumber %]">[% borrowerfirstname %] [% borrowersurname %]</a>: <strong>Patron has outstanding fines: [% amount_outstanding | format('%.2f') %]</strong></li>
+    <li><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber %]">[% patron.firstname %] [% patron.surname %]</a>: <strong>Patron has outstanding fines: [% amount_outstanding | format('%.2f') %]</strong></li>
     [% END %]
 
     [% IF ( diffbranch ) %]
-    <li> <strong>Pickup library is different. </strong>Patron: <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borrowerfirstname %] [% borrowersurname %]</a> Patron's home library: ([% Branches.GetName(borrower_branchcode) %] / [% borrower_branchcode %] )</li>
+    <li> <strong>Pickup library is different. </strong>Patron: <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber %]">[% patron.firstname %] [% patron.surname %]</a> Patron's home library: ([% Branches.GetName(patron.branchcode) %] / [% patron.branchcode %] )</li>
     [% END %]
 
 </ul></div>
@@ -362,7 +362,7 @@ function checkMultiHold() {
             <form action="placerequest.pl" method="post" onsubmit="return checkMultiHold();" name="form">
         [% END %]
 
-        <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
+        <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber %]" />
         <input type="hidden" name="type" value="str8" />
 
         [% IF ( multi_hold ) %]
@@ -381,8 +381,8 @@ function checkMultiHold() {
         [% END %]
 
        <ol> <li><span class="label">Patron:</span>
-            [% IF ( borrowernumber ) %]
-                <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borrowerfirstname %] [% borrowersurname %] ([% cardnumber %])</a>
+            [% IF ( patron.borrowernumber ) %]
+                <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber %]">[% patron.firstname %] [% patron.surname %] ([% cardnumber %])</a>
             [% ELSE %]
                 Not defined yet
             [% END %]
@@ -459,7 +459,7 @@ function checkMultiHold() {
 </ol>
    [% UNLESS ( multi_hold ) %]
         <fieldset class="action">
-            [% IF ( borrowernumber ) %]
+            [% IF ( patron.borrowernumber ) %]
                 [% IF ( override_required ) %]
                     <input type="submit" class="warning" value="Place hold" />
                 [% ELSIF ( none_available ) %]
@@ -596,9 +596,9 @@ function checkMultiHold() {
                             Can't be cancelled when item is in transit
                     [% ELSE %]
                     [% IF ( itemloo.waitingdate ) %]Waiting[% ELSE %]On hold[% END %]
-                    [% IF ( itemloo.canreservefromotherbranches ) %]for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% itemloo.ReservedForBorrowernumber %]">[% itemloo.ReservedForFirstname %] [% itemloo.ReservedForSurname %]</a>[% END %] [% IF ( itemloo.waitingdate ) %]at[% ELSE %]expected at[% END %] [% Branches.GetName( itemloo.ExpectedAtLibrary ) %]
+                    [% IF ( itemloo.canreservefromotherbranches ) %]for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% itemloo.ReservedFor.borrowernumber %]">[% itemloo.ReservedFor.firstname %] [% itemloo.ReservedFor.surname %]</a>[% END %] [% IF ( itemloo.waitingdate ) %]at[% ELSE %]expected at[% END %] [% Branches.GetName( itemloo.ExpectedAtLibrary ) %]
                     since
-                    [% IF ( itemloo.waitingdate ) %][% itemloo.waitingdate | $KohaDates %][% ELSE %][% IF ( itemloo.reservedate ) %][% itemloo.reservedate %][% END %][% END %]. <a class="info" href="modrequest.pl?CancelBiblioNumber=[% itemloo.biblionumber %]&amp;CancelBorrowerNumber=[% itemloo.ReservedForBorrowernumber %]&amp;CancelItemnumber=[% itemloo.itemnumber %]"  onclick="return confirmDelete(MSG_CONFIRM_DELETE_HOLD);">Cancel hold</a>
+                    [% IF ( itemloo.waitingdate ) %][% itemloo.waitingdate | $KohaDates %][% ELSE %][% IF ( itemloo.reservedate ) %][% itemloo.reservedate %][% END %][% END %]. <a class="info" href="modrequest.pl?CancelBiblioNumber=[% itemloo.biblionumber %]&amp;CancelBorrowerNumber=[% itemloo.ReservedFor.borrowernumber %]&amp;CancelItemnumber=[% itemloo.itemnumber %]"  onclick="return confirmDelete(MSG_CONFIRM_DELETE_HOLD);">Cancel hold</a>
 
                     [% END %]
                 [% ELSE %]
@@ -672,7 +672,7 @@ function checkMultiHold() {
             [% END %]
 
           [% IF ( biblioloo.alreadyres ) %]
-              <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borrowerfirstname %] [% borrowersurname %]</a> <strong>already has a hold</strong> on this item </li>
+              <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber %]">[% patron.firstname %] [% patron.surname %]</a> <strong>already has a hold</strong> on this item </li>
           [% END %]
           [% IF ( biblioloo.none_avail ) %]
               <li> <strong>No items are available</strong> to be placed on hold</li>
@@ -694,7 +694,7 @@ function checkMultiHold() {
   [% END %]<!-- /multi_hold -->
 
     <fieldset class="action">
-        [% IF ( borrowernumber ) %]
+        [% IF ( patron AND patron.borrowernumber ) %]
             [% IF ( override_required ) %]
                 <input type="submit" class="warning" value="Place hold" />
             [% ELSIF ( none_available ) %]
@@ -708,7 +708,7 @@ function checkMultiHold() {
        </fieldset>
 [% END %]
 
-[% UNLESS ( borrowernumber ) %]
+[% UNLESS ( patron ) %]
 [% IF ( reserveloop ) %]
 <form name="T[% time %]" action="modrequest.pl" method="post">
   [% IF ( multi_hold ) %]
index 453d71c..5cf457b 100644 (file)
@@ -45,7 +45,7 @@
     <tbody>[% FOREACH review IN reviews %]
     <tr>
         <td>
-            [% IF ( review.borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% review.borrowernumber %]">[% review.surname %], [% review.firstname %]</a>[% ELSE %](deleted patron)[% END %]
+            [% IF ( review.borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% review.borrowernumber %]">[% review.patron.surname %], [% review.patron.firstname %]</a>[% ELSE %](deleted patron)[% END %]
         </td>
         <td>
             <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% review.biblionumber %]">[% review.bibliotitle %]</a>
index e472146..0223844 100644 (file)
                                 <tr>
                                     <td>[% loopro.timestamp %]</td>
                                     <td>
-                                        <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loopro.user %]" title="display detail for this librarian."> [% IF ( loopro.userfirstname ) || ( loopro.usersurname ) %][% loopro.userfirstname %] [% loopro.usersurname %] ([% loopro.user %]) [% ELSE %][% loopro.user %][% END %]</a>
+                                        [% IF loopro.librarian %]
+                                            <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loopro.librarian.borrowernumber %]" title="display detail for this librarian."> [% IF ( loopro.librarian.firstname ) || ( loopro.librarian.surname ) %][% loopro.librarian.firstname %] [% loopro.librarian.surname %] ([% loopro.librarian.borrowernumber %]) [% ELSE %][% loopro.librarian.borrowernumber %][% END %]</a>
+                                        [% ELSE %]
+                                            [% loopro.user %]
+                                        [% END %]
                                     </td>
                                     <td>[% PROCESS translate_log_module module=loopro.module %]</td>
                                     <td>[% PROCESS translate_log_action action=loopro.action %]</td>
                                     <td>
                                         [% IF ( loopro.module == 'MEMBERS' ) || ( loopro.module == 'CIRCULATION' ) || ( loopro.module == 'FINES' ) %]
-                                             <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loopro.object %]" title="Display member details."> [% IF ( loopro.object ) %][% IF ( loopro.borrowerfirstname ) || ( loopro.borrowersurname ) %][% loopro.borrowerfirstname %] [% loopro.borrowersurname %] ([% loopro.object %]) [% ELSE %]Member [% loopro.object %][% END %][% END %] </a>
+                                            [% IF loopro.patron %]
+                                                <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loopro.object %]" title="Display member details."> [% IF ( loopro.object ) %][% IF ( loopro.patron.firstname ) || ( loopro.patron.surname ) %][% loopro.patron.firstname %] [% loopro.patron.surname %] ([% loopro.object %]) [% ELSE %]Member [% loopro.object %][% END %][% END %] </a>
+                                            [% ELSE %]
+                                                [% loopro.object %]
+                                            [% END %]
                                         [% ELSE %]
                                                 [% IF ( loopro.module == 'CATALOGUING' ) %]
                                                     [% IF ( loopro.info.substr(0, 4) == 'item' ) %]
index 7f6bfda..c07239a 100755 (executable)
@@ -108,11 +108,9 @@ if (C4::Context->preference('ExtendedPatronAttributes')) {
     );
 }
 
-$template->param(%{ $patron->unblessed });
-
 $template->param(
+    patron              => $patron,
     finesview           => 1,
-    borrowernumber      => $borrowernumber,
     total               => sprintf("%.2f",$total),
     totalcredit         => $totalcredit,
     is_child            => ($patron->category->category_type eq 'C'),
index 5a1e3f5..c67586f 100755 (executable)
@@ -113,23 +113,7 @@ if ( $op eq 'delete_confirm' or $countissues > 0 or $flags->{'CHARGES'}  or $is_
     $template->param( adultborrower => 1 ) if $patron->category->category_type =~ /^(A|I)$/;
 
     $template->param(
-        # FIXME The patron object should be passed to the template
-        borrowernumber => $patron->borrowernumber,
-        surname => $patron->surname,
-        title => $patron->title,
-        cardnumber => $patron->cardnumber,
-        firstname => $patron->firstname,
-        categorycode => $patron->categorycode,
-        category_type => $patron->category->category_type,
-        categoryname  => $patron->category->description,
-        address => $patron->address,
-        address2 => $patron->address2,
-        city => $patron->city,
-        zipcode => $patron->zipcode,
-        country => $patron->country,
-        phone => $patron->phone,
-        email => $patron->email,
-        branchcode => $patron->branchcode,
+        patron => $patron,
     );
     if ($countissues >0) {
         $template->param(ItemsOnIssues => $countissues);
index ca7c44f..bd42568 100755 (executable)
@@ -66,9 +66,6 @@ my $can_be_discharged = Koha::Patron::Discharge::can_be_discharged({
     borrowernumber => $borrowernumber
 });
 
-my $holds = $patron->holds;
-my $has_reserves = $holds->count;
-
 # Generating discharge if needed
 if ( $input->param('discharge') and $can_be_discharged ) {
     my $is_discharged = Koha::Patron::Discharge::is_discharged({
@@ -109,28 +106,7 @@ my @validated_discharges = Koha::Patron::Discharge::get_validated({
 $template->param( picture => 1 ) if $patron->image;
 
 $template->param(
-    # FIXME The patron object should be passed to the template
-    borrowernumber    => $borrowernumber,
-    title             => $patron->title,
-    initials          => $patron->initials,
-    surname           => $patron->surname,
-    borrowernumber    => $borrowernumber,
-    firstname         => $patron->firstname,
-    cardnumber        => $patron->cardnumber,
-    categorycode      => $patron->categorycode,
-    category_type     => $patron->category->category_type,
-    categoryname      => $patron->category->description,
-    address           => $patron->address,
-    streetnumber      => $patron->streetnumber,
-    streettype        => $patron->streettype,
-    address2          => $patron->address2,
-    city              => $patron->city,
-    zipcode           => $patron->zipcode,
-    country           => $patron->country,
-    phone             => $patron->phone,
-    email             => $patron->email,
-    branchcode        => $patron->branchcode,
-    has_reserves      => $has_reserves,
+    patron => $patron,
     can_be_discharged => $can_be_discharged,
     validated_discharges => \@validated_discharges,
 );
index 40d4c65..8a1f66d 100755 (executable)
@@ -69,7 +69,7 @@ if ( $op eq 'download' ) {
 else {
 
     my $patron_category = $patron->category;
-    $template->param(%{ $patron->unblessed});
+    $template->param( patron => $patron );
 
     my %errors;
 
@@ -106,10 +106,6 @@ else {
         $bf->DelFile( id => scalar $cgi->param('file_id') );
     }
 
-    $template->param(
-        categoryname    => $patron_category->description,
-    );
-
     if (C4::Context->preference('ExtendedPatronAttributes')) {
         my $attributes = GetBorrowerAttributes($borrowernumber);
         $template->param(
index 64f4c54..c659d0c 100755 (executable)
@@ -63,9 +63,8 @@ output_and_exit_if_error( $input, $cookie, $template, { module => 'members', log
 
 # Get supporting cast
 my ( $branch, $category, $houseboundprofile, $visit, $patron_image );
-if ( $patron ) {
+if ( $patron ) { # FIXME This test is not needed - output_and_exit_if_error handles it
     $patron_image = $patron->image;
-    $branch = Koha::Libraries->new->find($patron->branchcode);
     $category = Koha::Patron::Categories->new->find($patron->categorycode);
     $houseboundprofile = $patron->housebound_profile;
 }
@@ -158,7 +157,7 @@ if ( $method eq 'updateconfirm' and $houseboundprofile ) {
 $method = 'update_or_create' if ( !$houseboundprofile );
 
 # Ensure template has all patron details.
-$template->param(%{$patron->unblessed}) if ( $patron );
+$template->param( patron => $patron );
 
 # Load extended patron attributes if necessary (taken from members/files.pl).
 if ( C4::Context->preference('ExtendedPatronAttributes') and $patron ) {
@@ -174,8 +173,6 @@ $template->param(
     picture            => $patron_image,
     housebound_profile => $houseboundprofile,
     visit              => $houseboundvisit,
-    branch             => $branch,
-    category           => $category,
     messages           => \@messages,
     method             => $method,
     choosers           => $choosers,
index a8e3b87..ac6df22 100755 (executable)
@@ -96,12 +96,10 @@ if ($add){
         );
     }
 
-    $template->param(%{ $patron->unblessed});
+    $template->param( patron => $patron );
 
     $template->param(
         finesview      => 1,
-        borrowernumber => $borrowernumber,
-        categoryname   => $patron->category->description,
         is_child       => ($patron->category->category_type eq 'C'), # FIXME is_child should be a Koha::Patron method
         );
     output_html_with_http_headers $input, $cookie, $template->output;
index d3de811..117a7ae 100755 (executable)
@@ -95,7 +95,6 @@ if ($add){
     });
 
     my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in";
-    my $patron         = Koha::Patrons->find($borrowernumber);
     output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
 
   # get authorised values with type of MANUAL_INV
@@ -125,11 +124,9 @@ if ($add){
         );
     }
 
-    $template->param(%{ $patron->unblessed });
     $template->param(
+        patron         => $patron,
         finesview      => 1,
-        borrowernumber => $borrowernumber,
-        categoryname   => $patron->category->description,
         is_child       => ($patron->category->category_type eq 'C'),
     );
     output_html_with_http_headers $input, $cookie, $template->output;
index 178415f..be9dc08 100755 (executable)
@@ -200,27 +200,7 @@ if (C4::Context->preference('ExtendedPatronAttributes')) {
 }
 
 $template->param(
-    borrowernumber => $bor->{'borrowernumber'},
-    cardnumber     => $bor->{'cardnumber'},
-    surname        => $bor->{'surname'},
-    firstname      => $bor->{'firstname'},
-    othernames     => $bor->{'othernames'},
-    categorycode   => $bor->{'categorycode'},
-    category_type  => $category_type,
-    categoryname   => $bor->{'description'},
-    address        => $bor->{address},
-    address2       => $bor->{'address2'},
-    streettype     => $bor->{streettype},
-    city           => $bor->{'city'},
-    state          => $bor->{'state'},
-    zipcode        => $bor->{'zipcode'},
-    country        => $bor->{'country'},
-    phone          => $bor->{'phone'},
-    phonepro       => $bor->{'phonepro'},
-    mobile         => $bor->{'mobile'},
-    email          => $bor->{'email'},
-    emailpro       => $bor->{'emailpro'},
-    branchcode     => $bor->{'branchcode'},
+    patron         => $patron,
     loop           => \@loop,
     is_child       => ( $category_type eq 'C' ),
     csrf_token =>
index 374d17a..3d72349 100755 (executable)
@@ -114,29 +114,7 @@ if ( C4::Context->preference('ExtendedPatronAttributes') ) {
 }
 
 $template->param(
-    othernames                 => $bor->{'othernames'},
-    surname                    => $bor->{'surname'},
-    firstname                  => $bor->{'firstname'},
-    borrowernumber             => $bor->{'borrowernumber'},
-    cardnumber                 => $bor->{'cardnumber'},
-    categorycode               => $bor->{'categorycode'},
-    category_type              => $category_type,
-    categoryname               => $bor->{'description'},
-    address                    => $bor->{address},
-    address2                   => $bor->{'address2'},
-    streettype                 => $bor->{streettype},
-    city                       => $bor->{'city'},
-    state                      => $bor->{'state'},
-    zipcode                    => $bor->{'zipcode'},
-    country                    => $bor->{'country'},
-    phone                      => $bor->{'phone'},
-    phonepro                   => $bor->{'phonepro'},
-    streetnumber               => $bor->{'streetnumber'},
-    mobile                     => $bor->{'mobile'},
-    email                      => $bor->{'email'},
-    emailpro                   => $bor->{'emailpro'},
-    branchcode                 => $bor->{'branchcode'},
-    userid                     => $bor->{'userid'},
+    patron                     => $patron,
     destination                => $destination,
     is_child                   => ( $category_type eq 'C' ),
     csrf_token                 => Koha::Token->new->generate_csrf({ session_id => scalar $input->cookie('CGISESSID'), }),
index 29eea1f..888fe91 100755 (executable)
@@ -139,7 +139,7 @@ my $category_type = $patron->category->category_type;
 my $data = $patron->unblessed;
 
 $debug and printf STDERR "dates (enrolled,expiry,birthdate) raw: (%s, %s, %s)\n", map {$data->{$_}} qw(dateenrolled dateexpiry dateofbirth);
-foreach (qw(dateenrolled dateexpiry dateofbirth)) {
+foreach (qw(dateenrolled dateexpiry dateofbirth)) { # FIXME This should be removed
     my $userdate = $data->{$_};
     unless ($userdate) {
         $debug and warn sprintf "Empty \$data{%12s}", $_;
@@ -156,7 +156,7 @@ for (qw(gonenoaddress lost borrowernotes)) {
 
 if ( $patron->is_debarred ) {
     $template->param(
-        userdebarred => 1,
+        userdebarred => 1, # FIXME Template should use patron->is_debarred
         flagged => 1,
         debarments => scalar GetDebarments({ borrowernumber => $borrowernumber }),
     );
@@ -216,7 +216,7 @@ else {
     $samebranch = 1;
 }
 my $library = Koha::Libraries->find( $data->{branchcode})->unblessed;
-@{$data}{keys %$library} = values %$library; # merge in all branch columns
+@{$data}{keys %$library} = values %$library; # merge in all branch columns # FIXME This is really ugly, we should pass the library instead
 
 my ( $total, $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber );
 
@@ -234,7 +234,7 @@ if ($print eq "page") {
 }
 
 # Show OPAC privacy preference is system preference is set
-if ( C4::Context->preference('OPACPrivacy') ) {
+if ( C4::Context->preference('OPACPrivacy') ) { # FIXME Should be moved the the template
     $template->param( OPACPrivacy => 1);
     $template->param( "privacy".$data->{'privacy'} => 1);
 }
@@ -285,7 +285,7 @@ $template->param(
 );
 
 
-$template->param(%$data);
+$template->param(%$data); # FIXME This should be removed and used $patron instead, but too many things are processed above
 
 if (C4::Context->preference('ExtendedPatronAttributes')) {
     my $attributes = C4::Members::Attributes::GetBorrowerAttributes($borrowernumber);
@@ -323,7 +323,6 @@ if (C4::Context->preference('EnhancedMessagingPreferences')) {
     C4::Form::MessagingPreferences::set_form_values({ borrowernumber => $borrowernumber }, $template);
     $template->param(messaging_form_inactive => 1);
     $template->param(SMSSendDriver => C4::Context->preference("SMSSendDriver"));
-    $template->param(SMSnumber     => $data->{'smsalertnumber'});
     $template->param(TalkingTechItivaPhone => C4::Context->preference("TalkingTechItivaPhoneNotification"));
 }
 
@@ -352,9 +351,6 @@ $template->param(
     patron          => $patron,
     translated_language => $translated_language,
     detailview      => 1,
-    borrowernumber  => $borrowernumber,
-    othernames      => $data->{'othernames'},
-    categoryname    => $patron->category->description,
     was_renewed     => scalar $input->param('was_renewed') ? 1 : 0,
     todaysdate      => output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }),
     totalprice      => sprintf("%.2f", $totalprice),
@@ -367,7 +363,6 @@ $template->param(
     samebranch      => $samebranch,
     quickslip       => $quickslip,
     housebound_role => scalar $patron->housebound_role,
-    privacy_guarantor_checkouts => $data->{'privacy_guarantor_checkouts'},
     PatronsPerPage => C4::Context->preference("PatronsPerPage") || 20,
     relatives_issues_count => $relatives_issues_count,
     relatives_borrowernumbers => \@relatives,
index 4b1abb7..4537138 100755 (executable)
@@ -51,7 +51,6 @@ my ($template, $loggedinuser, $cookie)
 my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in";
 output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
 
-$template->param( $borrower );
 $template->param( picture => 1 ) if $patron->image;
 
 # Allow resending of messages in Notices tab
@@ -77,13 +76,12 @@ if (C4::Context->preference('ExtendedPatronAttributes')) {
     );
 }
 
-$template->param(%$borrower);
 $template->param( adultborrower => 1 ) if ( $borrower->{category_type} eq 'A' || $borrower->{category_type} eq 'I' );
 $template->param(
+    patron             => $patron,
     QUEUED_MESSAGES    => $queued_messages,
     borrowernumber     => $borrowernumber,
     sentnotices        => 1,
-    categoryname       => $patron->category->description,
 );
 output_html_with_http_headers $input, $cookie, $template->output;
 
index f51d56d..cb61231 100755 (executable)
@@ -67,13 +67,9 @@ if ( !$borrowernumber ) {
 
 # get borrower details
 my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in";
-my $patron         = Koha::Patrons->find($borrowernumber);
+our $patron         = Koha::Patrons->find($borrowernumber);
 output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
 
-my $category = $patron->category;
-our $borrower = $patron->unblessed;
-$borrower->{description} = $category->description;
-$borrower->{category_type} = $category->category_type;
 our $user = $input->remote_user;
 $user ||= q{};
 
@@ -142,16 +138,13 @@ sub add_accounts_to_template {
         }
         push @accounts, $account_line;
     }
-    borrower_add_additional_fields($borrower);
-
-    $template->param(%$borrower);
+    borrower_add_additional_fields($patron->unblessed);
 
     my $patron_image = Koha::Patron::Images->find($borrower->{borrowernumber});
     $template->param( picture => 1 ) if $patron_image;
     $template->param(
+        patron   => $patron,
         accounts => \@accounts,
-        borrower => $borrower,
-        categoryname => $borrower->{'description'},
         total    => $total,
     );
     return;
index 1eb4184..9a14284 100755 (executable)
@@ -55,8 +55,6 @@ output_and_exit_if_error( $input, $cookie, $template, { module => 'members', log
 
 my $borrower       = $patron->unblessed;
 my $category       = $patron->category;
-$borrower->{description} = $category->description;
-$borrower->{category_type} = $category->category_type;
 my $user           = $input->remote_user;
 
 my $branch         = C4::Context->userenv->{'branch'};
@@ -179,8 +177,7 @@ $template->param(%$borrower);
 
 $template->param(
     borrowernumber => $borrowernumber,    # some templates require global
-    borrower      => $borrower,
-    categoryname  => $borrower->{description},
+    patron        => $patron,
     total         => $total_due,
     ExtendedPatronAttributes => C4::Context->preference('ExtendedPatronAttributes'),
 
index 748242f..36a0aa4 100755 (executable)
@@ -54,15 +54,12 @@ my $patron         = Koha::Patrons->find( $borrowernumber );
 output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
 
 my $category = $patron->category;
-my $data = $patron->unblessed;
-$data->{description} = $category->description;
-$data->{category_type} = $category->category_type;
 
 if ( $action eq 'print' ) {
 #  ReversePayment( $borrowernumber, $input->param('accountno') );
 }
 
-if ( $data->{'category_type'} eq 'C') {
+if ( $category->category_type eq 'C') {
     my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
     $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
     $template->param( 'catcode' => $patron_categories->next->categorycde )  if $patron_categories->count == 1;
@@ -117,31 +114,16 @@ for (my $i=0;$i<$numaccts;$i++){
     push(@accountrows, \%row);
 }
 
-$template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' || $data->{'category_type'} eq 'I' );
+$template->param( adultborrower => 1 ) if ( $category->category_type eq 'A' || $category->category_type eq 'I' );
 
 $template->param( picture => 1 ) if $patron->image;
 
 $template->param(
+    patron               => $patron,
     finesview           => 1,
-    firstname           => $data->{'firstname'},
-    surname             => $data->{'surname'},
-    borrowernumber      => $borrowernumber,
-    cardnumber          => $data->{'cardnumber'},
-    categorycode        => $data->{'categorycode'},
-    category_type       => $data->{'category_type'},
- #   category_description => $data->{'description'},
-    categoryname                => $data->{'description'},
-    address             => $data->{'address'},
-    address2            => $data->{'address2'},
-    city                => $data->{'city'},
-    zipcode             => $data->{'zipcode'},
-    country             => $data->{'country'},
-    phone               => $data->{'phone'},
-    email               => $data->{'email'},
-    branchcode          => $data->{'branchcode'},
     total               => sprintf("%.2f",$total),
     totalcredit         => $totalcredit,
-       is_child        => ($data->{'category_type'} eq 'C'),
+    is_child            => ($category->category_type eq 'C'),
     accounts            => \@accountrows );
 
 output_html_with_http_headers $input, $cookie, $template->output;
index 66c19c2..d553713 100755 (executable)
@@ -53,11 +53,8 @@ my $patron         = Koha::Patrons->find( $borrowernumber );
 output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
 
 my $category = $patron->category;
-my $data = $patron->unblessed;
-$data->{description} = $category->description;
-$data->{category_type} = $category->category_type;
 
-if ( $data->{'category_type'} eq 'C' ) {
+if ( $category->category_type eq 'C' ) {
     my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
     $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
     $template->param( 'catcode' => $patron_categories->next->categorycode )  if $patron_categories->count == 1;
@@ -117,30 +114,16 @@ for ( my $i = 0 ; $i < $numaccts ; $i++ ) {
     push( @accountrows, \%row );
 }
 
-$template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' || $data->{'category_type'} eq 'I' );
+$template->param( adultborrower => 1 ) if ( $category->category_type eq 'A' || $category->category_type eq 'I' );
 
 $template->param( picture => 1 ) if $patron->image;
 
 $template->param(
+    patron         => $patron,
     finesview      => 1,
-    firstname      => $data->{'firstname'},
-    surname        => $data->{'surname'},
-    borrowernumber => $borrowernumber,
-    cardnumber     => $data->{'cardnumber'},
-    categorycode   => $data->{'categorycode'},
-    category_type  => $data->{'category_type'},
-    categoryname   => $data->{'description'},
-    address        => $data->{'address'},
-    address2       => $data->{'address2'},
-    city           => $data->{'city'},
-    zipcode        => $data->{'zipcode'},
-    country        => $data->{'country'},
-    phone          => $data->{'phone'},
-    email          => $data->{'email'},
-    branchcode     => $data->{'branchcode'},
     total          => sprintf( "%.2f", $total ),
     totalcredit    => $totalcredit,
-    is_child       => ( $data->{'category_type'} eq 'C' ),
+    is_child       => ( $category->category_type eq 'C' ),
     accounts       => \@accountrows
 );
 
index 21e656d..74ca8f7 100755 (executable)
@@ -47,15 +47,9 @@ my $patron         = Koha::Patrons->find( $borrowernumber );
 output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
 
 my $category = $patron->category;
-my $data = $patron->unblessed;
-$data->{description} = $category->description;
-$data->{category_type} = $category->category_type;
-foreach my $key ( keys %$data ) {
-    $template->param( $key => $data->{$key} );
-}
 $template->param(
+    patron => $patron,
     suggestionsview  => 1,
-    categoryname => $data->{'description'},
 );
 
 if (C4::Context->preference('ExtendedPatronAttributes')) {
index 90157b5..295a43c 100755 (executable)
@@ -36,11 +36,6 @@ use Koha::Patron::Categories;
 
 my $input = CGI->new;
 
-#get borrower details
-my $data = undef;
-my $borrowernumber = undef;
-my $cardnumber = undef;
-
 my ($template, $loggedinuser, $cookie)= get_template_and_user({template_name => "members/readingrec.tt",
                                query => $input,
                                type => "intranet",
@@ -52,40 +47,37 @@ my ($template, $loggedinuser, $cookie)= get_template_and_user({template_name =>
 my $op = $input->param('op') || '';
 my $patron;
 if ($input->param('cardnumber')) {
-    $cardnumber = $input->param('cardnumber');
+    my $cardnumber = $input->param('cardnumber');
     $patron = Koha::Patrons->find( { cardnumber => $cardnumber } );
 }
 if ($input->param('borrowernumber')) {
-    $borrowernumber = $input->param('borrowernumber');
+    my $borrowernumber = $input->param('borrowernumber');
     $patron = Koha::Patrons->find( $borrowernumber );
 }
 
 my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in";
 output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
 
-$data = $patron->unblessed;
-$borrowernumber = $patron->borrowernumber;
-
 my $order = 'date_due desc';
 my $limit = 0;
 my $issues = ();
 # Do not request the old issues of anonymous patron
-if ( $borrowernumber eq C4::Context->preference('AnonymousPatron') ){
+if ( $patron->borrowernumber eq C4::Context->preference('AnonymousPatron') ){
     # use of 'eq' in the above comparison is intentional -- the
     # system preference value could be blank
     $template->param( is_anonymous => 1 );
 } else {
-    $issues = GetAllIssues($borrowernumber,$order,$limit);
+    $issues = GetAllIssues($patron->borrowernumber,$order,$limit);
 }
 
 #   barcode export
 if ( $op eq 'export_barcodes' ) {
     # FIXME This should be moved out of this script
-    if ( $data->{'privacy'} < 2) {
+    if ( $patron->privacy < 2) {
         my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
         my @barcodes =
           map { $_->{barcode} } grep { $_->{returndate} =~ m/^$today/o } @{$issues};
-        my $borrowercardnumber = $data->{cardnumber};
+        my $borrowercardnumber = $patron->cardnumber;
         my $delimiter = "\n";
         binmode( STDOUT, ":encoding(UTF-8)" );
         print $input->header(
@@ -100,13 +92,14 @@ if ( $op eq 'export_barcodes' ) {
     }
 }
 
-if ( $data->{'category_type'} eq 'C') {
+my $category = $patron->category;
+if ( $category->category_type eq 'C') {
     my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
     $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
     $template->param( 'catcode' => $patron_categories->next->categorycode )  if $patron_categories->count == 1;
 }
 
-$template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' || $data->{'category_type'} eq 'I' );
+$template->param( adultborrower => 1 ) if ( $category->category_type eq 'A' || $category->category_type eq 'I' );
 if (! $limit){
        $limit = 'full';
 }
@@ -114,21 +107,17 @@ if (! $limit){
 $template->param( picture => 1 ) if $patron->image;
 
 if (C4::Context->preference('ExtendedPatronAttributes')) {
-    my $attributes = GetBorrowerAttributes($borrowernumber);
+    my $attributes = GetBorrowerAttributes($patron->borrowernumber);
     $template->param(
         ExtendedPatronAttributes => 1,
         extendedattributes => $attributes
     );
 }
 
-$template->param(%$data);
-
 $template->param(
+    patron            => $patron,
     readingrecordview => 1,
-    borrowernumber    => $borrowernumber,
-    privacy           => $data->{'privacy'},
-    categoryname      => $data->{description},
-    is_child          => ( $data->{category_type} eq 'C' ),
+    is_child          => ( $category->category_type eq 'C' ),
     loop_reading      => $issues,
 );
 output_html_with_http_headers $input, $cookie, $template->output;
index d298a95..28d4d1c 100755 (executable)
@@ -52,9 +52,6 @@ my $patron         = Koha::Patrons->find( $borrowernumber );
 output_and_exit_if_error( $query, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
 
 my $category = $patron->category;
-my $patron_info = $patron->unblessed;
-$patron_info->{description} = $category->description;
-$patron_info->{category_type} = $category->category_type;
 
 my $count;
 my @borrowerSubscriptions;
@@ -75,18 +72,12 @@ $template->param(
     routinglistview => 1
 );
 
-$template->param( adultborrower => 1 ) if ( $patron_info->{category_type} =~ /^(A|I)$/ );
-
-##################################################################################
-
-$template->param(%$patron_info);
+$template->param( adultborrower => 1 ) if ( $category->category_type =~ /^(A|I)$/ );
 
 $template->param(
+    patron            => $patron,
     findborrower      => $findborrower,
-    borrower          => $patron_info,
-    borrowernumber    => $borrowernumber,
-    branch            => $branch,
-    categoryname      => $patron_info->{description},
+    branch            => $branch, # FIXME This is confusing
 );
 
 if (C4::Context->preference('ExtendedPatronAttributes')) {
index 6164496..c268f0e 100755 (executable)
@@ -52,13 +52,7 @@ my $patron         = Koha::Patrons->find( $borrowernumber );
 output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
 
 my $category = $patron->category;
-my $borrower= $patron->unblessed;
-$borrower->{description} = $category->description;
-$borrower->{category_type} = $category->category_type;
 
-$template->param(
-    categoryname    => $borrower->{'description'},
-);
 # Construct column names
 my $fields = C4::Members::Statistics::get_fields();
 our @statistic_column_names = split '\|', $fields;
@@ -92,11 +86,10 @@ if (C4::Context->preference('ExtendedPatronAttributes')) {
 
 $template->param( picture => 1 ) if $patron->image;
 
-$template->param(%$borrower);
-
-$template->param( adultborrower => 1 ) if ( $borrower->{category_type} eq 'A' || $borrower->{category_type} eq 'I' );
+$template->param( adultborrower => 1 ) if ( $category->category_type eq 'A' || $category->category_type eq 'I' );
 
 $template->param(
+    patron             => $patron,
     statisticsview     => 1,
     datas              => $datas,
     column_names       => \@statistic_column_names,
index 9c1c612..01dcf22 100755 (executable)
@@ -47,11 +47,6 @@ my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"
 my $patron         = Koha::Patrons->find( $borrowernumber );
 output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
 
-my $category = $patron->category;
-my $data = $patron->unblessed;
-$data->{description} = $category->description;
-$data->{category_type} = $category->category_type;
-
 my ( $total, $accts, $numaccts ) = GetMemberAccountRecords($borrowernumber);
 foreach my $accountline (@$accts) {
     if (   $accountline->{accounttype} ne 'F'
@@ -68,9 +63,7 @@ my $holds_rs = Koha::Holds->search(
 );
 
 $template->param(
-    %$data,
-
-    borrowernumber => $borrowernumber,
+    patron => $patron,
 
     accounts => $accts,
     totaldue => $total,
index 2f32e44..e7653d9 100755 (executable)
@@ -848,7 +848,7 @@ if ( C4::Context->preference('reviewson') ) {
         }
     }
     for my $review (@$reviews) {
-        my $patron = Koha::Patrons->find( $review->{borrowernumber} );
+        my $patron = Koha::Patrons->find( $review->{borrowernumber} ); # FIXME Should be Koha::Review->reviewer or similar
 
         # setting some borrower info into this hash
         if ( $patron ) {
index dcaec35..2e4532e 100755 (executable)
@@ -480,12 +480,8 @@ foreach my $biblioNum (@biblionumbers) {
         my $holds = $item->current_holds;
 
         if ( my $first_hold = $holds->next ) {
-            my $patron = Koha::Patrons->find( $first_hold->borrowernumber );
             $itemLoopIter->{backgroundcolor} = 'reserved';
             $itemLoopIter->{reservedate}     = output_pref({ dt => dt_from_string($first_hold->reservedate), dateonly => 1 }); # FIXME Should be formatted in the template
-            $itemLoopIter->{ReservedForBorrowernumber} = $first_hold->borrowernumber;
-            $itemLoopIter->{ReservedForSurname}        = $patron->surname;
-            $itemLoopIter->{ReservedForFirstname}      = $patron->firstname;
             $itemLoopIter->{ExpectedAtLibrary}         = $first_hold->branchcode;
             $itemLoopIter->{waitingdate} = $first_hold->waitingdate;
         }
index d66be33..6716131 100755 (executable)
@@ -179,25 +179,11 @@ if ($borrowernumber_hold && !$action) {
         $diffbranch = 1;
     }
 
-    my $is_debarred = $patron->is_debarred;
     $template->param(
-                borrowernumber      => $patron->borrowernumber,
-                borrowersurname     => $patron->surname,
-                borrowerfirstname   => $patron->firstname,
-                borrowerstreetaddress   => $patron->address,
-                borrowercity        => $patron->city,
-                borrowerphone       => $patron->phone,
-                borrowermobile      => $patron->mobile,
-                borrowerfax         => $patron->fax,
-                borrowerphonepro    => $patron->phonepro,
-                borroweremail       => $patron->email,
-                borroweremailpro    => $patron->emailpro,
-                cardnumber          => $patron->cardnumber,
                 expiry              => $expiry,
                 diffbranch          => $diffbranch,
                 messages            => $messages,
                 warnings            => $warnings,
-                restricted          => $is_debarred,
                 amount_outstanding  => GetMemberAccountRecords($patron->borrowernumber),
     );
 }
@@ -403,9 +389,7 @@ foreach my $biblionumber (@biblionumbers) {
 
                 $item->{backgroundcolor} = 'reserved';
                 $item->{reservedate}     = output_pref({ dt => dt_from_string( $first_hold->reservedate ), dateonly => 1 }); # FIXME Should be formatted in the template
-                $item->{ReservedForBorrowernumber}     = $p->borrowernumber;
-                $item->{ReservedForSurname}     = $p->surname;
-                $item->{ReservedForFirstname}     = $p->firstname;
+                $item->{ReservedFor}     = $p;
                 $item->{ExpectedAtLibrary}     = $first_hold->branchcode;
                 $item->{waitingdate} = $first_hold->waitingdate;
             }
@@ -615,9 +599,6 @@ foreach my $biblionumber (@biblionumbers) {
                      holdsview => 1,
                      C4::Search::enabled_staff_search_views,
                     );
-    if ( $patron ) {
-        $template->param( borrower_branchcode => $patron->branchcode );
-    }
 
     $biblioloopiter{biblionumber} = $biblionumber;
     $biblioloopiter{title} = $biblio->title;
@@ -645,6 +626,7 @@ if ( C4::Context->preference( 'AllowHoldDateInFuture' ) ) {
 }
 
 $template->param(
+    patron => $patron,
     SuspendHoldsIntranet => C4::Context->preference('SuspendHoldsIntranet'),
     AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds'),
 );
index 783748a..6dc51f1 100755 (executable)
@@ -75,8 +75,7 @@ for my $review ( @$reviews ) {
     my $borrowernumber = $review->{borrowernumber};
     my $patron = Koha::Patrons->find( $borrowernumber);
     if ( $patron ) {
-        $review->{surname}     = $patron->surname;
-        $review->{firstname}   = $patron->firstname;
+        $review->{patron} = $patron;
     }
 }
 
index 0b11aac..54082df 100755 (executable)
@@ -119,10 +119,6 @@ if ($do_it) {
         $result->{'biblionumber'}      = q{};
         $result->{'biblioitemnumber'}  = q{};
         $result->{'barcode'}           = q{};
-        $result->{'userfirstname'}     = q{};
-        $result->{'usersurname'}       = q{};
-        $result->{'borrowerfirstname'} = q{};
-        $result->{'borrowersurname'}   = q{};
 
         if ( substr( $result->{'info'}, 0, 4 ) eq 'item' || $result->{module} eq "CIRCULATION" ) {
 
@@ -141,8 +137,7 @@ if ($do_it) {
         if ( $result->{'user'} ) {
             my $patron = Koha::Patrons->find( $result->{'user'} );
             if ($patron) {
-                $result->{'userfirstname'} = $patron->firstname;
-                $result->{'usersurname'}   = $patron->surname;
+                $result->{librarian} = $patron;
             }
         }
 
@@ -151,8 +146,7 @@ if ($do_it) {
             if ( $result->{'object'} ) {
                 my $patron = Koha::Patrons->find( $result->{'object'} );
                 if ($patron) {
-                    $result->{'borrowerfirstname'} = $patron->firstname;
-                    $result->{'borrowersurname'}   = $patron->surname;
+                    $result->{patron} = $patron;
                 }
             }
         }