From c188dc17dce45d3ca6b9e13b926e6c9ee9ba7e7c 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); --- koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc | 8 ++++---- koha-tmpl/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 ae5c276dc0..7c8ba139f1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/statistics.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/statistics.tt @@ -30,7 +30,7 @@
@@ -40,7 +40,7 @@
[% 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 5979e7f1dd..bfeb714cd0 100755 --- a/members/statistics.pl +++ b/members/statistics.pl @@ -60,9 +60,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.11.0