Bug 23013: Upgrade DataTables in the staff client
[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 [% 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                 [% IF !order_loop && search_done %]
22                     <div class="dialog message">
23                         Your search returned no results.
24                     </div>
25                 [% END %]
26
27                 [% UNLESS ( order_loop ) %]
28                     [% PROCESS filter_form context => "main" %]
29                 [% END %]
30
31
32     [% IF ( order_loop ) %]<h1>Search results</h1>
33         <div id="acqui_histsearch">
34         <table id="histsearcht">
35             <thead>
36                         <tr>
37                 <th>Order line (parent)</th>
38                 <th>Status</th>
39                                 <th>Basket</th>
40                 <th>Basket creator</th>
41                                 <th>Basket group</th>
42                 <th>Invoice number</th>
43                 <th class="anti-the">Summary</th>
44                                 <th>Vendor</th>
45                 <th class="title-string">Placed on</th>
46                 <th class="title-string">Received on</th>
47                 <th>Quantity received</th>
48                 <th>Pending order</th>
49                                 <th>Unit cost</th>
50                 <th>Fund</th>
51                         </tr>
52             </thead>
53             <tbody>
54             [% FOREACH order IN order_loop %]
55                 <tr>
56                     <td>
57                         [% order.ordernumber | html %]
58                         [% IF order.ordernumber != order.parent_ordernumber %]([% order.parent_ordernumber | html %])[% END %]
59                     </td>
60                     <td>
61                         [% SWITCH order.orderstatus %]
62                             [% CASE 'new' %]New
63                             [% CASE 'ordered' %]Ordered
64                             [% CASE 'partial' %]Partially received
65                             [% CASE 'complete' %]Received
66                             [% CASE 'cancelled' %]Cancelled
67                         [% END %]
68                     </td>
69                     <td><a href="basket.pl?basketno=[% order.basketno | uri %]">[% order.basketname | html %] ([% order.basketno | html %])</a></td>
70                     <td>[% order.authorisedbyname | html %]</td>
71                     <td>
72                         [% IF ( order.basketgroupid ) %]
73                         <a href="basketgroup.pl?op=add&booksellerid=[% order.id | uri %]&basketgroupid=[% order.basketgroupid | uri %]">[% order.groupname | html %] ([% order.basketgroupid | html %])</a>
74                         [% ELSE %]
75                             &nbsp;
76                         [% END %]
77                     </td>
78                     <td>[% IF ( order.invoicenumber ) %]
79                             <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% order.invoiceid | uri %]">[% order.invoicenumber | html %]</a>
80                         [% ELSE %]
81                             &nbsp;
82                         [% END %]
83                     </td>
84                     <td>
85                         <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% order.biblionumber | uri %]">[% order.title | html %]</a>
86                         <br />[% order.author | html %] <br /> [% order.isbn | html %]
87                     </td>
88                     <td><a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% order.id | uri %]">[% order.name | html %]</a></td>
89                     <td><span title="[% order.creationdate | html %]">[% order.creationdate | $KohaDates %]</span></td>
90                     <td>
91                         [% IF order.datereceived %]
92                             <span title="[% order.datereceived | html %]">[% order.datereceived | $KohaDates %]</span>
93                         [% ELSE %]
94                             <span title="0000-00-00"></span>
95                         [% END %]
96                     </td>
97                     <td>[% order.quantityreceived | html %]</td>
98                     <td>[% order.quantity | html %]</td>
99                     <td>[% order.ecost | html %]</td>
100                     <td>[% order.budget_name | html %]</td>
101                 </tr>
102             [% END %]
103             </tbody>
104         </table>
105     </div>
106     [% END %]
107
108 </main>
109 </div> <!-- /.col-sm-10.col-sm-push-2 -->
110
111 <div class="col-sm-2 col-sm-pull-10">
112     <aside>
113         [% IF ( order_loop ) %]
114             [% PROCESS filter_form context => "sidebar" %]
115         [% END %]
116         [% INCLUDE 'acquisitions-menu.inc' %]
117     </aside>
118 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
119 </div>
120
121 [% MACRO jsinclude BLOCK %]
122     [% Asset.js("js/acquisitions-menu.js") | $raw %]
123 [% INCLUDE 'calendar.inc' %]
124     [% INCLUDE 'datatables.inc' %]
125     [% INCLUDE 'columns_settings.inc' %]
126     [% Asset.js("js/autocomplete/patrons.js") | $raw %]
127     <script>
128         var MSG_REMOVE_PATRON = _("Remove");
129         $(document).ready(function() {
130             var columns_settings = [% ColumnsSettings.GetColumns( 'acqui', 'histsearch', 'histsearcht', 'json' ) | $raw %];
131             KohaTable("histsearcht", {
132                 "aoColumnDefs": [
133                     { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
134                     { "sType": "title-string", "aTargets" : [ "title-string" ] }
135                 ],
136                 "sPaginationType": "full"
137             }, columns_settings );
138
139             patron_autocomplete({
140                 patron_container: $("#basket_creators"),
141                 input_autocomplete: $("#find_patron"),
142                 patron_input_name: 'created_by',
143                 field_to_retrieve: 'borrowernumber'
144             });
145         });
146     </script>
147 [% END %]
148
149 [% BLOCK filter_form %]
150     <form action="/cgi-bin/koha/acqui/histsearch.pl" method="post">
151         [% IF ( context == "sidebar" ) %]
152             <fieldset class="brief">
153                 <h4>Search orders</h4>
154         [% ELSE %]
155             <fieldset class="rows">
156                 <legend>Search orders</legend>
157         [% END %]
158             [% INCLUDE 'filter-orders.inc' %]
159         </fieldset>
160         <input type="hidden" name="do_search" value="1" />
161         <fieldset class="action"><input type="submit" value="Search" /></fieldset>
162     </form>
163 [% END %]
164
165 [% INCLUDE 'intranet-bottom.inc' %]