Bug 27654: Sort module.keys hash when render columns_settings.tt
[koha-ffzg.git] / admin / aqbudgets.pl
index 44f0d7f..16f62c5 100755 (executable)
@@ -36,14 +36,13 @@ use C4::Debug;
 use Koha::Acquisition::Currencies;
 use Koha::Patrons;
 
-my $input = new CGI;
+my $input = CGI->new;
 my $dbh     = C4::Context->dbh;
 
 my ($template, $borrowernumber, $cookie, $staffflags ) = get_template_and_user(
     {   template_name   => "admin/aqbudgets.tt",
         query           => $input,
         type            => "intranet",
-        authnotrequired => 0,
         flagsrequired   => { acquisition => 'budget_manage' },
         debug           => 0,
     }
@@ -115,6 +114,8 @@ if ($op eq 'add_form') {
         }
         $dropbox_disabled = BudgetHasChildren($budget_id);
         $budget->{budget_owner} = Koha::Patrons->find( $budget->{budget_owner_id} );
+    } elsif ( $period->{budget_period_locked} ) {
+        output_and_exit( $input, $cookie, $template, 'budget_is_locked' );
     }
 
     # build budget hierarchy