Bug 4330 : Adding some copyright BibLibre statements
[koha_fer] / admin / aqplan.pl
index 5fb7097..8b68d51 100755 (executable)
@@ -60,7 +60,9 @@ my $budget_period_id = $input->param('budget_period_id');
 my $period = GetBudgetPeriod($budget_period_id);
 my $count  = GetPeriodsCount();
 my $cur    = GetCurrency;
-
+$template->param( symbol => $cur->{symbol},
+                  currency => $cur->{currency}
+               );
 $template->param( period_button_only => 1 ) if $count == 0;
 
 
@@ -95,7 +97,6 @@ my $show_actual  = $input->param('show_actual');
 my $show_percent = $input->param('show_percent');
 my $output       = $input->param("output");
 my $basename     = $input->param("basename");
-my $mime         = $input->param("MIME");
 my $del          = $input->param("sep");
 
 my $show_mine       = $input->param('show_mine') ;
@@ -153,6 +154,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;
 
 #reorder the list
 @category_list = sort { $a cmp $b } @category_list;
@@ -173,9 +175,7 @@ my $CGISort;
 my @authvals;
 my %labels;
 
-
-    my @names = $input->param();
-
+my @names = $input->param();
 # ------------------------------------------------------------
 if ( $op eq 'save' ) {
     #get budgets
@@ -292,6 +292,18 @@ elsif ( $authcat eq 'ITEMTYPES' ) {
         }
     }
     $sth->finish;
+} elsif ($authcat) {
+    my $query = qq{ SELECT * FROM authorised_values WHERE category=? order by lib };
+    my $sth   = $dbh->prepare($query);
+    $sth->execute($authcat);
+    if ( $sth->rows > 0 ) {
+        for ( my $i = 0 ; $i < $sth->rows ; $i++ ) {
+            my $results = $sth->fetchrow_hashref;
+            push @authvals, $results->{authorised_value};
+            $labels{ $results->{authorised_value} } = $results->{lib};
+        }
+    }
+    $sth->finish;
 }
 
 my @authvals_row;
@@ -321,11 +333,10 @@ foreach my $n (@names) {
 # ------------------------------------------------------------
 #         DEFAULT DISPLAY BEGINS
 
-my @mime = ( C4::Context->preference("MIME") );
 my $CGIextChoice = CGI::scrolling_list(
     -name     => 'MIME',
     -id       => 'MIME',
-    -values   => \@mime,
+    -values   => ['CSV'], # FIXME translation
     -size     => 1,
     -multiple => 0
 );
@@ -441,7 +452,6 @@ $template->param(
     show_actual               => $show_actual,
     show_percent              => $show_percent,
     show_mine                 => $show_mine,
-    cur                       => $cur->{symbol},
     cur_format                => $cur_format,
     CGIextChoice              => $CGIextChoice,
     CGIsepChoice              => $CGIsepChoice,