@@ -, +, @@ CanUserManageBasket() but not 'order_manage_all' --- acqui/basket.pl | 5 ++--- acqui/booksellers.pl | 11 ++++------- 2 files changed, 6 insertions(+), 10 deletions(-) --- a/acqui/basket.pl +++ a/acqui/basket.pl @@ -95,7 +95,7 @@ my $rs = $schema->resultset('VendorEdiAccount')->search( { vendor_id => $booksellerid, } ); $template->param( ediaccount => ($rs->count > 0)); -unless (CanUserManageBasket($loggedinuser, $basket, $userflags)) { +unless (CanUserManageBasket($logged_in_patron->unblessed, $basket, $userflags)) { $template->param( cannot_manage_basket => 1, basketno => $basketno, @@ -287,8 +287,7 @@ if ( $op eq 'list' ) { #if the basket is closed,and the user has the permission to edit basketgroups, display a list of basketgroups my ($basketgroup, $basketgroups); - my $patron = Koha::Patrons->find($loggedinuser); - if ($basket->{closedate} && haspermission($patron->userid, { acquisition => 'group_manage'} )) { + if ($basket->{closedate} && haspermission($logged_in_patron->userid, { acquisition => 'group_manage'} )) { $basketgroups = GetBasketgroups($basket->{booksellerid}); for my $bg ( @{$basketgroups} ) { if ($basket->{basketgroupid} && $basket->{basketgroupid} == $bg->{id}){ --- a/acqui/booksellers.pl +++ a/acqui/booksellers.pl @@ -96,12 +96,9 @@ if ( $supplier_count == 1 ) { ); } -my $uid; -# FIXME This script should only be accessed by a valid logged in patron -if ($loggedinuser) { - # FIXME Should not be needed, logged in patron should be cached - $uid = Koha::Patrons->find( $loggedinuser )->userid; -} +# FIXME Should not be needed, logged in patron should be cached +my $logged_in_patron = Koha::Patrons->find($loggedinuser); +my $logged_in_patron_unblessed = $logged_in_patron->unblessed; my $userenv = C4::Context::userenv; my $viewbaskets = C4::Context->preference('AcqViewBaskets'); @@ -126,7 +123,7 @@ for my $vendor (@suppliers) { my $loop_basket = []; for my $basket ( @{$baskets} ) { - if (CanUserManageBasket($loggedinuser, $basket, $userflags)) { + if (CanUserManageBasket($logged_in_patron_unblessed, $basket, $userflags)) { my $patron = Koha::Patrons->find( $basket->{authorisedby} ); foreach (qw(total_items total_biblios expected_items)) { $basket->{$_} ||= 0; --