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