Lines 40-45
use C4::Debug;
Link Here
|
40 |
|
40 |
|
41 |
my $input = new CGI; |
41 |
my $input = new CGI; |
42 |
my $dbh = C4::Context->dbh; |
42 |
my $dbh = C4::Context->dbh; |
|
|
43 |
my $sql_error; |
43 |
|
44 |
|
44 |
my ($template, $borrowernumber, $cookie, $staffflags ) = get_template_and_user( |
45 |
my ($template, $borrowernumber, $cookie, $staffflags ) = get_template_and_user( |
45 |
{ template_name => "admin/aqbudgets.tmpl", |
46 |
{ template_name => "admin/aqbudgets.tmpl", |
Lines 248-267
if ($op eq 'add_form') {
Link Here
|
248 |
@budgetusersid = split(':', $budget_hash->{'budget_users_ids'}); |
249 |
@budgetusersid = split(':', $budget_hash->{'budget_users_ids'}); |
249 |
} |
250 |
} |
250 |
|
251 |
|
|
|
252 |
my $r; |
251 |
if ( defined $$budget_hash{budget_id} ) { |
253 |
if ( defined $$budget_hash{budget_id} ) { |
252 |
if (CanUserModifyBudget($borrowernumber, $budget_hash->{budget_id}, |
254 |
if (CanUserModifyBudget($borrowernumber, $budget_hash->{budget_id}, |
253 |
$staffflags) |
255 |
$staffflags) |
254 |
) { |
256 |
) { |
255 |
ModBudget( $budget_hash ); |
257 |
$r = ModBudget( $budget_hash ); |
256 |
ModBudgetUsers($budget_hash->{budget_id}, @budgetusersid); |
258 |
ModBudgetUsers($budget_hash->{budget_id}, @budgetusersid); |
257 |
} |
259 |
} |
258 |
else { |
260 |
else { |
259 |
$template->param(error_not_authorised_to_modify => 1); |
261 |
$template->param(error_not_authorised_to_modify => 1); |
260 |
} |
262 |
} |
261 |
} else { |
263 |
} else { |
262 |
AddBudget( $budget_hash ); |
264 |
$r = AddBudget( $budget_hash ); |
263 |
ModBudgetUsers($budget_hash->{budget_id}, @budgetusersid); |
265 |
ModBudgetUsers($budget_hash->{budget_id}, @budgetusersid); |
264 |
} |
266 |
} |
|
|
267 |
$sql_error = 1 unless $r; |
265 |
} |
268 |
} |
266 |
my $branches = GetBranches(); |
269 |
my $branches = GetBranches(); |
267 |
$template->param( |
270 |
$template->param( |
Lines 364-369
if ($op eq 'add_form') {
Link Here
|
364 |
period_alloc_total => $period_alloc_total, |
367 |
period_alloc_total => $period_alloc_total, |
365 |
base_spent_total => $base_spent_total, |
368 |
base_spent_total => $base_spent_total, |
366 |
branchloop => \@branchloop2, |
369 |
branchloop => \@branchloop2, |
|
|
370 |
sql_error => $sql_error, |
367 |
); |
371 |
); |
368 |
|
372 |
|
369 |
} #---- END $OP eq DEFAULT |
373 |
} #---- END $OP eq DEFAULT |