Bug 12495 - Include streetnumber in hold alert address
[koha_fer] / admin / aqplan.pl
index 81418ff..0614bab 100755 (executable)
@@ -85,8 +85,8 @@ $template->param(
 
 # ------- get periods stuff ------------------
 
-my $borrower_id         = $template->{param_map}->{'USER_INFO'}[0]->{'borrowernumber'};
-my $borrower_branchcode = $template->{param_map}->{'USER_INFO'}[0]->{'branchcode'};
+my $borrower_id         = $template->{VARS}->{'USER_INFO'}[0]->{'borrowernumber'};
+my $borrower_branchcode = $template->{VARS}->{'USER_INFO'}[0]->{'branchcode'};
 
 my $periods;
 my $authcat      = $input->param('authcat');
@@ -132,7 +132,7 @@ my $op        = $input->param("op");
 
 my $budget_branchcode;
 
-my $budgets_ref = GetBudgetHierarchy( $budget_period_id, $show_mine?$template->{param_map}->{'USER_INFO'}[0]->{'branchcode'}:'', $show_mine?$template->{param_map}->{'USER_INFO'}[0]->{'borrowernumber'}:'' );
+my $budgets_ref = GetBudgetHierarchy( $budget_period_id, $show_mine?$template->{VARS}->{'USER_INFO'}[0]->{'branchcode'}:'', $show_mine?$template->{VARS}->{'USER_INFO'}[0]->{'borrowernumber'}:'' );
 
 # build categories list
 my $sth = $dbh->prepare("select distinct category from authorised_values where category like 'A%' ");
@@ -225,7 +225,6 @@ HideCols($authcat, @hide_cols);
 }
 # ------------------------------------------------------------
 if ( $authcat =~ m/^Asort/ ) {
-    # ----------- copied from C4::Input::buildCGIsort()
    my $query = qq{ SELECT * FROM authorised_values WHERE category=? order by lib };
     my $sth   = $dbh->prepare($query);
     $sth->execute($authcat  );
@@ -354,6 +353,10 @@ my ( @budget_lines, %cell_hash );
 foreach my $budget (@budgets) {
     my $budget_lock;
 
+    unless (CanUserUseBudget($borrowernumber, $budget, $staff_flags)) {
+        $budget_lock = 1
+    }
+
     # check budget permission
     if ( $period->{budget_period_locked} == 1 ) {
         $budget_lock = 1;
@@ -463,7 +466,7 @@ output_html_with_http_headers $input, $cookie, $template->output;
 sub _print_to_csv {
     my ( $header, $results ) = @_;
 
-    binmode STDOUT, ":utf8";
+    binmode STDOUT, ':encoding(UTF-8)';
 
     my $csv = Text::CSV_XS->new(
         {   sep_char     => $del,