From 020434f2754ced867f41f8d04776807a3143c54f Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 9 Jan 2015 16:10:11 +0100 Subject: [PATCH] Bug 13417: Remove warnings Without this patch perl -wc C4/VirtualShelves.pm failed: Constant subroutine C4::VirtualShelves::SHELVES_MASTHEAD_MAX redefined at /usr/share/perl/5.20/constant.pm line 156. Constant subroutine C4::VirtualShelves::SHELVES_COMBO_MAX redefined at /usr/share/perl/5.20/constant.pm line 156. Constant subroutine C4::VirtualShelves::SHELVES_MGRPAGE_MAX redefined at /usr/share/perl/5.20/constant.pm line 156. Constant subroutine C4::VirtualShelves::SHELVES_POPUP_MAX redefined at /usr/share/perl/5.20/constant.pm line 156. Constant subroutine C4::VirtualShelves::SHARE_INVITATION_EXPIRY_DAYS redefined at /usr/share/perl/5.20/constant.pm line 156. Subroutine GetShelves redefined at C4/VirtualShelves.pm line 103. Subroutine GetAllShelves redefined at C4/VirtualShelves.pm line 159. Subroutine GetSomeShelfNames redefined at C4/VirtualShelves.pm line 189. Subroutine GetShelf redefined at C4/VirtualShelves.pm line 230. Subroutine GetShelfContents redefined at C4/VirtualShelves.pm line 262. Subroutine AddShelf redefined at C4/VirtualShelves.pm line 315. Subroutine AddToShelf redefined at C4/VirtualShelves.pm line 353. Subroutine ModShelf redefined at C4/VirtualShelves.pm line 394. Subroutine ShelfPossibleAction redefined at C4/VirtualShelves.pm line 454. Subroutine DelFromShelf redefined at C4/VirtualShelves.pm line 545. Subroutine DelShelf redefined at C4/VirtualShelves.pm line 589. Subroutine GetBibliosShelves redefined at C4/VirtualShelves.pm line 603. Subroutine ShelvesMax redefined at C4/VirtualShelves.pm line 628. Subroutine HandleDelBorrower redefined at C4/VirtualShelves.pm line 648. Subroutine AddShare redefined at C4/VirtualShelves.pm line 683. Subroutine AcceptShare redefined at C4/VirtualShelves.pm line 703. Subroutine IsSharedList redefined at C4/VirtualShelves.pm line 731. Subroutine RemoveShare redefined at C4/VirtualShelves.pm line 750. Subroutine _shelf_count redefined at C4/VirtualShelves.pm line 764. Subroutine _CheckShelfName redefined at C4/VirtualShelves.pm line 788. C4/VirtualShelves.pm syntax OK Signed-off-by: Tomas Cohen Arazi --- C4/VirtualShelves.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/VirtualShelves.pm b/C4/VirtualShelves.pm index 7905b56df8..ab24a85a91 100644 --- a/C4/VirtualShelves.pm +++ b/C4/VirtualShelves.pm @@ -21,7 +21,6 @@ use strict; use warnings; use Carp; -use C4::Auth; use C4::Context; use C4::Debug; use C4::Members; @@ -465,6 +464,7 @@ sub ShelfPossibleAction { if ( $user > 0 and $action eq 'delete_shelf' ) { my $borrower = C4::Members::GetMember( borrowernumber => $user ); + require C4::Auth; return 1 if C4::Auth::haspermission( $borrower->{userid}, { shelves => 'delete_public_lists' } ); } -- 2.39.5