Bug 21526: Use the 'url' filter when needed
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-basket.tt
index 1a21dbd..1fea75f 100644 (file)
@@ -1,88 +1,84 @@
+[% USE raw %]
 [% USE Koha %]
+[% USE KohaDates %]
+[% USE Asset %]
 [% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && TagsEnabled && TagsInputOnList ) %]
 
 [% INCLUDE 'doc-head-open.inc' %]
-[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Your cart
+<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo; Your cart</title>
 [% INCLUDE 'doc-head-close.inc' %]
-[% BLOCK cssinclude %][% END %]
+[% BLOCK cssinclude %]<style type="text/css">.item-status, .dt-buttons { display: inline; } @media print { body { height: 99%; } }</style>[% END %]
 </head>
-<body id="basket">
+[% INCLUDE 'bodytag.inc' bodyid='basket' %]
     <div class="main">
         <div class="container-fluid">
             <div class="row-fluid">
                 <div class="span12">
                     <div id="userbasket">
                         <h2>Your cart</h2>
-
-                        [% UNLESS ( print_basket ) %]
-                            <div id="toolbar" class="toolbar">
+                            <div id="toolbar" class="toolbar noprint">
                                 [% IF ( verbose ) %]
-                                    <a href="opac-basket.pl" class="brief" onclick="showLess(); return false;">Brief display</a>
+                                    <a href="opac-basket.pl" class="brief">Brief display</a>
                                 [% ELSE %]
-                                    <a href="opac-basket.pl" class="detail" onclick="showMore(); return false;">More details</a>
+                                    <a href="opac-basket.pl" class="detail">More details</a>
                                 [% END %]
                                 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
-                                    <a class="send" href="opac-basket.pl" onclick="sendBasket(); return false;">Send</a>
+                                    <a class="send" href="opac-basket.pl">Send</a>
                                 [% END %]
-                                <a class="download" href="opac-basket.pl" onclick="downloadBasket(); return false;">Download</a>
-                                <a class="print-large" href="opac-basket.pl" onclick="printBasket(); return false;">Print</a>
-                                <a class="empty" href="opac-basket.pl" onclick="delBasket(); return false;">Empty and close</a>
+                                <a class="download" href="opac-basket.pl">Download</a>
+                                <a class="empty" href="opac-basket.pl">Empty and close</a>
                                 <a class="hide close" href="opac-basket.pl">Hide window</a>
+                                [% IF ( verbose ) %]
+                                    <a class="print-large" href="#">Print</a>
+                                [% END %]
                             </div>
 
-                            <div id="selections-toolbar" class="toolbar">
+                            <div id="selections-toolbar" class="toolbar noprint">
                                 <a id="CheckAll" href="#">Select all</a>
                                 <a id="CheckNone" href="#">Clear all</a>
                                 <span class="sep">|</span>
                                 <span class="links" id="tag_hides">
                                     <span id="selections">Select titles to: </span>
-                                    <a href="#" class="deleteshelf disabled" onclick="delSelRecords(); return false;">Remove</a>
+                                    <a href="#" class="deleteshelf disabled">Remove</a>
                                     [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) %]
                                         [% IF ( ( Koha.Preference( 'virtualshelves' ) == 1 ) && loggedinusername ) %]
-                                            <a href="#" class="newshelf disabled" onclick="addSelToShelf(); return false;">Add to a list</a>
+                                            <a href="#" class="newshelf disabled">Add to a list</a>
                                         [% END %]
                                         [% IF ( Koha.Preference( 'RequestOnOpac' ) == 1 ) %]
-                                            <a href="#" class="hold disabled" onclick="holdSel(); return false;">Place hold</a>
+                                            <a href="#" class="hold disabled">Place hold</a>
                                         [% END %]
                                         [% IF ( TagsInputEnabled && loggedinusername ) %]
-                                            <a href="#" id="tagsel_tag" class="disabled" onclick="tagSelected(); return false;">Tag</a>
+                                            <a href="#" id="tagsel_tag" class="disabled">Tag</a>
                                         [% END %]
                                     [% END # / IF opacuserlogin %]
                                 </span>
                                 [% IF ( TagsInputEnabled && loggedinusername ) %]
                                 <span id="tagsel_form" style="display:none">
                                     <label for="tagsel_new">New tag:</label>
-                                    <input name="tagsel_new" id="tagsel_new" maxlength="100" />
-                                    <input id="tagsel_button" name="tagsel_button" class="input tagsel_button" title="Add" type="submit" value="Add" onclick="tagAdded(); return false;" />
-                                    <a href="#" id="tagsel_cancel" onclick="tagCanceled(); return false;">Cancel</a>
+                                    <input type="text" name="tagsel_new" id="tagsel_new" maxlength="100" />
+                                    <input id="tagsel_button" name="tagsel_button" class="input tagsel_button" title="Add" type="submit" value="Add">
+                                    <a href="#" id="tagsel_cancel">Cancel</a>
                                 </span>
                                 [% END %]
                             </div>
-                        [% END # / UNLESS print_basket %]
 
                         [% IF ( verbose ) %]
                             <form action="opac-basket.pl" method="get" name="bookbag_form" id="bookbag_form" class="checkboxed">
                                 [% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %]
                                     <h3>
-                                        [% IF ( print_basket ) %]
-                                            [% BIBLIO_RESULT.title |html %]
-                                                [% IF ( BIBLIO_RESULT.subtitle ) %] [% FOREACH subtitl IN BIBLIO_RESULT.subtitle %] [% subtitl.subfield |html %] [% END %][% END %]
-                                                [% IF ( BIBLIO_RESULT.author ) %] [% BIBLIO_RESULT.author |html %][% END %]
-                                        [% ELSE %]
-                                                <input type="checkbox" class="cb" value="[% BIBLIO_RESULT.biblionumber %]" name="bib[% BIBLIO_RESULT.biblionumber %]" id="bib[% BIBLIO_RESULT.biblionumber %]" onclick="selRecord(value,checked)" />
-                                                [% BIBLIO_RESULT.title |html %]
-                                                [% IF ( BIBLIO_RESULT.subtitle ) %] [% FOREACH subtitl IN BIBLIO_RESULT.subtitle %] [% subtitl.subfield |html %] [% END %][% END %]
-                                                [% IF ( BIBLIO_RESULT.author ) %] [% BIBLIO_RESULT.author |html %][% END %]
-                                        [% END # / IF print_basket %]
+                                                <input type="checkbox" class="cb" value="[% BIBLIO_RESULT.biblionumber | html %]" name="bib[% BIBLIO_RESULT.biblionumber | html %]" id="bib[% BIBLIO_RESULT.biblionumber | html %]">
+                                                [% BIBLIO_RESULT.title | html %]
+                                                [% IF ( BIBLIO_RESULT.subtitle ) %] [% FOREACH subtitl IN BIBLIO_RESULT.subtitle %] [% subtitl.subfield | html %] [% END %][% END %]
+                                                [% IF ( BIBLIO_RESULT.author ) %] [% BIBLIO_RESULT.author | html %][% END %]
                                     </h3>
                                     <!-- COinS / Openurl -->
-                                    <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 %]&amp;rft.btitle=[% BIBLIO_RESULT.title |url %]&amp;rft.date=[% BIBLIO_RESULT.publicationyear %]&amp;rft.tpages=[% BIBLIO_RESULT.size %]&amp;rft.isbn=[% BIBLIO_RESULT.isbn |url %]&amp;rft.aucorp=&amp;rft.place=[% BIBLIO_RESULT.place %]&amp;rft.pub=[% BIBLIO_RESULT.publisher |url %]&amp;rft.edition=[% BIBLIO_RESULT.edition %]&amp;rft.series=[% BIBLIO_RESULT.series %]&amp;rft.genre="></span>
+                                    <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>
 
                                     <table class="table">
                                         [% IF ( BIBLIO_RESULT.isbn ) %]
                                             <tr>
                                                 <th scope="row">ISBN</th>
-                                                <td>[% BIBLIO_RESULT.isbn %]</td>
+                                                <td>[% BIBLIO_RESULT.isbn | html %]</td>
                                             </tr>
                                         [% END %]
 
                                             <th scope="row">Author(s)</th>
                                             <td>
                                                [% IF ( BIBLIO_RESULT.author ) %]
-                                                   <p>[% BIBLIO_RESULT.author %]</p>
+                                                   <p>[% BIBLIO_RESULT.author | html %]</p>
                                                [% END %]
                                                [% IF ( BIBLIO_RESULT.MARCAUTHORS ) %]
                                                    [% FOREACH MARCAUTHOR IN BIBLIO_RESULT.MARCAUTHORS %]
                                                    <p> [% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %]
-                                                          [% MARCAUTHOR_SUBFIELDS_LOO.separator %]
-                                                              [% MARCAUTHOR_SUBFIELDS_LOO.value %]
+                                                          [% MARCAUTHOR_SUBFIELDS_LOO.separator | html %]
+                                                              [% MARCAUTHOR_SUBFIELDS_LOO.value | html %]
                                                        [% END %]
                                                    </p>
                                                    [% END %]
                                         [% IF ( BIBLIO_RESULT.publishercode ) %]
                                             <tr>
                                                 <th scope="row">Publisher</th>
-                                                <td>[% BIBLIO_RESULT.place %] [% BIBLIO_RESULT.publishercode %] [% BIBLIO_RESULT.publicationyear %]
+                                                <td>[% BIBLIO_RESULT.place | html %] [% BIBLIO_RESULT.publishercode | html %] [% BIBLIO_RESULT.publicationyear | html %]
                                                 </td>
                                             </tr>
                                         [% END %]
                                         [% IF ( BIBLIO_RESULT.pages ) %]
                                             <tr>
                                                 <th scope="row">Details</th>
-                                                <td>[% BIBLIO_RESULT.pages %] [% BIBLIO_RESULT.illus %] [% BIBLIO_RESULT.size %]</td>
+                                                <td>[% BIBLIO_RESULT.pages | html %] [% BIBLIO_RESULT.illus | html %] [% BIBLIO_RESULT.item('size') | html %]</td>
                                             </tr>
                                         [% END %]
 
                                         [% IF ( BIBLIO_RESULT.seriestitle ) %]
                                         <tr>
                                             <th scope="row">Collection</th>
-                                            <td> [% BIBLIO_RESULT.seriestitle %]</td>
+                                            <td> [% BIBLIO_RESULT.seriestitle | html %]</td>
                                         </tr>
                                         [% END %]
 
                                             <th scope="row">Subject(s)</th>
                                             <td>[% FOREACH MARCSUBJCT IN BIBLIO_RESULT.MARCSUBJCTS %]
                                                    <p> [% FOREACH MARCSUBJECT_SUBFIELDS_LOO IN MARCSUBJCT.MARCSUBJECT_SUBFIELDS_LOOP %]
-                                                        [% MARCSUBJECT_SUBFIELDS_LOO.separator %][% MARCSUBJECT_SUBFIELDS_LOO.value %][% END %]
+                                                        [% MARCSUBJECT_SUBFIELDS_LOO.separator | html %][% MARCSUBJECT_SUBFIELDS_LOO.value | html %][% END %]
                                                    </p>
                                                 [% END %]</td>
                                         </tr>
 
                                         [% IF ( BIBLIO_RESULT.copyrightdate ) %]
                                             <tr><th scope="row">Copyright</th>
-                                                <td> [% BIBLIO_RESULT.copyrightdate %]</td>
+                                                <td> [% BIBLIO_RESULT.copyrightdate | html %]</td>
                                             </tr>
                                         [% END %]
 
                                                 <th scope="row">Notes</th>
                                                 <td>
                                                 [% FOREACH MARCNOTE IN BIBLIO_RESULT.MARCNOTES %]
-                                                    <p>- [% MARCNOTE.marcnote %]</p>
-                                                [% END %]</td>
+                                                    <p>
+                                                    [% IF MARCNOTE.marcnote.match('^https?://\S+$') %]
+                                                        - <a href="[% MARCNOTE.marcnote | url %]">[% MARCNOTE.marcnote | html %]</a>
+                                                    [% ELSE %]
+                                                        - [% MARCNOTE.marcnote | html %]
+                                                    [% END %]
+                                                    </p>
+                                                [% END %]
+                                                </td>
                                             </tr>
                                         [% END %]
 
                                         [% IF ( BIBLIO_RESULT.unititle ) %]
                                             <tr>
                                                 <th scope="row">Unified title</th>
-                                                <td> [% BIBLIO_RESULT.unititle %]</td>
+                                                <td> [% BIBLIO_RESULT.unititle | html %]</td>
                                             </tr>
                                         [% END %]
 
                                         [% IF ( BIBLIO_RESULT.serial ) %]
                                             <tr>
                                                 <th scope="row">Serial</th>
-                                                <td>[% BIBLIO_RESULT.serial %]</td>
+                                                <td>[% BIBLIO_RESULT.serial | html %]</td>
                                             </tr>
                                         [% END %]
 
                                         [% IF ( BIBLIO_RESULT.dewey ) %]
                                             <tr>
                                                 <th scope="row">Dewey</th>
-                                                <td>[% BIBLIO_RESULT.dewey %]</td>
+                                                <td>[% BIBLIO_RESULT.dewey | html %]</td>
                                             </tr>
                                         [% END %]
 
                                         [% IF ( BIBLIO_RESULT.classification ) %]
                                             <tr>
                                                 <th scope="row">Classification</th>
-                                                <td> [% BIBLIO_RESULT.classification %]</td>
+                                                <td> [% BIBLIO_RESULT.classification | html %]</td>
                                             </tr>
                                         [% END %]
 
                                         [% IF ( BIBLIO_RESULT.lccn ) %]
                                             <tr>
                                                 <th scope="row">LCCN</th>
-                                                <td> [% BIBLIO_RESULT.lccn %]</td>
+                                                <td> [% BIBLIO_RESULT.lccn | html %]</td>
                                             </tr>
                                         [% END %]
 
-                                        [% IF ( BIBLIO_RESULT.MARCurlS ) %]
+                                        [% IF BIBLIO_RESULT.MARCURLS.size %]
                                             <tr>
                                                 <th scope="row">URL(s)</th>
                                                 <td>
-                                                   [% FOREACH MARCurl IN BIBLIO_RESULT.MARCurlS %]
-                                                        <p>
-                                                        [% IF ( MARCurl.part ) %][% MARCurl.part %]
-                                                            <br />
-                                                        [% END %]
+                                                   [% FOREACH MARCurl IN BIBLIO_RESULT.MARCURLS %]
+                                                        [% IF MARCurl.part %]<p>[% MARCurl.part | html %]</p>[% END %]
 
-                                                        [% MARCurl.MARCurl %]
-                                                            [% IF ( MARCurl.notes ) %][% FOREACH note IN MARCurl.notes %][% note.note %]<br />[% END %][% END %]
+                                                        [% IF OPACURLOpenInNewWindow %]
+                                                            <a href="[% MARCurl.MARCURL | url %]" title="[% MARCurl.MARCURL | html %]" target="_blank" rel="noreferrer">[% MARCurl.linktext | html %]</a>
+                                                        [% ELSE %]
+                                                            <a href="[% MARCurl.MARCURL | url %]" title="[% MARCurl.MARCURL | html %]">[% MARCurl.linktext | html %]</a>
                                                         [% END %]
-                                                        </p>
+
+                                                        [% IF MARCurl.notes %][% FOREACH note IN MARCurl.notes %]<p>[% note.note | html %]</p>[% END %][% END %]
+                                                    [% END %]
                                                 </td>
                                             </tr>
                                         [% END %]
                                                     <ul>
                                                         [% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]
                                                             <li>
-                                                                <strong>[% ITEM_RESULT.branchname %]</strong>[% IF ( ITEM_RESULT.location_opac ) %], [% ITEM_RESULT.location_opac %][% END %]
+                                                                <strong>[% ITEM_RESULT.branchname | html %]</strong>[% IF ( ITEM_RESULT.location_opac ) %], [% ITEM_RESULT.location_opac | html %][% END %]
                                                                 [% IF ( ITEM_RESULT.itemcallnumber ) %]
-                                                                    ([% ITEM_RESULT.itemcallnumber %])
+                                                                    ([% ITEM_RESULT.itemcallnumber | html %])
                                                                 [% END %]
                                                                 ([% INCLUDE 'item-status.inc' item = ITEM_RESULT %])
                                                             </li>
                                 <table id="itemst" class="table table-bordered table-striped">
                                     <thead>
                                         <tr>
-                                            [% UNLESS ( print_basket ) %]<th>&nbsp;</th>[% END %]
+                                            <th class="noprint">&nbsp;</th>
                                             <th>Title</th>
                                             <th>Author</th>
                                             <th>Year</th>
                                     <tbody>
                                     [% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %]
                                         <tr>
-                                            [% UNLESS ( print_basket ) %]
-                                                <td>
-                                                <input type="checkbox" class="cb" value="[% BIBLIO_RESULT.biblionumber %]" name="bib[% BIBLIO_RESULT.biblionumber %]" id="bib[% BIBLIO_RESULT.biblionumber %]" onclick="selRecord(value,checked);" />
+                                                <td class="noprint">
+                                                <input type="checkbox" class="cb" value="[% BIBLIO_RESULT.biblionumber | html %]" name="bib[% BIBLIO_RESULT.biblionumber | html %]" id="bib[% BIBLIO_RESULT.biblionumber | html %]">
                                                 </td>
-                                            [% END %]
                                             <td>
-                                                <a href="#" onclick="openBiblio('[% BIBLIO_RESULT.dest %]',[% BIBLIO_RESULT.biblionumber %])">[% BIBLIO_RESULT.title |html %][% IF ( BIBLIO_RESULT.subtitle ) %] [% FOREACH subtitl IN BIBLIO_RESULT.subtitle %][% subtitl.subfield |html %][% END %][% END %]</a>
+                                                <a href="#" onclick="openBiblio('[% BIBLIO_RESULT.dest | html %]',[% BIBLIO_RESULT.biblionumber | html %])">[% BIBLIO_RESULT.title | html %][% IF ( BIBLIO_RESULT.subtitle ) %] [% FOREACH subtitl IN BIBLIO_RESULT.subtitle %][% subtitl.subfield | html %][% END %][% END %]</a>
                                                 <!-- COinS / Openurl -->
-                                                <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 %]&amp;rft.btitle=[% BIBLIO_RESULT.title |url %]&amp;rft.date=[% BIBLIO_RESULT.publicationyear %]&amp;rft.tpages=[% BIBLIO_RESULT.size %]&amp;rft.isbn=[% BIBLIO_RESULT.isbn |url %]&amp;rft.aucorp=&amp;rft.place=[% BIBLIO_RESULT.place %]&amp;rft.pub=[% BIBLIO_RESULT.publisher |url %]&amp;rft.edition=[% BIBLIO_RESULT.edition %]&amp;rft.series=[% BIBLIO_RESULT.series %]&amp;rft.genre="></span>
+                                                <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>
                                                 [% IF ( TagsInputEnabled && loggedinusername ) %]
-                                                <span id="newtag[% BIBLIO_RESULT.biblionumber %]_status" class="tagstatus results_summary" style="display:none">Tag status here.</span>
+                                                <span id="newtag[% BIBLIO_RESULT.biblionumber | html %]_status" class="tagstatus results_summary" style="display:none">Tag status here.</span>
                                                 [% END %]
                                             </td>
-                                            <td>[% BIBLIO_RESULT.author %]</td>
+                                            <td>[% BIBLIO_RESULT.author | html %]</td>
                                             <td>
                                                 [% IF ( BIBLIO_RESULT.publicationyear ) %]
-                                                    [% BIBLIO_RESULT.publicationyear %]
+                                                    [% BIBLIO_RESULT.publicationyear | html %]
                                                 [% ELSE %]
-                                                    [% BIBLIO_RESULT.copyrightdate %]
+                                                    [% BIBLIO_RESULT.copyrightdate | html %]
                                                 [% END %]
                                             </td>
                                             <td>[% IF ( BIBLIO_RESULT.ITEM_RESULTS ) %]<ul>[% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]
                                                 <li>
-                                                    [% ITEM_RESULT.branchname %][% IF ( ITEM_RESULT.location_opac ) %], [% ITEM_RESULT.location_opac %][% END %]
+                                                    [% ITEM_RESULT.branchname | html %][% IF ( ITEM_RESULT.location_opac ) %], [% ITEM_RESULT.location_opac | html %][% END %]
                                                     [% IF ( ITEM_RESULT.itemcallnumber ) %]
-                                                        ([% ITEM_RESULT.itemcallnumber %])
+                                                        ([% ITEM_RESULT.itemcallnumber | html %])
                                                     [% END %]
                                                     ([% INCLUDE 'item-status.inc' item = ITEM_RESULT %])
                                                 </li>
                             </form>
                         [% END # / verbose %]
 
-                        [% UNLESS ( print_basket ) %]
                             <form name="myform" action="opac-basket.pl" method="get">
                                 <input type="hidden" name="records" id="records" />
                             </form>
-                        [% END %]
 
                 </div> <!-- / #userbasket -->
             </div> <!-- / .span10 -->
 [% INCLUDE 'opac-bottom.inc' %]
 
 [% BLOCK jsinclude %]
-    [% IF ( print_basket ) %]
-        <script type="text/javascript">
-            //<![CDATA[
-                $(document).ready(function(){
-                    print();
-                    location.href="/cgi-bin/koha/opac-basket.pl?bib_list=[% bib_list %][% IF ( verbose ) %]&verbose=1[% END %]";
-                });
-            //]]>
-        </script>
-    [% ELSE %]
-        <script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
+    [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
         [% INCLUDE 'datatables.inc' %]
-        <script type="text/javascript">
+        <script>
             //<![CDATA[
 
             [% IF ( TagsInputEnabled && loggedinusername ) %]
             [% END # / TagsInputEnabled && loggedinusername %]
 
             $(document).ready(function(){
+                $(".brief").click(function(e){
+                    e.preventDefault();
+                    showLess();
+                });
+
+                $(".detail").click(function(e){
+                    e.preventDefault();
+                    showMore();
+                });
+
+                $(".send").click(function(e){
+                    e.preventDefault();
+                    sendBasket();
+                });
+
+                $(".download").click(function(e){
+                    e.preventDefault();
+                    downloadBasket();
+                });
+
+                $(".empty").click(function(e){
+                    e.preventDefault();
+                    delBasket();
+                });
+
+                $(".deleteshelf").click(function(e){
+                    e.preventDefault();
+                    delSelRecords();
+                });
+
+                $(".newshelf").click(function(e){
+                    e.preventDefault();
+                    addSelToShelf();
+                });
+
+                $(".hold").click(function(e){
+                    e.preventDefault();
+                    holdSel();
+                });
+
+                $("#tagsel_tag").click(function(e){
+                    e.preventDefault();
+                    tagSelected();
+                });
+
+                $("#tagsel_button").click(function(e){
+                    e.preventDefault();
+                    tagAdded();
+                });
+
+                $("#tagsel_cancel").click(function(e){
+                    e.preventDefault();
+                    tagCanceled();
+                });
+
                 $("#CheckAll").click(function(){
                     var checked = [];
                     $(".checkboxed").checkCheckboxes("*", true).each(
                     return false;
                 });
 
-                $("#itemst").dataTable($.extend(true, {}, dataTablesDefaults, {
-                    "aaSorting": [[ 1, "asc" ]],
-                    "aoColumnDefs": [
-                      { "aTargets": [ 0,-1 ], "bSortable": false, "bSearchable": false }
+                var itemst = $("#itemst").dataTable($.extend(true, {}, dataTablesDefaults, {
+                    "order": [[ 1, "asc" ]],
+                    "columnDefs": [
+                      { "targets": [ 0,-1 ], "sortable": false, "searchable": false }
                     ],
-                    "aoColumns": [
+                    "columns": [
                         null,
-                        { "sType": "anti-the" },
+                        { "type": "anti-the" },
                         null,
                         null,
                         null
-                    ]
+                    ],
+
                 }));
 
-                $(".cb").click(function(){
+                var buttons = new $.fn.dataTable.Buttons(itemst, {
+                     buttons: [
+                        'print'
+                    ]
+                }).container().appendTo($('#toolbar'));
+
+                $(".cb").change(function(){
+                    selRecord( $(this).val(), $(this).prop("checked") );
                     enableCheckboxActions();
+                    return false;
                 });
                 enableCheckboxActions();
             });
             }
             //]]>
         </script>
-    [% END # / IF print_basket %]
 [% END # / BLOCK jsinclude %]