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