use Modern::Perl;
use CGI qw ( -utf8 );
-use List::Util qw/min/;
use Koha::Database;
-use C4::Auth qw/get_user_subpermissions/;
-use C4::Auth;
-use C4::Acquisition;
-use C4::Budgets;
+use C4::Auth qw( get_template_and_user );
+use C4::Budgets qw(
+ AddBudget
+ BudgetHasChildren
+ CanUserModifyBudget
+ CanUserUseBudget
+ DelBudget
+ GetBudget
+ GetBudgetAuthCats
+ GetBudgetHierarchy
+ GetBudgetPeriod
+ GetBudgetPeriods
+ GetBudgetUsers
+ ModBudget
+ ModBudgetUsers
+);
use C4::Context;
-use C4::Output;
-use C4::Koha;
-use C4::Debug;
+use C4::Output qw( output_html_with_http_headers output_and_exit );
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,
}
);
# ------- get periods stuff ------------------
-# USED FOR PERMISSION COMPARISON LATER
-my $borrower_id = $template->{VARS}->{'USER_INFO'}->{'borrowernumber'};
-
$template->param(
show_mine => $show_mine,
op => $op,
}
$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
);
my @budgets = @{
- GetBudgetHierarchy( $$period{budget_period_id}, undef, ( $show_mine ? $borrower_id : 0 ))
+ GetBudgetHierarchy( $$period{budget_period_id}, undef, ( $show_mine ? $borrowernumber : 0 ))
};
my $period_total = 0;