Bug 12528 - Enable staff to deny message setting access to patrons on the OPAC
[koha.git] / admin / aqplan.pl
index f1bf496..c6946d6 100755 (executable)
@@ -35,6 +35,7 @@ use C4::Output;
 use C4::Koha;
 use C4::Auth;
 use C4::Debug;
+use Koha::Acquisition::Currencies;
 
 my $input = new CGI;
 ####  $input
@@ -56,9 +57,9 @@ my $budget_period_id = $input->param('budget_period_id');
 # IF PERIOD_ID IS DEFINED,  GET THE PERIOD - ELSE GET THE ACTIVE PERIOD BY DEFAULT
 my $period = GetBudgetPeriod($budget_period_id);
 my $count  = GetPeriodsCount();
-my $cur    = GetCurrency;
-$template->param( symbol => $cur->{symbol},
-                  currency => $cur->{currency}
+my $active_currency = Koha::Acquisition::Currencies->get_active;
+$template->param( symbol => $active_currency->symbol,
+                  currency => $active_currency->currency,
                );
 $template->param( period_button_only => 1 ) if $count == 0;
 
@@ -85,7 +86,6 @@ $template->param(
 my $borrower_id         = $template->{VARS}->{'USER_INFO'}->{'borrowernumber'};
 my $borrower_branchcode = $template->{VARS}->{'USER_INFO'}->{'branchcode'};
 
-my $periods;
 my $authcat      = $input->param('authcat');
 my $show_active  = $input->param('show_active');
 my $show_actual  = $input->param('show_actual');
@@ -96,7 +96,7 @@ my $del          = $input->param("sep");
 
 my $show_mine       = $input->param('show_mine') ;
 
-my @hide_cols      = $input->param('hide_cols');
+my @hide_cols      = $input->multi_param('hide_cols');
 
 if ( $budget_period_locked == 1  && not defined  $show_actual ) {
      $show_actual  = 1;
@@ -107,8 +107,6 @@ $authcat = 'Asort1' if  not defined $authcat; # defaults to Asort if no authcat
 my $budget_id = $input->param('budget_id');
 my $op        = $input->param("op");
 
-my $budget_branchcode;
-
 my $budgets_ref = GetBudgetHierarchy( $budget_period_id, $show_mine?$template->{VARS}->{'USER_INFO'}->{'branchcode'}:'', $show_mine?$template->{VARS}->{'USER_INFO'}->{'borrowernumber'}:'' );
 
 # build categories list
@@ -129,7 +127,7 @@ while ( my ($category) = $sth->fetchrow_array ) {
 push( @category_list, 'MONTHS' );
 push( @category_list, 'ITEMTYPES' );
 push( @category_list, 'BRANCHES' );
-push( @category_list, $$_{'authcat'} ) foreach @$auth_cats_loop;
+push( @category_list, $_ ) foreach @$auth_cats_loop;
 
 #reorder the list
 @category_list = sort { $a cmp $b } @category_list;
@@ -140,11 +138,10 @@ $template->param( authcat_dropbox => {
     });
 
 my @budgets = @$budgets_ref;
-my $CGISort;
 my @authvals;
 my %labels;
 
-my @names = $input->param();
+my @names = $input->multi_param();
 # ------------------------------------------------------------
 if ( $op eq 'save' ) {
     #get budgets
@@ -160,7 +157,6 @@ if ( $op eq 'save' ) {
     my %seen;
     @buds        = grep { !$seen{$_}++ } @buds;
     @auth_values = grep { !$seen{$_}++ } @auth_values;
-    my @budget_ids;
     my @budget_lines;
 
     foreach my $budget (@buds) {