Bug 7720: add options for controlling display of an item's home and/or holdings location
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / lateorders.tt
1 [% USE KohaDates %]
2 [% USE Branches %]
3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Koha &rsaquo; Acquisitions &rsaquo; Late orders</title>
5 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
6 [% INCLUDE 'doc-head-close.inc' %]
7 [% INCLUDE 'datatables.inc' %]
8 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
9 [% INCLUDE 'calendar.inc' %]
10 <script type="text/javascript">
11 //<![CDATA[
12
13 var late_orderst;
14 function check_uncheck() {
15     var all_nodes = $(late_orderst.fnGetNodes());
16     if ( $(all_nodes).find("input:checkbox[name=ordernumber]:checked").length > 0) {
17         var booksellerid = $(all_nodes).find("input:checkbox[name=ordernumber]:checked:first").attr("data-booksellerid");
18         $(all_nodes).find("input:checkbox[name=ordernumber][data-booksellerid!="+booksellerid+"]").attr('disabled', 'disabled');
19     } else {
20         $("input:checkbox[name=ordernumber]").removeAttr('disabled');
21     }
22 }
23
24 $(document).ready(function() {
25
26     late_orderst = $("#late_orders").dataTable($.extend(true, {}, dataTablesDefaults, {
27         "aoColumnDefs": [
28             { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
29             { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
30             { "sType": "title-string", "aTargets" : [ "title-string" ] }
31         ],
32         "sPaginationType": "four_button",
33         "bAutoWidth": false,
34         "fnDrawCallback": function() {
35             if ( typeof late_orderst != 'undefined' ) {
36                 check_uncheck();
37                 $('input:checkbox[name=ordernumber]').bind('click', check_uncheck);
38             };
39         }
40     } ) );
41     $('input:checkbox[name=ordernumber]').bind('click', check_uncheck);
42     $('#CheckAll').click(function(){ $(late_orderst.fnGetNodes()).find("td").checkCheckboxes();});
43     $('#CheckNone').click(function(){ $(late_orderst.fnGetNodes()).find("td").unCheckCheckboxes();});
44
45     // Generates a dynamic link for exporting the selection's data as CSV
46     $("#ExportSelected").click(function() {
47         var all_nodes = $(late_orderst.fnGetNodes());
48         var selected = $(all_nodes).find("input[name='ordernumber']:checked");
49
50         if (selected.length == 0) {
51             alert(_("Please select at least one item to export."));
52             return false;
53         }
54
55         // Building the url from currently checked boxes
56         var url = '/cgi-bin/koha/acqui/lateorders-export.pl?op=export';
57         for (var i = 0; i < selected.length; i++) {
58             url += '&amp;ordernumber=' + selected[i].value;
59         }
60         // And redirecting to the CSV page
61         location.href = url;
62         return false;
63     });
64 });
65 //]]>
66 </script>
67 </head>
68 <body id="acq_lateorders" class="acq">
69 [% INCLUDE 'header.inc' %]
70 [% INCLUDE 'acquisitions-search.inc' %]
71
72 <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>
73
74 <div id="doc3" class="yui-t2">
75    
76    <div id="bd">
77         <div id="yui-main">
78         <div class="yui-b">
79         
80 <h1>[% IF ( Supplier ) %][% Supplier %] : [% END %]Late orders</h1>
81 <div id="acqui_lateorders">
82
83 [% IF error_claim %]
84     [% IF ( error_claim == "no_email" ) %]
85         <div class="error">This vendor has no email</div>
86     [% ELSE %]
87         <div class="error">[% error_claim %]</div>
88     [% END %]
89 [% END %]
90 [% IF info_claim %]
91     <div class="dialog message">Email has been sent.</div>
92 [% END %]
93 [% IF ( lateorders ) %]
94 <form action="lateorders.pl" name="claim" method="post">
95   <input type="hidden" name="op" value="send_alert" />
96   <input type="hidden" name="delay" value="[% delay %]" />
97   <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
98         [% IF ( letters ) %]
99         <p><label for="letter_code">Claim using notice: </label><select name="letter_code" id="letter_code">
100           [% FOREACH letter IN letters %]
101                 <option value="[% letter.code %]">[% letter.name %]</option>
102           [% END %]
103           </select>
104         </p>
105         [% END %]
106     <table id="late_orders">
107       <thead>
108         <tr>
109             [% IF Supplier %]
110                 <th><a id="CheckAll" href="#">Check all</a><br /><a id="CheckNone" href="#">Uncheck all</a></th>
111             [% ELSE %]
112                 <th></th>
113             [% END %]
114             <th class="title-string">Order date</th>
115             <th class="title-string">Estimated delivery date</th>
116             <th>Vendor</th>
117             <th class="anti-the">Information</th>
118             <th>Total cost</th>
119             <th>Basket</th>
120             <th>Basket group</th>
121             <th>Library</th>
122             <th>Fund</th>
123             <th>Claims count</th>
124             <th class="title-string">Claimed date</th>
125         </tr>
126       </thead>
127       <tbody>
128       [% FOREACH lateorder IN lateorders %]
129         [% UNLESS ( loop.odd ) %]<tr class="highlight">
130         [% ELSE %]<tr>[% END %]
131             <td>
132                 <input type="checkbox" value="[% lateorder.ordernumber %]" data-booksellerid="[% lateorder.supplierid %]" name="ordernumber">
133             </td>
134             <td>
135                 <span title="[% lateorder.orderdate %]">[% lateorder.orderdate | $KohaDates %] ([% lateorder.latesince %] days)</span>
136             </td>
137             <td>
138                 [% IF ( lateorder.estimateddeliverydate ) %]
139                     <span title="[% lateorder.estimateddeliverydate %]">[% lateorder.estimateddeliverydate | $KohaDates  %]</span>
140                 [% ELSE %]
141                     <span title="0000-00-00"></span>
142                 [% END %]
143             </td>
144             <td>
145                 [% lateorder.supplier %]
146                 ([% lateorder.supplierid %])
147             </td>
148             <td>
149                 <b>[% lateorder.title |html %]</b>
150                    [% IF ( lateorder.author ) %]<br/><i>Author:</i> [% lateorder.author %][% END %]
151                    [% IF ( lateorder.publisher ) %]
152                         <br/><i>Published by:</i> [% lateorder.publisher %]
153                         [% IF ( lateorder.publicationyear ) %]
154                             <i> in </i>[% lateorder.publicationyear %]
155                         [% END %]
156                    [% END %]
157             </td>
158             <td>
159                    [% lateorder.unitpricesupplier %]x[% lateorder.quantity %] = 
160                    [% lateorder.subtotal %]
161             </td>
162             <td>
163                 [% IF ( CAN_user_acquisition_order_manage ) %]
164                     <a href="basket.pl?basketno=[% lateorder.basketno %]" title="basket">[% lateorder.basketname %] ([% lateorder.basketno %])</a>
165                 [% ELSE %]
166                     [% lateorder.basketname %] ([% lateorder.basketno %])
167                 [% END %]
168             </td>
169             <td>
170                 [% IF ( lateorder.basketgroupid ) %]
171                     [% IF ( CAN_user_acquisition_group_manage ) %]
172                         <a href="basketgroup.pl?op=add&booksellerid=[% lateorder.supplierid %]&basketgroupid=[% lateorder.basketgroupid %]" title="basketgroup">[% lateorder.basketgroupname %] ([% lateorder.basketgroupid %])</a>
173                     [% ELSE %]
174                         [% lateorder.basketgroupname %] ([% lateorder.basketgroupid %])</a>
175                     [% END %]
176                 [% END %]
177             </td>
178             <td>[% Branches.GetName( lateorder.branch ) %]
179             </td>
180             <td>[% lateorder.budget %]
181             </td>
182             <td>[% lateorder.claims_count %]</td>
183             <td>
184                 [% IF ( lateorder.claimed_date ) %]
185                     <span title="[% lateorder.claimed_date %]">[% lateorder.claimed_date | $KohaDates %]</span>
186                 [% ELSE %]
187                     <span title="0000-00-00"></span>
188                 [% END %]
189             </td>
190         </tr>
191       [% END %]
192       </tbody>
193       <tfoot>
194         <tr>
195             <th colspan="5">Total</th>
196             <th>[% total %]</th>
197             <th colspan="6">&nbsp;</th>
198         </tr>
199       </tfoot>
200     </table>
201     <div class="spacer"></div>
202
203     <p style="display:block;">
204         <input type="button" value="Export as CSV" id="ExportSelected" />
205         [% UNLESS lateorder.budget_lock %]
206             <input type="submit"  value="Claim order" />
207         [% END %]
208     </p>
209 </form>
210 [% ELSE %]<p>There are no late orders.</p>
211 [% END %]
212 </div>
213 </div>
214 </div>
215 <div class="yui-b">
216 <form action="lateorders.pl" method="get">
217 <fieldset class="brief">
218 <h4>Filter results:</h4>
219 [% FOREACH ERROR_LOO IN ERROR_LOOP %]
220 [% 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 %]
221 [% END %]
222 <ol>
223     <li><label for="delay">Order date:</label><input size="3" maxlength="3" id="delay" type="text" name="delay" value="[% delay %]" /> days ago</li>
224     <li><label for="from">Estimated delivery date from: </label>
225         <input type="text" size="10" id="from" name="estimateddeliverydatefrom" value="[% estimateddeliverydatefrom %]" class="datepickerfrom" />
226         <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
227     </li>
228     <li><label for="to">To: </label>
229         <input type="text" size="10" id="to" name="estimateddeliverydateto" value="[% estimateddeliverydateto %]" class="datepickerto" />
230         <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
231     </li>
232
233         <li><label for="booksellerid">Vendor:</label>
234                 <select id="booksellerid" size="1" tabindex="" name="booksellerid">
235             <option value=""></option>
236                         [% FOREACH SUPPLIER_LOO IN SUPPLIER_LOOP %]
237                 [% IF ( SUPPLIER_LOO.selected ) %]<option value="[% SUPPLIER_LOO.id %]" selected="selected">[% SUPPLIER_LOO.name %]</option>
238                 [% ELSE %]<option value="[% SUPPLIER_LOO.id %]">[% SUPPLIER_LOO.name %]</option>[% END %]
239                 [% END %]
240                 </select>
241 </ol>
242     <fieldset class="action"><input type="submit" value="Filter" /></fieldset>
243 </fieldset>
244     </form>
245 [% INCLUDE 'acquisitions-menu.inc' %]
246 </div>
247 </div>
248 [% INCLUDE 'intranet-bottom.inc' %]