Bug 27982: Replace obsolete title-string sorting: Acquisitions templates part 1
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / histsearch.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE KohaDates %]
4 [% USE TablesSettings %]
5 [% USE Branches %]
6 [% SET footerjs = 1 %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>Koha &rsaquo; Acquisitions &rsaquo; [% IF ( order_loop ) %]Orders search &rsaquo; Search results[% ELSE %]Order search[% END %]</title>
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 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
17     <ol>
18         <li>
19             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
20         </li>
21         <li>
22             <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
23         </li>
24
25     [% IF ( order_loop ) %]
26     <li>
27         <a href="/cgi-bin/koha/acqui/histsearch.pl">Orders search</a>
28     </li>
29     <li>
30         <a href="#" aria-current="page">
31             Search results
32         </a>
33     </li>
34     [% ELSE %]
35     <li>
36         <a href="#" aria-current="page">
37             Order search
38         </a>
39     </li>
40     [% END %]
41     </ol>
42 </nav>
43
44 <div class="main container-fluid">
45     <div class="row">
46         <div class="col-sm-10 col-sm-push-2">
47             <main>
48                 [% IF !order_loop && search_done %]
49                     <div class="dialog message">
50                         Your search returned no results.
51                     </div>
52                 [% END %]
53
54                 [% UNLESS ( order_loop ) %]
55                     [% PROCESS filter_form context => "main" %]
56                 [% END %]
57
58
59     [% IF ( order_loop ) %]<h1>Search results</h1>
60         <div id="acqui_histsearch">
61         <table id="histsearcht">
62             <thead>
63                         <tr>
64                 <th>Order line (parent)</th>
65                 <th>Status</th>
66                                 <th>Basket</th>
67                 <th>Basket creator</th>
68                 <th>Basket group</th>
69                 <th>Managing library</th>
70                 <th>Invoice number</th>
71                 <th class="anti-the">Summary</th>
72                                 <th>Vendor</th>
73                 <th>Placed on</th>
74                 <th>Received on</th>
75                 <th>Quantity received</th>
76                 <th>Quantity ordered</th>
77                                 <th>Unit cost</th>
78                 <th>Fund</th>
79                         </tr>
80             </thead>
81             <tbody>
82             [% FOREACH order IN order_loop %]
83                 <tr>
84                     <td>
85                         [% order.ordernumber | html %]
86                         [% IF order.ordernumber != order.parent_ordernumber %]([% order.parent_ordernumber | html %])[% END %]
87                     </td>
88                     <td>
89                         [% SWITCH order.orderstatus %]
90                             [% CASE 'new' %]New
91                             [% CASE 'ordered' %]Ordered
92                             [% CASE 'partial' %]Partially received
93                             [% CASE 'complete' %]Received
94                             [% CASE 'cancelled' %]Cancelled
95                         [% END %]
96                         [% IF order.is_standing %](standing order)[% END %]
97                     </td>
98                     <td><a href="basket.pl?basketno=[% order.basketno | uri %]">[% order.basketname | html %] ([% order.basketno | html %])</a></td>
99                     <td>[% order.authorisedbyname | html %]</td>
100                     <td>
101                         [% IF ( order.basketgroupid ) %]
102                         <a href="basketgroup.pl?op=add&booksellerid=[% order.id | uri %]&basketgroupid=[% order.basketgroupid | uri %]">[% order.groupname | html %] ([% order.basketgroupid | html %])</a>
103                         [% ELSE %]
104                             &nbsp;
105                         [% END %]
106                     </td>
107                     <td>[% Branches.GetName(order.managing_library) | html %]</td>
108                     <td>[% IF ( order.invoicenumber ) %]
109                             <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% order.invoiceid | uri %]">[% order.invoicenumber | html %]</a>
110                         [% ELSE %]
111                             &nbsp;
112                         [% END %]
113                     </td>
114                     <td>
115                         <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% order.biblionumber | uri %]">[% order.title | html %]</a>
116                         <br />[% order.author | html %] <br /> [% order.isbn | html %]
117                     </td>
118                     <td><a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% order.id | uri %]">[% order.name | html %]</a></td>
119                     <td data-order="[% order.creationdate | html %]">[% order.creationdate | $KohaDates %]</td>
120                     <td data-order="[% order.datereceived | html %]">
121                         [% order.datereceived | $KohaDates %]
122                     </td>
123                     <td>[% order.quantityreceived | html %]</td>
124                     <td>[% order.quantity | html %]</td>
125                     <td>[% order.ecost | html %]</td>
126                     <td>[% order.budget_name | html %]</td>
127                 </tr>
128             [% END %]
129             </tbody>
130         </table>
131     </div>
132     [% END %]
133
134 </main>
135 </div> <!-- /.col-sm-10.col-sm-push-2 -->
136
137 <div class="col-sm-2 col-sm-pull-10">
138     <aside>
139         [% IF ( order_loop ) %]
140             [% PROCESS filter_form context => "sidebar" %]
141         [% END %]
142         [% INCLUDE 'acquisitions-menu.inc' %]
143     </aside>
144 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
145 </div>
146
147 [% MACRO jsinclude BLOCK %]
148     [% Asset.js("js/acquisitions-menu.js") | $raw %]
149 [% INCLUDE 'calendar.inc' %]
150     [% INCLUDE 'datatables.inc' %]
151     [% INCLUDE 'columns_settings.inc' %]
152     [% Asset.js("js/autocomplete/patrons.js") | $raw %]
153     <script>
154         var MSG_REMOVE_PATRON = _("Remove");
155         $(document).ready(function() {
156             var columns_settings = [% TablesSettings.GetColumns( 'acqui', 'histsearch', 'histsearcht', 'json' ) | $raw %];
157             KohaTable("histsearcht", {
158                 "sPaginationType": "full"
159             }, columns_settings );
160
161             patron_autocomplete({
162                 patron_container: $("#basket_creators"),
163                 input_autocomplete: $("#find_patron"),
164                 patron_input_name: 'created_by',
165                 field_to_retrieve: 'borrowernumber'
166             });
167         });
168     </script>
169 [% END %]
170
171 [% BLOCK filter_form %]
172     <form action="/cgi-bin/koha/acqui/histsearch.pl" method="post">
173         [% IF ( context == "sidebar" ) %]
174             <fieldset class="brief">
175                 <h4>Search orders</h4>
176         [% ELSE %]
177             <fieldset class="rows">
178                 <legend>Search orders</legend>
179         [% END %]
180             [% INCLUDE 'filter-orders.inc' %]
181             <input type="hidden" name="do_search" value="1" />
182             <fieldset class="action"><input type="submit" value="Search" /></fieldset>
183         </fieldset>
184     </form>
185 [% END %]
186
187 [% INCLUDE 'intranet-bottom.inc' %]