Bug 12944: The autocomplete should only be applied for the form
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / histsearch.tt
1 [% USE KohaDates %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha &rsaquo; Acquisitions &rsaquo; [% IF ( order_loop ) %]Orders search &rsaquo; Search results[% ELSE %]Order search[% END %]</title>
4 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
5 [% INCLUDE 'doc-head-close.inc' %]
6 [% INCLUDE 'calendar.inc' %]
7 [% INCLUDE 'datatables.inc' %]
8
9 <script type="text/javascript" src="[% interface %]/js/autocomplete/patrons.js"></script>
10 <script type="text/javascript">
11 //<![CDATA[
12  $(document).ready(function() {
13     $("#histsearcht").dataTable($.extend(true, {}, dataTablesDefaults, {
14         "aoColumnDefs": [
15             { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
16             { "sType": "title-string", "aTargets" : [ "title-string" ] }
17         ],
18         "sPaginationType": "four_button"
19     } ) );
20
21     [% UNLESS order_loop %]
22         patron_autocomplete({
23             patron_container: $("#basket_creators"),
24             input_autocomplete: $("#find_patron"),
25             patron_input_name: 'created_by',
26             field_to_retrieve: 'borrowernumber'
27         });
28     [% END %]
29 });
30
31  //]]>
32 </script>
33 </head>
34 <body id="acq_histsearch" class="acq">
35 [% INCLUDE 'header.inc' %]
36 [% INCLUDE 'acquisitions-search.inc' %]
37
38 <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; [% IF ( order_loop ) %]<a href="/cgi-bin/koha/acqui/histsearch.pl">Orders search</a> &rsaquo; Search results[% ELSE %]Order search[% END %]</div>
39
40 <div id="doc3" class="yui-t2">
41    
42    <div id="bd">
43         <div id="yui-main">
44         <div class="yui-b">
45         
46 [% UNLESS ( order_loop ) %]<form action="/cgi-bin/koha/acqui/histsearch.pl" method="post">
47 <fieldset class="rows">
48     <legend>Search orders</legend>
49                 <ol>
50                 <li><label for="title">Title: </label> <input type="text" name="title" id="title" value="[% title %]" /></li>
51                 <li><label for="author">Author: </label> <input type="text" name="author" id="author" value="[% author %]" /></li>
52         <li><label for="isbn">ISBN: </label> <input type="text" name="isbn" id="isbn" value="[% isbn %]" /></li>
53                 [% IF (UNIMARC) %]
54         <li><label for="ean">EAN: </label> <input type="text" name="ean" id="ean" value="[% ean %]" /></li>
55                 [% END %]
56                 <li><label for="name">Vendor: </label> <input type="text" name="name" id="name" value="[% name %]" /></li>
57                 <li><label for="basket">Basket: </label> <input type="text" name="basket" id="basket" value="[% basket %]" /></li>
58         <li><label for="basket_creators">Basket created by: </label>
59             <input autocomplete="off" id="find_patron" type="text" style="width:150px" class="noEnterSubmit" />
60             <div>
61                 <div id="basket_creators" style="float:left;"></div>
62             </div>
63         </li>
64         <li><label for="booksellerinvoicenumber ">Bookseller invoice no: </label> <input type="text" name="booksellerinvoicenumber" id="booksellerinvoicenumber" value="[% booksellerinvoicenumber %]" /></li>
65         <li>
66             <label for="basketgroupname">Basket group:</label>
67             <input type="text" name="basketgroupname" id="basketgroupname" value="[% basketgroupname %]" />
68         </li>
69         <li>
70           <label for="ordernumber">Order line:</label>
71           <input type="text" name="ordernumber" id="ordernumber" value="[% ordernumber %]" />
72           [% IF search_children_too %]
73             <input type="checkbox" name="search_children_too" id="search_children_too" value="1" checked="checked" />
74           [% ELSE %]
75             <input type="checkbox" name="search_children_too" id="search_children_too" value="1" />
76           [% END %]
77           <label class="yesno" for="search_children_too">Display children too.</label>
78         </li>
79
80         <li>
81             <label for="orderstatus">Order status: </label>
82             <select name="orderstatus" id="orderstatus">
83                 [% IF orderstatus == "" %]
84                   <option value="">Any status except cancelled</option>
85                 [% ELSE %]
86                   <option value="" selected="selected"></option>
87                 [% END %]
88                 [% IF orderstatus == "new" %]
89                   <option value="new" selected="selected">New</option>
90                 [% ELSE %]
91                   <option value="new">New</option>
92                 [% END %]
93                 [% IF orderstatus == "ordered" %]
94                   <option value="ordered" selected="selected">Pending</option>
95                 [% ELSE %]
96                   <option value="ordered">Pending</option>
97                 [% END %]
98                 [% IF orderstatus == "partial" %]
99                   <option value="partial" selected="selected">Partially received</option>
100                 [% ELSE %]
101                   <option value="partial">Partially received</option>
102                 [% END %]
103                 [% IF orderstatus == "complete" %]
104                   <option value="complete" selected="selected">Received</option>
105                 [% ELSE %]
106                   <option value="complete">Received</option>
107                 [% END %]
108                 [% IF orderstatus == "cancelled" %]
109                   <option value="cancelled" selected="selected">Cancelled</option>
110                 [% ELSE %]
111                   <option value="cancelled">Cancelled</option>
112                 [% END %]
113             </select>
114         </li>
115         <li>
116             <label for="fund">Fund: </label>
117             <select name="budget" id="fund">
118                 <option value="">All funds</option>
119                 [% FOREACH bp_loo IN bp_loop %]
120                     <optgroup label="[% bp_loo.budget_period_description %]">
121                     [% FOREACH h_loo IN bp_loo.hierarchy %]
122                       [% IF h_loo.budget_id == budget_id %]
123                         <option type="text" value="[% h_loo.budget_id %]" branchcode="[% h_loo.budget_branchcode %]" selected="selected">
124                       [% ELSE %]
125                         <option type="text" value="[% h_loo.budget_id %]" branchcode="[% h_loo.budget_branchcode %]">
126                       [% END %]
127                             [% h_loo.budget_display_name %]
128                         </option>
129                     [% END %]
130                     </optgroup>
131                 [% END %]
132             </select>
133         </li>
134
135                 <li><label for="from">From: </label> 
136         <input type="text" size="10" id="from" name="from" value="[% from_placed_on %]" class="datepickerfrom" />
137                                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
138                 </li>
139                 <li><label for="to">To: </label> 
140         <input type="text" size="10" id="to" name="to" value="[% to_placed_on %]" class="datepickerto" />
141                                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
142                 </li>
143                 </ol>
144         </fieldset>
145     <input type="hidden" name="do_search" value="1" />
146         <fieldset class="action"><input type="submit" value="Search" /></fieldset>
147         </form>[% END %]
148     [% IF ( order_loop ) %]<h1>Search results</h1>
149         <div id="acqui_histsearch">
150         <table id="histsearcht">
151             <thead>
152                         <tr>
153                 <th>Order line (parent)</th>
154                 <th>Status</th>
155                                 <th>Basket</th>
156                 <th>Basket creator</th>
157                                 <th>Basket group</th>
158                 <th>Invoice number</th>
159                 <th class="anti-the">Summary</th>
160                                 <th>Vendor</th>
161                 <th class="title-string">Placed on</th>
162                 <th class="title-string">Received on</th>
163                 <th>Quantity received</th>
164                 <th>Pending order</th>
165                                 <th>Unit cost</th>
166                 <th>Fund</th>
167                         </tr>
168             </thead>
169             <tbody>
170             [% FOREACH order IN order_loop %]
171                 <tr>
172                     <td>
173                         [% order.ordernumber %]
174                         [% IF order.ordernumber != order.parent_ordernumber %]([% order.parent_ordernumber %])[% END %]
175                     </td>
176                     <td>
177                         [% SWITCH order.orderstatus %]
178                             [% CASE 'new' %]New
179                             [% CASE 'ordered' %]Pending
180                             [% CASE 'partial' %]Partially received
181                             [% CASE 'complete' %]Received
182                             [% CASE 'cancelled' %]Cancelled
183                         [% END %]
184                     </td>
185                     <td>[% order.basketname %] (<a href="basket.pl?basketno=[% order.basketno %]">[% order.basketno %]</a>)</td>
186                     <td>[% order.authorisedbyname %]</td>
187                     <td>
188                         [% IF ( order.basketgroupid ) %]
189                             [% order.groupname %] (<a href="basketgroup.pl?booksellerid=[% order.id %]">[% order.basketgroupid %]</a>)
190                         [% ELSE %]
191                             &nbsp;
192                         [% END %]
193                     </td>
194                     <td>[% IF ( order.invoicenumber ) %]
195                             <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% order.invoiceid %]">[% order.invoicenumber %]</a>
196                         [% ELSE %]
197                             &nbsp;
198                         [% END %]
199                     </td>
200                     <td>
201                         <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% order.biblionumber %]">[% order.title |html %]</a>
202                         <br />[% order.author %] <br /> [% order.isbn %]
203                     </td>
204                     <td><a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% order.id %]">[% order.name %]</a></td>
205                     <td><span title="[% order.creationdate %]">[% order.creationdate | $KohaDates %]</span></td>
206                     <td>
207                         [% IF order.datereceived %]
208                             <span title="[% order.datereceived %]">[% order.datereceived | $KohaDates %]</span>
209                         [% ELSE %]
210                             <span title="0000-00-00"></span>
211                         [% END %]
212                     </td>
213                     <td>[% order.quantityreceived %]</td>
214                     <td>[% order.quantity %]</td>
215                     <td>[% order.ecost %]</td>
216                     <td>[% order.budget_name %]</td>
217                 </tr>
218             [% END %]
219             </tbody>
220         </table>
221     </div>
222     [% ELSIF search_done %]
223       There is no order for this search.
224     [% END %]
225
226 </div>
227 </div>
228 <div class="yui-b">
229 [% INCLUDE 'acquisitions-menu.inc' %]
230 </div>
231 </div>
232 [% INCLUDE 'intranet-bottom.inc' %]