Bug 24249: OPAC lists page should require login for login-dependent operations
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-shelves.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% SET PRIVATE = 1 %]
5 [% SET PUBLIC = 2 %]
6 [% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && Koha.Preference('TagsShowOnList') ) %]
7 [% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && Koha.Preference('TagsInputOnList') ) %]
8 [% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
9 [% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %]
10
11 [% INCLUDE 'doc-head-open.inc' %]
12 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo;   [% IF op == 'view' %]Contents of [% shelf.shelfname | html %][% ELSE %]Your lists[% END %]</title>[% INCLUDE 'doc-head-close.inc' %]
13 [% BLOCK cssinclude %][% END %]
14 </head>
15 [% IF ( loggedinusername ) %][% INCLUDE 'bodytag.inc' bodyid='opac-userlists' bodyclass='scrollto' %][% ELSE %][% INCLUDE 'bodytag.inc' bodyid='opac-lists' bodyclass='scrollto' %][% END %]
16
17 [% BLOCK list_permissions %]
18     <li>
19         <label for="allow_changes_from">Allow changes to contents from: </label>
20         <select name="allow_changes_from" id="allow_changes_from" onchange="AdjustRemark()">
21
22             [% IF shelf.allow_change_from_owner %]<option value="0">Nobody</option>[% ELSE %]<option value="0" selected="selected">Nobody</option>[% END %]
23
24             [% IF shelf.allow_change_from_owner && (( !shelf.is_public && !shelf.is_shared ) || !shelf.allow_change_from_others ) %]
25                 <option value="1" selected="selected">Owner only</option>
26             [% ELSE %]
27                 <option value="1">Owner only</option>
28             [% END %]
29
30             [% IF shelf.allow_change_from_others %]<option value="2" selected="selected">Anyone seeing this list</option>[% ELSE %]<option value="2">Anyone seeing this list</option>[% END %]
31
32         </select>
33         &emsp; <span id="anyone_remark" style="display:none;color:red;">The Anyone permission has no actual effect while this list is strictly private.</span>
34     </li>
35 [% END %]
36
37 [% INCLUDE 'masthead.inc' %]
38 <div class="main">
39     <ul class="breadcrumb noprint">
40         <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
41         [% IF ( loggedinusername ) %]
42             <li><a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a> <span class="divider">&rsaquo;</span></li>
43         [% END %]
44
45         [% IF op != 'list' %]
46             <li><a href="/cgi-bin/koha/opac-shelves.pl">Lists</a></li>
47         [% ELSE %]
48             <li>Lists</li>
49         [% END %]
50
51         [% IF shelf and shelf.is_private %]
52             [% IF op == 'view' OR op == 'edit_form' %]
53                 <li><span class="divider">&rsaquo;</span> <a href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=[% PRIVATE | uri %]">Your lists</a></li>
54             [% ELSE %]
55                 <li><span class="divider">&rsaquo;</span> Your lists</li>
56             [% END %]
57         [% ELSIF shelf AND shelf.is_public %]
58             [% IF op == 'view' %]
59                 <li><span class="divider">&rsaquo;</span> <a href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=[% PUBLIC | uri %]">Public lists</a></li>
60             [% ELSE %]
61                 <li><span class="divider">&rsaquo;</span> Public lists</li>
62             [% END %]
63         [% END %]
64
65         [% IF op == 'view' %]
66             <li><span class="divider">&rsaquo;</span> Contents of <i>[% shelf.shelfname | html %]</i></li>
67         [% END %]
68
69         [% IF op == 'add_form' %]
70             <li><span class="divider">&rsaquo;</span> Create new list</li>
71         [% END %]
72
73         [% IF op == 'edit_form' %]
74             <li><span class="divider">&rsaquo;</span> Edit list <i>[% shelf.shelfname | html %]</i></li>
75         [% END %]
76
77     </ul> <!-- / .breadcrumb -->
78
79     <div class="container-fluid">
80         <div class="row-fluid">
81             [% IF ( OpacNav||loggedinusername ) && !print %]
82                 <div class="span2">
83                     <div id="navigation">
84                         [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
85                     </div>
86                 </div>
87             [% END %]
88
89             [% IF ( OpacNav||loggedinusername ) %]
90                 <div class="span10">
91             [% ELSE %]
92                 <div class="span12">
93             [% END %]
94                 <div id="usershelves" class="maincontent">
95
96                 [% FOR m IN messages %]
97                     [% SWITCH m.type %]
98                         [% CASE 'message' %]
99                             <div class="alert alert-success" role="alert">
100                         [% CASE 'error' %]
101                             <div class="alert alert-danger" role="alert">
102                     [% END %]
103                     [% SWITCH m.code %]
104                     [% CASE 'error_on_update' %]
105                         <span>An error occurred when updating this list.</span>
106                     [% CASE 'error_on_insert' %]
107                         <span>An error occurred when creating this list.</span>
108                     [% CASE 'error_on_delete' %]
109                         <span>An error occurred when deleting this list.</span>
110                     [% CASE 'error_on_add_biblio' %]
111                         <span>The item has not been added to the list. Please check it's not already in the list.</span>
112                     [% CASE 'error_on_remove_share' %]
113                         <span>The share has not been removed.</span>
114                     [% CASE 'success_on_update' %]
115                         <span>List updated.</span>
116                     [% CASE 'success_on_insert' %]
117                         <span>List created.</span>
118                     [% CASE 'success_on_delete' %]
119                         <span>List deleted.</span>
120                     [% CASE 'success_on_add_biblio' %]
121                         <span>The item has been added to the list.</span>
122                     [% CASE 'success_on_remove_biblios' %]
123                         <span>The item has been removed from the list.</span>
124                     [% CASE 'success_on_remove_share' %]
125                         <span>The share has been removed.</span>
126                     [% CASE 'does_not_exist' %]
127                         <span>This list does not exist.</span>
128                     [% CASE 'item_does_not_exist' %]
129                         <span>This item does not exist.</span>
130                     [% CASE 'unauthorized_on_view' %]
131                         <span>You do not have permission to view this list.</span>
132                     [% CASE 'unauthorized_on_insert' %]
133                         <span>You do not have permission to create a new list.</span>
134                     [% CASE 'unauthorized_on_update' %]
135                         <span>You do not have permission to update this list.</span>
136                     [% CASE 'unauthorized_on_delete' %]
137                         <span>You do not have permission to delete this list.</span>
138                     [% CASE 'unauthorized_on_add_biblio' %]
139                         <span>You do not have permission to add a record to this list.</span>
140                     [% CASE 'no_biblio_removed' %]
141                         <span>No record was removed.</span>
142                     [% CASE 'Koha::Exceptions::Virtualshelves::DuplicateObject' %]
143                         <span>An error occurred when creating the list. The name [% shelfname | html %] already exists.</span>
144                     [% CASE 'DBIx::Class::Exception' %]
145                         [% m.msg | html %]
146                     [% CASE %]
147                         [% m.code | html %]
148                         [% m.msg | html %]
149                     [% END %]
150                     </div>
151                 [% END %]
152
153                     [% IF shelf AND op == 'view' %]
154                         <h3>
155                             [% shelf.shelfname | html %]
156                             <a href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-shelves.pl?rss=1&amp;op=view&amp;shelfnumber=[% shelf.shelfnumber | uri %]" class="rss-list-link noprint">
157                                 <i class="fa fa-fw fa-rss rsssearchicon" title="Subscribe to this list"></i>
158                             </a>
159                         </h3>
160
161                          [% IF ( itemsloop ) %]
162                             <div id="floating">
163                              <div id="toolbar" class="toolbar clearfix">
164                                  <div class="list-actions">
165                                     <a class="btn btn-link newshelf" href="/cgi-bin/koha/opac-shelves.pl?op=add_form"><i class="fa fa-fw fa-plus"></i> New list</a> <span class="sep">|</span>
166                                     <a href="/cgi-bin/koha/opac-downloadshelf.pl?shelfnumber=[% shelf.shelfnumber | uri %]" class="btn btn-link download" data-toggle="modal" data-target="#modalWin"><i class="fa fa-fw fa-download"></i> Download list</a>
167
168                                     [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
169                                         <span class="sendlist"><a href="/cgi-bin/koha/opac-sendshelf.pl?shelfid=[% shelf.shelfnumber | uri %]" class="btn btn-link send" onclick="open('/cgi-bin/koha/opac-sendshelf.pl?shelfid=[% shelf.shelfnumber | html %]','win_form','scrollbars=yes,resizable=yes,height=400,width=500,top=50,left=100'); return false; "><i class="fa fa-fw fa-envelope"></i> Send list</a></span>
170                                     [% END %]
171
172                                     <a class="btn btn-link print-small" target="_blank" href="/cgi-bin/koha/opac-shelves.pl?op=view&amp;shelfnumber=[% shelf.shelfnumber | html %]&sortfield=[% sortfield | html %]&direction=[% direction | uri %]&print=1"><i class="fa fa-fw fa-print"></i> Print list</a>
173
174                                     [% IF can_manage_shelf %]
175                                         <span class="sep">|</span>
176                                         <form method="get" action="/cgi-bin/koha/opac-shelves.pl" class="form-inline">
177                                             <input type="hidden" name="op" value="edit_form" />
178                                             <input type="hidden" name="referer" value="view" />
179                                             <input type='hidden' name='category' value='[% category | html %]' />
180                                             <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
181                                             <button type="submit" class="btn btn-link editshelf"><i class="fa fa-fw fa-pencil-square-o"></i> Edit list</button>
182                                         </form>
183
184                                         <form method="post" action="/cgi-bin/koha/opac-shelves.pl" class="form-inline">
185                                             <input type="hidden" name="op" value="delete" />
186                                             <input type="hidden" name="referer" value="list" />
187                                             <input type='hidden' name='category' value='[% category | html %]' />
188                                             <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
189                                             <button type="submit" class="btn btn-link remove deleteshelf" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);"><i class="fa fa-fw fa-remove"></i> Delete list</button>
190                                         </form>
191                                         [% IF category == PRIVATE && Koha.Preference('OpacAllowSharingPrivateLists') %]
192                                             <a href="/cgi-bin/koha/opac-shareshelf.pl?op=invite&shelfnumber=[% shelf.shelfnumber | uri %]" class="btn btn-link sharelist"><i class="fa fa-fw fa-share"></i> Share list</a>
193                                         [% END %]
194                                     [% ELSIF category == PRIVATE # not manageshelf and private means shared %]
195                                         <form action="/cgi-bin/koha/opac-shelves.pl" method="post" class="form-inline">
196                                             <input type="hidden" name="op" value="remove_share" />
197                                             <input type="hidden" name="referer" value="list" />
198                                             <input type='hidden' name='category' value='[% category | html %]' />
199                                             <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
200                                             <button type="submit" class="btn btn-link deleteshelf" onclick="return confirmDelete(MSG_CONFIRM_REMOVE_SHARE);"><i class="fa fa-fw fa-remove"></i> Remove share</button>
201                                         </form>
202                                     [% END %]
203                                 </div>
204
205                                 <form action="/cgi-bin/koha/opac-shelves.pl" id="sorting-form" class="form-inline sort_by pull-right">
206                                     <input type="hidden" name="op" value="view" />
207                                     <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
208
209                                     <label for="sortfield">Sort by: </label>
210                                     <select name="sortfield" id="sortfield" class="resort">
211                                         <option value="">Default sorting</option>
212                                         <optgroup label="Author">
213                                             [% IF sortfield == 'author' && direction == 'asc' %]
214                                                 <option value="author:asc" selected="selected">Author (A-Z)</option>
215                                             [% ELSE %]
216                                                 <option value="author:asc">Author (A-Z)</option>
217                                             [% END %]
218                                             [% IF sortfield == 'author' && direction == 'desc' %]
219                                                 <option value="author:desc" selected="selected">Author (Z-A)</option>
220                                             [% ELSE %]
221                                                 <option value="author:desc">Author (Z-A)</option>
222                                             [% END %]
223                                         </optgroup>
224                                         <optgroup label="Title">
225                                             [% IF sortfield == 'title' && direction == 'asc' %]
226                                                 <option value="title:asc" selected="selected">Title (A-Z)</option>
227                                             [% ELSE %]
228                                                 <option value="title:asc">Title (A-Z)</option>
229                                             [% END %]
230                                             [% IF sortfield == 'title' && direction == 'desc' %]
231                                                 <option value="title:desc" selected="selected">Title (Z-A)</option>
232                                             [% ELSE %]
233                                                 <option value="title:desc">Title (Z-A)</option>
234                                             [% END %]
235                                         </optgroup>
236                                         <optgroup label="Call number">
237                                             [% IF sortfield == 'itemcallnumber' && direction == 'asc' %]
238                                                 <option value="itemcallnumber:asc" selected="selected">Call number (A-Z)</option>
239                                             [% ELSE %]
240                                                 <option value="itemcallnumber:asc">Call number (A-Z)</option>
241                                             [% END %]
242                                             [% IF sortfield == 'itemcallnumber' && direction == 'desc' %]
243                                                 <option value="itemcallnumber:desc" selected="selected">Call number (Z-A)</option>
244                                             [% ELSE %]
245                                                 <option value="itemcallnumber:desc">Call number (Z-A)</option>
246                                             [% END %]
247                                         </optgroup>
248                                         <optgroup label="Copyright date">
249                                             [% IF sortfield == 'copyrightdate' && direction == 'asc' %]
250                                                 <option value="copyrightdate:desc" selected="selected">Copyright date (newest to oldest)</option>
251                                             [% ELSE %]
252                                                 <option value="copyrightdate:desc">Copyright date (newest to oldest)</option>
253                                             [% END %]
254                                             [% IF sortfield == 'copyrightdate' && direction == 'desc' %]
255                                                 <option value="copyrightdate:asc" selected="selected">Copyright date (oldest to newest)</option>
256                                             [% ELSE %]
257                                                 <option value="copyrightdate:asc">Copyright date (oldest to newest)</option>
258                                             [% END %]
259                                         </optgroup>
260                                         <optgroup label="Date added">
261                                             [% IF sortfield == "dateadded" && direction == 'asc' %]
262                                                 <option value="dateadded:desc" selected="selected">Date added (newest to oldest)</option>
263                                             [% ELSE %]
264                                                 <option value="dateadded:desc">Date added (newest to oldest)</option>
265                                             [% END %]
266                                             [% IF sortfield == "dateadded" && direction == 'desc' %]
267                                                 <option value="dateadded:asc" selected="selected">Date added (oldest to newest)</option>
268                                             [% ELSE %]
269                                                 <option value="dateadded:asc">Date added (oldest to newest)</option>
270                                             [% END %]
271                                         </optgroup>
272                                     </select>
273
274                                     <input type="submit" class="btn btn-small" id="sort-submit" value="Resort list" />
275                                 </form>
276
277                             </div> <!-- / #toolbar -->
278
279                             <div id="selections-toolbar" class="toolbar noprint">
280                                 <span class="checkall"></span> <span class="clearall"></span> <span class="sep">|</span>
281                                 <span class="links">
282                                     <span id="selections">Select titles to: </span>
283                                     [% IF Koha.Preference( 'RequestOnOpac' ) == 1 %]
284                                         <span id="placehold"></span>
285                                     [% END %]
286                                     [% IF ( TagsInputEnabled && loggedinusername ) %]
287                                         <span id="addtags">
288                                           <a id="tagsel_tag" href="#" class="btn btn-link btn-disabled"><i class="fa fa-fw fa-tag"></i> Tag</a>
289                                         </span>
290                                         <span id="tagsel_form" style="display:none">
291                                           <label for="tagsel_new">New tag(s), separated by a comma:</label>
292                                           <input type="text" name="tagsel_new" id="tagsel_new" maxlength="100" />
293                                           <input id="tagsel_button" name="tagsel_button" class="tagsel_button btn btn-small" title="tagsel_button" type="submit" value="Add" />
294                                           <a href="#" id="tagsel_cancel">Cancel</a>
295                                         </span>
296                                     [% END %]
297                                     [% IF loggedinusername && can_remove_biblios %]
298                                         <span id="removeitems"></span>
299                                     [% END %]
300                                 </span> <!-- / .links -->
301                             </div> <!-- / #selections-toolbar -->
302                             </div> <!-- /#floating -->
303
304                             <form action="/cgi-bin/koha/opac-shelves.pl" method="post" id="myform" name="myform" class="checkboxed">
305                                 [% IF can_manage_shelf %]
306                                     <input type="hidden" name="op" value="remove_biblios" />
307                                     <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
308                                 [% END %]
309                                 <div class="searchresults">
310                                     <table id="listcontents" class="table">
311                                         <tbody>
312                                         [% FOREACH itemsloo IN itemsloop %]
313                                             <tr>
314                                                 <td class="select selectcol"><input type="checkbox" class="cb" name="biblionumber" value="[% itemsloo.biblionumber | html %]" /></td>
315                                                 [% UNLESS ( item_level_itypes ) %]
316                                                     <td>
317                                                         [% UNLESS ( noItemTypeImages ) %]
318                                                             <img src="[% itemsloo.imageurl | html %]" alt="[% itemsloo.description | html %]" title="[% itemsloo.description | html %]" />
319                                                         [% END %]
320                                                         [% itemsloo.description | html %]
321                                                     </td>
322                                                 [% END %]
323                                                 <td>
324                                                     <div class="coverimages">
325                                                         <a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% itemsloo.biblionumber | html %]">
326                                                             [% IF ( OPACLocalCoverImages ) %]
327                                                                 <span title="[% itemsloo.biblionumber |url %]" class="[% itemsloo.biblionumber | html %]" id="local-thumbnail[% loop.count | html %]"></span>
328                                                             [% END %]
329                                                             [% IF ( AdlibrisEnabled && itemsloo.normalized_isbn ) %]
330                                                                 <img src="[% AdlibrisURL | html %]?isbn=[% itemsloo.normalized_isbn | html %]" class="adlibris-cover" alt="Adlibris cover image" />
331                                                             [% END %]
332                                                             [% IF ( OPACAmazonCoverImages ) %]
333                                                                 [% IF ( itemsloo.normalized_isbn ) %]
334                                                                     <span title="[% itemsloo.biblionumber | html %]" id="amazon-thumbnail[% loop.count | html %]"><img src="https://images-na.ssl-images-amazon.com/images/P/[% itemsloo.normalized_isbn | html %].01.TZZZZZZZ.jpg" alt="" /></span>
335                                                                 [% ELSE %]
336                                                                     <span class="no-image">No cover image available</span>
337                                                                 [% END %]
338                                                             [% END %]
339
340                                                             [% IF ( SyndeticsEnabled && SyndeticsCoverImages ) %]
341                                                                 <span title="[% itemsloo.biblionumber | html %]" id="syndetics-thumbnail[% loop.count | html %]"><img src="https://secure.syndetics.com/index.aspx?isbn=[% itemsloo.normalized_isbn | html %]/SC.GIF&amp;client=[% SyndeticsClientCode | html %]&amp;type=xw10&amp;upc=[% itemsloo.normalized_upc | html %]&amp;oclc=[% itemsloo.normalized_oclc | html %]" alt="" /></span>
342                                                             [% END %]
343
344                                                             [% IF ( GoogleJackets ) %]
345                                                                 [% IF ( itemsloo.normalized_isbn ) %]
346                                                                     <div title="[% itemsloo.biblionumber |url %]" class="[% itemsloo.normalized_isbn | html %]" id="gbs-thumbnail[% loop.count | html %]"></div>
347                                                                 [% ELSE %]
348                                                                     <span class="no-image">No cover image available</span>
349                                                                 [% END %]
350                                                             [% END %]
351
352                                                             [% IF ( Koha.Preference('Coce') && Koha.Preference('CoceProviders') ) %]
353                                                                 [% coce_id = itemsloo.normalized_ean || itemsloo.normalized_isbn %]
354                                                                 [% IF ( coce_id ) %]
355                                                                     <span title="[% itemsloo.biblionumber |url %]" class="[% coce_id | html %]" id="coce-thumbnail[% loop.count | html %]"></span>
356                                                                 [% ELSE %]
357                                                                     <span class="no-image">No cover image available</span>
358                                                                 [% END %]
359                                                             [% END %]
360
361
362                                                             [% IF OpenLibraryCovers %]
363                                                                 [% IF itemsloo.normalized_isbn %]
364                                                                     <span title="[% itemsloo.biblionumber | html %]" class="[% itemsloo.normalized_isbn | html %]" id="openlibrary-thumbnail[% loop.count | html %]"></span>
365                                                                 [% ELSE %]
366                                                                     <span class="no-image">No cover image available</span>
367                                                                 [% END %]
368                                                             [% END %]
369
370                                                         </a> <!-- / .p1 -->
371                                                         [% IF ( BakerTaylorEnabled ) %]
372                                                             [% bt_id = ( itemsloo.normalized_upc || itemsloo.normalized_isbn ) %]
373                                                             [% IF ( bt_id ) %]
374                                                                 <a href="https://[% BakerTaylorBookstoreURL | uri %][% bt_id | uri %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" /></a>
375                                                             [% ELSE %]
376                                                                 <span class="no-image">No cover image available</span>
377                                                             [% END %]
378                                                         [% END %]
379
380                                                         [% IF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') %]
381                                                             [% IF ( itemsloo.BiblioDefaultViewmarc ) %]
382                                                                 <a class="custom_cover_image" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% itemsloo.biblionumber |url %]">
383                                                             [% ELSE %]
384                                                                 [% IF ( itemsloo.BiblioDefaultViewisbd ) %]
385                                                                     <a class="custom_cover_image" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% itemsloo.biblionumber |url %]">
386                                                                 [% ELSE %]
387                                                                     <a class="custom_cover_image" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% itemsloo.biblionumber |url %]">
388                                                                 [% END %]
389                                                             [% END %]
390                                                             <img alt="Cover image" src="[% itemsloo.biblio_object.custom_cover_image_url | url %]" /></a>
391                                                         [% END %]
392
393                                                     </div>
394                                                     [% IF ( itemsloo.XSLTBloc ) %]
395                                                         [% itemsloo.XSLTBloc | $raw %]
396                                                     [% ELSE %]
397
398                                                         [% IF ( itemsloo.BiblioDefaultViewmarc ) %]
399                                                             <a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% itemsloo.biblionumber |url %]" title="View details for this title">
400                                                         [% ELSE %]
401                                                             [% IF ( itemsloo.BiblioDefaultViewisbd ) %]
402                                                                 <a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% itemsloo.biblionumber |url %]" title="View details for this title">
403                                                             [% ELSE %]
404                                                                 <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% itemsloo.biblionumber |url %]" title="View details for this title">
405                                                             [% END %]
406                                                         [% END %]
407
408                                                         [% INCLUDE 'biblio-title.inc' biblio=itemsloo %]
409                                                         </a>
410
411                                                         [% IF ( itemsloo.author ) %]
412                                                             by <a href="/cgi-bin/koha/opac-search.pl?q=au:[% itemsloo.author |url %]" title="Search for works by this author" class="author">[% itemsloo.author | html %]</a>
413                                                         [% ELSE %]
414                                                             &nbsp;
415                                                         [% END %]
416
417                                                         <span class="results_summary">
418                                                             <span class="label">Publication:</span>
419                                                             [% IF ( itemsloo.place ) %]
420                                                                 [% itemsloo.place | html %]
421                                                             [% END %]
422                                                             [% IF ( itemsloo.publishercode ) %]
423                                                                 [% itemsloo.publishercode | html %]
424                                                             [% END %]
425                                                             [% IF ( itemsloo.publicationyear ) %]
426                                                                 [% itemsloo.publicationyear | html %]
427                                                             [% ELSE %]
428                                                                 [% IF ( itemsloo.copyrightdate ) %]
429                                                                     [% itemsloo.copyrightdate | html %]
430                                                                 [% END %]
431                                                             [% END %]
432                                                             [% IF ( itemsloo.pages ) %]. [% itemsloo.pages | html %][% END %]
433                                                             [% IF ( itemsloo.notes ) %], [% itemsloo.notes | html %][% END %]
434                                                             [% IF ( itemsloo.item('size') ) %] [% itemsloo.item('size') | html %][% END %]
435                                                         </span>
436                                                         <span class="results_summary">
437                                                             <span class="label">Holdings:</span>
438                                                             [% IF ( itemsloo.ITEM_RESULTS ) %]
439                                                                 [% FOREACH ITEM_RESULT IN itemsloo.ITEM_RESULTS %]
440                                                                     [% ITEM_RESULT.homebranch | html %]
441                                                                     [% IF ( ITEM_RESULT.location_opac ) %]
442                                                                         <span class="shelvingloc">[% ITEM_RESULT.location_opac | html %]</span>
443                                                                     [% END %]
444                                                                     [% IF ( ITEM_RESULT.itemcallnumber ) %]
445                                                                         ([% ITEM_RESULT.itemcallnumber | html %])
446                                                                             [% IF ( loop.last ) %].[% ELSE %],[% END %]
447                                                                     [% END %]
448                                                                 [% END %]
449                                                             [% ELSE %]
450                                                                 This record has no items.
451                                                             [% END %]
452                                                         </span>
453                                                     [% END # / IF itemsloo.XSLTBloc %]
454
455                                                     [% IF ( TagsShowEnabled && itemsloo.TagLoop.size ) %]
456                                                         <div class="results_summary tags">
457                                                             <span class="label">Tags:</span>
458                                                             <ul>
459                                                                 [% FOREACH TagLoo IN itemsloo.TagLoop %]
460                                                                     <li><a href="/cgi-bin/koha/opac-search.pl?tag=[% TagLoo.term |url %]&amp;q=[% TagLoo.term |url %]">[% TagLoo.term | html %]</a> <span class="weight">([% TagLoo.weight_total | html %])</span></li>
461                                                                 [% END %]
462                                                             </ul>
463                                                         </div>
464                                                     [% END %]
465
466                                                     [% INCLUDE 'title-actions-menu.inc' items=itemsloo %]
467
468                                                     <!-- COinS / Openurl -->
469                                                     <span class="Z3988" title="[% itemsloo.coins | html %]"></span>
470                                                 </td>
471                                             </tr>
472                                         [% END # / FOREACH itemsloop %]
473                                         </tbody>
474                                     </table> <!-- / #listcontents -->
475                                 </div><!-- / .searchresults -->
476
477                             [% IF ( pagination_bar ) %]
478                                 <div class="pages">[% pagination_bar | $raw %]</div>
479                             [% END %]
480
481                         [% ELSE %]
482                             <div id="toolbar" class="toolbar clearfix">
483                                 <div class="list-actions">
484                                     <a class="newshelf" href="/cgi-bin/koha/opac-shelves.pl?op=add_form">New list</a> <span class="sep"></span>
485                                     [% IF can_manage_shelf %]
486                                         <span class="sep">|</span>
487                                         <form method="get" action="/cgi-bin/koha/opac-shelves.pl" class="form-inline">
488                                             <input type="hidden" name="op" value="edit_form" />
489                                             <input type="hidden" name="referer" value="view" />
490                                             <input type="hidden" name="category" value="category" />
491                                             <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
492                                             <input type="submit" class="editshelf" value="Edit list" />
493                                         </form>
494
495                                         <form method="post" action="/cgi-bin/koha/opac-shelves.pl" class="form-inline">
496                                             <input type="hidden" name="op" value="delete" />
497                                             <input type="hidden" name="shelfnumber" value="[% shelfnumber | html %]"/>
498                                             <input type="hidden" name="category" value="category" />
499                                             <input type="submit" class="deleteshelf" value="Delete list" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);"/>
500                                         </form>
501                                     [% END %]
502                                 </div> <!-- / .list-actions -->
503                             </div> <!-- / #toolbar -->
504
505                             <div class="alert alert-info">
506                                 This list is empty.
507                                 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
508                                     You can add to your lists from the results of any <a href="opac-main.pl">search</a>.
509                                 [% END %]
510                             </div>
511                         [% END # / IF itemsloop %]
512                       [% END %]
513                     [% IF itemsloop && can_remove_biblios %]
514                         <input type="hidden" name="op" value="remove_biblios" />
515                         <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
516                         <input type="hidden" name="modifyshelfcontents" value="1" />
517                         <input type="submit" value="Remove selected items" id="remove-selected" class="btn btn-danger"/>
518                     [% ELSIF !itemsloop && can_manage_shelf %]
519                         <form method="post" action="opac-shelves.pl">
520                         <input type="hidden" name="op" value="delete" />
521                         <input type="hidden" name="referer" value="list" />
522                         <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]"/>
523                         <input type="submit" class="btn btn-danger" value="Delete this list" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST)" />
524                     [% END %]
525                             </form> <!-- / myform -->
526
527                     [% IF op == 'add_form' OR op == 'edit_form' %]
528                         <form method="post" action="/cgi-bin/koha/opac-shelves.pl">
529                             <fieldset class="rows">
530                                 [% IF op == 'add_form' %]
531                                     <div id="addshelf">
532                                     <legend>Create a new list</legend>
533                                     <input type="hidden" name="op" value="add" />
534                                 [% ELSE %]
535                                     <legend>Editing <em>[% shelf.shelfname | html %]</em></legend>
536                                     <input type="hidden" name="op" value="edit" />
537                                     <input type="hidden" name="referer" value="[% referer | html %]" />
538                                     <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
539                                 [% END %]
540                                 <input type="hidden" name="owner" id="owner" value="[% loggedinusernumber | html %]" />
541                                 <ol>
542                                     <li>
543                                         <label class="required" for="shelfname">List name: </label>
544                                         <input type="text" id="shelfname" name="shelfname" maxlength="255" value="[% shelf.shelfname | html %]" required="required" class="required"/> <span class="required">Required</span></li>
545                                     <li>
546                                         <label for="sortfield" >Sort this list by: </label>
547                                         <select name="sortfield" id="sortfield">
548                                             [% IF shelf.sortfield == "title" %]
549                                                 <option value="title" selected="selected">Title</option>
550                                             [% ELSE %]
551                                                 <option value="title">Title</option>
552                                             [% END %]
553                                             [% IF shelf.sortfield == "author" %]
554                                                 <option value="author" selected="selected">Author</option>
555                                             [% ELSE %]
556                                                 <option value="author">Author</option>
557                                             [% END %]
558                                             [% IF shelf.sortfield == "copyrightdate" %]
559                                                 <option value="copyrightdate" selected="selected">Year</option>
560                                             [% ELSE %]
561                                                 <option value="copyrightdate">Year</option>
562                                             [% END %]
563                                             [% IF shelf.sortfield == "itemcallnumber" %]
564                                                 <option value="itemcallnumber" selected="selected">Call number</option>
565                                             [% ELSE %]
566                                                 <option value="itemcallnumber">Call number</option>
567                                             [% END %]
568                                             [% IF shelf.sortfield == "dateadded" %]
569                                                 <option value="dateadded" selected="selected">Date added</option>
570                                             [% ELSE %]
571                                                 <option value="dateadded">Date added</option>
572                                             [% END %]
573                                         </select>
574                                     </li>
575                                     [% IF Koha.Preference('OpacAllowPublicListCreation') OR category == PUBLIC %]
576                                         <li>
577                                             <label for="category">Category:</label>
578                                             <select name="category" id="category" onchange="AdjustRemark()">
579                                                 [% IF shelf.is_private %]
580                                                         <option value="1" selected="selected">Private</option>
581                                                     [% ELSE %]
582                                                         <option value="1">Private</option>
583                                                     [% END %]
584                                                 [% IF shelf.is_public %]
585                                                     <option value="2" selected="selected">Public</option>
586                                                 [% ELSE %]
587                                                     <option value="2">Public</option>
588                                                 [% END %]
589                                             </select>
590                                             [% IF shelf.is_public AND NOT Koha.Preference('OpacAllowPublicListCreation') %]
591                                                 <span class="hint alert alert-info">The library has disabled the ability for patrons to create new public lists.  If you make your list private, you will not be able to make it public again.</span>
592                                             [% END %]
593                                         </li>
594                                     [% END %]
595                                     [% INCLUDE list_permissions %]
596                                 </ol>
597                                 [% UNLESS Koha.Preference('OpacAllowPublicListCreation') OR category == PUBLIC %]
598                                     <input type="hidden" name="category" value="[% PRIVATE | html %]" />
599                                 [% END %]
600                             </fieldset>
601
602                             <fieldset class="action">
603                                 <input type="submit" value="Save" class="btn" />
604                                 [% IF referer == 'view' %]
605                                     <a href="/cgi-bin/koha/opac-shelves.pl?op=view&amp;shelfnumber=[% shelf.shelfnumber | uri %]" class="cancel">Cancel</a>
606                                 [% ELSE %]
607                                      <a href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=[% PRIVATE | uri %]" class="cancel">Cancel</a>
608                                  [% END %]
609
610                             </fieldset>
611                         </form>
612
613                     [% ELSIF op == 'list' %]
614                         <h2>Lists</h2>
615                         <div class="toptabs ui-tabs ui-widget ui-widget-content ui-corner-all">
616                         <ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
617                             [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
618                                 [% IF category == PRIVATE %]
619                                     <li id="privateshelves_tab" class="ui-state-default ui-corner-top ui-tabs-active ui-state-active"><a class="ui-tabs-anchor" href="/cgi-bin/koha/opac-shelves.pl?op=listamp;category=[% PRIVATE | html %]">Your lists</a></li>
620                                 [% ELSE %]
621                                     <li id="privateshelves_tab" class="ui-state-default ui-corner-top"><a class="ui-tabs-anchor" href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=[% PRIVATE | html %]">Your lists</a></li>
622                                 [% END %]
623                             [% END %]
624                             [% IF category == PUBLIC %]
625                                 <li id="publicshelves_tab" class="ui-state-default ui-corner-top ui-tabs-active ui-state-active"><a class="ui-tabs-anchor" href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=[% PUBLIC | html %]">Public lists</a></li>
626                             [% ELSE %]
627                                 <li id="publicshelves_tab" class="ui-state-default ui-corner-top"><a class="ui-tabs-anchor" href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=[% PUBLIC | html %]">Public lists</a></li>
628                             [% END %]
629                         </ul>
630
631                         [% IF category == PRIVATE %]
632                             <div id="privateshelves" class="ui-tabs-panel ui-widget-content ui-corner-bottom" style="display:block;">
633                         [% ELSE %]
634                             <div id="publicshelves" class="ui-tabs-panel ui-widget-content ui-corner-bottom" style="display:block;">
635                         [% END %]
636
637                             [% IF loggedinusername %]
638                                 <div id="toolbar" class="toolbar"><a class="btn btn-link newshelf" href="/cgi-bin/koha/opac-shelves.pl?op=add_form"><i class="fa fa-plus"></i> New list</a></div>
639                             [% ELSE %]
640                                 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
641                                     <div class="alert alert-info"><a href="/cgi-bin/koha/opac-shelves.pl?op=add_form">Log in to create a new list</a></div>
642                                 [% END %]
643                             [% END %]
644
645                             [% IF shelves.count %]
646                                 <table class="table">
647                                     <thead>
648                                         <tr>
649                                             <th>List name</th>
650                                             <th>Contents</th>
651                                             <th>Type</th>
652                                             <th>&nbsp;</th>
653                                         </tr>
654                                     </thead>
655                                     <tbody>
656                                         [% FOREACH s IN shelves %]
657                                             [% SET contents = s.get_contents %]
658                                             <tr>
659                                                 <td><a href="/cgi-bin/koha/opac-shelves.pl?op=view&amp;shelfnumber=[% s.shelfnumber | uri %]">[% s.shelfname | html %]</a></td>
660                                                 <td>[% IF contents.count %][% contents.count | html %] [% IF contents.count == 1 %]item[% ELSE %]items[% END %][% ELSE %]Empty[% END %]</td>
661                                                 <td>
662                                                     [% IF s.is_private %]
663                                                         [% IF s.is_shared %]Shared[% ELSE %]Private[% END %]
664                                                     [% ELSE %]
665                                                         Public
666                                                     [% END %]
667                                                 </td>
668                                                 <td>
669                                                     [% IF s.can_be_managed( loggedinusernumber ) %]
670                                                         <form action="/cgi-bin/koha/opac-shelves.pl" method="get" class="form-inline">
671                                                             <input type="hidden" name="shelfnumber" value="[% s.shelfnumber | html %]" />
672                                                             <input type="hidden" name="category" value="[% s.category | html %]" />
673                                                             <input type="hidden" name="op" value="edit_form" />
674                                                             <input type="hidden" name="referer" value="list" />
675                                                             <button type="submit" class="btn btn-link editshelf"><i class="fa fa-pencil-square-o"></i> Edit</button>
676                                                         </form>
677                                                     [% END %]
678                                                     [% IF s.can_be_deleted( loggedinusernumber ) %]
679                                                         <form action="/cgi-bin/koha/opac-shelves.pl" method="post" class="form-inline">
680                                                             <input type="hidden" name="op" value="delete" />
681                                                             <input type="hidden" name="referer" value="list" />
682                                                             <input type='hidden' name='category' value='[% category | html %]' />
683                                                             <input type="hidden" name="shelfnumber" value="[% s.shelfnumber | html %]" />
684                                                             <button type="submit" class="btn btn-link remove deleteshelf" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);"><i class="fa fa-remove"></i> Delete</button>
685                                                         </form>
686                                                     [% END %]
687                                                     [% IF s.is_private AND s.can_be_managed( loggedinusernumber ) AND Koha.Preference('OpacAllowSharingPrivateLists') %]
688                                                         <a href="/cgi-bin/koha/opac-shareshelf.pl?op=invite&shelfnumber=[% s.shelfnumber | uri %]" class="sharelist">Share</a>
689                                                     [% END %]
690                                                     [% IF s.is_shared_with( loggedinusernumber ) %]
691                                                         <form action="opac-shelves.pl" method="post" class="form-inline">
692                                                             <input type="hidden" name="op" value="remove_share" />
693                                                             <input type="hidden" name="referer" value="list" />
694                                                             <input type='hidden' name='category' value='[% category | html %]' />
695                                                             <input type="hidden" name="shelfnumber" value="[% s.shelfnumber | html %]" />
696                                                             <input type="submit" class="deleteshelf" onclick="return confirmDelete(MSG_CONFIRM_REMOVE_SHARE);" value="Remove share" />
697                                                         </form>
698                                                     [% END %]&nbsp;
699                                                 </td>
700                                             </tr>
701                                         [% END %]
702                                     </tbody>
703                                 </table>
704                                 <div class="pages">[% pagination_bar | $raw %]</div>
705                             [% ELSE %]
706                                 [% IF category == PUBLIC %]
707                                     <p>No public lists.</p>
708                                 [% ELSIF loggedinusernumber %]
709                                     <p>No private lists.</p>
710                                 [% END %]
711                             [% END %]
712                             </div> [%# privateshelves or publicshelves %]
713                             </div> [%# <div class="toptabs ui-tabs ui-widget ui-widget-content ui-corner-all"> %]
714                         [% ELSIF NOT loggedinusernumber %]
715                             [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
716                                 <div class="alert alert-info"><a href="/cgi-bin/koha/opac-shelves.pl?op=add_form">Log in to create a new list</a></div>
717                             [% END %]
718                         [% END  # IF loggedinusername %]
719                 </div> <!-- / #usershelves -->
720                 </div> <!-- / .span10/12 -->
721       </div> <!-- / .row-fluid -->
722     </div> <!-- / .container-fluid -->
723   </div> <!-- / .main -->
724
725 <div class="modal hide" id="modalWin" role="dialog" aria-hidden="true" tabindex="-1">
726     <div class="modal-content">
727         <div class="modal-body">
728             <div style="margin:1em;padding:1em;font-size:150%;">
729                 <img src="[% interface | html %]/[% theme | html %]/images/loading.gif" alt="" /> Loading
730             </div>
731         </div>
732     </div>
733 </div>
734
735 <!-- DEBUG -->
736     <div id="debug"></div>
737 <!-- /DEBUG -->
738
739 [% INCLUDE 'opac-bottom.inc' %]
740 [% BLOCK jsinclude %]
741 [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
742 [% Asset.js("lib/hc-sticky.js") | $raw %]
743 <script>
744 var MSG_REMOVE_FROM_LIST = _("Are you sure you want to remove these items from the list?");
745 var MSG_REMOVE_ONE_FROM_LIST = _("Are you sure you want to remove this item from the list?");
746 var MSG_CONFIRM_DELETE_LIST = _("Are you sure you want to delete this list?");
747 var MSG_CONFIRM_REMOVE_SHARE = _("Are you sure you want to remove this share?");
748
749 [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'RequestOnOpac' ) == 1 ) ) %]
750     function holdSelections() {
751         var checkedBoxes = $("input:checkbox:checked");
752         if ($(checkedBoxes).size() == 0) {
753             alert(MSG_NO_RECORD_SELECTED);
754         } else {
755             var bibs = "";
756             $(checkedBoxes).each(function(){
757                 bibs += $(this).val() + "/";
758             });
759             document.location = "/cgi-bin/koha/opac-reserve.pl?biblionumbers="+bibs;
760         }
761     }
762 [% END %]
763 [% IF ( TagsInputEnabled && loggedinusername ) %]
764     function tagSelected() {
765         var checkedBoxes = $("input:checkbox:checked");
766         if ($(checkedBoxes).size()) {
767             $("#tagsel_tag").hide();
768             $(".tag_hides").hide();
769             $("#tagsel_form").show();
770         } else {
771             alert(MSG_NO_RECORD_SELECTED);
772         }
773     }
774
775     function tagCanceled() {
776         $("#tagsel_form").hide();
777         $("#tagsel_tag").show();
778         $(".tag_hides").show();
779         $("#tagsel_new").val("");
780         $(".tagstatus").empty().hide();
781     }
782
783     function tagAdded() {
784         var checkedBoxes = $("input:checkbox:checked");
785         if (!$(checkedBoxes).size()) {
786             alert(MSG_NO_RECORD_SELECTED);
787             return false;
788         }
789
790         var tag = $("#tagsel_new").val();
791         if (!tag || (tag == "")) {
792             alert(MSG_NO_TAG_SPECIFIED);
793             return false;
794         }
795
796         var bibs = [];
797         for (var i = 0; i < $(checkedBoxes).size(); i++) {
798             var box = $(checkedBoxes).get(i);
799             bibs[i] = $(box).val();
800         }
801
802         KOHA.Tags.add_multitags_button(bibs, tag);
803         return false;
804     }
805 [% END %]
806
807 function enableCheckboxActions(){
808     // Enable/disable controls if checkboxes are checked
809     var checkedBoxes = $(".checkboxed input:checkbox:checked");
810     if ($(checkedBoxes).size()) {
811       $("#selections").html(_("With selected titles: "));
812       $("#selections-toolbar .links a").removeClass("disabled");
813     } else {
814       $("#selections").html(_("Select titles to: "));
815       $("#selections-toolbar .links a").addClass("disabled");
816     }
817 }
818
819 $(function() {
820     [% IF Koha.Preference( 'opacbookbag' ) == 1 %]$(".addtocart,.cartRemove").removeClass("hidden");[% END %]
821     $("span.clearall").html("<a id=\"CheckNone\" href=\"#\">"+_("Clear all")+"<\/a>");
822     $("span.checkall").html("<a id=\"CheckAll\" href=\"#\">"+_("Select all")+"<\/a>");
823     $("a.print").show();
824
825     [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'RequestOnOpac' ) == 1 ) ) %]
826         $("#placehold").html("<a href=\"#\" class=\"btn btn-link hold tag_hides btn-disabled\"><i class=\"fa fa-fw fa-bookmark\"></i> "+_("Place hold")+"<\/a>");
827         $("#selections-toolbar a.hold").click(function(){
828             holdSelections();
829             return false;
830         });
831     [% END %]
832
833     // If JS is enabled add parameter to download link
834     var dialoglink = $(".download").attr("href");
835     dialoglink += "&context=modal";
836     $(".download").attr("href",dialoglink);
837
838     $("#CheckAll").click(function(){
839         $(".checkboxed").checkCheckboxes();
840         enableCheckboxActions();
841         return false;
842     });
843     $("#CheckNone").click(function(){
844         $(".checkboxed").unCheckCheckboxes();
845         enableCheckboxActions();
846         return false;
847     });
848
849     $(".cb").click(function(){
850       enableCheckboxActions();
851     });
852     enableCheckboxActions();
853
854     [% IF ( TagsInputEnabled && loggedinusername ) %]
855         var tagAdd = $(".tag_add");
856         tagAdd.removeClass("hidden");
857         $("#tagsel_tag").click(function(){
858             tagSelected();
859             return false;
860         });
861         $("#tagsel_cancel").click(function(){
862             tagCanceled();
863             return false;
864         });
865         $("#tagsel_button").click(function(){
866             tagAdded();
867             return false;
868         });
869
870         tagAdd.click(function(){
871             var thisid = $(this).attr("id");
872             thisid = thisid.replace("tag_add","");
873             $(this).hide();
874             $("#tagform"+thisid).show();
875             $("#newtag"+thisid).focus();
876             $("#newtag"+thisid+"_status").empty().hide();
877             return false;
878         });
879         $(".cancel_tag_add").click(function(){
880             var thisid = $(this).attr("id");
881             thisid = thisid.replace("cancel","");
882             $("#tagform"+thisid).hide();
883             $("#tag_add"+thisid).show();
884             $("#newtag"+thisid).val("");
885             $("#newtag"+thisid+"_status").empty().hide();
886             return false;
887         });
888         $(".tagbutton").click(function(){
889           var thisid = $(this).attr("title");
890           var tag = $("#newtag"+thisid).val();
891           if (!tag || (tag == "")) {
892               alert(MSG_NO_TAG_SPECIFIED);
893               return false;
894           }
895           KOHA.Tags.add_tag_button(thisid, tag);
896           return false;
897         });
898     [% END %]
899
900     [% IF loggedinusername && can_remove_biblios %]
901         $(".removefromlist").on("click", function(e){
902             return confirmDelete(MSG_REMOVE_ONE_FROM_LIST);
903         });
904
905         $("#myform").submit(function(){
906             var checkedBoxes = $(".checkboxed input:checkbox:checked");
907             var numchecked = $(checkedBoxes).size();
908             if (numchecked) {
909                 if( numchecked > 1 ){
910                     return confirmDelete(MSG_REMOVE_FROM_LIST);
911                 } else {
912                     return confirmDelete(MSG_REMOVE_ONE_FROM_LIST);
913                 }
914             } else {
915                 alert(MSG_NO_RECORD_SELECTED);
916                 return false;
917             }
918         });
919         $("#removeitems").html("<a href=\"#\" class=\"btn btn-link disabled removeitems tag_hides\"><i class=\"fa fa-fw fa-remove\"></i> "+_("Remove from list")+"</a>")
920         .click(function(){
921             $("#myform").submit();
922             return false;
923         });
924     [% END %]
925     [% IF OpenLibraryCovers %]KOHA.OpenLibrary.GetCoverFromIsbn();[% END %]
926     [% IF OPACLocalCoverImages %]KOHA.LocalCover.GetCoverFromBibnumber(false);[% END %]
927     [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
928     [% IF ( Koha.Preference('Coce') && Koha.Preference('CoceProviders') ) %]
929         KOHA.coce.getURL('[% Koha.Preference('CoceHost') | html %]', '[% Koha.Preference('CoceProviders') | html %]');
930     [% END %]
931
932     [% IF print %]
933         window.print();
934         window.onafterprint = function () {
935             window.close();
936         }
937         setTimeout('window.close()', 1000); // Hack for Chrome < 63
938     [% END %]
939
940     AdjustRemark();
941
942     Sticky = $("#floating");
943     Sticky.hcSticky({
944         stickTo: "#usershelves",
945         stickyClass: "floating"
946     });
947
948     sortMenu( $("#sorting-form") );
949
950     $("#sortfield").on("change", function(){
951         $('#sorting-form').submit();
952     });
953
954 }); // document.ready
955
956 function sortMenu( sorting_form ){
957     var shelfnumber = sorting_form.find("input[name='shelfnumber']").val();
958     var sort_link = "/cgi-bin/koha/opac-shelves.pl?op=view&amp;shelfnumber=" + shelfnumber + "&sortfield=";
959     var menu = "<div class=\"btn-group\"><button type=\"button\" class=\"btn btn-link dropdown-toggle\" data-toggle=\"dropdown\" id=\"sortmenu\" aria-haspopup=\"true\" aria-expanded=\"false\"><i class=\"fa fa-sort\"></i> " + _("Sort") + "</span></button><ul class=\"dropdown-menu dropdown-menu-right\" aria-labelledby=\"sortmenu\">";
960     $("#sortfield").children().each(function(){
961         if( $(this)[0].tagName.toUpperCase() == "OPTION" ){
962             menu += "<li><a href=\"" + sort_link + $(this).val() + "\">" + $(this).text() + "</a></li>";
963         } else if( $(this)[0].tagName.toUpperCase() == "OPTGROUP" ){
964             menu += "<li class=\"dropdown-header\">" + $(this).attr("label") + "</li>";
965             $(this).children().each(function(){
966                 if( $(this)[0].tagName.toUpperCase() == "OPTION" ){
967                     menu += "<li><a href=\"" + sort_link + $(this).val() + "\">" + $(this).text() + "</a></li>";
968                 }
969             });
970         }
971     });
972     menu += "</ul></div>";
973     $(".list-actions").append( menu );
974     sorting_form.remove();
975 }
976
977 function AdjustRemark() {
978     var category;
979     if( $("#category").length > 0 ) {
980         category = $("#category").val();
981     } else {
982         category = [% category | html %];
983     }
984     var perms = $("#allow_changes_from").val();
985
986     if( perms < 2 ) {
987         $("#anyone_remark").hide();
988     } else if( category==1 ) {
989         // If we move to Private (without shares), show Anyone remark
990         // Note: the number of shares is not tested real-time
991         [% IF !shelf.is_shared %]
992             $("#anyone_remark").show();
993         [% ELSE %]
994             $("#anyone_remark").hide();
995         [% END %]
996     } else { // category==2
997         $("#anyone_remark").hide();
998     }
999 }
1000 </script>
1001 [% END %]