);
my $cur = GetCurrency();
-$template->param( cur => $cur->{symbol} );
+$template->param( symbol => $cur->{symbol},
+ currency => $cur->{currency}
+ );
my $op = $input->param('op');
$show_mine = $input->param('show_mine') if $show == 1;
# IF USER DOESNT HAVE PERM FOR AN 'ADD', THEN REDIRECT TO THE DEFAULT VIEW...
-if ( not defined $template->{param_map}->{'CAN_user_acquisition_budget_add_del'} && $op == 'add_form' ) {
+if ( not defined $template->{VARS}->{'CAN_user_acquisition_budget_add_del'} && $op == 'add_form' ) {
$op = '';
}
-
my $num=FormatNumber;
my $script_name = "/cgi-bin/koha/admin/aqbudgets.pl";
my $budget_hash = $input->Vars;
my $budget_id = $$budget_hash{budget_id};
my $budget_permission = $input->param('budget_permission');
-my $budget_period_dropbox = $input->param('budget_period_dropbox');
+my $filter_budgetbranch = $input->param('filter_budgetbranch');
#filtering non budget keys
delete $$budget_hash{$_} foreach grep {/filter|^op$|show/} keys %$budget_hash;
-my $filter_budgetbranch = $input->param('filter_budgetbranch');
my $filter_budgetname = $input->param('filter_budgetname');
$template->param(
notree => ($filter_budgetbranch or $show_mine)
# ------- get periods stuff ------------------
# USED FOR PERMISSION COMPARISON LATER
-my $borrower_id = $template->{param_map}->{'USER_INFO'}[0]->{'borrowernumber'};
+my $borrower_id = $template->{VARS}->{'USER_INFO'}[0]->{'borrowernumber'};
my $user = GetMemberDetails($borrower_id);
my $user_branchcode = $user->{'branchcode'};
# Used to create form to add or modify a record
if ($op eq 'add_form') {
#### ------------------- ADD_FORM -------------------------
-
# if no buget_id is passed then its an add
# pass the period_id to build the dropbox - because we only want to show budgets from this period
my $dropbox_disabled;
$template->param(authorised_value_categories1 => \@auth_cats_loop1);
$template->param(authorised_value_categories2 => \@auth_cats_loop2);
- my $budget_perm_dropbox =
- GetBudgetPermDropbox($budget->{'budget_permission'});
-
+ if($budget->{'budget_permission'}){
+ my $budget_permission = "budget_perm_".$budget->{'budget_permission'};
+ $template->param($budget_permission => 1);
+ }
+
# if no buget_id is passed then its an add
$template->param(
add_validate => 1,
dateformat => C4::Dates->new()->visual(),
budget_parent_id => $budget_parent->{'budget_id'},
budget_parent_name => $budget_parent->{'budget_name'},
- budget_perm_dropbox => $budget_perm_dropbox,
branchloop_select => \@branchloop_select,
%$period,
%$budget,
}
}
my $branches = GetBranches();
- my $budget_period_dropbox = GetBudgetPeriodsDropbox($$period{budget_period_id} );
$template->param(
- budget_period_dropbox => $budget_period_dropbox,
budget_id => $budget_id,
%$period,
);
# PERMISSIONS
unless($staffflags->{'superlibrarian'} % 2 == 1 ) {
#IF NO PERMS, THEN DISABLE EDIT/DELETE
- unless ( $template->{param_map}->{'CAN_user_acquisition_budget_modify'} ) {
+ unless ( $template->{VARS}->{'CAN_user_acquisition_budget_modify'} ) {
$budget->{'budget_lock'} = 1;
}
# check budget permission
);
}
- my $budget_period_total = $num->format_price($$period{budget_period_total}) if $$period{budget_period_total};
+ my $budget_period_total;
+ if ( $period->{budget_period_total} ) {
+ $budget_period_total =
+ $num->format_price( $period->{budget_period_total} );
+ }
$template->param(
else => 1,
budget => \@loop,