Bug 17153: Redirect to search when logging in from search
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / includes / masthead.inc
index 121b8f9..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 %]
     <div class="container-fluid">
         <div class="row-fluid">
             <div id="opac-main-search">
-    <!--             <div class="span2">
-        [% IF ( opacsmallimage ) %]
-            <h1 id="libraryname" style="background-image: url('[% opacsmallimage %]');">
-        [% ELSE %]
-            <h1 id="libraryname">
-        [% END %]
-            <a href="/cgi-bin/koha/opac-main.pl">[% IF ( LibraryName ) %][% LibraryName %][% ELSE %]Koha Online Catalog[% END %]</a></h1>
-    </div> /.span2 -->
             <div class="span12">
                 [% IF ( OpacPublic ) %]
                     [% UNLESS ( advsearch ) %]
                                 [% ELSE %]
                                     <option value="se">Series</option>
                                 [% END # /ms_se %]
-                                [% IF ( numbersphr ) %]
+                                [% IF ( Koha.Preference('OPACNumbersPreferPhrase') ) %]
                                     [% IF ( ms_callnum ) %]
                                             <option selected="selected" value="callnum,phr">Call number</option>
                                     [% ELSE %]
                                     [% ELSE %]
                                         <option value="callnum">Call number</option>
                                     [% END # /ms_callnum %]
-                                [% END # /numbersphr %]
+                                [% END # /IF OPACNumbersPreferPhrase %]
                                 </select>
 
                                 [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
 
                                             [% 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 ( shibbolethAuthentication ) %]
                     [% IF ( invalidShibLogin ) %]
-                    <!-- This is what is displayed if shibboleth login has failed to match a koha user -->
-                    <div class="alert alert-info">
-                        <p>Sorry, your Shibboleth identity does not match a valid library identity. If you have a local login, you may use that below.</p>
-                    </div>
+                        <!-- This is what is displayed if shibboleth login has failed to match a koha user -->
+                        <div class="alert alert-info">
+                            <p>Sorry, your Shibboleth identity does not match a valid library identity. If you have a local login, you may use that below.</p>
+                        </div>
                     [% ELSE %]
-                    <h4>Shibboleth Login</h4>
-                    <p>If you have a Shibboleth account, please <a href="[% shibbolethLoginUrl %]">click here to login</a>.</p>
-                    <h4>Local Login</h4>
+                        <h4>Shibboleth login</h4>
+                        <p>If you have a Shibboleth account, please <a href="[% shibbolethLoginUrl %]">click here to login</a>.</p>
+                        <h4>Local Login</h4>
+                    [% END %]
+                [% END %]
+                <input type="hidden" name="koha_login_context" value="opac" />
+                <fieldset class="brief">
+                    <label for="muserid">Login:</label><input type="text" id="muserid" name="userid" />
+                    <label for="mpassword">Password:</label><input type="password" id="mpassword" name="password" />
+                    [% IF Koha.Preference( 'OpacLoginInstructions' ) %]
+                        <div id="nologininstructions-modal" class="nologininstructions">
+                            [% Koha.Preference( 'OpacLoginInstructions' ) %]
+                        </div>
                     [% END %]
-            [% END %]
-                    <input type="hidden" name="koha_login_context" value="opac" />
-                    <fieldset class="brief">
-                        <label for="muserid">Login:</label><input type="text" id="muserid" name="userid" />
-                        <label for="mpassword">Password:</label><input type="password" id="mpassword" name="password" />
                     [% IF Koha.Preference('OpacPasswordChange') && Koha.Preference('OpacResetPassword') %]
-                        <div id="forgotpassword-modal">
-                            <a href="/cgi-bin/koha/opac-password-recovery.pl">Forgot your password?</a>
+                        <div id="forgotpassword-modal" class="forgotpassword">
+                            <p><a href="/cgi-bin/koha/opac-password-recovery.pl">Forgot your password?</a></p>
                         </div>
                     [% END %]
-                    [% IF Koha.Preference( 'NoLoginInstructions' ) %]
-                        <div id="nologininstructions-modal">
-                            [% Koha.Preference( 'NoLoginInstructions' ) %]
+                    [% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %]
+                        <div id="patronregistration-modal" class="patronregistration">
+                            <p>Don't have an account? <a href="/cgi-bin/koha/opac-memberentry.pl">Register here.</a></p>
                         </div>
                     [% END %]
-                        [% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %]<div id="mpatronregistration"><p>Don't have an account? <a href="/cgi-bin/koha/opac-memberentry.pl">Register here.</a></p></div>[% END %]
-                    </fieldset>
+                </fieldset>
             </div>
             <div class="modal-footer">
                 <input type="submit" class="btn btn-primary" value="Log in" />