Bug 16522: (follow-up) Rename "Host item entry" to "In"
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-basket.tt
1 [% USE raw %]
2 [% USE Koha %]
3 [% USE AuthorisedValues %]
4 [% USE Branches %]
5 [% USE KohaDates %]
6 [% USE Asset %]
7 [% SET is_popup = 1 %]
8 [% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && TagsEnabled && TagsInputOnList ) %]
9
10 [% INCLUDE 'doc-head-open.inc' %]
11 <title>Your cart &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
12 [% INCLUDE 'doc-head-close.inc' %]
13 [% BLOCK cssinclude %]<style>.item-status, .dt-buttons { display: inline; } @media print { body { height: 99%; } }</style>[% END %]
14 </head>
15 [% INCLUDE 'bodytag.inc' bodyid='basket' %]
16     <div class="main">
17         <div class="container-fluid">
18             <div class="row">
19                 <div class="col">
20                     <div id="userbasket" class="maincontent">
21                         <h1>Your cart</h1>
22                         <div id="floating">
23                             <div id="toolbar" class="toolbar noprint">
24                                 [% IF ( verbose ) %]
25                                     <a href="opac-basket.pl" class="btn btn-link btn-sm brief"><i class="fa fa-fw fa-search-minus" aria-hidden="true"></i> Brief display</a>
26                                 [% ELSE %]
27                                     <a href="opac-basket.pl" class="btn btn-link btn-sm detail"><i class="fa fa-fw fa-search-plus" aria-hidden="true"></i> More details</a>
28                                 [% END %]
29                                 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
30                                     <a class="btn btn-link btn-sm send" href="opac-basket.pl"><i class="fa fa-fw fa-envelope" aria-hidden="true"></i> Send</a>
31                                 [% END %]
32
33                                 <div id="download-cart" class="btn-group dropdown">
34                                     <a id="format" class="btn btn-link dropdown-toggle" data-toggle="dropdown" role="button" href="#"><i class="fa fa-fw fa-download" aria-hidden="true"></i> Download <b class="caret"></b></a>
35                                     <div class="dropdown-menu" role="menu" aria-labelledby="format">
36                                         <a role="menuitem" class="dropdown-item download-cart" data-format="bibtex" href="#">BibTeX</a>
37                                         <a role="menuitem" class="dropdown-item download-cart" data-format="isbd" href="#">ISBD</a>
38                                         <a role="menuitem" class="dropdown-item download-cart" data-format="iso2709" href="#">MARC</a>
39                                         <a role="menuitem" class="dropdown-item download-cart" data-format="ris" href="#">RIS (Zotero, EndNote, others)</a>
40                                         [% FOREACH csv_profile IN csv_profiles %]
41                                             <a role="menuitem" class="dropdown-item download-cart" data-format="[% csv_profile.export_format_id | html %]" href="#">CSV - [% csv_profile.profile | html %]</a>
42                                         [% END %]
43                                     </div>
44                                 </div>
45
46                                 <a class="btn btn-link remove empty" href="opac-basket.pl"><i class="fa fa-fw fa-trash" aria-hidden="true"></i> Empty and close</a>
47                                 <a class="btn btn-link close" href="opac-basket.pl"><i class="fa fa-fw fa-times-circle" aria-hidden="true"></i> Hide window</a>
48                                 [% IF ( verbose ) %]
49                                     <a class="btn btn-link btn-sm print-large" href="#"><i class="fa fa-fw fa-print" aria-hidden="true"></i> Print</a>
50                                 [% END %]
51                             </div>
52
53                             <div class="selections-toolbar toolbar noprint">
54                                 <div class="check_control">
55                                     <a id="CheckAll" class="btn btn-link btn-sm btn-sm" href="#">Select all</a>
56                                     <a id="CheckNone" class="btn btn-link btn-sm btn-sm" href="#">Clear all</a>
57                                 </div>
58                                 <span class="links" id="tag_hides">
59                                     <span class="selections">Select titles to: </span>
60                                     <a href="#" class="btn btn-link btn-sm remove deleteshelf disabled" aria-disabled="true"><i class="fa fa-remove" aria-hidden="true"></i> Remove</a>
61                                     [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) %]
62                                         [% IF ( ( Koha.Preference( 'virtualshelves' ) == 1 ) && loggedinusername ) %]
63                                             <a href="#" class="btn btn-link btn-sm newshelf disabled" aria-disabled="true"><i class="fa fa-fw fa-list" aria-hidden="true"></i> Add to a list</a>
64                                         [% END %]
65                                         [% IF ( Koha.Preference( 'OPACHoldRequests' ) == 1 ) %]
66                                             <a href="#" class="btn btn-link btn-sm hold disabled" aria-disabled="true"><i class="fa fa-fw fa-bookmark" aria-hidden="true"></i> Place hold</a>
67                                         [% END %]
68                                         [% IF ( TagsInputEnabled && loggedinusername ) %]
69                                             <a href="#" id="tagsel_tag" class="btn btn-link btn-sm disabled" aria-disabled="true"><i class="fa fa-fw fa-tag" aria-hidden="true"></i> Tag</a>
70                                         [% END %]
71                                     [% END # / IF opacuserlogin %]
72                                 </span>
73                                 [% IF ( TagsInputEnabled && loggedinusername ) %]
74                                 <span id="tagsel_form" style="display:none">
75                                     <label for="tagsel_new">New tag:</label>
76                                     <input type="text" name="tagsel_new" id="tagsel_new" maxlength="100" />
77                                     <input id="tagsel_button" name="tagsel_button" class="input tagsel_button" title="Add" type="submit" value="Add">
78                                     <a href="#" id="tagsel_cancel">Cancel</a>
79                                 </span>
80                                 [% END %]
81                             </div>
82                         </div> <!-- /#floating -->
83
84                         [% IF ( verbose ) %]
85                             <form action="opac-basket.pl" method="get" name="bookbag_form" id="bookbag_form">
86                                 [% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %]
87                                     [% IF BIBLIO_RESULT.title %]
88                                         [% check_title = BIBLIO_RESULT.title %]
89                                     [% ELSE %]
90                                         [% check_title = BIBLIO_RESULT.biblionumber %]
91                                     [% END %]
92                                     <label for="bib[% BIBLIO_RESULT.biblionumber | html %]" class="sr-only">[% check_title | html %]</label>
93                                     <h2>
94                                                 <input type="checkbox" class="cb" value="[% BIBLIO_RESULT.biblionumber | html %]" name="bib[% BIBLIO_RESULT.biblionumber | html %]" id="bib[% BIBLIO_RESULT.biblionumber | html %]">
95                                                 [% INCLUDE 'biblio-title.inc' biblio=BIBLIO_RESULT %]
96                                                 [% IF ( BIBLIO_RESULT.author ) %] [% BIBLIO_RESULT.author | html %][% END %]
97                                     </h2>
98                                     <!-- COinS / Openurl -->
99                                     <span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.au=[% BIBLIO_RESULT.author | html %]&amp;rft.btitle=[% BIBLIO_RESULT.title |url %]&amp;rft.date=[% BIBLIO_RESULT.publicationyear | html %]&amp;rft.tpages=[% BIBLIO_RESULT.item('size') | html %]&amp;rft.isbn=[% BIBLIO_RESULT.isbn |url %]&amp;rft.aucorp=&amp;rft.place=[% BIBLIO_RESULT.place | html %]&amp;rft.pub=[% BIBLIO_RESULT.publisher |url %]&amp;rft.edition=[% BIBLIO_RESULT.edition | html %]&amp;rft.series=[% BIBLIO_RESULT.series | html %]&amp;rft.genre="></span>
100
101                                     <table class="table">
102                                         [% IF ( BIBLIO_RESULT.isbn ) %]
103                                             <tr>
104                                                 <th scope="row">ISBN</th>
105                                                 <td>[% BIBLIO_RESULT.isbn | html %]</td>
106                                             </tr>
107                                         [% END %]
108
109                                         [% IF ( BIBLIO_RESULT.HASAUTHORS ) %]
110                                         <tr>
111                                             <th scope="row">Author(s)</th>
112                                             <td>
113                                                [% IF ( BIBLIO_RESULT.author ) %]
114                                                    <p>[% BIBLIO_RESULT.author | html %]</p>
115                                                [% END %]
116                                                [% IF ( BIBLIO_RESULT.MARCAUTHORS ) %]
117                                                    [% FOREACH MARCAUTHOR IN BIBLIO_RESULT.MARCAUTHORS %]
118                                                    <p> [% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %]
119                                                           [% MARCAUTHOR_SUBFIELDS_LOO.separator | html %]
120                                                               [% MARCAUTHOR_SUBFIELDS_LOO.value | html %]
121                                                        [% END %]
122                                                    </p>
123                                                    [% END %]
124                                                [% END %]
125                                             </td>
126                                         </tr>
127                                         [% END %]
128
129                                         [% IF ( BIBLIO_RESULT.publishercode ) %]
130                                             <tr>
131                                                 <th scope="row">Publisher</th>
132                                                 <td>[% BIBLIO_RESULT.place | html %] [% BIBLIO_RESULT.publishercode | html %] [% BIBLIO_RESULT.publicationyear | html %]
133                                                 </td>
134                                             </tr>
135                                         [% END %]
136
137                                         [% IF ( BIBLIO_RESULT.pages ) %]
138                                             <tr>
139                                                 <th scope="row">Details</th>
140                                                 <td>[% BIBLIO_RESULT.pages | html %] [% BIBLIO_RESULT.illus | html %] [% BIBLIO_RESULT.item('size') | html %]</td>
141                                             </tr>
142                                         [% END %]
143
144                                         [% IF ( BIBLIO_RESULT.seriestitle ) %]
145                                         <tr>
146                                             <th scope="row">Collection</th>
147                                             <td> [% BIBLIO_RESULT.seriestitle | html %]</td>
148                                         </tr>
149                                         [% END %]
150
151                                         [% IF ( BIBLIO_RESULT.MARCSUBJCTS ) %]
152                                         <tr>
153                                             <th scope="row">Subject(s)</th>
154                                             <td>[% FOREACH MARCSUBJCT IN BIBLIO_RESULT.MARCSUBJCTS %]
155                                                    <p> [% FOREACH MARCSUBJECT_SUBFIELDS_LOO IN MARCSUBJCT.MARCSUBJECT_SUBFIELDS_LOOP %]
156                                                         [% MARCSUBJECT_SUBFIELDS_LOO.separator | html %][% MARCSUBJECT_SUBFIELDS_LOO.value | html %][% END %]
157                                                    </p>
158                                                 [% END %]</td>
159                                         </tr>
160                                         [% END %]
161
162                                         [% IF ( BIBLIO_RESULT.copyrightdate ) %]
163                                             <tr><th scope="row">Copyright</th>
164                                                 <td> [% BIBLIO_RESULT.copyrightdate | html %]</td>
165                                             </tr>
166                                         [% END %]
167
168                                         [% IF ( BIBLIO_RESULT.MARCNOTES ) %]
169                                             <tr>
170                                                 <th scope="row">Notes</th>
171                                                 <td>
172                                                 [% FOREACH MARCNOTE IN BIBLIO_RESULT.MARCNOTES %]
173                                                     <p>
174                                                     [% IF MARCNOTE.marcnote.match('^https?://\S+$') %]
175                                                         - <a href="[% MARCNOTE.marcnote | url %]">[% MARCNOTE.marcnote | html %]</a>
176                                                     [% ELSE %]
177                                                         - [% MARCNOTE.marcnote | html %]
178                                                     [% END %]
179                                                     </p>
180                                                 [% END %]
181                                                 </td>
182                                             </tr>
183                                         [% END %]
184
185                                         [% IF ( BIBLIO_RESULT.unititle ) %]
186                                             <tr>
187                                                 <th scope="row">Unified title</th>
188                                                 <td> [% BIBLIO_RESULT.unititle | html %]</td>
189                                             </tr>
190                                         [% END %]
191
192                                         [% IF ( BIBLIO_RESULT.serial ) %]
193                                             <tr>
194                                                 <th scope="row">Serial</th>
195                                                 <td>[% BIBLIO_RESULT.serial | html %]</td>
196                                             </tr>
197                                         [% END %]
198
199                                         [% IF ( BIBLIO_RESULT.dewey ) %]
200                                             <tr>
201                                                 <th scope="row">Dewey</th>
202                                                 <td>[% BIBLIO_RESULT.dewey | html %]</td>
203                                             </tr>
204                                         [% END %]
205
206                                         [% IF ( BIBLIO_RESULT.classification ) %]
207                                             <tr>
208                                                 <th scope="row">Classification</th>
209                                                 <td> [% BIBLIO_RESULT.classification | html %]</td>
210                                             </tr>
211                                         [% END %]
212
213                                         [% IF ( BIBLIO_RESULT.lccn ) %]
214                                             <tr>
215                                                 <th scope="row">LCCN</th>
216                                                 <td> [% BIBLIO_RESULT.lccn | html %]</td>
217                                             </tr>
218                                         [% END %]
219
220                                         [% IF BIBLIO_RESULT.MARCURLS.size %]
221                                             <tr>
222                                                 <th scope="row">URL(s)</th>
223                                                 <td>
224                                                    [% FOREACH MARCurl IN BIBLIO_RESULT.MARCURLS %]
225                                                         [% IF MARCurl.part %]<p>[% MARCurl.part | html %]</p>[% END %]
226
227                                                         [% IF OPACURLOpenInNewWindow %]
228                                                             <a href="[% MARCurl.MARCURL | url %]" title="[% MARCurl.MARCURL | html %]" target="_blank" rel="noreferrer">[% MARCurl.linktext | html %]</a>
229                                                         [% ELSE %]
230                                                             <a href="[% MARCurl.MARCURL | url %]" title="[% MARCurl.MARCURL | html %]">[% MARCurl.linktext | html %]</a>
231                                                         [% END %]
232
233                                                         [% IF MARCurl.notes %][% FOREACH note IN MARCurl.notes %]<p>[% note.note | html %]</p>[% END %][% END %]
234                                                     [% END %]
235                                                 </td>
236                                             </tr>
237                                         [% END %]
238
239                                         [% IF BIBLIO_RESULT.HOSTITEMENTRIES %]
240                                             <tr>
241                                                 <th scope="row">In</th>
242                                                 <td>
243                                                     <p>
244                                                         [% IF BIBLIO_RESULT.HOSTITEMENTRIES.biblionumber %]
245                                                             <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% BIBLIO_RESULT.HOSTITEMENTRIES.biblionumber | uri %]">[% INCLUDE 'biblio-title.inc' biblio=BIBLIO_RESULT.HOSTITEMENTRIES %]</a> [% BIBLIO_RESULT.RELATEDPARTS | html %]
246                                                         [% ELSE %]
247                                                             [% BIBLIO_RESULT.HOSTITEMENTRIES | html %]
248                                                         [% END %]
249                                                     </p>
250                                                 </td>
251                                             </tr>
252                                         [% END %]
253
254                                         <tr>
255                                             <th scope="row">Location(s) (Status)</th>
256                                             <td>
257                                                 [% IF ( BIBLIO_RESULT.ITEM_RESULTS ) %]
258                                                     <ul>
259                                                         [% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]
260                                                             <li>
261                                                                 <strong>[% Branches.GetName(ITEM_RESULT.holdingbranch) | html %]</strong>
262                                                                 <span class="shelvingloc">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_RESULT.location, opac => 1 ) | html %]</span>
263                                                                 [% IF ( ITEM_RESULT.itemcallnumber ) %]
264                                                                     ([% ITEM_RESULT.itemcallnumber | html %])
265                                                                 [% END %]
266                                                                 ([% INCLUDE 'item-status.inc' item = ITEM_RESULT.item_object %])
267                                                             </li>
268                                                         [% END %]
269                                                     </ul>
270                                                 [% ELSE %]
271                                                     This record has no items.
272                                                 [% END %]
273                                             </td>
274                                         </tr>
275                                     </table>
276                                 [% END # / FOREACH BIBLIO_RESULT %]
277                             </form>
278
279                         [% ELSE %]
280
281                             <form action="/cgi-bin/koha/opac-basket.pl" method="get" name="bookbag_form" id="bookbag_form">
282                                 <table id="itemst" class="table table-bordered table-striped">
283                                     <caption class="sr-only">Items in your cart</caption>
284                                     <thead>
285                                         <tr>
286                                             <th class="noprint">&nbsp;</th>
287                                             <th>Title</th>
288                                             <th>Author</th>
289                                             <th>Year</th>
290                                             <th>Location (Status)</th>
291                                         </tr>
292                                     </thead>
293                                     <tbody>
294                                     [% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %]
295                                         <tr>
296                                                 <td class="noprint selectcol">
297                                                     [% IF BIBLIO_RESULT.title %]
298                                                         [% check_title = BIBLIO_RESULT.title %]
299                                                     [% ELSE %]
300                                                         [% check_title = BIBLIO_RESULT.biblionumber %]
301                                                     [% END %]
302                                                     <label for="bib[% BIBLIO_RESULT.biblionumber | html %]" class="sr-only">[% check_title | html %]</label>
303                                                 <input type="checkbox" class="cb" value="[% BIBLIO_RESULT.biblionumber | html %]" name="bib[% BIBLIO_RESULT.biblionumber | html %]" id="bib[% BIBLIO_RESULT.biblionumber | html %]">
304                                                 </td>
305                                             <td>
306                                                 <a href="#" onclick="openBiblio('[% PROCESS biblio_a_href biblionumber => BIBLIO_RESULT.biblionumber %]',[% BIBLIO_RESULT.biblionumber | html %])">[% INCLUDE 'biblio-title.inc' biblio=BIBLIO_RESULT %]</a>
307                                                 <!-- COinS / Openurl -->
308                                                 <span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.au=[% BIBLIO_RESULT.author | html %]&amp;rft.btitle=[% BIBLIO_RESULT.title |url %]&amp;rft.date=[% BIBLIO_RESULT.publicationyear | html %]&amp;rft.tpages=[% BIBLIO_RESULT.item('size') | html %]&amp;rft.isbn=[% BIBLIO_RESULT.isbn |url %]&amp;rft.aucorp=&amp;rft.place=[% BIBLIO_RESULT.place | html %]&amp;rft.pub=[% BIBLIO_RESULT.publisher |url %]&amp;rft.edition=[% BIBLIO_RESULT.edition | html %]&amp;rft.series=[% BIBLIO_RESULT.series | html %]&amp;rft.genre="></span>
309                                                 [% IF ( TagsInputEnabled && loggedinusername ) %]
310                                                 <span id="newtag[% BIBLIO_RESULT.biblionumber | html %]_status" class="tagstatus results_summary" style="display:none">Tag status here.</span>
311                                                 [% END %]
312
313                                                 [% IF BIBLIO_RESULT.HOSTITEMENTRIES %]
314                                                     <p>In:
315                                                         [% IF BIBLIO_RESULT.HOSTITEMENTRIES.biblionumber %]
316                                                         <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% BIBLIO_RESULT.HOSTITEMENTRIES.biblionumber | uri %]">[% INCLUDE 'biblio-title.inc' biblio=entry %]</a> [% BIBLIO_RESULT.RELATEDPARTS | html %]
317                                                         [% ELSE %]
318                                                         [% BIBLIO_RESULT.HOSTITEMENTRIES | html %]
319                                                         [% END %]
320                                                     </p>
321                                                 [% END %]
322                                             </td>
323                                             <td>[% BIBLIO_RESULT.author | html %]</td>
324                                             <td>
325                                                 [% IF ( BIBLIO_RESULT.publicationyear ) %]
326                                                     [% BIBLIO_RESULT.publicationyear | html %]
327                                                 [% ELSE %]
328                                                     [% BIBLIO_RESULT.copyrightdate | html %]
329                                                 [% END %]
330                                             </td>
331                                             <td>[% IF ( BIBLIO_RESULT.ITEM_RESULTS ) %]<ul>[% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]
332                                                 <li>
333                                                     [% Branches.GetName(ITEM_RESULT.holdingbranch) | html %]
334                                                     <span class="shelvingloc">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_RESULT.location, opac => 1 ) | html %]</span>
335                                                     [% IF ( ITEM_RESULT.itemcallnumber ) %]
336                                                         ([% ITEM_RESULT.itemcallnumber | html %])
337                                                     [% END %]
338                                                     ([% INCLUDE 'item-status.inc' item = ITEM_RESULT %])
339                                                 </li>
340                                                 [% END %]</ul>[% ELSE %]This record has no items.[% END %]
341                                             </td>
342                                         </tr>
343                                     [% END # / FOREACH BIBLIO_RESULT %]
344                                     </tbody>
345                                 </table>
346                             </form>
347                         [% END # / verbose %]
348
349                             <form name="myform" action="opac-basket.pl" method="get">
350                                 <input type="hidden" name="records" id="records" />
351                             </form>
352                             <form method="post" id="download_cart" action="/cgi-bin/koha/opac-downloadcart.pl">
353                                 <input type="hidden" name="format" id="download_format" value="" />
354                                 <input type="hidden" name="bib_list" value="[% bib_list | html %]" />
355                             </form>
356
357                 </div> <!-- / #userbasket -->
358             </div> <!-- / .col -->
359         </div> <!-- / .row -->
360     </div> <!-- / .container-fluid -->
361 </div> <!-- / .main -->
362
363 [% INCLUDE 'opac-bottom.inc' %]
364
365 [% BLOCK jsinclude %]
366     [% Asset.js("lib/hc-sticky.js") | $raw %]
367         [% INCLUDE 'datatables.inc' %]
368         <script>
369             [% IF ( TagsInputEnabled && loggedinusername ) %]
370                 function tagSelected() {
371                     var bibs = document.getElementById('records').value;
372                     if (bibs) {
373                         $("#tagsel_tag").hide();
374                         $("#tag_hides").hide();
375                         $("#tagsel_form").show();
376                     } else {
377                         alert( __("No item was selected") );
378                     }
379                 }
380
381                 function tagCanceled() {
382                     $("#tagsel_form").hide();
383                     $("#tagsel_tag").show();
384                     $("#tag_hides").show();
385                     $("#tagsel_new").val("");
386                     $(".tagstatus").empty().hide();
387                 }
388
389                 function tagAdded() {
390                     var checkedBoxes = $("input:checkbox:checked");
391                     if (!$(checkedBoxes).size()) {
392                         alert( __("No item was selected") );
393                         return false;
394                     }
395
396                     var tag = $("#tagsel_new").val();
397                     if (!tag || (tag == "")) {
398                         alert(MSG_NO_TAG_SPECIFIED);
399                         return false;
400                     }
401
402                     var bibs = [];
403                     for (var i = 0; i < $(checkedBoxes).size(); i++) {
404                         var box = $(checkedBoxes).get(i);
405                         bibs[i] = $(box).val();
406                     }
407
408                     KOHA.Tags.add_multitags_button(bibs, tag);
409                     return false;
410                 }
411             [% END # / TagsInputEnabled && loggedinusername %]
412
413             $(document).ready(function(){
414                 $(".brief").click(function(e){
415                     e.preventDefault();
416                     showLess();
417                 });
418
419                 $(".detail").click(function(e){
420                     e.preventDefault();
421                     showMore();
422                 });
423
424                 $(".send").click(function(e){
425                     e.preventDefault();
426                     sendBasket();
427                 });
428
429                 $(".download-cart").on("click", function(e){
430                     e.preventDefault();
431                     var format = $(this).data("format");
432                     $("#download_format").val( format );
433                     $("#download_cart").submit();
434                 });
435
436                 $(".empty").click(function(e){
437                     e.preventDefault();
438                     delBasket();
439                 });
440
441                 $(".deleteshelf").click(function(e){
442                     e.preventDefault();
443                     delSelRecords();
444                 });
445
446                 $(".newshelf").click(function(e){
447                     e.preventDefault();
448                     addSelToShelf();
449                 });
450
451                 $(".hold").click(function(e){
452                     e.preventDefault();
453                     holdSel();
454                 });
455
456                 $("#tagsel_tag").click(function(e){
457                     e.preventDefault();
458                     tagSelected();
459                 });
460
461                 $("#tagsel_button").click(function(e){
462                     e.preventDefault();
463                     tagAdded();
464                 });
465
466                 $("#tagsel_cancel").click(function(e){
467                     e.preventDefault();
468                     tagCanceled();
469                 });
470
471                 $("#CheckAll").click(function(e){
472                     e.preventDefault();
473                     $(".cb").each(function(){
474                         $(this).prop("checked", true);
475                         selRecord(this.value, true);
476                     });
477                     enableCheckboxActions();
478                 });
479
480                 $("#CheckNone").click(function(e){
481                     e.preventDefault();
482                     $(".cb").each(function(){
483                         $(this).prop("checked", false);
484                         selRecord(this.value, false);
485                     });
486                     enableCheckboxActions();
487                 });
488
489                 if( $("#itemst").length > 0 ){
490                     var itemst = $("#itemst").dataTable($.extend(true, {}, dataTablesDefaults, {
491                         "order": [[ 1, "asc" ]],
492                         "columnDefs": [
493                           { "targets": [ 0,-1 ], "sortable": false, "searchable": false }
494                         ],
495                         "columns": [
496                             null,
497                             { "type": "anti-the" },
498                             null,
499                             null,
500                             null
501                         ],
502                     }));
503
504                     var buttons = new $.fn.dataTable.Buttons(itemst, {
505                          buttons: [
506                             'print'
507                         ]
508                     }).container().appendTo($('#toolbar'));
509                 }
510
511                 $(".cb").change(function(){
512                     selRecord( $(this).val(), $(this).prop("checked") );
513                     enableCheckboxActions();
514                     return false;
515                 });
516                 enableCheckboxActions();
517
518                 Sticky = $("#floating");
519                 Sticky.hcSticky({
520                     stickTo: "#userbasket",
521                     stickyClass: "floating"
522                 });
523             });
524
525             function enableCheckboxActions(){
526                 // Enable/disable controls if checkboxes are checked
527                 var checkedBoxes = $(".cb:checked");
528                 if ( checkedBoxes.length ) {
529                   $(".selections").html(_("With selected titles: "));
530                   $(".selections-toolbar .links a").removeClass("disabled").attr("aria-disabled", "false");
531                 } else {
532                   $(".selections").html(_("Select titles to: "));
533                   $(".selections-toolbar .links a").addClass("disabled").attr("aria-disabled", "true");
534                 }
535             }
536         </script>
537 [% END # / BLOCK jsinclude %]