View | Details | Raw Unified | Return to bug 30232
Collapse All | Expand All

(-)a/acqui/basket.pl (-3 / +2 lines)
Lines 95-101 my $rs = $schema->resultset('VendorEdiAccount')->search( Link Here
95
    { vendor_id => $booksellerid, } );
95
    { vendor_id => $booksellerid, } );
96
$template->param( ediaccount => ($rs->count > 0));
96
$template->param( ediaccount => ($rs->count > 0));
97
97
98
unless (CanUserManageBasket($loggedinuser, $basket, $userflags)) {
98
unless (CanUserManageBasket($logged_in_patron->unblessed, $basket, $userflags)) {
99
    $template->param(
99
    $template->param(
100
        cannot_manage_basket => 1,
100
        cannot_manage_basket => 1,
101
        basketno => $basketno,
101
        basketno => $basketno,
Lines 287-294 if ( $op eq 'list' ) { Link Here
287
287
288
#if the basket is closed,and the user has the permission to edit basketgroups, display a list of basketgroups
288
#if the basket is closed,and the user has the permission to edit basketgroups, display a list of basketgroups
289
    my ($basketgroup, $basketgroups);
289
    my ($basketgroup, $basketgroups);
290
    my $patron = Koha::Patrons->find($loggedinuser);
290
    if ($basket->{closedate} && haspermission($logged_in_patron->userid, { acquisition => 'group_manage'} )) {
291
    if ($basket->{closedate} && haspermission($patron->userid, { acquisition => 'group_manage'} )) {
292
        $basketgroups = GetBasketgroups($basket->{booksellerid});
291
        $basketgroups = GetBasketgroups($basket->{booksellerid});
293
        for my $bg ( @{$basketgroups} ) {
292
        for my $bg ( @{$basketgroups} ) {
294
            if ($basket->{basketgroupid} && $basket->{basketgroupid} == $bg->{id}){
293
            if ($basket->{basketgroupid} && $basket->{basketgroupid} == $bg->{id}){
(-)a/acqui/booksellers.pl (-8 / +4 lines)
Lines 96-107 if ( $supplier_count == 1 ) { Link Here
96
    );
96
    );
97
}
97
}
98
98
99
my $uid;
99
# FIXME Should not be needed, logged in patron should be cached
100
# FIXME This script should only be accessed by a valid logged in patron
100
my $logged_in_patron = Koha::Patrons->find($loggedinuser);
101
if ($loggedinuser) {
101
my $logged_in_patron_unblessed = $logged_in_patron->unblessed;
102
    # FIXME Should not be needed, logged in patron should be cached
103
    $uid = Koha::Patrons->find( $loggedinuser )->userid;
104
}
105
102
106
my $userenv = C4::Context::userenv;
103
my $userenv = C4::Context::userenv;
107
my $viewbaskets = C4::Context->preference('AcqViewBaskets');
104
my $viewbaskets = C4::Context->preference('AcqViewBaskets');
Lines 126-132 for my $vendor (@suppliers) { Link Here
126
    my $loop_basket = [];
123
    my $loop_basket = [];
127
124
128
    for my $basket ( @{$baskets} ) {
125
    for my $basket ( @{$baskets} ) {
129
        if (CanUserManageBasket($loggedinuser, $basket, $userflags)) {
126
        if (CanUserManageBasket($logged_in_patron_unblessed, $basket, $userflags)) {
130
            my $patron = Koha::Patrons->find( $basket->{authorisedby} );
127
            my $patron = Koha::Patrons->find( $basket->{authorisedby} );
131
            foreach (qw(total_items total_biblios expected_items)) {
128
            foreach (qw(total_items total_biblios expected_items)) {
132
                $basket->{$_} ||= 0;
129
                $basket->{$_} ||= 0;
133
- 

Return to bug 30232