Bug 14039: Add the title to all places
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 9 Aug 2017 19:45:31 +0000 (16:45 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 9 Oct 2017 19:15:50 +0000 (16:15 -0300)
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 <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc
koha-tmpl/intranet-tmpl/prog/en/modules/members/statistics.tt
members/statistics.pl

index 418ac7f..b2cbfb8 100644 (file)
@@ -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 %]<span class="patron-title">[%- borrower.title | html %]</span> [% END %][%- borrower.surname | html %], [% borrower.firstname | html %] [% IF borrower.othernames %] ([% borrower.othernames | html %]) [% END %]
         [%- ELSE %]
-            [% IF borrower.title %] <span class="patron-title">[%- borrower.title | html %] </span>[% END %][%- borrower.firstname | html %] [% IF borrower.othernames %] ([% borrower.othernames | html %]) [% END %] [% borrower.surname | html %]
+            [% IF borrower.title %]<span class="patron-title">[%- borrower.title | html %]</span> [% 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 %]<span class="patron-title">[%- title | html %]</span> [% END %][%- surname | html %], [% firstname | html %] [% IF othernames %] ([% othernames | html %]) [% END %]
         [%- ELSE %]
-            [%- firstname | html %] [% IF othernames %] ([% othernames | html %]) [% END %] [% surname | html %]
+            [% IF title %]<span class="patron-title">[%- title | html %]</span> [% END %][%- firstname | html %] [% IF othernames %] ([% othernames | html %]) [% END %] [% surname | html %]
         [%- END %]
     [%- END -%]
     [%- IF ( cardnumber ) -%]
index 7397339..44a0bca 100644 (file)
@@ -26,7 +26,7 @@ Statistics for [% INCLUDE 'patron-title.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; Statistics for [% firstname %] [% surname %] ([% cardnumber %])
+&rsaquo; [% IF ( unknowuser ) %]Patron does not exist[% ELSE %]Statistics for [% INCLUDE 'patron-title.inc' invert_name = 1 %][% END %]
 </div>
 
 <div id="doc3" class="yui-t1">
@@ -36,7 +36,7 @@ Statistics for [% INCLUDE 'patron-title.inc' %]
         <div class="yui-b">
         [% INCLUDE 'members-toolbar.inc' %]
 
-            <h3>Statistics for [% UNLESS ( I ) %][% title %] [% firstname %] [% END %] [% surname %] ([% cardnumber %])</h3>
+            <h3>Statistics for [% INCLUDE 'patron-title.inc' %]</h3>
             [% IF ( datas.size ) %]
                 <table id="statistics">
                 <thead>
index 55d5ed0..07019d3 100755 (executable)
@@ -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'},
 );