+[% USE Asset %]
[% USE KohaDates %]
[% USE Branches %]
+[% USE ColumnsSettings %]
+[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha › Acquisitions › 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' %]
-<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() {
-
- late_orderst = $("#late_orders").dataTable($.extend(true, {}, dataTablesDefaults, {
- "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);
- };
- }
- } ) );
- $('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 += '&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> › <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> › <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>
[% 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">
</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>
</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>
</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 += '&ordernumber=' + selected[i].value;
+ }
+ // And redirecting to the CSV page
+ location.href = url;
+ return false;
+ });
+ });
+ </script>
+[% END %]
+
[% INCLUDE 'intranet-bottom.inc' %]