Bug 33001: (follow-up) Add spans for translatability
[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>[% IF ( order_loop ) %]Orders search &rsaquo; Search results[% ELSE %]Order search[% END %] &rsaquo; Acquisitions &rsaquo; Koha</title>
9 [% INCLUDE 'doc-head-close.inc' %]
10 </head>
11
12 <body id="acq_histsearch" class="acq">
13 [% WRAPPER 'header.inc' %]
14     [% INCLUDE 'acquisitions-search.inc' %]
15 [% END %]
16
17 [% WRAPPER 'sub-header.inc' %]
18     [% WRAPPER breadcrumbs %]
19         [% WRAPPER breadcrumb_item %]
20             <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
21         [% END %]
22         [% IF ( order_loop ) %]
23             [% WRAPPER breadcrumb_item %]
24                 <a href="/cgi-bin/koha/acqui/histsearch.pl">Orders search</a>
25             [% END %]
26             [% WRAPPER breadcrumb_item bc_active= 1 %]
27                 <span>Search results</span>
28             [% END %]
29         [% ELSE %]
30             [% WRAPPER breadcrumb_item bc_active= 1 %]
31                 <span>Order search</span>
32             [% END %]
33         [% END %]
34     [% END #/ WRAPPER breadcrumbs %]
35 [% END #/ WRAPPER sub-header.inc %]
36
37 <div class="main container-fluid">
38     <div class="row">
39         <div class="col-sm-10 col-sm-push-2">
40             <main>
41
42                 <h1>Order search</h1>
43
44                 [% IF !order_loop && search_done %]
45                     <div class="dialog message">
46                         Your search returned no results.
47                     </div>
48                 [% END %]
49
50                 [% UNLESS ( order_loop ) %]
51                     [% PROCESS filter_form context => "main" %]
52                 [% END %]
53
54
55     [% IF ( order_loop ) %]
56     <div id="acqui_histsearch" class="page-section">
57         <h2>Search results</h2>
58         <table id="histsearcht">
59             <thead>
60                         <tr>
61                 <th>Order line (parent)</th>
62                 <th>Status</th>
63                                 <th>Basket</th>
64                 <th>Basket creator</th>
65                 <th>Basket group</th>
66                 <th>Managing library</th>
67                 <th>Invoice number</th>
68                 <th class="anti-the">Summary</th>
69                                 <th>Vendor</th>
70                 <th>Placed on</th>
71                 <th>Received on</th>
72                 <th>Quantity received</th>
73                 <th>Quantity ordered</th>
74                                 <th>Unit cost</th>
75                 <th>Fund</th>
76                 <th>Internal note</th>
77                 <th>Vendor note</th>
78                         </tr>
79             </thead>
80             <tbody>
81             [% FOREACH order IN order_loop %]
82                 <tr>
83                     <td>
84                         [% order.ordernumber | html %]
85                         [% IF order.ordernumber != order.parent_ordernumber %]([% order.parent_ordernumber | html %])[% END %]
86                     </td>
87                     <td>
88                         [% SWITCH order.orderstatus %]
89                             [% CASE 'new' %]<span>New</span>
90                             [% CASE 'ordered' %]<span>Ordered</span>
91                             [% CASE 'partial' %]<span>Partially received</span>
92                             [% CASE 'complete' %]<span>Received</span>
93                             [% CASE 'cancelled' %]<span>Cancelled</span>
94                         [% END %]
95                         [% IF order.is_standing %](standing order)[% END %]
96                     </td>
97                     <td><a href="basket.pl?basketno=[% order.basketno | uri %]">[% order.basketname | html %] ([% order.basketno | html %])</a></td>
98                     <td>[% order.authorisedbyname | html %]</td>
99                     <td>
100                         [% IF ( order.basketgroupid ) %]
101                         <a href="basketgroup.pl?op=add&booksellerid=[% order.id | uri %]&basketgroupid=[% order.basketgroupid | uri %]">[% order.groupname | html %] ([% order.basketgroupid | html %])</a>
102                         [% ELSE %]
103                             &nbsp;
104                         [% END %]
105                     </td>
106                     <td>[% Branches.GetName(order.managing_library) | html %]</td>
107                     <td>[% IF ( order.invoicenumber ) %]
108                             <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% order.invoiceid | uri %]">[% order.invoicenumber | html %]</a>
109                         [% ELSE %]
110                             &nbsp;
111                         [% END %]
112                     </td>
113                     <td>
114                         <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% order.biblionumber | uri %]">[% order.title | html %]</a>
115                         <br />[% order.author | html %] <br /> [% order.isbn | html %]
116                     </td>
117                     <td><a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% order.id | uri %]">[% order.name | html %]</a></td>
118                     <td data-order="[% order.creationdate | html %]">[% order.creationdate | $KohaDates %]</td>
119                     <td data-order="[% order.datereceived | html %]">
120                         [% order.datereceived | $KohaDates %]
121                     </td>
122                     <td>[% order.quantityreceived | html %]</td>
123                     <td>[% order.quantity | html %]</td>
124                     <td>[% order.ecost | html %]</td>
125                     <td>[% order.budget_name | html %]</td>
126                     <td>[% order.order_internalnote | html %]</td>
127                     <td>[% order.order_vendornote | html %]</td>
128                 </tr>
129             [% END %]
130             </tbody>
131         </table>
132     </div>
133     [% END %]
134
135 </main>
136 </div> <!-- /.col-sm-10.col-sm-push-2 -->
137
138 <div class="col-sm-2 col-sm-pull-10">
139     <aside>
140         [% IF ( order_loop ) %]
141             [% PROCESS filter_form context => "sidebar" %]
142         [% END %]
143         [% INCLUDE 'acquisitions-menu.inc' %]
144     </aside>
145 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
146 </div>
147
148 [% MACRO jsinclude BLOCK %]
149     [% Asset.js("js/acquisitions-menu.js") | $raw %]
150 [% INCLUDE 'calendar.inc' %]
151     [% INCLUDE 'datatables.inc' %]
152     [% INCLUDE 'columns_settings.inc' %]
153     <script>
154         var MSG_REMOVE_PATRON = _("Remove");
155         $(document).ready(function() {
156             var table_settings = [% TablesSettings.GetTableSettings( 'acqui', 'histsearch', 'histsearcht', 'json' ) | $raw %];
157             KohaTable("histsearcht", {
158                 "sPaginationType": "full"
159             }, table_settings );
160
161             function AddPatron( patron_name, value, container, input_name ) {
162                 div = "<div id='borrower_" + value + "'>" + patron_name + " ( <a href='#' class='removePatron'><i class='fa fa-trash' aria-hidden='true'></i> " + MSG_REMOVE_PATRON + " </a> ) <input type='hidden' name='" + input_name + "' value='" + value + "' /></div>";
163                 $(container).append( div );
164
165                 $(container).parent().show( 800 );
166             }
167             function RemovePatron( cardnumber, container ) {
168                 $( '#borrower_' + cardnumber ).remove();
169
170                 if ( ! $(container).html() ) {
171                     $(container).parent("fieldset").hide( 800 );
172                 }
173             }
174             patron_autocomplete($("#find_patron"), {
175                 'on-select-callback': function( event, ui ) {
176                     var field = ui.item.borrowernumber;
177                     AddPatron( ui.item.firstname + " " + ( ui.item.middle_name || "" ) + " " + ui.item.surname, field, $("#basket_creators"), 'created_by' );
178                     $("#find_patron").val('').focus();
179                     return false;
180                 }
181             });
182             $("body").on("click",".removePatron",function(e){
183                 e.preventDefault();
184                 var divid = $(this).parent().attr("id");
185                 var cardnumber = divid.replace("borrower_","");
186                 RemovePatron(cardnumber, $("#basket_creators"));
187             });
188
189         });
190     </script>
191 [% END %]
192
193 [% BLOCK filter_form %]
194     <form action="/cgi-bin/koha/acqui/histsearch.pl" method="post">
195         [% IF ( context == "sidebar" ) %]
196             <fieldset class="brief">
197                 <h4>Search orders</h4>
198         [% ELSE %]
199             <fieldset class="rows">
200                 <legend>Search orders</legend>
201         [% END %]
202             [% INCLUDE 'filter-orders.inc' %]
203             <input type="hidden" name="do_search" value="1" />
204         </fieldset>
205         <fieldset class="action">
206             <input type="submit" class="btn btn-primary" value="Search" />
207         </fieldset>
208     </form>
209 [% END %]
210
211 [% INCLUDE 'intranet-bottom.inc' %]