From 0ab22e1c7c6b6e8d14a4fb7478ab2a3d42da347d Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 1 Jun 2017 14:47:40 -0300 Subject: [PATCH] Bug 18789: Send Koha::Patron object to the templates 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 Signed-off-by: Josef Moravec Signed-off-by: Jonathan Druart --- acqui/acqui-home.pl | 5 +- acqui/booksellers.pl | 3 +- admin/aqbudgets.pl | 3 +- circ/branchtransfers.pl | 5 +- circ/overdue.pl | 15 --- circ/transferstoreceive.pl | 8 +- circ/waitingreserves.pl | 6 +- .../prog/en/includes/borrower_debarments.inc | 4 +- .../prog/en/includes/circ-menu.inc | 66 +++++----- .../includes/member-alt-address-style-de.inc | 22 ++-- .../includes/member-alt-address-style-fr.inc | 22 ++-- .../includes/member-alt-address-style-us.inc | 20 +-- .../includes/member-alt-contact-style-de.inc | 18 +-- .../includes/member-alt-contact-style-fr.inc | 18 +-- .../includes/member-alt-contact-style-us.inc | 18 +-- .../member-display-address-style-de.inc | 20 +-- .../member-display-address-style-fr.inc | 22 ++-- .../member-display-address-style-us.inc | 20 +-- .../member-display-alt-address-style-de.inc | 20 +-- .../member-display-alt-address-style-fr.inc | 26 ++-- .../member-display-alt-address-style-us.inc | 20 +-- .../includes/member-main-address-style-de.inc | 18 +-- .../includes/member-main-address-style-fr.inc | 18 +-- .../includes/member-main-address-style-us.inc | 18 +-- .../prog/en/includes/members-toolbar.inc | 22 ++-- .../prog/en/modules/acqui/acqui-home.tt | 4 +- .../prog/en/modules/acqui/booksellers.tt | 6 +- .../prog/en/modules/admin/aqbudgets.tt | 8 +- .../prog/en/modules/circ/branchtransfers.tt | 6 +- .../prog/en/modules/circ/printslip.tt | 2 +- .../en/modules/circ/transferstoreceive.tt | 14 +-- .../prog/en/modules/circ/waitingreserves.tt | 14 +-- .../prog/en/modules/members/boraccount.tt | 10 +- .../prog/en/modules/members/deletemem.tt | 14 +-- .../prog/en/modules/members/discharge.tt | 8 +- .../prog/en/modules/members/housebound.tt | 16 +-- .../prog/en/modules/members/mancredit.tt | 12 +- .../prog/en/modules/members/maninvoice.tt | 12 +- .../prog/en/modules/members/member-flags.tt | 10 +- .../en/modules/members/member-password.tt | 14 +-- .../prog/en/modules/members/memberentrygen.tt | 2 +- .../en/modules/members/moremember-print.tt | 20 +-- .../prog/en/modules/members/moremember.tt | 118 +++++++++--------- .../prog/en/modules/members/pay.tt | 21 ++-- .../prog/en/modules/members/paycollect.tt | 26 ++-- .../prog/en/modules/members/printfeercpt.tt | 9 +- .../prog/en/modules/members/printinvoice.tt | 9 +- .../modules/members/purchase-suggestions.tt | 2 +- .../prog/en/modules/members/readingrec.tt | 4 +- .../prog/en/modules/members/routing-lists.tt | 4 +- .../prog/en/modules/reserve/request.tt | 50 ++++---- .../prog/en/modules/reviews/reviewswaiting.tt | 2 +- .../prog/en/modules/tools/viewlog.tt | 12 +- members/boraccount.pl | 4 +- members/deletemem.pl | 18 +-- members/discharge.pl | 26 +--- members/files.pl | 6 +- members/housebound.pl | 7 +- members/mancredit.pl | 4 +- members/maninvoice.pl | 5 +- members/member-flags.pl | 22 +--- members/member-password.pl | 24 +--- members/moremember.pl | 15 +-- members/notices.pl | 4 +- members/pay.pl | 13 +- members/paycollect.pl | 5 +- members/printfeercpt.pl | 26 +--- members/printinvoice.pl | 25 +--- members/purchase-suggestions.pl | 8 +- members/readingrec.pl | 35 ++---- members/routing-lists.pl | 15 +-- members/statistics.pl | 11 +- members/summary-print.pl | 9 +- opac/opac-detail.pl | 2 +- opac/opac-reserve.pl | 4 - reserve/request.pl | 22 +--- reviews/reviewswaiting.pl | 3 +- tools/viewlog.pl | 10 +- 78 files changed, 475 insertions(+), 714 deletions(-) diff --git a/acqui/acqui-home.pl b/acqui/acqui-home.pl index cbb8896804..d23f082187 100755 --- a/acqui/acqui-home.pl +++ b/acqui/acqui-home.pl @@ -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} ) { diff --git a/acqui/booksellers.pl b/acqui/booksellers.pl index b0ec7285b1..99da78cb9f 100755 --- a/acqui/booksellers.pl +++ b/acqui/booksellers.pl @@ -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}); diff --git a/admin/aqbudgets.pl b/admin/aqbudgets.pl index f106a86415..5aeb8b9786 100755 --- a/admin/aqbudgets.pl +++ b/admin/aqbudgets.pl @@ -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 diff --git a/circ/branchtransfers.pl b/circ/branchtransfers.pl index 1305c82803..b9d357c97f 100755 --- a/circ/branchtransfers.pl +++ b/circ/branchtransfers.pl @@ -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' ); diff --git a/circ/overdue.pl b/circ/overdue.pl index ff65712d2a..fe3fdd021f 100755 --- a/circ/overdue.pl +++ b/circ/overdue.pl @@ -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}, diff --git a/circ/transferstoreceive.pl b/circ/transferstoreceive.pl index de6a89aa22..10df07df07 100755 --- a/circ/transferstoreceive.pl +++ b/circ/transferstoreceive.pl @@ -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 ); } diff --git a/circ/waitingreserves.pl b/circ/waitingreserves.pl index 24e03475ab..5943ea5673 100755 --- a/circ/waitingreserves.pl +++ b/circ/waitingreserves.pl @@ -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) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc index e8e22e8c66..92dda54b34 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc @@ -40,7 +40,7 @@ [% d.created | $KohaDates %] [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %] - + Remove @@ -53,7 +53,7 @@ [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]

Add manual restriction

- +
Add manual restriction diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc index bdcc8afb63..2b29bfcb9e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc @@ -1,5 +1,5 @@ [% USE Koha %] -[% IF ( borrowernumber ) %] +[% IF ( patron.borrowernumber ) %]
[% INCLUDE 'patron-title.inc' %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/deletemem.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/deletemem.tt index 660fd93a7b..76b7bcdb9d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/deletemem.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/deletemem.tt @@ -1,13 +1,13 @@ [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] -Koha › Delete patron [% firstname %] [% surname %] +Koha › Delete patron [% patron.firstname %] [% patron.surname %] [% INCLUDE 'doc-head-close.inc' %] [% INCLUDE 'header.inc' %] [% INCLUDE 'patron-search.inc' %] - +
@@ -29,18 +29,18 @@ [% END %]
- [% 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 %]
-

Are you sure you want to delete the patron [% firstname %] [% surname %]? This cannot be undone.

+

Are you sure you want to delete the patron [% patron.firstname %] [% patron.surname %]? This cannot be undone.

- +
- +
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharge.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharge.tt index 960fc620d8..01b2e9d4f3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharge.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharge.tt @@ -3,7 +3,7 @@ [% USE Branches %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] -Koha › Patrons › [% UNLESS blocking_error %]Discharge for [% firstname %] [% surname %] ([% cardnumber %])[% END %] +Koha › Patrons › [% UNLESS blocking_error %]Discharge for [% patron.firstname %] [% patron.surname %] ([% patron.cardnumber %])[% END %] [% INCLUDE 'doc-head-close.inc' %] @@ -13,7 +13,7 @@
@@ -33,12 +33,12 @@ [% UNLESS can_be_discharged %]

Cannot edit discharge: the patron has checked out items.

[% ELSE %] - [% IF has_reserves %] + [% IF patron.holds.count %]

Borrower has reserves: they will be canceled if the discharge is generated.

[% END %]
- +
[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/housebound.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/housebound.tt index ae36321bf2..cfbb3b388a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/housebound.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/housebound.tt @@ -57,7 +57,7 @@

Manage housebound profile

- + [% IF ( housebound_profile ) %] [% ELSE %] @@ -188,7 +188,7 @@
+ href="/cgi-bin/koha/members/housebound.pl?borrowernumber=[% patron.borrowernumber %]"> Cancel
@@ -205,7 +205,7 @@ [% ELSE %] [% END %] - +
Delivery details
    @@ -314,7 +314,7 @@
    + href="/cgi-bin/koha/members/housebound.pl?borrowernumber=[% patron.borrowernumber %]"> Cancel
    @@ -371,7 +371,7 @@
@@ -397,15 +397,15 @@ - Edit - Delete + Edit + Delete [% END %] [% END %]
- Add a new delivery diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt index 72adcf6d06..5f68a4c6fb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt @@ -21,15 +21,15 @@
- +
Manual credit
    @@ -43,7 +43,7 @@
  1. Example: 5.00
-
Cancel
+
Cancel
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt index 7817042d51..71eeb78176 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt @@ -21,10 +21,10 @@
@@ -33,7 +33,7 @@ ERROR an invalid itemnumber was entered, please hit back and try again [% END %] [% ELSE %] -
+
Manual invoice
    @@ -55,7 +55,7 @@
  1. Example: 5.00
-
Cancel
+
Cancel
[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tt index f63db2293e..5c1bbf0f98 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tt @@ -2,7 +2,7 @@ [% SET footerjs = 1 %] [% PROCESS 'permissions.inc' %] [% INCLUDE 'doc-head-open.inc' %] -Koha › Patrons › Set permissions for [% surname %], [% firstname %] +Koha › Patrons › Set permissions for [% patron.surname %], [% patron.firstname %] [% INCLUDE 'doc-head-close.inc' %] @@ -11,7 +11,7 @@ [% INCLUDE 'header.inc' %] [% INCLUDE 'patron-search.inc' %] - +
@@ -22,9 +22,9 @@
- + -

Set permissions for [% surname %], [% firstname %]

+

Set permissions for [% patron.surname %], [% patron.firstname %]

    @@ -64,7 +64,7 @@
-
Cancel
+
Cancel
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tt index d27001deae..c32bdfffe8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tt @@ -2,7 +2,7 @@ [% USE Branches %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] -Koha › Patrons › [% IF ( newpassword ) %]Password updated [% ELSE %]Update password for [% surname %], [% firstname %][% END %] +Koha › Patrons › [% IF ( newpassword ) %]Password updated [% ELSE %]Update password for [% patron.surname %], [% patron.firstname %][% END %] [% INCLUDE 'doc-head-close.inc' %] @@ -10,7 +10,7 @@ [% INCLUDE 'header.inc' %] [% INCLUDE 'patron-search.inc' %] - +
@@ -26,8 +26,8 @@
- - + + [% IF ( errormsg ) %]

The following errors have occurred:

@@ -55,10 +55,10 @@ [% END %] -
Change username and/or password for [% firstname %] [% surname %] +
Change username and/or password for [% patron.firstname %] [% patron.surname %]
  1. -
  2. + [% 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 @@
    - Cancel + Cancel
    [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt index d373666892..607217ad70 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -3,7 +3,7 @@ [% USE Branches %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] -Koha › Patrons › [% 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 %]) +Koha › Patrons › [% 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 %]) [% INCLUDE 'doc-head-close.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt index 35a841056d..32e75334e2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt @@ -4,13 +4,13 @@ [% USE Price %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] - Summary for [% firstname %] [% surname %] ([% cardnumber %]) + Summary for [% patron.firstname %] [% patron.surname %] ([% patron.cardnumber %]) [% INCLUDE 'doc-head-close.inc' %]
    -

    Account summary: [% firstname %] [% surname %] ([% cardnumber %])

    +

    Account summary: [% patron.firstname %] [% patron.surname %] ([% patron.cardnumber %])

      [% IF Koha.Preference( 'AddressFormat' ) %] @@ -18,15 +18,15 @@ [% ELSE %] [% INCLUDE 'member-display-address-style-us.inc' %] [% END %] -
    • [% IF ( phone ) %][% phone %][% ELSE %](no phone number on file)[% END %]
    • -
    • [% IF ( email ) %][% email %][% ELSE %](no primary email on file)[% END %]
    • - [% IF ( emailpro ) %] -
    • [% emailpro %]
    • +
    • [% IF ( patron.phone ) %][% patron.phone %][% ELSE %](no phone number on file)[% END %]
    • +
    • [% IF ( patron.email ) %][% patron.email %][% ELSE %](no primary email on file)[% END %]
    • + [% IF ( patron.emailpro ) %] +
    • [% patron.emailpro %]
    • [% END %] -
    • Registration date: [% dateenrolled | $KohaDates %]
    • -
    • Expiration date: [% dateexpiry | $KohaDates %]
    • -
    • Library: [% Branches.GetName( branchcode ) %]
    • -
    • Category: [% description %]
    • +
    • Registration date: [% patron.dateenrolled | $KohaDates %]
    • +
    • Expiration date: [% patron.dateexpiry | $KohaDates %]
    • +
    • Library: [% Branches.GetName( patron.branchcode ) %]
    • +
    • Category: [% patron.category.description %]
    [% IF ( issues ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index 83bcff0408..e1af48d5b2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -54,7 +54,7 @@ [% END %]
    - [% IF ( was_renewed ) %]
    Patron's account has been renewed until [% dateexpiry | $KohaDates %]
    [% END %] + [% IF ( was_renewed ) %]
    Patron's account has been renewed until [% patron.dateexpiry | $KohaDates %]
    [% END %] [% IF fines %]
    @@ -110,17 +110,17 @@ View restrictions [% END %] - [% IF ( gonenoaddress ) %]
  3. Patron's address is in doubt.
  4. [% END %] + [% IF ( patron.gonenoaddress ) %]
  5. Patron's address is in doubt.
  6. [% END %] [% IF ( lost ) %]
  7. Patron's card has been reported lost.
  8. [% END %]
    [% END %]

    [% UNLESS ( I ) %] - [% title | html %] [% firstname | html %] [% END %] [% surname | html %] ([% cardnumber | html %])

    + [% patron.title | html %] [% patron.firstname | html %] [% END %] [% patron.surname | html %] ([% patron.cardnumber | html %])
    - [% IF ( othernames ) %]“[% othernames | html %]”[% END %] + [% IF ( patron.othernames ) %]“[% patron.othernames | html %]”[% END %]
    [% IF Koha.Preference( 'AddressFormat' ) %] @@ -132,17 +132,17 @@
      - [% IF ( phone ) %]
    1. Primary phone: [% phone | html %]
    2. [% END %] - [% IF ( phonepro ) %]
    3. Secondary phone: [% phonepro | html %]
    4. [% END %] - [% IF ( mobile ) %]
    5. Other phone: [% mobile | html %]
    6. [% END %] - [% IF ( fax ) %]
    7. Fax: [% fax |html %]
    8. [% END %] - [% IF ( email ) %][% END %] - [% IF ( emailpro ) %][% END %] + [% IF ( patron.phone ) %]
    9. Primary phone: [% patron.phone | html %]
    10. [% END %] + [% IF ( patron.phonepro ) %]
    11. Secondary phone: [% patron.phonepro | html %]
    12. [% END %] + [% IF ( patron.mobile ) %]
    13. Other phone: [% patron.mobile | html %]
    14. [% END %] + [% IF ( patron.fax ) %]
    15. Fax: [% patron.fax |html %]
    16. [% END %] + [% IF ( patron.email ) %][% END %] + [% IF ( patron.emailpro ) %][% END %] [% UNLESS ( I ) %] - [% IF ( initials ) %]
    17. Initials: [% initials | html %]
    18. [% END %] - [% IF ( dateofbirth ) %]
    19. Date of birth:[% dateofbirth | $KohaDates %] ([% age %] years)
    20. [% END %] - [% IF ( sex ) %]
    21. Gender: - [% IF ( sex == 'F' ) %]Female[% ELSIF ( sex == 'M' ) %]Male[% ELSE %][% sex %][% END %] + [% IF ( patron.initials ) %]
    22. Initials: [% patron.initials | html %]
    23. [% END %] + [% IF ( patron.dateofbirth ) %]
    24. Date of birth:[% patron.dateofbirth | $KohaDates %] ([% age %] years)
    25. [% END %] + [% IF ( patron.sex ) %]
    26. Gender: + [% IF ( patron.sex == 'F' ) %]Female[% ELSIF ( patron.sex == 'M' ) %]Male[% ELSE %][% patron.sex %][% END %]
    27. [% END %] [% END %] [% IF guarantees %] @@ -172,9 +172,9 @@
    [% IF ( guarantor.borrowernumber ) %] - Edit + Edit [% ELSE %] - Edit + Edit [% END %]
    @@ -188,16 +188,16 @@
    [% IF ( picture ) %] Manage patron image -
    To update the image for [% title | html %] [% surname | html %], select a new image file and click 'Upload.'
    Click the 'Delete' button to remove the current image. +
    To update the image for [% patron.title | html %] [% patron.surname | html %], select a new image file and click 'Upload.'
    Click the 'Delete' button to remove the current image. [% ELSE %] Upload patron image -
    [% 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. +
    [% 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 %]
    Only PNG, GIF, JPEG, XPM formats are supported.
    - - + +
    1. @@ -207,7 +207,7 @@ - [% IF ( picture ) %]Delete[% END %] + [% IF ( picture ) %]Delete[% END %]
@@ -241,7 +241,7 @@
- + [% END %] [% IF ( ExtendedPatronAttributes ) %] @@ -270,7 +270,7 @@
[% END %]
- + [% END %] [% END %] @@ -280,11 +280,11 @@

Patron messaging preferences

[% INCLUDE 'messaging-preference-form.inc' %] [% IF ( SMSSendDriver ) %] -
  1. SMS number:[% SMSnumber %] + [% END %]
- + [% END %]
@@ -293,16 +293,16 @@

Library use

    -
  1. Card number: [% cardnumber %]
  2. -
  3. Borrowernumber: [% borrowernumber %]
  4. -
  5. Category: [% categoryname %] ([% categorycode %])
  6. -
  7. Registration date: [% dateenrolled | $KohaDates %]
  8. +
  9. Card number: [% patron.cardnumber %]
  10. +
  11. Borrowernumber: [% patron.borrowernumber %]
  12. +
  13. Category: [% patron.category.description %] ([% patron.categorycode %])
  14. +
  15. Registration date: [% patron.dateenrolled | $KohaDates %]
  16. Expiration date: [% IF ( was_renewed ) %] - [% dateexpiry | $KohaDates %] + [% patron.dateexpiry | $KohaDates %] [% ELSE %] - [% dateexpiry | $KohaDates %] + [% patron.dateexpiry | $KohaDates %] [% END %]
  17. @@ -323,18 +323,18 @@ [% END %] - [% IF ( sort1 ) %]
  18. Sort field 1:[% AuthorisedValues.GetByCode('Bsort1', sort1) |html %]
  19. [% END %] - [% IF ( sort2 ) %]
  20. Sort field 2:[% AuthorisedValues.GetByCode('Bsort2', sort2) |html %]
  21. [% END %] -
  22. Username: [% userid |html %]
  23. + [% IF ( patron.sort1 ) %]
  24. Sort field 1:[% AuthorisedValues.GetByCode('Bsort1', patron.sort1) |html %]
  25. [% END %] + [% IF ( patron.sort2 ) %]
  26. Sort field 2:[% AuthorisedValues.GetByCode('Bsort2', patron.sort2) |html %]
  27. [% END %] +
  28. Username: [% patron.userid |html %]
  29. Password: - [% IF ( password ) %] + [% IF ( patron.password ) %] ******* [% ELSE %] - Undefined + Undefined [% END %]
  30. - [% IF ( borrowernotes ) %]
  31. Circulation note: [% borrowernotes |html %]
  32. [% END %] - [% IF ( opacnote ) %]
  33. OPAC note:[% opacnote |html %]
  34. [% END %] + [% IF ( patron.borrowernotes ) %]
  35. Circulation note: [% patron.borrowernotes |html %]
  36. [% END %] + [% IF ( patron.opacnote ) %]
  37. OPAC note:[% patron.opacnote |html %]
  38. [% END %] [% IF Koha.Preference( 'NorwegianPatronDBEnable' ) == 1 %] [% IF ( sync == 1 ) %]
  39. Activate sync: Yes
  40. @@ -346,9 +346,9 @@ [% END %] [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
  41. Check previous checkouts: - [% IF ( checkprevcheckout == 'yes' ) %] + [% IF ( patron.checkprevcheckout == 'yes' ) %] Yes - [% ELSIF ( checkprevcheckout == 'no' ) %] + [% ELSIF ( patron.checkprevcheckout == 'no' ) %] No [% ELSE %] Inherited @@ -358,13 +358,13 @@ [% IF Koha.Preference('TranslateNotices') %]
  42. Preferred language for notices: - [% translated_language %] + [% patron.translated_language %]
  43. [% END %]
- +

Alternate address

@@ -376,28 +376,28 @@ [% END %]
    - [% IF ( B_phone ) %]
  1. Phone: [% B_phone |html %]
  2. [% END %] - [% IF ( B_email ) %][% END %] - [% IF ( contactnote ) %]
  3. Contact note: [% contactnote |html %]
  4. [% END %] + [% IF ( patron.B_phone ) %]
  5. Phone: [% patron.B_phone |html %]
  6. [% END %] + [% IF ( patron.B_email ) %][% END %] + [% IF ( patron.contactnote ) %]
  7. Contact note: [% patron.contactnote |html %]
  8. [% END %]
- +

Alternative contact

-
  1. Surname: [% altcontactsurname | html %]
  2. -
  3. First name: [% altcontactfirstname | html %]
  4. -
  5. Address: [% altcontactaddress1 | html %]
  6. -
  7. Address 2: [% altcontactaddress2 | html %]
  8. -
  9. City: [% altcontactaddress3 | html %]
  10. - [% IF ( altcontactstate ) %]
  11. State: [% altcontactstate | html %]
  12. [% END %] -
  13. ZIP/Postal code: [% altcontactzipcode | html %]
  14. - [% IF ( altcontactcountry ) %]
  15. Country: [% altcontactcountry | html %]
  16. [% END %] - [% IF ( altcontactphone ) %]
  17. Phone: [% altcontactphone | html %]
  18. [% END %] +
    1. Surname: [% patron.altcontactsurname | html %]
    2. +
    3. First name: [% patron.altcontactfirstname | html %]
    4. +
    5. Address: [% patron.altcontactaddress1 | html %]
    6. +
    7. Address 2: [% patron.altcontactaddress2 | html %]
    8. +
    9. City: [% patron.altcontactaddress3 | html %]
    10. + [% IF ( patron.altcontactstate ) %]
    11. State: [% patron.altcontactstate | html %]
    12. [% END %] +
    13. ZIP/Postal code: [% patron.altcontactzipcode | html %]
    14. + [% IF ( patron.altcontactcountry ) %]
    15. Country: [% patron.altcontactcountry | html %]
    16. [% END %] + [% IF ( patron.altcontactphone ) %]
    17. Phone: [% patron.altcontactphone | html %]
    18. [% END %]
- +
@@ -503,7 +503,7 @@
- + [% IF Koha.Preference('AutoResumeSuspendedHolds') %] @@ -517,7 +517,7 @@
- + @@ -559,7 +559,7 @@ /* 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 %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt index ba6b33e489..18e64fcdd9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt @@ -4,7 +4,7 @@ [% USE Price %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] -Koha › Patrons › Pay Fines for [% borrower.firstname |html %] [% borrower.surname |html %] +Koha › Patrons › Pay Fines for [% patron.firstname |html %] [% patron.surname |html %] [% INCLUDE 'doc-head-close.inc' %] @@ -12,28 +12,28 @@ [% INCLUDE 'header.inc' %] [% INCLUDE 'patron-search.inc' %] - +
-[% INCLUDE 'members-toolbar.inc' borrowernumber=borrower.borrowernumber %] +[% INCLUDE 'members-toolbar.inc' borrowernumber=patron.borrowernumber %]
[% IF ( accounts ) %]
- +

Select all | Clear all

@@ -120,11 +120,10 @@ [% IF CAN_user_updatecharges_writeoff %][% END %] -Cancel +Cancel -[% ELSE %] -

[% borrower.firstname |html %] [% borrower.surname |html %] has no outstanding fines.

+

[% patron.firstname |html %] [% patron.surname |html %] has no outstanding fines.

[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt index 5813babaa9..39df1437c0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt @@ -2,37 +2,37 @@ [% USE Branches %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] -Koha › Patrons › Collect fine payment for [% borrower.firstname %] [% borrower.surname %] +Koha › Patrons › Collect fine payment for [% patron.firstname %] [% patron.surname %] [% INCLUDE 'doc-head-close.inc' %] [% INCLUDE 'header.inc' %] [% INCLUDE 'patron-search.inc' %] - +
-[% INCLUDE 'members-toolbar.inc' borrowernumber=borrower.borrowernumber %] +[% INCLUDE 'members-toolbar.inc' borrowernumber=patron.borrowernumber %]
@@ -45,7 +45,7 @@ [% IF ( pay_individual ) %]
- + @@ -89,14 +89,14 @@ + Cancel
[% ELSIF ( writeoff_individual ) %]
Write off an individual fine - + @@ -130,13 +130,13 @@
+ Cancel
[% ELSE %]
- + @@ -159,7 +159,7 @@ + Cancel
[% END %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt index 5027672afb..a6c5a3ad74 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt @@ -1,8 +1,9 @@ [% USE Koha %] [% USE KohaDates %] +[% USE Branches %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] -Print receipt for [% cardnumber %] +Print receipt for [% patron.cardnumber %] [% INCLUDE 'doc-head-close.inc' %] [% INCLUDE 'blocking_errors.inc' %] @@ -27,13 +28,13 @@
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt index acb8fd25de..62fb69d5ab 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt @@ -1,7 +1,8 @@ [% USE Koha %] +[% USE Branches %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] -Print receipt for [% cardnumber %] +Print receipt for [% patron.cardnumber %] [% INCLUDE 'doc-head-close.inc' %] @@ -25,13 +26,13 @@ diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/purchase-suggestions.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/purchase-suggestions.tt index 5484c2fc95..f95c0097b3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/purchase-suggestions.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/purchase-suggestions.tt @@ -27,7 +27,7 @@

Purchase suggestions

[% IF suggestions %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt index 8ca27f46e1..dd32e0c7d8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt @@ -27,12 +27,12 @@
Staff members are not allowed to access patron's checkout history
[% ELSIF is_anonymous %]
This is the anonymous patron, so no circulation history is displayed. To get a list of anonymized loans, please run a report.
-[% ELSIF ( privacy == 2) %] +[% ELSIF ( patron.privacy == 2) %]
This patron has set the privacy rules to never keeping a circulation history.
[% ELSIF ( !loop_reading ) %]
This patron has no circulation history.
[% ELSE %] - +
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/routing-lists.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/routing-lists.tt index 1cec765411..1959e2f6d1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/routing-lists.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/routing-lists.tt @@ -57,7 +57,7 @@ - +
[% END %] @@ -67,7 +67,7 @@ [% ELSE %]

Patron does not belong to any subscription routing lists.

- + [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt index 1cd3618149..8504cf5135 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -17,7 +17,7 @@
- [% IF ( branchname ) %]

[% branchname %]

[% END %] +

[% Branches.GetName( patron.branchcode ) %]

- Received with thanks from [% firstname %] [% surname %]
- Card number : [% cardnumber %]
+ Received with thanks from [% patron.firstname %] [% patron.surname %]
+ Card number : [% patron.cardnumber %]
- [% IF ( branchname ) %]

[% branchname %]

[% END %] +

[% Branches.GetName( patron.branchcode ) %]

- Bill to: [% firstname %] [% surname %]
- Card number: [% cardnumber %]
+ Bill to: [% patron.firstname %] [% patron.surname %]
+ Card number: [% patron.cardnumber %]