From 9e9ca9f7f9054047cc148b009eeaa70d4242f43d Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 28 Mar 2013 11:30:45 -0400 Subject: [PATCH] Bug 9917 - Routing list tab on patron account should depend on syspref/permission The routing list tab displays on patron pages even if the RoutingSerials preference is OFF. Display of the tab should be conditional on that pref being turned on. This patch adds a check for the RoutingSerials preference to the menu include files and amends the affected scripts to make the variable available on the pages where those includes are used. To test, view the following pages with RoutingSerials both on and off. The routing list tab should be shown and hidden accordingly: - Circulation - Patron details - Patron fines - Pay fines - Pay amount/selected (click from the Pay fines page) - Create manual invoice - Create manual credit - Patron circulation history - Patron modification log - Patron notices - Patron routing lists - Patron statistics - Patron files - Patron permissions - Set patron password - "Can't delete patron" page (try to delete a patron with checkouts). Signed-off-by: Chris Cormack Touches a lot of files, but only a tiny change in each, works well. Could perhaps be set in C4/Auth instead, but that's no reason not to sign off --- circ/circulation.pl | 1 + koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc | 2 +- koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt | 1 + members/boraccount.pl | 1 + members/deletemem.pl | 1 + members/files.pl | 1 + members/mancredit.pl | 1 + members/maninvoice.pl | 1 + members/member-flags.pl | 1 + members/member-password.pl | 3 ++- members/moremember.pl | 1 + members/notices.pl | 1 + members/pay.pl | 5 ++++- members/paycollect.pl | 1 + members/readingrec.pl | 1 + members/routing-lists.pl | 1 + members/statistics.pl | 1 + tools/viewlog.pl | 1 + 18 files changed, 22 insertions(+), 3 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 7ca62f2..ca0862b 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -721,6 +721,7 @@ $template->param( activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), SuspendHoldsIntranet => C4::Context->preference('SuspendHoldsIntranet'), AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds'), + RoutingSerials => C4::Context->preference('RoutingSerials'), ); # save stickyduedate to session 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 f2cd877..fb283ec 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc @@ -69,7 +69,7 @@ [% IF ( CAN_user_updatecharges ) %] [% IF ( finesview ) %]
  • [% ELSE %]
  • [% END %]Fines
  • [% END %] - [% IF ( routinglistview ) %]
  • [% ELSE %]
  • [% END %]Routing Lists
  • + [% IF ( RoutingSerials ) %][% IF ( routinglistview ) %]
  • [% ELSE %]
  • [% END %]Routing lists
  • [% END %] [% IF ( intranetreadinghistory ) %] [% IF ( readingrecordview ) %]
  • [% ELSE %]
  • [% END %]Circulation history
  • [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt index ced2858..abcdccd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt @@ -72,6 +72,7 @@ in the global namespace %] [% IF ( CAN_user_updatecharges ) %] [% IF ( finesview ) %]
  • [% ELSE %]
  • [% END %]Fines
  • [% END %] + [% IF ( RoutingSerials ) %][% IF ( routinglistview ) %]
  • [% ELSE %]
  • [% END %]Routing lists
  • [% END %] [% IF ( intranetreadinghistory ) %][% IF ( readingrecordview ) %]
  • [% ELSE %]
  • [% END %]Circulation history
  • [% END %] [% IF ( CAN_user_parameters ) %][% IF ( logview ) %]
  • [% ELSE %]
  • [% END %]Modification log
  • [% END %] [% IF ( EnhancedMessagingPreferences ) %] diff --git a/members/boraccount.pl b/members/boraccount.pl index eebc8d3..48e2620 100755 --- a/members/boraccount.pl +++ b/members/boraccount.pl @@ -129,6 +129,7 @@ $template->param( reverse_col => $reverse_col, accounts => $accts, activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), + RoutingSerials => C4::Context->preference('RoutingSerials'), ); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/members/deletemem.pl b/members/deletemem.pl index a813cd6..7a78ead 100755 --- a/members/deletemem.pl +++ b/members/deletemem.pl @@ -104,6 +104,7 @@ if ($countissues > 0 or $flags->{'CHARGES'} or $data->{'borrowernumber'}){ branchcode => $bor->{'branchcode'}, branchname => GetBranchName($bor->{'branchcode'}), activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), + RoutingSerials => C4::Context->preference('RoutingSerials'), ); if ($countissues >0) { $template->param(ItemsOnIssues => $countissues); diff --git a/members/files.pl b/members/files.pl index 84bc41e..77d7be5 100755 --- a/members/files.pl +++ b/members/files.pl @@ -104,6 +104,7 @@ else { $template->param( categoryname => $data->{'description'}, branchname => GetBranchName($data->{'branchcode'}), + RoutingSerials => C4::Context->preference('RoutingSerials'), ); if (C4::Context->preference('ExtendedPatronAttributes')) { diff --git a/members/mancredit.pl b/members/mancredit.pl index d8e7f6a..b011d1a 100755 --- a/members/mancredit.pl +++ b/members/mancredit.pl @@ -108,6 +108,7 @@ if (C4::Context->preference('ExtendedPatronAttributes')) { branchname => GetBranchName($data->{'branchcode'}), is_child => ($data->{'category_type'} eq 'C'), activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), + RoutingSerials => C4::Context->preference('RoutingSerials'), ); output_html_with_http_headers $input, $cookie, $template->output; } diff --git a/members/maninvoice.pl b/members/maninvoice.pl index 5bd756a..6331535 100755 --- a/members/maninvoice.pl +++ b/members/maninvoice.pl @@ -135,6 +135,7 @@ if (C4::Context->preference('ExtendedPatronAttributes')) { branchname => GetBranchName($data->{'branchcode'}), is_child => ($data->{'category_type'} eq 'C'), activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), + RoutingSerials => C4::Context->preference('RoutingSerials'), ); output_html_with_http_headers $input, $cookie, $template->output; } diff --git a/members/member-flags.pl b/members/member-flags.pl index ca8c9d0..d1c165c 100755 --- a/members/member-flags.pl +++ b/members/member-flags.pl @@ -192,6 +192,7 @@ $template->param( loop => \@loop, is_child => ($bor->{'category_type'} eq 'C'), activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), + RoutingSerials => C4::Context->preference('RoutingSerials'), ); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/members/member-password.pl b/members/member-password.pl index ebba80a..bed8fc4 100755 --- a/members/member-password.pl +++ b/members/member-password.pl @@ -121,7 +121,8 @@ if (C4::Context->preference('ExtendedPatronAttributes')) { destination => $destination, is_child => ($bor->{'category_type'} eq 'C'), activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), - minPasswordLength => $minpw + minPasswordLength => $minpw, + RoutingSerials => C4::Context->preference('RoutingSerials'), ); if( scalar(@errors )){ diff --git a/members/moremember.pl b/members/moremember.pl index e6f80dd..df6a664 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -424,6 +424,7 @@ $template->param( activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds'), SuspendHoldsIntranet => C4::Context->preference('SuspendHoldsIntranet'), + RoutingSerials => C4::Context->preference('RoutingSerials'), ); $template->param( $error => 1 ) if $error; diff --git a/members/notices.pl b/members/notices.pl index 51a843c..16935d9 100755 --- a/members/notices.pl +++ b/members/notices.pl @@ -69,6 +69,7 @@ $template->param( branchname => GetBranchName($borrower->{'branchcode'}), categoryname => $borrower->{'description'}, activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), + RoutingSerials => C4::Context->preference('RoutingSerials'), ); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/members/pay.pl b/members/pay.pl index 4b918ae..7dbe3eb 100755 --- a/members/pay.pl +++ b/members/pay.pl @@ -100,7 +100,10 @@ for (@names) { } } -$template->param( activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne '') ); +$template->param( + activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), + RoutingSerials => C4::Context->preference('RoutingSerials'), +); add_accounts_to_template(); diff --git a/members/paycollect.pl b/members/paycollect.pl index d66702e..9828fb3 100755 --- a/members/paycollect.pl +++ b/members/paycollect.pl @@ -141,6 +141,7 @@ $template->param( borrower => $borrower, total => $total_due, activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), + RoutingSerials => C4::Context->preference('RoutingSerials'), ); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/members/readingrec.pl b/members/readingrec.pl index ba94149..d41e3f9 100755 --- a/members/readingrec.pl +++ b/members/readingrec.pl @@ -140,6 +140,7 @@ $template->param( loop_reading => $issues, activeBorrowerRelationship => ( C4::Context->preference('borrowerRelationship') ne '' ), + RoutingSerials => C4::Context->preference('RoutingSerials'), ); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/members/routing-lists.pl b/members/routing-lists.pl index 25b0f85..d70c1bc 100755 --- a/members/routing-lists.pl +++ b/members/routing-lists.pl @@ -125,6 +125,7 @@ $template->param( country => $borrower->{'country'}, phone => $borrower->{'phone'} || $borrower->{'mobile'}, cardnumber => $borrower->{'cardnumber'}, + RoutingSerials => C4::Context->preference('RoutingSerials'), ); my ($picture, $dberror) = GetPatronImage($borrower->{'cardnumber'}); diff --git a/members/statistics.pl b/members/statistics.pl index d48cdde..75a30a8 100755 --- a/members/statistics.pl +++ b/members/statistics.pl @@ -104,6 +104,7 @@ $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; diff --git a/tools/viewlog.pl b/tools/viewlog.pl index 29386b3..e48aaef 100755 --- a/tools/viewlog.pl +++ b/tools/viewlog.pl @@ -96,6 +96,7 @@ if ($src eq 'circ') { # if we were called from circulation, use the circulatio email => $data->{'email'}, branchcode => $data->{'branchcode'}, branchname => GetBranchName($data->{'branchcode'}), + RoutingSerials => C4::Context->preference('RoutingSerials'), ); } -- 1.7.10.4