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