Bug 40114: Can't select new library when editing a desk
This patch fixes selection of a library when editing a desk in
Administration. The form should provide all libraries as options, not
just the currently selected one.
To test, apply the patch and go to Administration -> Desks.
- If necessary, create a new desk.
- Edit the desk. The form should load with the correct library prefilled
in the <select>, but should offer all libraries as a choices.
Sponsored-by: Athens County Public Libraries
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 20085be7fb)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
parent
694ff22961
commit
f94664313d
|
|
@ -114,17 +114,10 @@
|
|||
<label for="branchcode" class="required">Library: </label>
|
||||
<select id="branchcode" name="branchcode" required="required">
|
||||
<option value=""></option>
|
||||
[% FOREACH branch IN branches %]
|
||||
[% IF desk %]
|
||||
[% IF (desk.branchcode == branch.branchcode) %]
|
||||
<option value="[% branch.branchcode|html %]" selected="selected">[% branch.branchname|html %]</option>
|
||||
[% END %]
|
||||
[% ELSE %]
|
||||
[% IF (Branches.GetLoggedInBranchcode == branch.branchcode) %]
|
||||
<option value="[% branch.branchcode|html %]" selected="selected">[% branch.branchname|html %]</option>
|
||||
[% END %]
|
||||
<option value="[% branch.branchcode|html %]">[% branch.branchname|html %]</option>
|
||||
[% END %]
|
||||
[% IF desk %]
|
||||
[% PROCESS options_for_libraries libraries => Branches.all( selected => desk.branchcode ) %]
|
||||
[% ELSE %]
|
||||
[% PROCESS options_for_libraries libraries => Branches.all() %]
|
||||
[% END %]
|
||||
</select>
|
||||
</li>
|
||||
|
|
|
|||
Loading…
Reference in New Issue