$url .= "&apage=$activepage" if($activepage != 1);
my $inactive_pagination_bar = pagination_bar ($url, getnbpages( scalar(@$results), $inactivepagesize), $inactivepage, "ipage");
+my $branchloop = C4::Branch::GetBranchesLoop();
+
my $tab = $input->param('tab') ? $input->param('tab') - 1 : 0;
$template->param(
period_active_loop => \@period_active_loop,
active_pagination_bar => $active_pagination_bar,
inactive_pagination_bar => $inactive_pagination_bar,
tab => $tab,
+ branchloop => $branchloop,
);
$template->param($op=>1);
my $budget;
-my $branches = GetBranches($show_mine);
-my @branchloop2;
-foreach my $thisbranch (keys %$branches) {
- my %row = (
- value => $thisbranch,
- branchname => $branches->{$thisbranch}->{'branchname'},
- );
- $row{selected} = 1 if $thisbranch eq $filter_budgetbranch;
- push @branchloop2, \%row;
-}
+my $branchloop = C4::Branch::GetBranchesLoop($filter_budgetbranch);
$template->param(auth_cats_loop => GetBudgetAuthCats( $budget_period_id ))
if $budget_period_id;
#This Looks WEIRD to me : should budgets be filtered in such a way ppl who donot own it would not see the amount spent on the budget by others ?
+ my @budgets_to_display;
foreach my $budget (@budgets) {
# PERMISSIONS
unless(CanUserModifyBudget($borrowernumber, $budget, $staffflags)) {
$budget->{budget_hierarchy} = \@budget_hierarchy;
$budget->{budget_has_children} = BudgetHasChildren( $budget->{budget_id} );
+ push @budgets_to_display, $budget;
}
my $budget_period_total = $period->{budget_period_total};
$template->param(
op => 'list',
- budgets => \@budgets,
+ budgets => \@budgets_to_display,
periods => $periods,
budget_period_total => $budget_period_total,
period_alloc_total => $period_alloc_total,
spent_total => $spent_total,
ordered_total => $ordered_total,
available_total => $available_total,
- branchloop => \@branchloop2,
+ branchloop => $branchloop,
+ filter_budgetname => $filter_budgetname,
);
} #---- END list
exit(1);
}
+my $branchloop = C4::Branch::GetBranchesLoop();
$template->param(
authvals_row => \@authvals_row,
budget_lines => \@budget_lines,
CGIsepChoice => $CGIsepChoice,
authvals => \@authvals_row,
- hide_cols_loop => \@hide_cols
+ hide_cols_loop => \@hide_cols,
+ branchloop => $branchloop,
);
output_html_with_http_headers $input, $cookie, $template->output;