Bug 19166: (follow-up) Adjust table and files and QA issues
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / lateorders.tt
index 5df669b..7711a33 100644 (file)
@@ -1,92 +1,32 @@
+[% USE Asset %]
 [% USE KohaDates %]
 [% USE Branches %]
 [% USE ColumnsSettings %]
+[% SET footerjs = 1 %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Acquisitions &rsaquo; Late orders</title>
-<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
+[% Asset.css("css/datatables.css") %]
 [% INCLUDE 'doc-head-close.inc' %]
-[% INCLUDE 'datatables.inc' %]
-[% INCLUDE 'columns_settings.inc' %]
-<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
-[% INCLUDE 'calendar.inc' %]
-<script type="text/javascript">
-//<![CDATA[
-
-var late_orderst;
-function check_uncheck() {
-    var all_nodes = $(late_orderst.fnGetNodes());
-    if ( $(all_nodes).find("input:checkbox[name=ordernumber]:checked").length > 0) {
-        var booksellerid = $(all_nodes).find("input:checkbox[name=ordernumber]:checked:first").attr("data-booksellerid");
-        $(all_nodes).find("input:checkbox[name=ordernumber][data-booksellerid!="+booksellerid+"]").attr('disabled', 'disabled');
-    } else {
-        $("input:checkbox[name=ordernumber]").removeAttr('disabled');
-    }
-}
-
-$(document).ready(function() {
-
-    var columns_settings = [% ColumnsSettings.GetColumns( 'acqui', 'lateorders', 'late_orders', 'json' ).raw %];
-    late_orderst = KohaTable("#late_orders", {
-        "aoColumnDefs": [
-            { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
-            { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
-            { "sType": "title-string", "aTargets" : [ "title-string" ] }
-        ],
-        "sPaginationType": "four_button",
-        "bAutoWidth": false,
-        "fnDrawCallback": function() {
-            if ( typeof late_orderst != 'undefined' ) {
-                check_uncheck();
-                $('input:checkbox[name=ordernumber]').bind('click', check_uncheck);
-            };
-        }
-    }, columns_settings );
-    $('input:checkbox[name=ordernumber]').bind('click', check_uncheck);
-    $('#CheckAll').click(function(){ $(late_orderst.fnGetNodes()).find("td").checkCheckboxes();});
-    $('#CheckNone').click(function(){ $(late_orderst.fnGetNodes()).find("td").unCheckCheckboxes();});
-
-    // Generates a dynamic link for exporting the selection's data as CSV
-    $("#ExportSelected").click(function() {
-        var all_nodes = $(late_orderst.fnGetNodes());
-        var selected = $(all_nodes).find("input[name='ordernumber']:checked");
-
-        if (selected.length == 0) {
-            alert(_("Please select at least one item to export."));
-            return false;
-        }
-
-        // Building the url from currently checked boxes
-        var url = '/cgi-bin/koha/acqui/lateorders-export.pl?op=export';
-        for (var i = 0; i < selected.length; i++) {
-            url += '&amp;ordernumber=' + selected[i].value;
-        }
-        // And redirecting to the CSV page
-        location.href = url;
-        return false;
-    });
-});
-//]]>
-</script>
 </head>
+
 <body id="acq_lateorders" class="acq">
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'acquisitions-search.inc' %]
 
 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo; <a href="lateorders.pl">Late orders</a></div>
 
-<div id="doc3" class="yui-t2">
-   
-   <div id="bd">
-       <div id="yui-main">
-       <div class="yui-b">
-       
+<div class="main container-fluid">
+    <div class="row">
+        <div class="col-sm-10 col-sm-push-2">
+            <main>
+
 <h1>[% IF ( Supplier ) %][% Supplier %] : [% END %]Late orders</h1>
 <div id="acqui_lateorders">
 
 [% IF error_claim %]
     [% IF ( error_claim == "no_email" ) %]
         <div class="error">This vendor has no email</div>
-    [% ELSIF ( error_claim == "no_order_seleted" ) %]
+    [% ELSIF ( error_claim == "no_order_selected" ) %]
         <div class="error">No order selected</div>
     [% ELSE %]
         <div class="error">[% error_claim %]</div>
@@ -98,7 +38,7 @@ $(document).ready(function() {
 [% IF ( lateorders ) %]
 <form action="lateorders.pl" name="claim" method="post">
   <input type="hidden" name="op" value="send_alert" />
-  <input type="hidden" name="delay" value="[% delay%]" />
+  <input type="hidden" name="delay" value="[% delay | html%]" />
   <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
        [% IF ( letters ) %]
        <p><label for="letter_code">Claim using notice: </label><select name="letter_code" id="letter_code">
@@ -131,8 +71,7 @@ $(document).ready(function() {
       </thead>
       <tbody>
       [% FOREACH lateorder IN lateorders %]
-        [% UNLESS ( loop.odd ) %]<tr class="highlight">
-        [% ELSE %]<tr>[% END %]
+        <tr>
             <td>
                 <input type="checkbox" value="[% lateorder.ordernumber %]" data-booksellerid="[% lateorder.supplierid %]" name="ordernumber">
             </td>
@@ -151,7 +90,7 @@ $(document).ready(function() {
                 ([% lateorder.supplierid %])
             </td>
             <td>
-                <b>[% lateorder.title %]</b>
+                <b>[% lateorder.title |html %]</b>
                    [% IF ( lateorder.author ) %]<br/><i>Author:</i> [% lateorder.author %][% END %]
                    [% IF ( lateorder.publisher ) %]
                         <br/><i>Published by:</i> [% lateorder.publisher %]
@@ -214,18 +153,20 @@ $(document).ready(function() {
 </form>
 [% ELSE %]<p>There are no late orders.</p>
 [% END %]
-</div>
-</div>
-</div>
-<div class="yui-b">
+</div> <!-- /#acqui_lateorders -->
+</main>
+</div> <!-- /.col-sm-10.col-sm-push-2 -->
+
+<div class="col-sm-2 col-sm-pull-10">
+    <aside>
 <form action="lateorders.pl" method="get">
 <fieldset class="brief">
 <h4>Filter results:</h4>
 [% FOREACH ERROR_LOO IN ERROR_LOOP %]
-[% IF ( ERROR_LOO.delay_digits ) %]<p class="error">The number of days ([% ERROR_LOO.bad_delay %]) must be a number between 0 and 999.</p>[% END %]
+[% IF ( ERROR_LOO.delay_digits ) %]<p class="error">The number of days ([% ERROR_LOO.bad_delay | html %]) must be a number between 0 and 999.</p>[% END %]
 [% END %]
 <ol>
-    <li><label for="delay">Order date:</label><input size="3" maxlength="3" id="delay" type="text" name="delay" value="[% delay%]" /> days ago</li>
+    <li><label for="delay">Order date:</label><input size="3" maxlength="3" id="delay" type="text" name="delay" value="[% delay | html%]" /> days ago</li>
     <li><label for="from">Estimated delivery date from: </label>
         <input type="text" size="10" id="from" name="estimateddeliverydatefrom" value="[% estimateddeliverydatefrom %]" class="datepickerfrom" />
         <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
@@ -248,6 +189,71 @@ $(document).ready(function() {
 </fieldset>
     </form>
 [% INCLUDE 'acquisitions-menu.inc' %]
+</aside>
+</div> <!-- /.col-sm-2.col-sm-pull-10 -->
 </div>
-</div>
+
+[% MACRO jsinclude BLOCK %]
+    [% Asset.js("js/acquisitions-menu.js") %]
+    [% INCLUDE 'datatables.inc' %]
+    [% INCLUDE 'columns_settings.inc' %]
+    [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") %]
+    [% INCLUDE 'calendar.inc' %]
+    <script>
+        var late_orderst;
+        function check_uncheck() {
+            var all_nodes = $(late_orderst.fnGetNodes());
+            if ( $(all_nodes).find("input:checkbox[name=ordernumber]:checked").length > 0) {
+                var booksellerid = $(all_nodes).find("input:checkbox[name=ordernumber]:checked:first").attr("data-booksellerid");
+                $(all_nodes).find("input:checkbox[name=ordernumber][data-booksellerid!="+booksellerid+"]").prop('disabled', true);
+            } else {
+                $("input:checkbox[name=ordernumber]").prop('disabled', false);
+            }
+        }
+
+        $(document).ready(function() {
+
+            var columns_settings = [% ColumnsSettings.GetColumns( 'acqui', 'lateorders', 'late_orders', 'json' ) %];
+            late_orderst = KohaTable("late_orders", {
+                "aoColumnDefs": [
+                    { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
+                    { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
+                    { "sType": "title-string", "aTargets" : [ "title-string" ] }
+                ],
+                "sPaginationType": "four_button",
+                "bAutoWidth": false,
+                "fnDrawCallback": function() {
+                    if ( typeof late_orderst != 'undefined' ) {
+                        check_uncheck();
+                        $('input:checkbox[name=ordernumber]').bind('click', check_uncheck);
+                    };
+                }
+            }, columns_settings );
+            $('input:checkbox[name=ordernumber]').bind('click', check_uncheck);
+            $('#CheckAll').click(function(){ $(late_orderst.fnGetNodes()).find("td").checkCheckboxes();});
+            $('#CheckNone').click(function(){ $(late_orderst.fnGetNodes()).find("td").unCheckCheckboxes();});
+
+            // Generates a dynamic link for exporting the selection's data as CSV
+            $("#ExportSelected").click(function() {
+                var all_nodes = $(late_orderst.fnGetNodes());
+                var selected = $(all_nodes).find("input[name='ordernumber']:checked");
+
+                if (selected.length == 0) {
+                    alert(_("Please select at least one item to export."));
+                    return false;
+                }
+
+                // Building the url from currently checked boxes
+                var url = '/cgi-bin/koha/acqui/lateorders-export.pl?op=export';
+                for (var i = 0; i < selected.length; i++) {
+                    url += '&amp;ordernumber=' + selected[i].value;
+                }
+                // And redirecting to the CSV page
+                location.href = url;
+                return false;
+            });
+        });
+    </script>
+[% END %]
+
 [% INCLUDE 'intranet-bottom.inc' %]