Permalink
Browse files

Bug 9917 - Routing list tab on patron account should depend on syspre…

…f/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 <chrisc@catalyst.net.nz>

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

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
  • Loading branch information...
oleonard authored and jcamins committed Mar 28, 2013
1 parent c7cb7f6 commit a4e804fceb6061d1e3c4f404a1b08649cf71563c
View
@@ -721,6 +721,7 @@ sub build_issue_data {
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
@@ -69,7 +69,7 @@
[% IF ( CAN_user_updatecharges ) %]
[% IF ( finesview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrowernumber %]">Fines</a></li>
[% END %]
- [% IF ( routinglistview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/routing-lists.pl?borrowernumber=[% borrowernumber %]">Routing Lists</a></li>
+ [% 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 ( intranetreadinghistory ) %]
[% IF ( readingrecordview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/readingrec.pl?borrowernumber=[% borrowernumber %]">Circulation history</a></li>
[% END %]
@@ -72,6 +72,7 @@ in the global namespace %]
[% IF ( CAN_user_updatecharges ) %]
[% IF ( finesview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrower.borrowernumber %]">Fines</a></li>
[% END %]
+ [% 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 ( intranetreadinghistory ) %][% IF ( readingrecordview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/readingrec.pl?borrowernumber=[% borrower.borrowernumber %]">Circulation history</a></li>[% END %]
[% IF ( CAN_user_parameters ) %][% IF ( logview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/tools/viewlog.pl?do_it=1&amp;modules=MEMBERS&amp;modules=circulation&amp;object=[% borrower.borrowernumber %]&amp;src=circ">Modification log</a></li>[% END %]
[% IF ( EnhancedMessagingPreferences ) %]
View
@@ -129,6 +129,7 @@
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;
View
@@ -104,6 +104,7 @@
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);
View
@@ -104,6 +104,7 @@
$template->param(
categoryname => $data->{'description'},
branchname => GetBranchName($data->{'branchcode'}),
+ RoutingSerials => C4::Context->preference('RoutingSerials'),
);
if (C4::Context->preference('ExtendedPatronAttributes')) {
View
@@ -108,6 +108,7 @@
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;
}
View
@@ -135,6 +135,7 @@
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;
}
View
@@ -192,6 +192,7 @@
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;
@@ -121,7 +121,8 @@
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 )){
View
@@ -424,6 +424,7 @@ BEGIN
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;
View
@@ -69,6 +69,7 @@
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;
View
@@ -100,7 +100,10 @@ =head1 pay.pl
}
}
-$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();
View
@@ -141,6 +141,7 @@
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;
View
@@ -140,6 +140,7 @@
loop_reading => $issues,
activeBorrowerRelationship =>
( C4::Context->preference('borrowerRelationship') ne '' ),
+ RoutingSerials => C4::Context->preference('RoutingSerials'),
);
output_html_with_http_headers $input, $cookie, $template->output;
View
@@ -125,6 +125,7 @@
country => $borrower->{'country'},
phone => $borrower->{'phone'} || $borrower->{'mobile'},
cardnumber => $borrower->{'cardnumber'},
+ RoutingSerials => C4::Context->preference('RoutingSerials'),
);
my ($picture, $dberror) = GetPatronImage($borrower->{'cardnumber'});
View
@@ -104,6 +104,7 @@ =head1 members/statistics.pl
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;
View
@@ -96,6 +96,7 @@ =head1 viewlog.pl
email => $data->{'email'},
branchcode => $data->{'branchcode'},
branchname => GetBranchName($data->{'branchcode'}),
+ RoutingSerials => C4::Context->preference('RoutingSerials'),
);
}

0 comments on commit a4e804f

Please sign in to comment.