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/addorderiso2709.pl (-4 / +4 lines)
Lines 68-73 my $op = $cgiparams->{'op'} || ''; Link Here
68
my $booksellerid  = $input->param('booksellerid');
68
my $booksellerid  = $input->param('booksellerid');
69
my $allmatch = $input->param('allmatch');
69
my $allmatch = $input->param('allmatch');
70
my $bookseller = Koha::Acquisition::Booksellers->find( $booksellerid );
70
my $bookseller = Koha::Acquisition::Booksellers->find( $booksellerid );
71
my $logged_in_patron = Koha::Patrons->find($loggedinuser);
72
my $logged_in_patron_unblessed = $logged_in_patron->unblessed;
71
73
72
$template->param(scriptname => "/cgi-bin/koha/acqui/addorderiso2709.pl",
74
$template->param(scriptname => "/cgi-bin/koha/acqui/addorderiso2709.pl",
73
                booksellerid => $booksellerid,
75
                booksellerid => $booksellerid,
Lines 312-325 if ($op eq ""){ Link Here
312
            }
314
            }
313
        } else {
315
        } else {
314
            # 3rd add order
316
            # 3rd add order
315
            my $patron = Koha::Patrons->find( $loggedinuser );
316
            # get quantity in the MARC record (1 if none)
317
            # get quantity in the MARC record (1 if none)
317
            my $quantity = GetMarcQuantity($marcrecord, C4::Context->preference('marcflavour')) || 1;
318
            my $quantity = GetMarcQuantity($marcrecord, C4::Context->preference('marcflavour')) || 1;
318
            my %orderinfo = (
319
            my %orderinfo = (
319
                biblionumber       => $biblionumber,
320
                biblionumber       => $biblionumber,
320
                basketno           => $cgiparams->{'basketno'},
321
                basketno           => $cgiparams->{'basketno'},
321
                quantity           => $c_quantity,
322
                quantity           => $c_quantity,
322
                branchcode         => $patron->branchcode,
323
                branchcode         => $logged_in_patron->branchcode,
323
                budget_id          => $c_budget_id,
324
                budget_id          => $c_budget_id,
324
                uncertainprice     => 1,
325
                uncertainprice     => 1,
325
                sort1              => $c_sort1,
326
                sort1              => $c_sort1,
Lines 406-419 if ($op eq ""){ Link Here
406
my $budgets = GetBudgets();
407
my $budgets = GetBudgets();
407
my $budget_id = @$budgets[0]->{'budget_id'};
408
my $budget_id = @$budgets[0]->{'budget_id'};
408
# build bookfund list
409
# build bookfund list
409
my $patron = Koha::Patrons->find( $loggedinuser )->unblessed;
410
my $budget = GetBudget($budget_id);
410
my $budget = GetBudget($budget_id);
411
411
412
# build budget list
412
# build budget list
413
my $budget_loop = [];
413
my $budget_loop = [];
414
my $budgets_hierarchy = GetBudgetHierarchy;
414
my $budgets_hierarchy = GetBudgetHierarchy;
415
foreach my $r ( @{$budgets_hierarchy} ) {
415
foreach my $r ( @{$budgets_hierarchy} ) {
416
    next unless (CanUserUseBudget($patron, $r, $userflags));
416
    next unless (CanUserUseBudget($logged_in_patron_unblessed, $r, $userflags));
417
    push @{$budget_loop},
417
    push @{$budget_loop},
418
      { b_id  => $r->{budget_id},
418
      { b_id  => $r->{budget_id},
419
        b_txt => $r->{budget_name},
419
        b_txt => $r->{budget_name},
(-)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/duplicate_orders.pl (-2 / +4 lines)
Lines 29-34 use Koha::Acquisition::Baskets; Link Here
29
use Koha::Acquisition::Currencies;
29
use Koha::Acquisition::Currencies;
30
use Koha::Acquisition::Orders;
30
use Koha::Acquisition::Orders;
31
use Koha::DateUtils qw( dt_from_string output_pref );
31
use Koha::DateUtils qw( dt_from_string output_pref );
32
use Koha::Patrons;
32
33
33
my $input    = CGI->new;
34
my $input    = CGI->new;
34
my $basketno = $input->param('basketno');
35
my $basketno = $input->param('basketno');
Lines 49-55 output_and_exit( $input, $cookie, $template, 'unknown_basket' ) Link Here
49
  unless $basket;
50
  unless $basket;
50
51
51
my $vendor = $basket->bookseller;
52
my $vendor = $basket->bookseller;
52
my $patron = Koha::Patrons->find($loggedinuser)->unblessed;
53
my $logged_in_patron = Koha::Patrons->find($loggedinuser);
54
my $logged_in_patron_unblessed = $logged_in_patron->unblessed;
53
55
54
my $filters = {
56
my $filters = {
55
    basket                  => scalar $input->param('basket'),
57
    basket                  => scalar $input->param('basket'),
Lines 102-108 elsif ( $op eq 'batch_edit' ) { Link Here
102
    my $budgets_hierarchy = GetBudgetHierarchy;
104
    my $budgets_hierarchy = GetBudgetHierarchy;
103
    foreach my $r ( @{$budgets_hierarchy} ) {
105
    foreach my $r ( @{$budgets_hierarchy} ) {
104
        next
106
        next
105
          unless ( C4::Budgets::CanUserUseBudget( $patron, $r, $userflags ) );
107
          unless ( C4::Budgets::CanUserUseBudget( $logged_in_patron_unblessed, $r, $userflags ) );
106
108
107
        push @{$budget_loop},
109
        push @{$budget_loop},
108
          {
110
          {
(-)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/neworderempty.pl (-3 / +4 lines)
Lines 125-130 our ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user( Link Here
125
    }
125
    }
126
);
126
);
127
127
128
my $logged_in_patron = Koha::Patrons->find($loggedinuser);
129
my $logged_in_patron_unblessed = $logged_in_patron->unblessed;
130
128
our $marcflavour = C4::Context->preference('marcflavour');
131
our $marcflavour = C4::Context->preference('marcflavour');
129
132
130
if(!$basketno) {
133
if(!$basketno) {
Lines 328-341 $suggestion = GetSuggestionInfo($suggestionid) if $suggestionid; Link Here
328
my $active_currency = Koha::Acquisition::Currencies->get_active;
331
my $active_currency = Koha::Acquisition::Currencies->get_active;
329
332
330
# build bookfund list
333
# build bookfund list
331
my $patron = Koha::Patrons->find( $loggedinuser )->unblessed;
332
333
my $budget =  GetBudget($budget_id);
334
my $budget =  GetBudget($budget_id);
334
# build budget list
335
# build budget list
335
my $budget_loop = [];
336
my $budget_loop = [];
336
my $budgets = GetBudgetHierarchy;
337
my $budgets = GetBudgetHierarchy;
337
foreach my $r (@{$budgets}) {
338
foreach my $r (@{$budgets}) {
338
    next unless (CanUserUseBudget($patron, $r, $userflags));
339
    next unless (CanUserUseBudget($logged_in_patron_unblessed, $r, $userflags));
339
    push @{$budget_loop}, {
340
    push @{$budget_loop}, {
340
        b_id  => $r->{budget_id},
341
        b_id  => $r->{budget_id},
341
        b_txt => $r->{budget_name},
342
        b_txt => $r->{budget_name},
(-)a/acqui/orderreceive.pl (-2 / +4 lines)
Lines 103-108 unless ( $order ) { Link Here
103
    exit;
103
    exit;
104
}
104
}
105
105
106
my $logged_in_patron = Koha::Patrons->find($loggedinuser);
107
my $logged_in_patron_unblessed = $logged_in_patron->unblessed;
108
106
# prepare the form for receiving
109
# prepare the form for receiving
107
my $basket = $order->basket;
110
my $basket = $order->basket;
108
my $currencies = Koha::Acquisition::Currencies->search;
111
my $currencies = Koha::Acquisition::Currencies->search;
Lines 169-175 if ( $suggestion ) { Link Here
169
    $template->param( suggestion => $suggestion );
172
    $template->param( suggestion => $suggestion );
170
}
173
}
171
174
172
my $patron = Koha::Patrons->find( $loggedinuser )->unblessed;
173
my @budget_loop;
175
my @budget_loop;
174
my $periods = GetBudgetPeriods( );
176
my $periods = GetBudgetPeriods( );
175
foreach my $period (@$periods) {
177
foreach my $period (@$periods) {
Lines 180-186 foreach my $period (@$periods) { Link Here
180
    my $budget_hierarchy = GetBudgetHierarchy( $period->{'budget_period_id'} );
182
    my $budget_hierarchy = GetBudgetHierarchy( $period->{'budget_period_id'} );
181
    my @funds;
183
    my @funds;
182
    foreach my $r ( @{$budget_hierarchy} ) {
184
    foreach my $r ( @{$budget_hierarchy} ) {
183
        next unless ( CanUserUseBudget( $patron, $r, $userflags ) );
185
        next unless ( CanUserUseBudget( $logged_in_patron_unblessed, $r, $userflags ) );
184
        if ( !defined $r->{budget_amount} || $r->{budget_amount} == 0 ) {
186
        if ( !defined $r->{budget_amount} || $r->{budget_amount} == 0 ) {
185
            next;
187
            next;
186
        }
188
        }
(-)a/acqui/parcels.pl (-1 / +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},
(-)a/admin/aqbudgets.pl (-4 / +7 lines)
Lines 56-61 my ($template, $borrowernumber, $cookie, $staffflags ) = get_template_and_user( Link Here
56
    }
56
    }
57
);
57
);
58
58
59
my $logged_in_patron = Koha::Patrons->find($borrowernumber);
60
my $logged_in_patron_unblessed = $logged_in_patron->unblessed;
61
59
my $active_currency = Koha::Acquisition::Currencies->get_active;
62
my $active_currency = Koha::Acquisition::Currencies->get_active;
60
if ( $active_currency ) {
63
if ( $active_currency ) {
61
    $template->param( symbol => $active_currency->symbol,
64
    $template->param( symbol => $active_currency->symbol,
Lines 115-121 if ($op eq 'add_form') { Link Here
115
    my $dropbox_disabled;
118
    my $dropbox_disabled;
116
    if (defined $budget_id ) {    ### MOD
119
    if (defined $budget_id ) {    ### MOD
117
        $budget = GetBudget($budget_id);
120
        $budget = GetBudget($budget_id);
118
        if (!CanUserModifyBudget($borrowernumber, $budget, $staffflags)) {
121
        if (!CanUserModifyBudget($logged_in_patron_unblessed, $budget, $staffflags)) {
119
            $template->param(error_not_authorised_to_modify => 1);
122
            $template->param(error_not_authorised_to_modify => 1);
120
            output_html_with_http_headers $input, $cookie, $template->output;
123
            output_html_with_http_headers $input, $cookie, $template->output;
121
            exit;
124
            exit;
Lines 211-217 if ($op eq 'add_form') { Link Here
211
214
212
    my $budget_modified = 0;
215
    my $budget_modified = 0;
213
    if (defined $budget_id) {
216
    if (defined $budget_id) {
214
        if (CanUserModifyBudget($borrowernumber, $budget_hash->{budget_id},
217
        if (CanUserModifyBudget($logged_in_patron_unblessed, $budget_hash->{budget_id},
215
            $staffflags)
218
            $staffflags)
216
        ) {
219
        ) {
217
            ModBudget( $budget_hash );
220
            ModBudget( $budget_hash );
Lines 252-259 if ( $op eq 'list' ) { Link Here
252
    my @budgets_to_display;
255
    my @budgets_to_display;
253
    foreach my $budget (@budgets) {
256
    foreach my $budget (@budgets) {
254
        # PERMISSIONS
257
        # PERMISSIONS
255
        next unless CanUserUseBudget($borrowernumber, $budget, $staffflags);
258
        next unless CanUserUseBudget($logged_in_patron_unblessed, $budget, $staffflags);
256
        unless(CanUserModifyBudget($borrowernumber, $budget, $staffflags)) {
259
        unless(CanUserModifyBudget($logged_in_patron_unblessed, $budget, $staffflags)) {
257
            $budget->{'budget_lock'} = 1;
260
            $budget->{'budget_lock'} = 1;
258
        }
261
        }
259
262
(-)a/admin/aqplan.pl (-1 / +4 lines)
Lines 41-46 use C4::Context; Link Here
41
use C4::Output qw( output_html_with_http_headers );
41
use C4::Output qw( output_html_with_http_headers );
42
use C4::Auth qw( get_template_and_user );
42
use C4::Auth qw( get_template_and_user );
43
use Koha::Acquisition::Currencies;
43
use Koha::Acquisition::Currencies;
44
use Koha::Patrons;
44
45
45
our $input = CGI->new;
46
our $input = CGI->new;
46
####  $input
47
####  $input
Lines 54-59 my ( $template, $borrowernumber, $cookie, $staff_flags ) = get_template_and_user Link Here
54
        flagsrequired   => { acquisition => 'planning_manage' },
55
        flagsrequired   => { acquisition => 'planning_manage' },
55
    }
56
    }
56
);
57
);
58
my $logged_in_patron = Koha::Patrons->find($borrowernumber);
59
my $logged_in_patron_unblessed = $logged_in_patron->unblessed;
57
60
58
my $budget_period_id = $input->param('budget_period_id');
61
my $budget_period_id = $input->param('budget_period_id');
59
# ' ------- get periods stuff ------------------'
62
# ' ------- get periods stuff ------------------'
Lines 315-321 my ( @budget_lines, %cell_hash ); Link Here
315
foreach my $budget (@budgets) {
318
foreach my $budget (@budgets) {
316
    my $budget_lock;
319
    my $budget_lock;
317
320
318
    unless (CanUserUseBudget($borrowernumber, $budget, $staff_flags)) {
321
    unless (CanUserUseBudget($logged_in_patron_unblessed, $budget, $staff_flags)) {
319
        $budget_lock = 1
322
        $budget_lock = 1
320
    }
323
    }
321
324
(-)a/suggestion/suggestion.pl (-3 / +5 lines)
Lines 122-127 $borrowernumber = $input->param('borrowernumber') if ( $input->param('borrowernu Link Here
122
$template->param('borrowernumber' => $borrowernumber);
122
$template->param('borrowernumber' => $borrowernumber);
123
my $branchfilter = $input->param('branchcode') || C4::Context->userenv->{'branch'};
123
my $branchfilter = $input->param('branchcode') || C4::Context->userenv->{'branch'};
124
124
125
my $logged_in_patron = Koha::Patrons->find($borrowernumber);
126
my $logged_in_patron_unblessed = $logged_in_patron->unblessed;
127
125
#########################################
128
#########################################
126
##  Operations
129
##  Operations
127
##
130
##
Lines 421-427 $template->param(patron_reason_loop=>$patron_reason_loop); Link Here
421
my $budgets = GetBudgets;
424
my $budgets = GetBudgets;
422
my @budgets_loop;
425
my @budgets_loop;
423
foreach my $budget ( @{$budgets} ) {
426
foreach my $budget ( @{$budgets} ) {
424
    next unless (CanUserUseBudget($borrowernumber, $budget, $userflags));
427
    next unless (CanUserUseBudget($logged_in_patron_unblessed, $budget, $userflags));
425
428
426
    ## Please see file perltidy.ERR
429
    ## Please see file perltidy.ERR
427
    $budget->{'selected'} = 1
430
    $budget->{'selected'} = 1
Lines 436-442 $template->param( budgetsloop => \@budgets_loop); Link Here
436
my $sugg_budget_loop = [];
439
my $sugg_budget_loop = [];
437
my $sugg_budgets     = GetBudgetHierarchy();
440
my $sugg_budgets     = GetBudgetHierarchy();
438
foreach my $r ( @{$sugg_budgets} ) {
441
foreach my $r ( @{$sugg_budgets} ) {
439
    next unless ( CanUserUseBudget( $borrowernumber, $r, $userflags ) );
442
    next unless ( CanUserUseBudget( $logged_in_patron_unblessed, $r, $userflags ) );
440
    my $selected = ( $$suggestion_ref{budgetid} && $r->{budget_id} eq $$suggestion_ref{budgetid} ) ? 1 : 0;
443
    my $selected = ( $$suggestion_ref{budgetid} && $r->{budget_id} eq $$suggestion_ref{budgetid} ) ? 1 : 0;
441
    push @{$sugg_budget_loop},
444
    push @{$sugg_budget_loop},
442
      {
445
      {
443
- 

Return to bug 30232