From 934de70eec747f901904721fc12024051cf52f4c Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 24 Mar 2015 17:30:02 +0100 Subject: [PATCH] Bug 3969: Fix funds search MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The funds search does not work at all. On the budget and the budget plan page, the library dropdown list is empty. Test plan: On the budget, the budget plan and the fund pages, confirm that you are able to search a fund by code (or name) and the library dropdown list is correctly filled. Tested with several combinations. Works as expected. Signed-off-by: Marc Véron Signed-off-by: Katrin Fischer Tested various combinations, no problems found. Passes tests and QA script. Signed-off-by: Tomas Cohen Arazi --- admin/aqbudgetperiods.pl | 3 +++ admin/aqbudgets.pl | 18 ++++++------------ admin/aqplan.pl | 4 +++- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/admin/aqbudgetperiods.pl b/admin/aqbudgetperiods.pl index 94f77e7582..3731cf6670 100755 --- a/admin/aqbudgetperiods.pl +++ b/admin/aqbudgetperiods.pl @@ -287,6 +287,8 @@ $url = "aqbudgetperiods.pl?tab=2"; $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, @@ -294,6 +296,7 @@ $template->param( active_pagination_bar => $active_pagination_bar, inactive_pagination_bar => $inactive_pagination_bar, tab => $tab, + branchloop => $branchloop, ); $template->param($op=>1); diff --git a/admin/aqbudgets.pl b/admin/aqbudgets.pl index f1c2f3981f..0cf3c6136e 100755 --- a/admin/aqbudgets.pl +++ b/admin/aqbudgets.pl @@ -100,16 +100,7 @@ $template->param( 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; @@ -284,6 +275,7 @@ if ( $op eq 'list' ) { #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)) { @@ -335,6 +327,7 @@ if ( $op eq 'list' ) { $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}; @@ -343,14 +336,15 @@ if ( $op eq 'list' ) { $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 diff --git a/admin/aqplan.pl b/admin/aqplan.pl index dda1d2199b..bdd5dda95b 100755 --- a/admin/aqplan.pl +++ b/admin/aqplan.pl @@ -400,6 +400,7 @@ if ( $output eq "file" ) { exit(1); } +my $branchloop = C4::Branch::GetBranchesLoop(); $template->param( authvals_row => \@authvals_row, budget_lines => \@budget_lines, @@ -415,7 +416,8 @@ $template->param( 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; -- 2.39.5