From d179da572b1d6bd7066d96f494aa805b86b92ae1 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 6 Jul 2017 18:10:10 -0300 Subject: [PATCH] Bug 18906: Display all funds the logged in user can use There are complex conditions to know if a librarian can use a fund, we cannot do that with a SQL query, we need to use C4::Budgets::CanUserUseBudget When this patch is applied then all funds are visible to both superlibrarian patrons and patrons with all acq permissions Signed-off-by: Alex Buckley Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart (cherry picked from commit 19a7b498e1f4355ab1e4ee0adb5db299613f3f5c) Signed-off-by: Fridolin Somers --- admin/aqbudgets.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/admin/aqbudgets.pl b/admin/aqbudgets.pl index 97664df13b..cf2c749e40 100755 --- a/admin/aqbudgets.pl +++ b/admin/aqbudgets.pl @@ -237,7 +237,7 @@ if ( $op eq 'list' ) { ); my @budgets = @{ - GetBudgetHierarchy( $$period{budget_period_id}, C4::Context->userenv->{branch}, ( $show_mine ? $borrower_id : 0 )) + GetBudgetHierarchy( $$period{budget_period_id}, undef, ( $show_mine ? $borrower_id : 0 )) }; my $period_total = 0; @@ -248,6 +248,7 @@ if ( $op eq 'list' ) { my @budgets_to_display; foreach my $budget (@budgets) { # PERMISSIONS + next unless CanUserUseBudget($borrowernumber, $budget, $staffflags); unless(CanUserModifyBudget($borrowernumber, $budget, $staffflags)) { $budget->{'budget_lock'} = 1; } -- 2.39.5