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