Bug 26194: (follow-up) Default to current branch
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 12 Aug 2020 15:07:05 +0000 (16:07 +0100)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 18 Aug 2020 13:45:49 +0000 (15:45 +0200)
When adding a new register, it would be helpful to default to the
current logged in branch.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

koha-tmpl/intranet-tmpl/prog/en/modules/admin/cash_registers.tt

index 3d9b8b7..97c10e5 100644 (file)
                             <li>
                                 <label for="branch">Library: </label>
                                 <select id="branch" name="branch">
-                                [% FOREACH branch IN branch_list %]
-                                [% IF cash_register.branch == branch.branchcode %]
-                                    <option value="[% branch.branchcode | html %]" selected="1">[% branch.branchname | html %]</option>
+                                [% IF cash_register %]
+                                    [% PROCESS options_for_libraries libraries => Branches.all( selected => cash_register.branch ) %]
                                 [% ELSE %]
-                                    <option value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option>
-                                [% END %]
+                                    [% PROCESS options_for_libraries libraries => Branches.all() %]
                                 [% END %]
                                 </select>
                             </li>