Bug 30107: When editing desks default to the branch the desk belongs to

TO test:
1. Turn on UseCirculationDesks
2. Add some desks via Administration > Circulation desks, make several and have them belong to different libraries.
3. Go edit some of those desks and notice the Library: dropdown always defaults to the users logged in branch
4. Apply patch
5. Try editing desk again, now the dropdown should default the library that the desk belongs to.
6. Try making a new desk and make sure it defaults to the logged in branch

Signed-off-by: Séverine Queune <severine.queune@bulac.fr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Lucas Gass 2022-03-09 18:41:56 +00:00 committed by Fridolin Somers
parent be67a035be
commit 24d1b4edd9

View file

@ -118,10 +118,15 @@
<select id="branchcode" name="branchcode" required="required">
<option value=""></option>
[% FOREACH branch IN branches %]
[% IF (Branches.GetLoggedInBranchcode == branch.branchcode) %]
<option value="[% branch.branchcode|html %]" selected="selected">[% branch.branchname|html %]</option>
[% IF desk %]
[% IF (desk.branchcode == branch.branchcode) %]
<option value="[% branch.branchcode|html %]" selected="selected">[% branch.branchname|html %]</option>
[% END%]
[% ELSE %]
<option value="[% branch.branchcode|html %]">[% branch.branchname|html %]</option>
[% 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 %]
[% END %]
</select>