Bug 32445: Fix availability display on opac-basket
[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                                         <tr>
240                                             <th scope="row">Location(s) (Status)</th>
241                                             <td>
242                                                 [% IF ( BIBLIO_RESULT.ITEM_RESULTS ) %]
243                                                     <ul>
244                                                         [% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]
245                                                             <li>
246                                                                 <strong>[% Branches.GetName(ITEM_RESULT.holdingbranch) | html %]</strong>
247                                                                 <span class="shelvingloc">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_RESULT.location, opac => 1 ) | html %]</span>
248                                                                 [% IF ( ITEM_RESULT.itemcallnumber ) %]
249                                                                     ([% ITEM_RESULT.itemcallnumber | html %])
250                                                                 [% END %]
251                                                                 ([% INCLUDE 'item-status.inc' item = ITEM_RESULT.item_object %])
252                                                             </li>
253                                                         [% END %]
254                                                     </ul>
255                                                 [% ELSE %]
256                                                     This record has no items.
257                                                 [% END %]
258                                             </td>
259                                         </tr>
260                                     </table>
261                                 [% END # / FOREACH BIBLIO_RESULT %]
262                             </form>
263
264                         [% ELSE %]
265
266                             <form action="/cgi-bin/koha/opac-basket.pl" method="get" name="bookbag_form" id="bookbag_form">
267                                 <table id="itemst" class="table table-bordered table-striped">
268                                     <caption class="sr-only">Items in your cart</caption>
269                                     <thead>
270                                         <tr>
271                                             <th class="noprint">&nbsp;</th>
272                                             <th>Title</th>
273                                             <th>Author</th>
274                                             <th>Year</th>
275                                             <th>Location (Status)</th>
276                                         </tr>
277                                     </thead>
278                                     <tbody>
279                                     [% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %]
280                                         <tr>
281                                                 <td class="noprint selectcol">
282                                                     [% IF BIBLIO_RESULT.title %]
283                                                         [% check_title = BIBLIO_RESULT.title %]
284                                                     [% ELSE %]
285                                                         [% check_title = BIBLIO_RESULT.biblionumber %]
286                                                     [% END %]
287                                                     <label for="bib[% BIBLIO_RESULT.biblionumber | html %]" class="sr-only">[% check_title | html %]</label>
288                                                 <input type="checkbox" class="cb" value="[% BIBLIO_RESULT.biblionumber | html %]" name="bib[% BIBLIO_RESULT.biblionumber | html %]" id="bib[% BIBLIO_RESULT.biblionumber | html %]">
289                                                 </td>
290                                             <td>
291                                                 <a href="#" onclick="openBiblio('[% PROCESS biblio_a_href biblionumber => BIBLIO_RESULT.biblionumber %]',[% BIBLIO_RESULT.biblionumber | html %])">[% INCLUDE 'biblio-title.inc' biblio=BIBLIO_RESULT %]</a>
292                                                 <!-- COinS / Openurl -->
293                                                 <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>
294                                                 [% IF ( TagsInputEnabled && loggedinusername ) %]
295                                                 <span id="newtag[% BIBLIO_RESULT.biblionumber | html %]_status" class="tagstatus results_summary" style="display:none">Tag status here.</span>
296                                                 [% END %]
297                                             </td>
298                                             <td>[% BIBLIO_RESULT.author | html %]</td>
299                                             <td>
300                                                 [% IF ( BIBLIO_RESULT.publicationyear ) %]
301                                                     [% BIBLIO_RESULT.publicationyear | html %]
302                                                 [% ELSE %]
303                                                     [% BIBLIO_RESULT.copyrightdate | html %]
304                                                 [% END %]
305                                             </td>
306                                             <td>[% IF ( BIBLIO_RESULT.ITEM_RESULTS ) %]<ul>[% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]
307                                                 <li>
308                                                     [% Branches.GetName(ITEM_RESULT.holdingbranch) | html %]
309                                                     <span class="shelvingloc">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_RESULT.location, opac => 1 ) | html %]</span>
310                                                     [% IF ( ITEM_RESULT.itemcallnumber ) %]
311                                                         ([% ITEM_RESULT.itemcallnumber | html %])
312                                                     [% END %]
313                                                     ([% INCLUDE 'item-status.inc' item = ITEM_RESULT %])
314                                                 </li>
315                                                 [% END %]</ul>[% ELSE %]This record has no items.[% END %]
316                                             </td>
317                                         </tr>
318                                     [% END # / FOREACH BIBLIO_RESULT %]
319                                     </tbody>
320                                 </table>
321                             </form>
322                         [% END # / verbose %]
323
324                             <form name="myform" action="opac-basket.pl" method="get">
325                                 <input type="hidden" name="records" id="records" />
326                             </form>
327                             <form method="post" id="download_cart" action="/cgi-bin/koha/opac-downloadcart.pl">
328                                 <input type="hidden" name="format" id="download_format" value="" />
329                                 <input type="hidden" name="bib_list" value="[% bib_list | html %]" />
330                             </form>
331
332                 </div> <!-- / #userbasket -->
333             </div> <!-- / .col -->
334         </div> <!-- / .row -->
335     </div> <!-- / .container-fluid -->
336 </div> <!-- / .main -->
337
338 [% INCLUDE 'opac-bottom.inc' %]
339
340 [% BLOCK jsinclude %]
341     [% Asset.js("lib/hc-sticky.js") | $raw %]
342         [% INCLUDE 'datatables.inc' %]
343         <script>
344             [% IF ( TagsInputEnabled && loggedinusername ) %]
345                 function tagSelected() {
346                     var bibs = document.getElementById('records').value;
347                     if (bibs) {
348                         $("#tagsel_tag").hide();
349                         $("#tag_hides").hide();
350                         $("#tagsel_form").show();
351                     } else {
352                         alert( __("No item was selected") );
353                     }
354                 }
355
356                 function tagCanceled() {
357                     $("#tagsel_form").hide();
358                     $("#tagsel_tag").show();
359                     $("#tag_hides").show();
360                     $("#tagsel_new").val("");
361                     $(".tagstatus").empty().hide();
362                 }
363
364                 function tagAdded() {
365                     var checkedBoxes = $("input:checkbox:checked");
366                     if (!$(checkedBoxes).size()) {
367                         alert( __("No item was selected") );
368                         return false;
369                     }
370
371                     var tag = $("#tagsel_new").val();
372                     if (!tag || (tag == "")) {
373                         alert(MSG_NO_TAG_SPECIFIED);
374                         return false;
375                     }
376
377                     var bibs = [];
378                     for (var i = 0; i < $(checkedBoxes).size(); i++) {
379                         var box = $(checkedBoxes).get(i);
380                         bibs[i] = $(box).val();
381                     }
382
383                     KOHA.Tags.add_multitags_button(bibs, tag);
384                     return false;
385                 }
386             [% END # / TagsInputEnabled && loggedinusername %]
387
388             $(document).ready(function(){
389                 $(".brief").click(function(e){
390                     e.preventDefault();
391                     showLess();
392                 });
393
394                 $(".detail").click(function(e){
395                     e.preventDefault();
396                     showMore();
397                 });
398
399                 $(".send").click(function(e){
400                     e.preventDefault();
401                     sendBasket();
402                 });
403
404                 $(".download-cart").on("click", function(e){
405                     e.preventDefault();
406                     var format = $(this).data("format");
407                     $("#download_format").val( format );
408                     $("#download_cart").submit();
409                 });
410
411                 $(".empty").click(function(e){
412                     e.preventDefault();
413                     delBasket();
414                 });
415
416                 $(".deleteshelf").click(function(e){
417                     e.preventDefault();
418                     delSelRecords();
419                 });
420
421                 $(".newshelf").click(function(e){
422                     e.preventDefault();
423                     addSelToShelf();
424                 });
425
426                 $(".hold").click(function(e){
427                     e.preventDefault();
428                     holdSel();
429                 });
430
431                 $("#tagsel_tag").click(function(e){
432                     e.preventDefault();
433                     tagSelected();
434                 });
435
436                 $("#tagsel_button").click(function(e){
437                     e.preventDefault();
438                     tagAdded();
439                 });
440
441                 $("#tagsel_cancel").click(function(e){
442                     e.preventDefault();
443                     tagCanceled();
444                 });
445
446                 $("#CheckAll").click(function(e){
447                     e.preventDefault();
448                     $(".cb").each(function(){
449                         $(this).prop("checked", true);
450                         selRecord(this.value, true);
451                     });
452                     enableCheckboxActions();
453                 });
454
455                 $("#CheckNone").click(function(e){
456                     e.preventDefault();
457                     $(".cb").each(function(){
458                         $(this).prop("checked", false);
459                         selRecord(this.value, false);
460                     });
461                     enableCheckboxActions();
462                 });
463
464                 if( $("#itemst").length > 0 ){
465                     var itemst = $("#itemst").dataTable($.extend(true, {}, dataTablesDefaults, {
466                         "order": [[ 1, "asc" ]],
467                         "columnDefs": [
468                           { "targets": [ 0,-1 ], "sortable": false, "searchable": false }
469                         ],
470                         "columns": [
471                             null,
472                             { "type": "anti-the" },
473                             null,
474                             null,
475                             null
476                         ],
477                     }));
478
479                     var buttons = new $.fn.dataTable.Buttons(itemst, {
480                          buttons: [
481                             'print'
482                         ]
483                     }).container().appendTo($('#toolbar'));
484                 }
485
486                 $(".cb").change(function(){
487                     selRecord( $(this).val(), $(this).prop("checked") );
488                     enableCheckboxActions();
489                     return false;
490                 });
491                 enableCheckboxActions();
492
493                 Sticky = $("#floating");
494                 Sticky.hcSticky({
495                     stickTo: "#userbasket",
496                     stickyClass: "floating"
497                 });
498             });
499
500             function enableCheckboxActions(){
501                 // Enable/disable controls if checkboxes are checked
502                 var checkedBoxes = $(".cb:checked");
503                 if ( checkedBoxes.length ) {
504                   $(".selections").html(_("With selected titles: "));
505                   $(".selections-toolbar .links a").removeClass("disabled").attr("aria-disabled", "false");
506                 } else {
507                   $(".selections").html(_("Select titles to: "));
508                   $(".selections-toolbar .links a").addClass("disabled").attr("aria-disabled", "true");
509                 }
510             }
511         </script>
512 [% END # / BLOCK jsinclude %]