Bug 21911: Fix OPAC scoping to work with new group system
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / includes / masthead.inc
1 [% USE Koha %]
2 [% USE Branches %]
3 [% SET OpacLangSelectorMode = Koha.Preference('OpacLangSelectorMode') %]
4 <div id="wrap">
5     <div id="header-region" class="noprint">
6         <div class="navbar navbar-inverse navbar-static-top">
7             <div class="navbar-inner">
8                 <div class="container-fluid">
9                     <h1 id="logo">
10                         <a class="brand" href="/cgi-bin/koha/opac-main.pl">
11                             [% IF ( LibraryNameTitle ) %]
12                                 [% LibraryNameTitle %]
13                             [% ELSE %]
14                                 Koha online
15                             [% END %]
16                         </a>
17                     </h1>
18                     [% IF ( Koha.Preference( 'opacbookbag' ) == 1 ) %]
19                         <div id="cartDetails" class="cart-message">Your cart is empty.</div>
20                     [% END %]
21                     <ul class="nav">
22                         [% IF ( Koha.Preference( 'opacbookbag' ) == 1 ) %]
23                             <li class="dropdown">
24                                 <a href="#" title="Collect items you are interested in" class="dropdown-toggle" id="cartmenulink" data-toggle="dropdown" role="button">
25                                     <i id="carticon" class="icon-shopping-cart icon-white"></i> <span class="cartlabel">Cart</span> <span id="basketcount"></span> <b class="caret"></b>
26                                 </a>
27                                 <ul aria-labelledby="cartmenulink" role="menu" class="dropdown-menu">
28                                     <li role="presentation">
29                                         <a href="#" id="cartmenuitem" class="cart-message" tabindex="-1" role="menuitem">Your cart is empty.</a>
30                                     </li>
31                                 </ul>
32                             </li>
33                         [% END %]
34                         [% IF ( Koha.Preference( 'virtualshelves' ) == 1 ) && ( Koha.Preference( 'opacbookbag' ) == 1 ) %]
35                             <li class="divider-vertical"></li>
36                         [% END %]
37                         [% IF ( Koha.Preference( 'virtualshelves' ) == 1 ) %]
38                             <li class="dropdown">
39                                 <a href="#" title="Show lists" class="dropdown-toggle" id="listsmenu" data-toggle="dropdown" role="button"><i class="icon-list icon-white"></i> <span class="listslabel">Lists</span> <b class="caret"></b></a>
40                                 <ul aria-labelledby="listsmenu" role="menu" class="dropdown-menu">
41                                 [% IF some_public_shelves.count %]
42                                     <li role="presentation"><a href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=2" tabindex="-1" role="menuitem"><strong>Public lists</strong></a></li>
43                                     [% SET number_of_public_shelves = 0 %]
44                                     [% FOREACH s IN some_public_shelves %]
45                                         <li role="presentation"><a href="/cgi-bin/koha/opac-shelves.pl?op=view&amp;shelfnumber=[% s.shelfnumber %]&amp;sortfield=[% s.sortfield %]" tabindex="-1" role="menuitem">[% s.shelfname |html %]</a></li>
46                                         [% SET number_of_public_shelves = number_of_public_shelves + 1 %]
47                                         [% IF number_of_public_shelves >= 10 %][% LAST %][% END %]
48                                     [% END %]
49                                     [% IF some_public_shelves > 10 %]
50                                         <li role="presentation"><a href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=2" tabindex="-1" role="menuitem" class="listmenulink">View All</a></li>
51                                     [% END %]
52                                 [% ELSE %]
53                                     <li role="presentation"><a href="#" tabindex="-1" class="menu-inactive" role="menuitem">No public lists</a></li>
54                                 [% END %]
55                                 <li class="divider" role="presentation"></li>
56                                 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
57                                     <li role="presentation"><a href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=1" tabindex="-1" role="menuitem"><strong>Your lists</strong></a></li>
58                                     [% IF loggedinusername %]
59                                         [% IF some_private_shelves.count %]
60                                             [% SET number_of_private_shelves = 0 %]
61                                             [% FOREACH s IN some_private_shelves %]
62                                                 <li role="presentation"><a href="/cgi-bin/koha/opac-shelves.pl?op=view&amp;shelfnumber=[% s.shelfnumber %]&amp;sortfield=[% s.sortfield %]" tabindex="-1" role="menuitem">[% s.shelfname |html %]</a></li>
63                                                 [% SET number_of_private_shelves = number_of_private_shelves + 1 %]
64                                                 [% IF number_of_private_shelves >= 10 %][% LAST %][% END %]
65                                             [% END %]
66                                             [% IF some_private_shelves > 10 %]
67                                                 <li role="presentation"><a href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=1" tabindex="-1" role="menuitem" class="listmenulink">View All</a></li>
68                                             [% END %]
69                                         [% ELSE %]
70                                             <li role="presentation"><a href="#" tabindex="-1" class="menu-inactive" role="menuitem">No private lists</a></li>
71                                         [% END %]
72                                             <li role="presentation"><a href="/cgi-bin/koha/opac-shelves.pl?op=add_form" tabindex="-1" role="menuitem" class="listmenulink">New list</a></li>
73                                     [% ELSE %]
74                                         [% IF Koha.Preference('casAuthentication') %]
75                                             [%# CAS authentication is too complicated for modal window %]
76                                             <li role="presentation"><a href="/cgi-bin/koha/opac-user.pl" tabindex="-1" class="menu-inactive" role="menuitem">Log in to create your own lists</a></li>
77                                         [% ELSE %]
78                                             <li role="presentation"><a href="/cgi-bin/koha/opac-user.pl" tabindex="-1" class="menu-inactive loginModal-trigger" role="menuitem">Log in to create your own lists</a></li>
79                                         [% END %]
80                                     [% END # / IF loggedinusername %]
81                                 [% END # / IF opacuserlogin %]
82                                 </ul> <!-- / .dropdown-menu -->
83                             </li> <!-- / .dropdown -->
84                         [% END # / IF virtualshelves %]
85                     </ul> <!-- / .nav -->
86                     [% IF Koha.Preference( 'virtualshelves' ) == 1 %]<div id="listsDetails"></div>[% END %]
87                     [% IF Koha.Preference( 'opacuserlogin' ) == 1 || opaclanguagesdisplay || EnableOpacSearchHistory %]
88                         <a id="user-menu-trigger" class="pull-right" href="#"><i class="icon-user"></i> <span class="caret"></span></a>
89                         <div id="members">
90                             <ul class="nav pull-right">
91
92                                 [% INCLUDE 'masthead-langmenu.inc' %]
93
94                                 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
95                                     [% UNLESS ( loggedinusername ) %]
96                                         [% IF Koha.Preference('casAuthentication') %]
97                                             [%# CAS authentication is too complicated for modal window %]
98                                             <li><a class="login-link" href="/cgi-bin/koha/opac-user.pl">Log in to your account</a></li>
99                                         [% ELSIF ( Koha.Preference('GoogleOpenIDConnect') == 1 ) %]
100                                             <li><a class="login-link" href="/cgi-bin/koha/svc/auth/googleopenidconnect" role="button" data-toggle="modal">Log in to your account</a></li>
101                                         [% ELSE %]
102                                             <li><a href="/cgi-bin/koha/opac-user.pl" class="login-link loginModal-trigger" role="button" data-toggle="modal">Log in to your account</a></li>
103                                         [% END %]
104                                     [% END %]
105                                     [% IF ( loggedinusername ) %]
106                                         <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>
107                                         <li class="divider-vertical"></li>
108                                     [% END %]
109                                 [% END %]
110                                 [% IF EnableOpacSearchHistory %]
111                                     <li><p class="navbar-text"><a class="login-link" href="/cgi-bin/koha/opac-search-history.pl" title="View your search history">Search history</a> [<a class="logout clearsh" href="/cgi-bin/koha/opac-search-history.pl?action=delete" title="Delete your search history">x</a>]</p></li>
112                                     <li class="divider-vertical"></li>
113                                 [% END %]
114                                 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
115                                     [% IF ( loggedinusername ) %]
116                                         <li><p class="navbar-text">
117                                             <a class="logout" id="logout" href="/cgi-bin/koha/opac-main.pl?logout.x=1">
118                                             Log out</a></p></li>
119                                     [% END %]
120                                 [% END %]
121                             </ul>
122                         </div> <!-- /members -->
123                     [% END # IF opacuserlogin %]
124                 </div> <!-- /container-fluid -->
125             </div> <!-- /navbar-inner -->
126         </div> <!-- /navbar -->
127
128         [% IF ( opacheader ) %]
129             <div class="container-fluid">
130                 <div class="row-fluid">
131                     <div id="opacheader">
132                         [% opacheader %]
133                     </div>
134                 </div>
135             </div>
136         [% END %]
137     </div> <!-- / header-region -->
138
139     <div class="container-fluid">
140         <div class="row-fluid">
141             <div id="opac-main-search">
142             <div class="span12">
143                 [% IF ( OpacPublic ) %]
144                     [% UNLESS ( advsearch ) %]
145                         [% IF ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
146                             <div class="mastheadsearch librarypulldown">
147                         [% ELSE %]
148                             <div class="mastheadsearch">
149                         [% END %]
150                         [% IF Koha.Preference('OpacCustomSearch') == '' %]
151                             <form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform" class="form-inline">
152                                 <label for="masthead_search"> Search
153                                     [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
154                                         [% IF ( mylibraryfirst ) %]
155                                             (in [% Branches.GetName( mylibraryfirst ) %] only)
156                                         [% END %]
157                                     [% END %]
158                                 </label>
159
160                                 <select name="idx" id="masthead_search">
161                                 [% IF ( ms_kw ) %]
162                                     <option selected="selected" value="">Library catalog</option>
163                                 [% ELSE %]
164                                     <option value="">Library catalog</option>
165                                 [% END # /ms_kw %]
166                                 [% IF ( ms_ti ) %]
167                                     <option selected="selected" value="ti">Title</option>
168                                 [% ELSE %]
169                                     <option value="ti">Title</option>
170                                 [% END # /ms_ti %]
171                                 [% IF ( ms_au ) %]
172                                     <option selected="selected" value="au">Author</option>
173                                 [% ELSE %]
174                                     <option value="au">Author</option>
175                                 [% END # /ms_au%]
176                                 [% IF ( ms_su ) %]
177                                     <option selected="selected" value="su">Subject</option>
178                                 [% ELSE %]
179                                     <option value="su">Subject</option>
180                                 [% END # /ms_su %]
181                                 [% IF ( ms_nb ) %]
182                                     <option selected="selected" value="nb">ISBN</option>
183                                 [% ELSE %]
184                                     <option value="nb">ISBN</option>
185                                 [% END # /ms_nb%]
186                                 [% IF ( ms_se ) %]
187                                     <option selected="selected" value="se">Series</option>
188                                 [% ELSE %]
189                                     <option value="se">Series</option>
190                                 [% END # /ms_se %]
191                                 [% IF ( Koha.Preference('OPACNumbersPreferPhrase') ) %]
192                                     [% IF ( ms_callnum ) %]
193                                             <option selected="selected" value="callnum,phr">Call number</option>
194                                     [% ELSE %]
195                                         <option value="callnum,phr">Call number</option>
196                                     [% END #/ms_callnum %]
197                                 [% ELSE %]
198                                     [% IF ( ms_callnum ) %]
199                                         <option selected="selected" value="callnum">Call number</option>
200                                     [% ELSE %]
201                                         <option value="callnum">Call number</option>
202                                     [% END # /ms_callnum %]
203                                 [% END # /IF OPACNumbersPreferPhrase %]
204                                 </select>
205
206                                 [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
207                                     <div class="input-append nolibrarypulldown">
208                                 [% END %]
209                                 [% IF ( ms_value ) %]
210                                     <input type="text" title="Type search term" class="transl1" id = "translControl1" name="q" value="[% ms_value |html %]" /><span id="translControl"></span>
211                                 [% ELSE %]
212                                     <input type="text" title="Type search term" class="transl1" id = "translControl1" name="q" /><span id="translControl"></span>
213                                 [% END # /ms_value %]
214
215                                 [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
216                                     <button type="submit" id="searchsubmit" class="btn btn-primary">Go</button>
217                                     </div>
218                                 [% END %]
219
220                                 [% IF ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
221                                     <div class="input-append">
222                                         <select name="branch_group_limit" id="select_library">
223                                             <option value="">All libraries</option>
224
225                                             [% IF LibrarySearchGroups %]<optgroup label="Libraries">[% END %]
226
227                                             [% FOREACH library IN Branches.all( selected => opac_name ) %]
228                                                 [% IF library.selected %]
229                                                     <option selected="selected" value="branch:[% library.branchcode %]">[% library.branchname %]</option>
230                                                 [% ELSE %]
231                                                     <option value="branch:[% library.branchcode %]">[% library.branchname %]</option>
232                                                 [% END %]
233                                             [% END %]
234
235                                             [% IF LibrarySearchGroups %]
236                                                 </optgroup>
237                                                 <optgroup label="Groups">
238                                                     [% FOREACH lsg IN LibrarySearchGroups %]
239                                                         [% IF lsg.id == opac_name %]
240                                                             <option selected="selected" value="multibranchlimit-[% lsg.id %]">[% lsg.title %]</option>
241                                                         [% ELSE %]
242                                                             <option value="multibranchlimit-[% lsg.id %]">[% lsg.title %]</option>
243                                                         [% END # / bc.selected %]
244                                                     [% END %]
245                                                 </optgroup>
246                                             [% END # / BranchCategoriesLoop %]
247                                         </select>
248                                         <button type="submit" id="searchsubmit" class="btn btn-primary">Go</button>
249                                     </div>
250                                 [% ELSE %]
251                                     [% IF ( opac_limit_override ) %]
252                                         [% IF ( opac_search_limit ) %]
253                                             [% IF ( multibranchlimit = opac_search_limit.match( 'branch:(multibranchlimit-\d+)' ) ) %]
254                                                 <input name="branch_group_limit" value="[% multibranchlimit.0 | html %]" type="hidden" />
255                                             [% ELSE %]
256                                                 <input name="limit" value="[% opac_search_limit | html %]" type="hidden" />
257                                             [% END %]
258                                         [% END %]
259                                     [% ELSE %]
260                                         [% IF ( mylibraryfirst ) %]
261                                             <input name="limit" value="branch:[% mylibraryfirst %]" type="hidden" />
262                                         [% END %]
263                                     [% END # / opac_limit_override %]
264                                 [% END # / OpacAddMastheadLibraryPulldown %]
265
266                             </form>
267                         [% ELSE # / Koha.Preference('OpacCustomSearch') == '' %]
268                             [% Koha.Preference('OpacCustomSearch') %]
269                         [% END # / Koha.Preference('OpacCustomSearch') == '' %]
270                         </div> <!-- / .mastheadsearch -->
271                     [% END # / UNLESS advsearch %]
272
273                     <div class="row-fluid">
274                             <div id="moresearches">
275                                 <ul>
276                                     <li><a href="/cgi-bin/koha/opac-search.pl">Advanced search</a></li>
277                                     [% IF ( Koha.Preference( 'UseCourseReserves' ) == 1 ) %]<li><a href="/cgi-bin/koha/opac-course-reserves.pl">Course reserves</a></li>[% END %]
278                                     [% IF Koha.Preference( 'OpacBrowser' ) == 1 %]<li><a href="/cgi-bin/koha/opac-browser.pl">Browse by hierarchy</a></li>[% END %]
279                                     [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]<li><a href="/cgi-bin/koha/opac-authorities-home.pl">Authority search</a></li>[% END %]
280                                     [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'reviewson' ) == 1 ) && ( Koha.Preference( 'OpacShowRecentComments' ) == 1 ) ) %]<li><a href="/cgi-bin/koha/opac-showreviews.pl">Recent comments</a></li>[% END %]
281                                     [% IF Koha.Preference( 'TagsEnabled' ) == 1 %]<li><a href="/cgi-bin/koha/opac-tags.pl">Tag cloud</a></li>[% END %]
282                                     [% IF Koha.Preference( 'OpacCloud' ) == 1 %]<li><a href="/cgi-bin/koha/opac-tags_subject.pl">Subject cloud</a></li>[% END %]
283                                     [% IF Koha.Preference( 'OpacTopissue' ) == 1 %]<li><a href="/cgi-bin/koha/opac-topissues.pl">Most popular</a></li>[% END %]
284                                     [% IF Koha.Preference( 'suggestion' ) == 1 %]
285                                         [% IF Koha.Preference( 'AnonSuggestions' ) == 1 %]
286                                             <li><a href="/cgi-bin/koha/opac-suggestions.pl">Purchase suggestions</a></li>
287                                         [% ELSIF ( ( Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 ) ) %]
288                                             <li><a href="/cgi-bin/koha/opac-suggestions.pl">Purchase suggestions</a></li>
289                                         [% END %]
290                                     [% END %]
291                                 </ul>
292                             </div> <!-- /#moresearches -->
293                     </div> <!-- /.row-fluid -->
294
295                 [% END # / OpacPublic %]
296             </div> <!-- /.span10 -->
297             </div> <!-- /.opac-main-search -->
298         </div> <!-- / .row-fluid -->
299     </div> <!-- /.container-fluid -->
300
301     <!-- Login form hidden by default, used for modal window -->
302     <div id="loginModal" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="modalLoginLabel" aria-hidden="true">
303         <div class="modal-header">
304             <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
305             <h3 id="modalLoginLabel">Log in to your account</h3>
306         </div>
307         <form action="/cgi-bin/koha/opac-user.pl" method="post" name="auth" id="modalAuth">
308             <div class="modal-body">
309                 [% IF ( shibbolethAuthentication ) %]
310                     [% IF ( invalidShibLogin ) %]
311                         <!-- This is what is displayed if shibboleth login has failed to match a koha user -->
312                         <div class="alert alert-info">
313                             <p>Sorry, your Shibboleth identity does not match a valid library identity. If you have a local login, you may use that below.</p>
314                         </div>
315                     [% ELSE %]
316                         <h4>Shibboleth login</h4>
317                         <p>If you have a Shibboleth account, please <a href="[% shibbolethLoginUrl %]">click here to login</a>.</p>
318                         <h4>Local Login</h4>
319                     [% END %]
320                 [% END %]
321                 <input type="hidden" name="koha_login_context" value="opac" />
322                 <fieldset class="brief">
323                     <label for="muserid">Login:</label><input type="text" id="muserid" name="userid" />
324                     <label for="mpassword">Password:</label><input type="password" id="mpassword" name="password" />
325                     [% IF Koha.Preference( 'OpacLoginInstructions' ) %]
326                         <div id="nologininstructions-modal" class="nologininstructions">
327                             [% Koha.Preference( 'OpacLoginInstructions' ) %]
328                         </div>
329                     [% END %]
330                     [% IF Koha.Preference('OpacPasswordChange') && Koha.Preference('OpacResetPassword') %]
331                         <div id="forgotpassword-modal" class="forgotpassword">
332                             <p><a href="/cgi-bin/koha/opac-password-recovery.pl">Forgot your password?</a></p>
333                         </div>
334                     [% END %]
335                     [% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %]
336                         <div id="patronregistration-modal" class="patronregistration">
337                             <p>Don't have an account? <a href="/cgi-bin/koha/opac-memberentry.pl">Register here.</a></p>
338                         </div>
339                     [% END %]
340                 </fieldset>
341             </div>
342             <div class="modal-footer">
343                 <input type="submit" class="btn btn-primary" value="Log in" />
344                 <a href="#" data-dismiss="modal" aria-hidden="true" class="cancel">Cancel</a>
345             </div>
346         </form> <!-- /#auth -->
347     </div>  <!-- /#modalAuth  -->