From f15376c623434a7eff9e912de600e12fdbfd2c53 Mon Sep 17 00:00:00 2001 From: Zoe Bennett Date: Thu, 18 Jan 2018 01:44:11 +0000 Subject: [PATCH] Bug 17765: Changed variable $flags to $userflags to eliminate the issue of masking declaration in the same scope. Hides 'Holds' link on the 'Details' and 'Checkout' pages when the user does not have the permission to 'reserveforothers'. Test Plan: 1) With a user who has the permission to 'reserveforothers' check that the 'Holds' link is on the 'Details' and 'Check out' pages 2) Then with a user who does not have the permission to 'reserveforothers' check that on the 'Details' and 'Check out' pages there is no longer the 'Holds' link next to the 'Checkouts' and 'Fines & Charges' tabs. --- circ/circulation.pl | 8 +++++--- members/moremember.pl | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 4438dfb..5f61507 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -176,9 +176,11 @@ my $print = $query->param('print') || q{}; my $debt_confirmed = $query->param('debt_confirmed') || 0; # Don't show the debt error dialog twice my $charges = $query->param('charges') || q{}; -my $flags = C4::Auth::getuserflags($patron->flags, $patron->userid); -if (ref $flags->{reserveforothers} && $flags->{reserveforothers}){ - $template->param( has_reserveforothers_permission => 1 )} +my $userflags = C4::Auth::getuserflags($patron->flags, $patron->userid); +warn($userflags->{reserveforothers}); +if ($userflags->{reserveforothers}){ + $template->param( has_reserveforothers_permission => 1 ); +} # Check if stickyduedate is turned off if ( @$barcodes ) { diff --git a/members/moremember.pl b/members/moremember.pl index 56db5dd..e32cdde 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -167,8 +167,8 @@ if ( $patron->is_debarred ) { } } -my $flags = C4::Auth::getuserflags($patron->flags, $patron->userid); -if (ref $flags->{reserveforothers} && $flags->{reserveforothers}){ +my $userflags = C4::Auth::getuserflags($patron->flags, $patron->userid); +if ($userflags->{reserveforothers}){ $template->param( has_reserveforothers_permission => 1); } -- 2.1.4