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

(-)a/acqui/acqui-home.pl (-1 / +4 lines)
Lines 46-51 my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user( Link Here
46
    }
46
    }
47
);
47
);
48
48
49
my $logged_in_patron = Koha::Patrons->find($loggedinuser);
50
my $logged_in_patron_unblessed = $logged_in_patron->unblessed;
51
49
my $status           = $query->param('status') || "ASKED";
52
my $status           = $query->param('status') || "ASKED";
50
# Get current branch count and total viewable count, if they don't match then pass
53
# Get current branch count and total viewable count, if they don't match then pass
51
# both to template
54
# both to template
Lines 77-83 my $totavail_active = 0; Link Here
77
80
78
my @budget_loop;
81
my @budget_loop;
79
foreach my $budget ( @{$budget_arr} ) {
82
foreach my $budget ( @{$budget_arr} ) {
80
    next unless (CanUserUseBudget($loggedinuser, $budget, $userflags));
83
    next unless (CanUserUseBudget($logged_in_patron_unblessed, $budget, $userflags));
81
84
82
    my $patron = Koha::Patrons->find( $budget->{budget_owner_id} );
85
    my $patron = Koha::Patrons->find( $budget->{budget_owner_id} );
83
    if ( $patron ) {
86
    if ( $patron ) {
(-)a/acqui/basket.pl (-3 / +4 lines)
Lines 85-91 our ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user( Link Here
85
    }
85
    }
86
);
86
);
87
87
88
my $logged_in_patron = Koha::Patrons->find( $loggedinuser );
88
my $logged_in_patron = Koha::Patrons->find($loggedinuser);
89
my $logged_in_patron_unblessed = $logged_in_patron->unblessed;
89
90
90
our $basket = GetBasket($basketno);
91
our $basket = GetBasket($basketno);
91
$booksellerid = $basket->{booksellerid} unless $booksellerid;
92
$booksellerid = $basket->{booksellerid} unless $booksellerid;
Lines 95-101 my $rs = $schema->resultset('VendorEdiAccount')->search( Link Here
95
    { vendor_id => $booksellerid, } );
96
    { vendor_id => $booksellerid, } );
96
$template->param( ediaccount => ($rs->count > 0));
97
$template->param( ediaccount => ($rs->count > 0));
97
98
98
unless (CanUserManageBasket($logged_in_patron->unblessed, $basket, $userflags)) {
99
unless (CanUserManageBasket($logged_in_patron_unblessed, $basket, $userflags)) {
99
    $template->param(
100
    $template->param(
100
        cannot_manage_basket => 1,
101
        cannot_manage_basket => 1,
101
        basketno => $basketno,
102
        basketno => $basketno,
Lines 370-376 if ( $op eq 'list' ) { Link Here
370
    my $budgets = GetBudgetHierarchy;
371
    my $budgets = GetBudgetHierarchy;
371
    my $has_budgets = 0;
372
    my $has_budgets = 0;
372
    foreach my $r (@{$budgets}) {
373
    foreach my $r (@{$budgets}) {
373
        next unless (CanUserUseBudget($loggedinuser, $r, $userflags));
374
        next unless (CanUserUseBudget($logged_in_patron_unblessed, $r, $userflags));
374
375
375
        $has_budgets = 1;
376
        $has_budgets = 1;
376
        last;
377
        last;
(-)a/acqui/booksellers.pl (-1 / +1 lines)
Lines 108-114 my $userbranch = $userenv->{branch}; Link Here
108
my $budgets = GetBudgetHierarchy;
108
my $budgets = GetBudgetHierarchy;
109
my $has_budgets = 0;
109
my $has_budgets = 0;
110
foreach my $r (@{$budgets}) {
110
foreach my $r (@{$budgets}) {
111
    next unless (CanUserUseBudget($loggedinuser, $r, $userflags));
111
    next unless (CanUserUseBudget($logged_in_patron_unblessed, $r, $userflags));
112
112
113
    $has_budgets = 1;
113
    $has_budgets = 1;
114
    last;
114
    last;
(-)a/acqui/invoice.pl (-2 / +4 lines)
Lines 52-58 my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( Link Here
52
    }
52
    }
53
);
53
);
54
54
55
my $logged_in_patron = Koha::Patrons->find( $loggedinuser );
55
my $logged_in_patron = Koha::Patrons->find($loggedinuser);
56
my $logged_in_patron_unblessed = $logged_in_patron->unblessed;
57
56
my $invoiceid = $input->param('invoiceid');
58
my $invoiceid = $input->param('invoiceid');
57
my $op        = $input->param('op');
59
my $op        = $input->param('op');
58
60
Lines 279-285 my $shipmentcost_budgetid = $details->{shipmentcost_budgetid}; Link Here
279
my $budget_loop = [];
281
my $budget_loop = [];
280
my $budgets     = GetBudgetHierarchy();
282
my $budgets     = GetBudgetHierarchy();
281
foreach my $r ( @{$budgets} ) {
283
foreach my $r ( @{$budgets} ) {
282
    next unless ( CanUserUseBudget( $loggedinuser, $r, $flags ) );
284
    next unless ( CanUserUseBudget( $logged_in_patron_unblessed, $r, $flags ) );
283
285
284
    my $selected = $shipmentcost_budgetid ? $r->{budget_id} eq $shipmentcost_budgetid : 0;
286
    my $selected = $shipmentcost_budgetid ? $r->{budget_id} eq $shipmentcost_budgetid : 0;
285
287
(-)a/acqui/invoices.pl (-1 / +5 lines)
Lines 36-41 use C4::Acquisition qw( GetInvoices GetInvoice ); Link Here
36
use C4::Budgets qw( GetBudget GetBudgets CanUserUseBudget );
36
use C4::Budgets qw( GetBudget GetBudgets CanUserUseBudget );
37
use Koha::DateUtils qw( dt_from_string output_pref );
37
use Koha::DateUtils qw( dt_from_string output_pref );
38
use Koha::Acquisition::Booksellers;
38
use Koha::Acquisition::Booksellers;
39
use Koha::Patrons;
39
40
40
my $input = CGI->new;
41
my $input = CGI->new;
41
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
42
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
Lines 47-52 my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( Link Here
47
    }
48
    }
48
);
49
);
49
50
51
my $logged_in_patron = Koha::Patrons->find($loggedinuser);
52
my $logged_in_patron_unblessed = $logged_in_patron->unblessed;
53
50
my $invoicenumber    = $input->param('invoicenumber');
54
my $invoicenumber    = $input->param('invoicenumber');
51
my $supplierid       = $input->param('supplierid');
55
my $supplierid       = $input->param('supplierid');
52
my $shipmentdatefrom = $input->param('shipmentdatefrom');
56
my $shipmentdatefrom = $input->param('shipmentdatefrom');
Lines 107-113 foreach (@suppliers) { Link Here
107
my $budgets = GetBudgets();
111
my $budgets = GetBudgets();
108
my @budgets_loop;
112
my @budgets_loop;
109
foreach my $budget (@$budgets) {
113
foreach my $budget (@$budgets) {
110
    push @budgets_loop, $budget if CanUserUseBudget( $loggedinuser, $budget, $flags );
114
    push @budgets_loop, $budget if CanUserUseBudget( $logged_in_patron_unblessed, $budget, $flags );
111
}
115
}
112
116
113
my (@openedinvoices, @closedinvoices);
117
my (@openedinvoices, @closedinvoices);
(-)a/acqui/parcels.pl (-2 / +5 lines)
Lines 76-81 use C4::Budgets qw( GetBudgetHierarchy GetBudget CanUserUseBudget ); Link Here
76
76
77
use Koha::Acquisition::Booksellers;
77
use Koha::Acquisition::Booksellers;
78
use Koha::DateUtils qw( output_pref dt_from_string );
78
use Koha::DateUtils qw( output_pref dt_from_string );
79
use Koha::Patrons;
79
80
80
my $input          = CGI->new;
81
my $input          = CGI->new;
81
my $booksellerid     = $input->param('booksellerid');
82
my $booksellerid     = $input->param('booksellerid');
Lines 96-101 our ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( Link Here
96
    }
97
    }
97
);
98
);
98
99
100
my $logged_in_patron = Koha::Patrons->find($loggedinuser);
101
my $logged_in_patron_unblessed = $logged_in_patron->unblessed;
102
99
my $invoicenumber = $input->param('invoice');
103
my $invoicenumber = $input->param('invoice');
100
my $shipmentcost = $input->param('shipmentcost');
104
my $shipmentcost = $input->param('shipmentcost');
101
my $shipmentcost_budgetid = $input->param('shipmentcost_budgetid');
105
my $shipmentcost_budgetid = $input->param('shipmentcost_budgetid');
Lines 179-185 if ($count_parcels) { Link Here
179
my $budget_loop = [];
183
my $budget_loop = [];
180
my $budgets = GetBudgetHierarchy;
184
my $budgets = GetBudgetHierarchy;
181
foreach my $r (@{$budgets}) {
185
foreach my $r (@{$budgets}) {
182
    next unless (CanUserUseBudget($loggedinuser, $r, $flags));
186
    next unless (CanUserUseBudget($logged_in_patron_unblessed, $r, $flags));
183
    push @{$budget_loop}, {
187
    push @{$budget_loop}, {
184
        b_id  => $r->{budget_id},
188
        b_id  => $r->{budget_id},
185
        b_txt => $r->{budget_name},
189
        b_txt => $r->{budget_name},
186
- 

Return to bug 30232