Merge branch 'bug_9073' into 3.12-master
[koha_fer] / koha-tmpl / intranet-tmpl / prog / en / modules / basket / basket.tt
index 0896075..9989194 100644 (file)
@@ -1,5 +1,5 @@
 [% INCLUDE 'doc-head-open.inc' %]
-<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha Online[% END %] Catalog &rsaquo; Your Cart</title>
+<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] Catalog &rsaquo; Your cart</title>
     [% IF ( print_basket ) %]
 
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <script type="text/javascript">
        //<![CDATA[
 
-$(document).ready(function()
-    {
-        $("#itemst").tablesorter({
-                        headers: { 0: { sorter: false }}
-                });
-    }
-);
-
-
 function placeHold () {
     var checkedItems = $("input:checkbox:checked");
     if ($(checkedItems).size() == 0) {
         alert(MSG_NO_RECORD_SELECTED);
         return false;
     }
-    var bibs = "";
-    var badBibs = false;
-    $(checkedItems).each(function() {
-        var bib = $(this).val();
-        bibs += bib + "/";
-    });
 
-    var newloc = "/cgi-bin/koha/reserve/request.pl?biblionumbers=" + bibs;
-    if ($(checkedItems).size() > 1) { newloc += "&multi_hold=1"; }
+    var newloc;
+
+    if ($(checkedItems).size() > 1) {
+        var bibs = "";
+        $(checkedItems).each(function() {
+            var bib = $(this).val();
+            bibs += bib + "/";
+        });
+
+        newloc = "/cgi-bin/koha/reserve/request.pl?biblionumbers=" + bibs + "&multi_hold=1";
+    } else {
+        var bib = checkedItems[0].value;
+        newloc = "/cgi-bin/koha/reserve/request.pl?biblionumber=" + bib;
+    }
+
     window.opener.location = newloc;
     window.close();
 }
@@ -65,25 +63,46 @@ function placeHold () {
            });
         $(".holdsep").text("| ");
         $(".hold").text(_("Place Hold"));
+        $("#downloadcartc").empty();
+        yuiToolbar();
+        $("#itemst").tablesorter({
+            headers: { 0: { sorter: false }}
+        });
        });
 
-
+function yuiToolbar() {
+    var downloadmenu = [
+    { text: _("iso2709"), url: "/cgi-bin/koha/basket/downloadcart.pl?format=iso2709&bib_list=[% bib_list %]" },
+    { text: _("RIS"), url: "/cgi-bin/koha/basket/downloadcart.pl?format=ris&bib_list=[% bib_list %]" },
+    { text: _("BibTex"), url: "/cgi-bin/koha/basket/downloadcart.pl?format=bibtex&bib_list=[% bib_list %]" },
+[% FOREACH csv_profile IN csv_profiles %]
+    { text: _("CSV - [% csv_profile.profile %]"), url: "/cgi-bin/koha/basket/downloadcart.pl?format=[% csv_profile.export_format_id %]&bib_list=[% bib_list %]" },
+[% END %]
+    ];
+    new YAHOO.widget.Button({
+        type: "menu",
+        label: _("Download"),
+        name: "downloadmenubutton",
+        menu: downloadmenu,
+        container: "downloadcartc"
+    });
+}
        //]]>
        </script>
        [% END %]
 </head>
-[% IF ( print_basket ) %]<body id="basket" onload="print();history.back();">[% ELSE %]<body id="basket">[% END %]
+[% IF ( print_basket ) %]<body id="cart_basket" class="cart" onload="print();history.back();">[% ELSE %]<body id="cart_basket" class="cart">[% END %]
 
 <div id="doc" class="yui-t7">
 <div class="container">
 [% UNLESS ( print_basket ) %]
-<h1>Your Cart</h1>
+<h1>Your cart</h1>
 
 <div id="toolbar">
 <ul class="toolbar">
        <li>
            <span id="addchild" class="yui-button yui-link-button"><span class="first-child">
-               [% IF ( verbose ) %]<a href="basket.pl" class="brief" onclick="showLess(); return false;">Brief Display</a>[% ELSE %]<a href="basket.pl" class="detail" onclick="showMore(); return false;">More Details</a>[% END %]
+        [% IF ( verbose ) %]<a href="basket.pl" class="brief" onclick="showLess(); return false;">Brief display</a>[% ELSE %]<a href="basket.pl" class="detail" onclick="showMore(); return false;">More details</a>[% END %]
            </span></span>
        </li>
        <li>
@@ -91,11 +110,9 @@ function placeHold () {
                <a class="send" href="basket.pl" onclick="sendBasket(); return false;">Send</a>
            </span></span>
        </li>
-       <li>
-           <span id="savemenuc" class="yui-button yui-link-button"><span class="first-child">
-               <a class="download" href="basket.pl" onclick="downloadBasket(); return false;">Download</a>
-           </span></span>
-       </li>
+    <li id="downloadcartc">
+        <a href="#" id="downloadcart">Download</a>
+    </li>
        <li>
            <span id="printmenuc" class="yui-button yui-link-button"><span class="first-child">
                <a class="print" href="basket.pl" onclick="printBasket(); return false;">Print</a>
@@ -103,12 +120,12 @@ function placeHold () {
        </li>
        <li>
            <span id="delete" class="yui-button yui-link-button"><span class="first-child">
-               <a class="empty" href="basket.pl" onclick="delBasket('popup'); return false;">Empty and Close</a>
+        <a class="empty" href="basket.pl" onclick="delBasket('popup'); return false;">Empty and close</a>
            </span></span>
        </li>
        <li>
            <span id="hide" class="yui-button yui-link-button"><span class="first-child">
-               <a class="hide" href="basket.pl" onclick="quit(); return false;">Hide Window</a>
+        <a class="hide close" href="basket.pl">Hide window</a>
            </span></span>
        </li>
 </ul>
@@ -116,7 +133,7 @@ function placeHold () {
         [% END %]
 
 [% IF ( verbose ) %]
-       [% UNLESS ( print_basket ) %]<p style="padding: 7px 0; border-top : 1px solid #E8E8E8;"><a id="CheckAll" href="#">Select All</a> <a id="CheckNone" href="#">Clear All</a> | <b>Selected items :</b>
+    [% UNLESS ( print_basket ) %]<p style="padding: 7px 0; border-top : 1px solid #E8E8E8;"><a id="CheckAll" href="#">Select all</a> <a id="CheckNone" href="#">Clear all</a> | <b>Selected items :</b>
 
     <a href="#" onclick="delSelRecords(); return false;">Remove</a>
 
@@ -125,7 +142,7 @@ function placeHold () {
 [% END %]
 
 [% IF ( CAN_user_reserveforothers ) %]
-     | <a href="#" onclick="placeHold(); return false;">Place Hold</a>
+     | <a href="#" onclick="placeHold(); return false;">Place hold</a>
 [% END %]
 
 </p>[% END %]
@@ -253,7 +270,7 @@ function placeHold () {
 
         [% IF ( BIBLIO_RESULT.MARCurlS ) %]
         <tr>
-            <th scope="row">url(s)</th>
+            <th scope="row">URL(s)</th>
             <td>
           [% FOREACH MARCurl IN BIBLIO_RESULT.MARCurlS %]
                <p>[% IF ( MARCurl.part ) %][% MARCurl.part %]
@@ -283,8 +300,8 @@ function placeHold () {
 [% UNLESS ( print_basket ) %]
 <p style="border-top : 1px solid #E8E8E8;">
        <form action="/cgi-bin/koha/basket/basket.pl" method="get" name="bookbag_form" id="bookbag_form">
-    <a id="CheckAll" href="#">Select All</a>
-    <a id="CheckNone" href="#">Clear All</a>
+    <a id="CheckAll" href="#">Select all</a>
+    <a id="CheckNone" href="#">Clear all</a>
     | <b>Selected items :</b>
 <a href="#" onclick="delSelRecords(); return false;">Remove</a>
 
@@ -293,7 +310,7 @@ function placeHold () {
 [% END %]
 
 [% IF ( CAN_user_reserveforothers ) %]
-     | <a href="#" onclick="placeHold(); return false;">Place Hold</a>
+     | <a href="#" onclick="placeHold(); return false;">Place hold</a>
 [% END %]
 
 
@@ -303,7 +320,7 @@ function placeHold () {
        <thead><tr>
            [% UNLESS ( print_basket ) %]<th>&nbsp;</th>[% END %]
            <th>Title</th>
-           <th>Item Type</th>
+        <th>Item type</th>
            <th>Location</th>
         </tr></thead>