Bug 19621: Use Koha.Preference on template side to display/hide "Routing lists" tab
authorNick Clemens <nick@bywatersolutions.com>
Mon, 13 Nov 2017 17:18:44 +0000 (17:18 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 22 Dec 2017 16:15:36 +0000 (13:15 -0300)
Patch applies without issue and functions as described.

Signed-off-by: Dilan Johnpullé <dilan@calyx.net.au>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

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

17 files changed:
koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc
members/boraccount.pl
members/deletemem.pl
members/files.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/purchase-suggestions.pl
members/readingrec.pl
members/routing-lists.pl
members/statistics.pl
tools/viewlog.pl

index de75551..7a419bd 100644 (file)
@@ -81,7 +81,7 @@
         [% IF ( finesview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrowernumber %]">Fines</a></li>
     [% END %]
     [% IF ( CAN_user_circulate_circulate_remaining_permissions  )  %]
-        [% IF ( 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=[% borrowernumber %]">Routing lists</a></li>[% END %]
     [% END %]
     [% IF ( CAN_user_borrowers ) %]
         [% IF ( intranetreadinghistory ) %]
index e7d769e..ac7cee2 100755 (executable)
@@ -117,7 +117,6 @@ $template->param(
     is_child            => ($patron->category->category_type eq 'C'),
     reverse_col         => $reverse_col,
     accounts            => $accts,
-    RoutingSerials => C4::Context->preference('RoutingSerials'),
 );
 
 output_html_with_http_headers $input, $cookie, $template->output;
index 4cbb4d6..ea12ae6 100755 (executable)
@@ -132,7 +132,6 @@ if ( $op eq 'delete_confirm' or $countissues > 0 or $flags->{'CHARGES'}  or $is_
         phone => $patron->phone,
         email => $patron->email,
         branchcode => $patron->branchcode,
-        RoutingSerials => C4::Context->preference('RoutingSerials'),
     );
     if ($countissues >0) {
         $template->param(ItemsOnIssues => $countissues);
index 8cc25a9..069182d 100755 (executable)
@@ -109,7 +109,6 @@ else {
 
     $template->param(
         categoryname    => $patron_category->description,
-        RoutingSerials => C4::Context->preference('RoutingSerials'),
     );
 
     if (C4::Context->preference('ExtendedPatronAttributes')) {
index 5a93e95..7534b83 100755 (executable)
@@ -101,7 +101,6 @@ if ($add){
         borrowernumber => $borrowernumber,
         categoryname   => $patron->category->description,
         is_child       => ($patron->category->category_type eq 'C'), # FIXME is_child should be a Koha::Patron method
-        RoutingSerials => C4::Context->preference('RoutingSerials'),
         );
     output_html_with_http_headers $input, $cookie, $template->output;
 }
index bd24a10..44d2b18 100755 (executable)
@@ -127,7 +127,6 @@ if ($add){
         borrowernumber => $borrowernumber,
         categoryname   => $patron->category->description,
         is_child       => ($patron->category->category_type eq 'C'),
-        RoutingSerials => C4::Context->preference('RoutingSerials'),
     );
     output_html_with_http_headers $input, $cookie, $template->output;
 }
index 158074a..27e020c 100755 (executable)
@@ -219,7 +219,6 @@ $template->param(
     branchcode     => $bor->{'branchcode'},
     loop           => \@loop,
     is_child       => ( $category_type eq 'C' ),
-    RoutingSerials => C4::Context->preference('RoutingSerials'),
     csrf_token =>
         Koha::Token->new->generate_csrf( { session_id => scalar $input->cookie('CGISESSID'), } ),
 );
index c458ae8..db51b17 100755 (executable)
@@ -145,7 +145,6 @@ $template->param(
     userid                     => $bor->{'userid'},
     destination                => $destination,
     is_child                   => ( $category_type eq 'C' ),
-    RoutingSerials             => C4::Context->preference('RoutingSerials'),
     csrf_token                 => Koha::Token->new->generate_csrf({ session_id => scalar $input->cookie('CGISESSID'), }),
 );
 
index 2a54cbe..27185ef 100755 (executable)
@@ -357,7 +357,6 @@ $template->param(
     quickslip       => $quickslip,
     housebound_role => scalar $patron->housebound_role,
     privacy_guarantor_checkouts => $data->{'privacy_guarantor_checkouts'},
-    RoutingSerials => C4::Context->preference('RoutingSerials'),
     PatronsPerPage => C4::Context->preference("PatronsPerPage") || 20,
     relatives_issues_count => $relatives_issues_count,
     relatives_borrowernumbers => \@relatives,
index 9f0ab11..7129f18 100755 (executable)
@@ -82,7 +82,6 @@ $template->param(
     borrowernumber     => $borrowernumber,
     sentnotices        => 1,
     categoryname       => $patron->category->description,
-    RoutingSerials => C4::Context->preference('RoutingSerials'),
 );
 output_html_with_http_headers $input, $cookie, $template->output;
 
index ce35b0a..b1add01 100755 (executable)
@@ -123,7 +123,6 @@ for (@names) {
 
 $template->param(
     finesview => 1,
-    RoutingSerials => C4::Context->preference('RoutingSerials'),
 );
 
 add_accounts_to_template();
index b4ea12b..6bf0fee 100755 (executable)
@@ -184,7 +184,6 @@ $template->param(
     borrower      => $borrower,
     categoryname  => $borrower->{description},
     total         => $total_due,
-    RoutingSerials => C4::Context->preference('RoutingSerials'),
     ExtendedPatronAttributes => C4::Context->preference('ExtendedPatronAttributes'),
 
     csrf_token => Koha::Token->new->generate_csrf({ session_id => scalar $input->cookie('CGISESSID') }),
index 5acc3cc..f6df07d 100755 (executable)
@@ -57,7 +57,6 @@ foreach my $key ( keys %$data ) {
 $template->param(
     suggestionsview  => 1,
     categoryname => $data->{'description'},
-    RoutingSerials => C4::Context->preference('RoutingSerials'),
 );
 
 if (C4::Context->preference('ExtendedPatronAttributes')) {
index ba5e174..7fe990d 100755 (executable)
@@ -131,7 +131,6 @@ $template->param(
     categoryname      => $data->{description},
     is_child          => ( $data->{category_type} eq 'C' ),
     loop_reading      => $issues,
-    RoutingSerials => C4::Context->preference('RoutingSerials'),
 );
 output_html_with_http_headers $input, $cookie, $template->output;
 
index b03be94..be9a863 100755 (executable)
@@ -91,7 +91,6 @@ $template->param(
     borrowernumber    => $borrowernumber,
     branch            => $branch,
     categoryname      => $patron_info->{description},
-    RoutingSerials    => C4::Context->preference('RoutingSerials'),
 );
 
 if (C4::Context->preference('ExtendedPatronAttributes')) {
index 07019d3..ffed672 100755 (executable)
@@ -107,7 +107,6 @@ $template->param(
     count_total_issues_returned => $count_total_issues_returned,
     count_total_precedent_state => $count_total_precedent_state,
     count_total_actual_state => $count_total_actual_state,
-    RoutingSerials => C4::Context->preference('RoutingSerials'),
 );
 
 output_html_with_http_headers $input, $cookie, $template->output;
index 00469ba..0b11aac 100755 (executable)
@@ -95,7 +95,6 @@ if ( $src eq 'circ' ) {
         menu           => 1,
         borrowernumber => $borrowernumber,
         categoryname   => $patron->category->description,
-        RoutingSerials => C4::Context->preference('RoutingSerials'),
     );
 }