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