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