Bug 24242: Display funds that the logged in user can access - suggestions
The design of this script is pretty bad and any modifications is a
challenge.
Here we are trying to display to display the funds available for the
logged in user. I did not understand previous code, as we are doing a
limit using CanUserUseBudget, I do not think it makes sense to retrieve
funds for a given library.
Also, I am wondering if the dropdown list in the filters has ever been
populated: budgetid_loop in the template *never* appeared in the history
of suggestion.pl (??)
Test plan:
Search for suggestions
Add/edit suggestions
=> The funds in the dropdown list should be the ones the logged in user
can use.
Signed-off-by: hc <hc@interleaf.ie>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit de309a2674)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
4a059f220c
commit
8f256790fe
|
|
@ -737,8 +737,8 @@
|
|||
[% ELSE %]
|
||||
<option value="__NONE__">None</option>
|
||||
[% END %]
|
||||
[% FOREACH budgetid_loo IN budgetid_loop %]
|
||||
[% IF ( budgetid_loo.selected ) %] <option value="[% budgetid_loo.code | html %]" selected="selected">[% budgetid_loo.desc | html %]</option>[% ELSE %]<option value="[% budgetid_loo.code | html %]">[% budgetid_loo.desc | html %]</option>[% END %]
|
||||
[% FOREACH budgetsloo IN budgetsloop %]
|
||||
[% IF ( budgetsloo.selected ) %]<option value="[% budgetsloo.budget_id | html %]" selected="selected">[% budgetsloo.budget_name | html %]</option>[% ELSE %]<option value="[% budgetsloo.budget_id | html %]">[% budgetsloo.budget_name | html %]</option>[% END %]
|
||||
[% END %]
|
||||
</select></li>
|
||||
<li><label for="branchcode">Library:</label>
|
||||
|
|
|
|||
|
|
@ -351,14 +351,7 @@ my $patron_reason_loop = GetAuthorisedValues("OPAC_SUG");
|
|||
$template->param(patron_reason_loop=>$patron_reason_loop);
|
||||
|
||||
#Budgets management
|
||||
my $budgets = [];
|
||||
if ($branchfilter) {
|
||||
my $searchbudgets = { budget_branchcode => $branchfilter };
|
||||
$budgets = GetBudgets($searchbudgets);
|
||||
} else {
|
||||
$budgets = GetBudgets(undef);
|
||||
}
|
||||
|
||||
my $budgets = GetBudgets;
|
||||
my @budgets_loop;
|
||||
foreach my $budget ( @{$budgets} ) {
|
||||
next unless (CanUserUseBudget($borrowernumber, $budget, $userflags));
|
||||
|
|
|
|||
Loading…
Reference in New Issue