Bug 15184: Prepare the ground - Move order search filters
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / histsearch.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE KohaDates %]
4 [% USE ColumnsSettings %]
5 [% SET footerjs = 1 %]
6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>Koha &rsaquo; Acquisitions &rsaquo; [% IF ( order_loop ) %]Orders search &rsaquo; Search results[% ELSE %]Order search[% END %]</title>
8 [% Asset.css("css/datatables.css") | $raw %]
9 [% INCLUDE 'doc-head-close.inc' %]
10 </head>
11
12 <body id="acq_histsearch" class="acq">
13 [% INCLUDE 'header.inc' %]
14 [% INCLUDE 'acquisitions-search.inc' %]
15
16 <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>
17
18 <div class="main container-fluid">
19     <div class="row">
20         <div class="col-sm-10 col-sm-push-2">
21             <main>
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     [% INCLUDE 'filter-orders.inc' %]
27 </fieldset>
28     <input type="hidden" name="do_search" value="1" />
29         <fieldset class="action"><input type="submit" value="Search" /></fieldset>
30         </form>[% END %]
31     [% IF ( order_loop ) %]<h1>Search results</h1>
32         <div id="acqui_histsearch">
33         <table id="histsearcht">
34             <thead>
35                         <tr>
36                 <th>Order line (parent)</th>
37                 <th>Status</th>
38                                 <th>Basket</th>
39                 <th>Basket creator</th>
40                                 <th>Basket group</th>
41                 <th>Invoice number</th>
42                 <th class="anti-the">Summary</th>
43                                 <th>Vendor</th>
44                 <th class="title-string">Placed on</th>
45                 <th class="title-string">Received on</th>
46                 <th>Quantity received</th>
47                 <th>Pending order</th>
48                                 <th>Unit cost</th>
49                 <th>Fund</th>
50                         </tr>
51             </thead>
52             <tbody>
53             [% FOREACH order IN order_loop %]
54                 <tr>
55                     <td>
56                         [% order.ordernumber | html %]
57                         [% IF order.ordernumber != order.parent_ordernumber %]([% order.parent_ordernumber | html %])[% END %]
58                     </td>
59                     <td>
60                         [% SWITCH order.orderstatus %]
61                             [% CASE 'new' %]New
62                             [% CASE 'ordered' %]Ordered
63                             [% CASE 'partial' %]Partially received
64                             [% CASE 'complete' %]Received
65                             [% CASE 'cancelled' %]Cancelled
66                         [% END %]
67                     </td>
68                     <td>[% order.basketname | html %] (<a href="basket.pl?basketno=[% order.basketno | uri %]">[% order.basketno | html %]</a>)</td>
69                     <td>[% order.authorisedbyname | html %]</td>
70                     <td>
71                         [% IF ( order.basketgroupid ) %]
72                             [% order.groupname | html %] (<a href="basketgroup.pl?op=add&booksellerid=[% order.id | uri %]&basketgroupid=[% order.basketgroupid | uri %]">[% order.basketgroupid | html %]</a>)
73                         [% ELSE %]
74                             &nbsp;
75                         [% END %]
76                     </td>
77                     <td>[% IF ( order.invoicenumber ) %]
78                             <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% order.invoiceid | uri %]">[% order.invoicenumber | html %]</a>
79                         [% ELSE %]
80                             &nbsp;
81                         [% END %]
82                     </td>
83                     <td>
84                         <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% order.biblionumber | uri %]">[% order.title | html %]</a>
85                         <br />[% order.author | html %] <br /> [% order.isbn | html %]
86                     </td>
87                     <td><a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% order.id | uri %]">[% order.name | html %]</a></td>
88                     <td><span title="[% order.creationdate | html %]">[% order.creationdate | $KohaDates %]</span></td>
89                     <td>
90                         [% IF order.datereceived %]
91                             <span title="[% order.datereceived | html %]">[% order.datereceived | $KohaDates %]</span>
92                         [% ELSE %]
93                             <span title="0000-00-00"></span>
94                         [% END %]
95                     </td>
96                     <td>[% order.quantityreceived | html %]</td>
97                     <td>[% order.quantity | html %]</td>
98                     <td>[% order.ecost | html %]</td>
99                     <td>[% order.budget_name | html %]</td>
100                 </tr>
101             [% END %]
102             </tbody>
103         </table>
104     </div>
105     [% ELSIF search_done %]
106       There is no order for this search.
107     [% END %]
108
109 </main>
110 </div> <!-- /.col-sm-10.col-sm-push-2 -->
111
112 <div class="col-sm-2 col-sm-pull-10">
113     <aside>
114         [% INCLUDE 'acquisitions-menu.inc' %]
115     </aside>
116 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
117 </div>
118
119 [% MACRO jsinclude BLOCK %]
120     [% Asset.js("js/acquisitions-menu.js") | $raw %]
121 [% INCLUDE 'calendar.inc' %]
122     [% INCLUDE 'datatables.inc' %]
123     [% INCLUDE 'columns_settings.inc' %]
124     [% Asset.js("js/autocomplete/patrons.js") | $raw %]
125     <script>
126         var MSG_REMOVE_PATRON = _("Remove");
127         $(document).ready(function() {
128             var columns_settings = [% ColumnsSettings.GetColumns( 'acqui', 'histsearch', 'histsearcht', 'json' ) | $raw %];
129             KohaTable("histsearcht", {
130                 "aoColumnDefs": [
131                     { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
132                     { "sType": "title-string", "aTargets" : [ "title-string" ] }
133                 ],
134                 "sPaginationType": "four_button"
135             }, columns_settings );
136
137             [% UNLESS order_loop %]
138                 patron_autocomplete({
139                     patron_container: $("#basket_creators"),
140                     input_autocomplete: $("#find_patron"),
141                     patron_input_name: 'created_by',
142                     field_to_retrieve: 'borrowernumber'
143                 });
144             [% END %]
145         });
146     </script>
147 [% END %]
148
149 [% INCLUDE 'intranet-bottom.inc' %]