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