From 38526ca13aa63bf6dee90e8a408a8dfa93316b58 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 9 Aug 2017 16:45:31 -0300 Subject: [PATCH] Bug 14039: Add the title to all places There are other scripts where the borrower variable is not defined and the fields are passed one by one. To have a consistent behaviour we should add the title at the different places. Note that this script also add the use of the include file for statistics.tt and remove the pass of parameters to the template, already done later: 99 $template->param(%$borrower); Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart --- koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc | 8 ++++---- .../intranet-tmpl/prog/en/modules/members/statistics.tt | 4 ++-- members/statistics.pl | 3 --- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc index 418ac7f4e4..b2cbfb870b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc @@ -3,9 +3,9 @@ [%- borrower.surname | html %] [% IF borrower.othernames %] ([% borrower.othernames | html %]) [% END %] [%- ELSE %] [%- IF invert_name %] - [%- borrower.surname | html %], [% borrower.firstname | html %] [% IF borrower.othernames %] ([% borrower.othernames | html %]) [% END %] + [% IF borrower.title %][%- borrower.title | html %] [% END %][%- borrower.surname | html %], [% borrower.firstname | html %] [% IF borrower.othernames %] ([% borrower.othernames | html %]) [% END %] [%- ELSE %] - [% IF borrower.title %] [%- borrower.title | html %] [% END %][%- borrower.firstname | html %] [% IF borrower.othernames %] ([% borrower.othernames | html %]) [% END %] [% borrower.surname | html %] + [% IF borrower.title %][%- borrower.title | html %] [% END %][%- borrower.firstname | html %] [% IF borrower.othernames %] ([% borrower.othernames | html %]) [% END %] [% borrower.surname | html %] [%- END -%] [%- END -%] [%- IF ( borrower.cardnumber ) -%] @@ -16,9 +16,9 @@ [%- surname | html %] [% IF othernames %] ([% othernames | html %]) [% END %] [%- ELSE %] [%- IF invert_name %] - [%- surname | html %], [% firstname | html %] [% IF othernames %] ([% othernames | html %]) [% END %] + [% IF title %][%- title | html %] [% END %][%- surname | html %], [% firstname | html %] [% IF othernames %] ([% othernames | html %]) [% END %] [%- ELSE %] - [%- firstname | html %] [% IF othernames %] ([% othernames | html %]) [% END %] [% surname | html %] + [% IF title %][%- title | html %] [% END %][%- firstname | html %] [% IF othernames %] ([% othernames | html %]) [% END %] [% surname | html %] [%- END %] [%- END -%] [%- IF ( cardnumber ) -%] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/statistics.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/statistics.tt index 7397339eb1..44a0bcafa1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/statistics.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/statistics.tt @@ -26,7 +26,7 @@ Statistics for [% INCLUDE 'patron-title.inc' %]
@@ -36,7 +36,7 @@ Statistics for [% INCLUDE 'patron-title.inc' %]
[% INCLUDE 'members-toolbar.inc' %] -

Statistics for [% UNLESS ( I ) %][% title %] [% firstname %] [% END %] [% surname %] ([% cardnumber %])

+

Statistics for [% INCLUDE 'patron-title.inc' %]

[% IF ( datas.size ) %] diff --git a/members/statistics.pl b/members/statistics.pl index 55d5ed02b5..07019d3ec5 100755 --- a/members/statistics.pl +++ b/members/statistics.pl @@ -59,9 +59,6 @@ my $borrower= $patron->unblessed; $borrower->{description} = $category->description; $borrower->{category_type} = $category->category_type; -foreach my $key ( keys %$borrower ) { - $template->param( $key => $borrower->{$key} ); -} $template->param( categoryname => $borrower->{'description'}, ); -- 2.39.5