Bug 28569: In opac-suggestions.pl preselect user library
authorFridolin Somers <fridolin.somers@biblibre.com>
Wed, 16 Jun 2021 09:17:19 +0000 (11:17 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 11 Aug 2021 10:53:54 +0000 (12:53 +0200)
In OPAC new purchase suggestion opac-suggestions.pl for library combobox :
actually first value is selected, user library should be selected.

Test plan :
1) Create a new library named 'ZZZ top'
2) Set this library on a user U1
2) Loggin at OPAC with user U1
3) Create a new suggestion
=> Check library 'ZZZ top' is preselected

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt

index 2cef56f..d02a89a 100644 (file)
                                                 [% IF ( branchcode_required ) %]
                                                     <label for="branch" class="required">Library:</label>
                                                     <select name="branchcode" id="branch" required="required">
-                                                        [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
+                                                        [% PROCESS options_for_libraries libraries => Branches.all %]
                                                     </select>
                                                     <span class="required">Required</span>
                                                 [% ELSE %]
                                                     <label for="branch">Library:</label>
                                                     <select name="branchcode" id="branch">
-                                                        [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
+                                                        [% PROCESS options_for_libraries libraries => Branches.all %]
                                                     </select>
                                                 [% END %]
                                             </li>