Bug 37246: (QA follow-up) DRY Dropdown

If we're using the same dropdown it should be defined once.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Pedro Amorim 2024-07-05 15:38:26 +00:00 committed by Katrin Fischer
parent 12a9e98d2d
commit ef4efffe46
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 29 additions and 34 deletions

View File

@ -591,21 +591,7 @@
</select>
</li>
<li>
<label for="budgetid">Fund:</label>
<select name="budgetid" id="budgetid">
<option value="">Any</option>
[% FOREACH budget IN sugg_budgets %]
[% IF ( budget.selected ) %]
<option value="[% budget.b_id | html %]" selected="selected">[% budget.b_txt | html %] [% IF ( !budget.b_active ) %](inactive)[% END %]</option>
[% ELSIF ( budget.b_active ) %]
<option value="[% budget.b_id | html %]">[% budget.b_txt | html %]</option>
[% ELSE %]
<option value="[% budget.b_id | html %]" class="b_inactive">[% budget.b_txt | html %] (inactive)</option>
[% END %]
[% END %]
</select>
<label for="showallfunds" style="float:none;width:auto;">&nbsp;Show inactive:</label>
<input type="checkbox" class="showallfunds" />
[% PROCESS funds_dropdown %]
</li>
<li>
<label for="quantity">Copies:</label>
@ -1219,25 +1205,7 @@
<fieldset class="brief acquisition_information">
<ol>
<li>
<label for="budgetid">Fund:</label>
<select name="budgetid" id="budgetid">
[% IF budgetid == '__NONE__' %]
<option value="__NONE__" selected="selected">None</option>
[% ELSE %]
<option value="__NONE__">None</option>
[% END %]
[% FOREACH budget IN sugg_budgets %]
[% IF ( budget.selected ) %]
<option value="[% budget.b_id | html %]" selected="selected">[% budget.b_txt | html %] [% IF ( !budget.b_active ) %](inactive)[% END %]</option>
[% ELSIF ( budget.b_active ) %]
<option value="[% budget.b_id | html %]">[% budget.b_txt | html %]</option>
[% ELSE %]
<option value="[% budget.b_id | html %]" class="b_inactive">[% budget.b_txt | html %] (inactive)</option>
[% END %]
[% END %]
</select>
<label for="showallfunds" style="float:none;width:auto;">&nbsp;Show inactive:</label>
<input type="checkbox" class="showallfunds" />
[% PROCESS funds_dropdown %]
</li>
</ol>
</fieldset> <!-- /#acquisition_information -->
@ -1271,6 +1239,33 @@
[% END # /IF op == "show" %]
[% BLOCK funds_dropdown %]
<label for="budgetid">Fund:</label>
<select name="budgetid" id="budgetid">
[% IF op == 'save' %]
<option value="">Any</option>
[% ELSE %]
[% IF budgetid == '__NONE__' %]
<option value="__NONE__" selected="selected">None</option>
[% ELSE %]
<option value="__NONE__">None</option>
[% END %]
[% END %]
[% FOREACH budget IN sugg_budgets %]
[% IF ( budget.selected ) %]
<option value="[% budget.b_id | html %]" selected="selected">[% budget.b_txt | html %] [% IF ( !budget.b_active ) %](inactive)[% END %]</option>
[% ELSIF ( budget.b_active ) %]
<option value="[% budget.b_id | html %]">[% budget.b_txt | html %]</option>
[% ELSE %]
<option value="[% budget.b_id | html %]" class="b_inactive">[% budget.b_txt | html %] (inactive)</option>
[% END %]
[% END %]
</select>
<!-- this is needed -->
<label for="showallfunds" style="float:none;width:auto;">&nbsp;Show inactive:</label>
<input type="checkbox" class="showallfunds" />
[% END %]
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'calendar.inc' %]