Bug 17153: Redirect to search when logging in from search
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / includes / masthead.inc
index 97b9d22..15d185f 100644 (file)
                                         [% END %]
                                     [% END %]
                                     [% IF ( loggedinusername ) %]
-                                        <li><p class="members navbar-text">Welcome, <a class="login-link" href="/cgi-bin/koha/opac-user.pl"><span class="loggedinusername">[% USER_INFO.title %] [% USER_INFO.firstname %] [% USER_INFO.surname %]</span></a></p></li>
+                                        <li><p class="members navbar-text">Welcome, <a class="login-link" href="/cgi-bin/koha/opac-user.pl"><span class="loggedinusername" data-borrowernumber="[% USER_INFO.borrowernumber %]" data-branchcode="[% USER_INFO.branchcode %]" >[% USER_INFO.title %] [% USER_INFO.firstname %] [% USER_INFO.surname %]</span></a></p></li>
                                         <li class="divider-vertical"></li>
                                     [% END %]
                                 [% END %]
 
                                             [% IF LibrarySearchGroups %]<optgroup label="Libraries">[% END %]
 
-                                            [% FOREACH BranchesLoo IN BranchesLoop %]
-                                                [% IF ( BranchesLoo.selected ) %]<option selected="selected" value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>
-                                                [% ELSE %]<option value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>[% END %]
+                                            [% FOREACH library IN Branches.all( selected => opac_name ) %]
+                                                [% IF library.selected %]
+                                                    <option selected="selected" value="branch:[% library.branchcode %]">[% library.branchname %]</option>
+                                                [% ELSE %]
+                                                    <option value="branch:[% library.branchcode %]">[% library.branchname %]</option>
+                                                [% END %]
                                             [% END %]
 
                                             [% IF LibrarySearchGroups %]
             <h3 id="modalLoginLabel">Log in to your account</h3>
         </div>
         <form action="/cgi-bin/koha/opac-user.pl" method="post" name="auth" id="modalAuth">
+            <input type="hidden" name="has-search-query" id="has-search-query" value="" />
             <div class="modal-body">
                 [% IF ( shibbolethAuthentication ) %]
                     [% IF ( invalidShibLogin ) %]