Bug 12485 - Show OPAC search history when opacuserlogin is OFF
authorOwen Leonard <oleonard@myacpl.org>
Thu, 26 Jun 2014 19:03:37 +0000 (15:03 -0400)
committerChris Cormack <chrisc@catalyst.net.nz>
Wed, 2 Jul 2014 20:44:10 +0000 (08:44 +1200)
In the boostrap OPAC the link to search history is missing if
opacuserlogin is turned off. OPAC search history should be available
whether or not users can log in. This patch removes this dependency.

To test, apply the patch and test with various combinations of
opacuserlogin and EnableOpacSearchHistory:

- opacuserlogin and EnableOpacSearchHistory both enabled
- opacuserlogin enabled and EnableOpacSearchHistory disabled
- opacuserlogin disabled and EnableOpacSearchHistory enabled

Followed test plan. Works as expected.
Signed-off-by: Marc VĂ©ron <veron@veron.ch>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, no problems found.
Passes QA script and tests.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc

index d17f893..b035047 100644 (file)
                         [% END # / IF virtualshelves %]
                     </ul> <!-- / .nav -->
                     [% IF Koha.Preference( 'virtualshelves' ) == 1 %]<div id="listsDetails"></div>[% END %]
-                    [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
+                    [% IF Koha.Preference( 'opacuserlogin' ) == 1 || EnableOpacSearchHistory %]
                         <a id="user-menu-trigger" class="pull-right" href="#"><i class="icon-user"></i> <span class="caret"></span></a>
                         <div id="members">
                             <ul class="nav pull-right">
-                                [% UNLESS ( loggedinusername ) %]
-                                    [% IF Koha.Preference('casAuthentication') %]
-                                        [%# CAS authentication is too complicated for modal window %]
-                                        <li><a href="/cgi-bin/koha/opac-user.pl">Log in to your account</a></li>
-                                    [% ELSE %]
-                                        <li><a href="/cgi-bin/koha/opac-user.pl" class="loginModal-trigger" role="button" data-toggle="modal">Log in to your account</a></li>
+                                [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
+                                    [% UNLESS ( loggedinusername ) %]
+                                        [% IF Koha.Preference('casAuthentication') %]
+                                            [%# CAS authentication is too complicated for modal window %]
+                                            <li><a href="/cgi-bin/koha/opac-user.pl">Log in to your account</a></li>
+                                        [% ELSE %]
+                                            <li><a href="/cgi-bin/koha/opac-user.pl" class="loginModal-trigger" role="button" data-toggle="modal">Log in to your account</a></li>
+                                        [% END %]
+                                    [% END %]
+                                    [% IF ( loggedinusername ) %]
+                                        <li><p class="members navbar-text">Welcome, <a href="/cgi-bin/koha/opac-user.pl"><span class="loggedinusername">[% FOREACH USER_INF IN USER_INFO %][% USER_INF.title %] [% USER_INF.firstname %] [% USER_INF.surname %][% END %]</span></a></p></li>
+                                        <li class="divider-vertical"></li>
                                     [% END %]
-                                [% END %]
-                                [% IF ( loggedinusername ) %]
-                                    <li><p class="members navbar-text">Welcome, <a href="/cgi-bin/koha/opac-user.pl"><span class="loggedinusername">[% FOREACH USER_INF IN USER_INFO %][% USER_INF.title %] [% USER_INF.firstname %] [% USER_INF.surname %][% END %]</span></a></p></li>
-                                    <li class="divider-vertical"></li>
                                 [% END %]
                                 [% IF EnableOpacSearchHistory %]
                                     <li><p class="navbar-text"><a href="/cgi-bin/koha/opac-search-history.pl" title="View your search history">Search history</a> [<a class="logout" href="/cgi-bin/koha/opac-search-history.pl?action=delete" title="Delete your search history" onclick="return confirm(MSG_DELETE_SEARCH_HISTORY);">x</a>]</p></li>
                                     <li class="divider-vertical"></li>
                                 [% END %]
-                                [% IF ( loggedinusername ) %]
-                                    <li><p class="navbar-text">
-                                        [% IF persona %]
-                                            <a class="logout" id="logout" href="/cgi-bin/koha/opac-main.pl?logout.x=1" onclick='navigator.id.logout();'>
-                                        [% ELSE %]
-                                            <a class="logout" id="logout" href="/cgi-bin/koha/opac-main.pl?logout.x=1">
-                                        [% END %]
-                                        Log out</a></p></li>
+                                [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
+                                    [% IF ( loggedinusername ) %]
+                                        <li><p class="navbar-text">
+                                            [% IF persona %]
+                                                <a class="logout" id="logout" href="/cgi-bin/koha/opac-main.pl?logout.x=1" onclick='navigator.id.logout();'>
+                                            [% ELSE %]
+                                                <a class="logout" id="logout" href="/cgi-bin/koha/opac-main.pl?logout.x=1">
+                                            [% END %]
+                                            Log out</a></p></li>
+                                    [% END %]
                                 [% END %]
                             </ul>
                         </div> <!-- /members -->
-                    [% END %]
+                    [% END # IF opacuserlogin %]
                 </div> <!-- /container-fluid -->
             </div> <!-- /navbar-inner -->
         </div> <!-- /navbar -->