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