Bug 13618: Add html filters to all the variables
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / parcels.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE KohaDates %]
4 [% SET footerjs = 1 %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha &rsaquo; Acquisitions &rsaquo; Receive shipment from vendor [% name | html %]</title>
7 [% Asset.css("css/datatables.css") | $raw %]
8 [% INCLUDE 'doc-head-close.inc' %]
9 </head>
10
11 <body id="acq_parcels" 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; <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | html %]">[% name | html %]</a> &rsaquo; Receive shipment from vendor [% name | html %]</div>
16
17 [% IF ( count ) %]<div id="doc3" class="yui-t2">[% ELSE %]<div id="doc" class="yui-t7">[% END %]
18    
19    <div id="bd">
20         <div id="yui-main">
21         <div class="yui-b">
22
23 [% IF ( error_failed_to_create_invoice ) %]
24     <div id="error" class="dialog alert">
25         <p>An error has occurred. Invoice cannot be created.</p>
26     </div>
27 [% END %]
28 <h1>Receive shipment from vendor <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | html %]">[% name | html %]</a></h1>
29
30     [% IF duplicate_invoices %]
31     <div id="parcels_duplicate_invoice" class="dialog alert">
32         <p>This invoice number has already been used. Would you like to receive on an existing invoice?</p>
33         <table>
34             <thead><tr><th>Invoice no.</th><th>Shipment date</th><th></th></tr></thead>
35             <tbody>
36                 [% FOREACH invoice IN duplicate_invoices %]
37                     <tr>
38                         <td>[% invoice.invoicenumber | html %]</td>
39                         <td>[% invoice.shipmentdate | $KohaDates %]</td>
40                         <td><a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoice.invoiceid | html %]">Receive</a></td>
41                     </tr>
42                 [% END %]
43             </tbody>
44         </table>
45         <form method="get" action="parcels.pl">
46             <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
47             <input type="hidden" name="op" value="confirm" />
48             <input type="hidden" name="invoice" value="[% invoicenumber | html %]" />
49             <input type="hidden" name="shipmentdate" value="[% shipmentdate | $KohaDates %]" />
50             <input type="hidden" name="shipmentcost" value="[% shipmentcost | html %]" />
51             <input type="hidden" name="shipmentcost_budgetid" value="[% shipmentcost_budgetid | html %]" />
52             <input type="submit" class="button" value="Create new invoice anyway" />
53         </form>
54     </div>
55     [% END %]
56
57
58 [% IF ( count ) %]
59 <p> [% count | html %] shipments</p>
60 <div id="resultlist">
61 <!-- Search Results Table -->
62
63 <table class="small" id="parcelst">
64     <thead>
65         <tr>
66             <th>Line</th>
67             <th class="title-string">Date received</th>
68             <th>Invoice number</th>
69             <th>Item count</th>
70             <th>Biblio count</th>
71             <th>Items expected</th>
72         </tr>
73     </thead>
74     <tbody>
75     <!-- Actual Search Results -->
76     [% FOREACH searchresult IN searchresults %]
77         <tr>
78             <td>
79                 [% searchresult.number | html %]
80             </td>
81             <td>
82                 <span title="[% searchresult.datereceived | html %]">[% searchresult.datereceived | $KohaDates %]</span>
83             </td>
84             <td>
85                 [% IF ( searchresult.code ) %]
86                     <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% searchresult.invoiceid | html %]">[% searchresult.code | html %]</a>
87                 [% ELSE %]
88                     <abbr title="not available">n/a</abbr>
89                 [% END %]
90             </td>
91             <td>
92                 [% searchresult.reccount | html %]
93             </td>
94             <td>
95                 [% searchresult.bibcount | html %]
96             </td>
97             <td>
98                 [% searchresult.itemcount | html %]
99             </td>
100         </tr>
101     [% END %]
102     </tbody>
103 </table>
104
105 <div id="resultnumber">
106 <!-- Row of numbers corresponding to search result pages -->
107 [% IF ( displayprev ) %]
108     <a href="parcels.pl?booksellerid=[% booksellerid | html %]&amp;startfrom=[% prevstartfrom | html %][% IF ( datefrom ) %]&amp;datefrom=[% datefrom | html %][% END %][% IF ( dateto ) %]&amp;dateto=[% dateto | html %][% END %][% IF ( code ) %]&amp;filter=[% code | html %][% END %][% IF ( orderby ) %]&amp;orderby=[% orderby | html %][% END %][% IF ( resultsperpage ) %]&amp;resultsperpage=[% resultsperpage | html %][% END %]&amp;type=intra">&lt;&lt; Previous</a>
109 [% END %]
110 [% FOREACH number IN numbers %]
111     [% IF ( number.highlight ) %]
112     <span class="current">[% number.number | html %]</span>
113     [% ELSE %]
114     <a href="parcels.pl?booksellerid=[% booksellerid | html %]&amp;startfrom=[% number.startfrom | html %][% IF ( number.datefrom ) %]&amp;datefrom=[% number.datefrom | html %][% END %][% IF ( number.dateto ) %]&amp;dateto=[% number.dateto | html %][% END %][% IF ( number.code ) %]&amp;filter=[% number.code | html %][% END %][% IF ( number.orderby ) %]&amp;orderby=[% number.orderby | html %][% END %][% IF ( number.resultsperpage ) %]&amp;resultsperpage=[% number.resultsperpage | html %][% END %]&amp;type=intra">[% number.number | html %]</a>
115     [% END %]
116 [% END %]
117 [% IF ( displaynext ) %]
118     <a href="parcels.pl?booksellerid=[% booksellerid | html %]&amp;startfrom=[% nextstartfrom | html %][% IF ( datefrom ) %]&amp;datefrom=[% datefrom | html %][% END %][% IF ( dateto ) %]&amp;dateto=[% dateto | html %][% END %][% IF ( code ) %]&amp;filter=[% code | html %][% END %][% IF ( orderby ) %]&amp;orderby=[% orderby | html %][% END %][% IF ( resultsperpage ) %]&amp;resultsperpage=[% resultsperpage | html %][% END %]&amp;type=intra">Next &gt;&gt;</a>
119 [% END %]
120 </div>
121 </div>
122 [% END %]
123
124     <div id="parcels_new_parcel">
125         <form method="get" action="parcels.pl" class="validated">
126     <fieldset class="rows">
127     <legend>Receive a new shipment</legend>
128        <ol> <li>
129             <label for="invoice" class="required">Vendor invoice:</label>
130             <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
131             <input type="hidden" name="op" value="new" />
132             <input type="text" size="20" id="invoice" name="invoice" class="focus required" required="required" />
133         </li>
134                 [% IF ( gst ) %]
135         <li>
136             <label for="gst">GST:</label>
137             <input type="text" size="20" id="gst" name="gst" />
138         </li>
139                 [% END %]
140       <!--  // Removing freight input until shipping can be proplerly handled .
141           <li>
142             <label for="freight">Shipping:</label>
143             <input type="text" size="20" id="freight" name="freight" />
144         </li> -->
145          <li>
146             <label for="shipmentdate">Shipment date: </label>
147             <input type="text" id="shipmentdate" name="shipmentdate" maxlength="10" size="10" value="[% shipmentdate_today | $KohaDates %]" class="datepicker" />
148             <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
149         </li>
150         <li>
151             <label for="shipmentcost">Shipping cost: </label>
152             <input type="text" id="shipmentcost" name="shipmentcost" size="10" />
153         </li>
154         <li>
155             <label for="shipmentcost_budgetid">Shipping fund: </label>
156             <select id="shipmentcost_budgetid" name="shipmentcost_budgetid">
157                 <option value="">No fund</option>
158                 [% FOREACH budget IN budgets %]
159                     [% IF ( budget.b_active ) %]
160                         <option value="[% budget.b_id | html %]">[% budget.b_txt | html %]</option>
161                     [% ELSE %]
162                         <option value="[% budget.b_id | html %]" class="b_inactive">[% budget.b_txt | html %] (inactive)</option>
163                     [% END %]
164                 [% END %]
165             </select>
166             <label for="showallfunds" style="float:none;width:auto;">&nbsp;Show inactive:</label>
167             <input type="checkbox" id="showallfunds" />
168
169         </li>
170                 </ol>
171     </fieldset>
172             <fieldset class="action"><input type="submit" class="button" value="Next" /> <a class="cancel" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | html %]">Cancel</a></fieldset>
173         </form>
174     </div>
175 </div>
176 </div>
177 <div class="yui-b">
178 [% IF ( count ) %]<form method="get" action="parcels.pl">
179     <fieldset class="brief">
180         <h4>Filter</h4>
181         <ol>
182             <li> <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" /></li>
183             <li><label for="filter">Invoice number:</label><input type="text" size="20" name="filter" value="[% filter | html %]" id="filter" /></li>
184             <li><label for="datefrom">From:</label><input type="text" size="9" id="datefrom" name="datefrom" value="[% datefrom | html %]" class="datepicker" /><br />
185                 <label for="dateto">To:</label><input type="text" size="9" id="dateto" name="dateto" value="[% dateto | html %]" class="datepicker" /></li>
186             <li><label for="orderby">Sort by :</label><select name="orderby" id="orderby">
187                 <option value="invoicenumber">Invoice number</option>
188                 <option value="shipmentdate">Shipment date</option>
189                 <option value="shipmentdate desc">Shipment date reverse</option>
190                 <option value="invoicenumber desc">Invoice number reverse</option>
191                 </select><br />
192                 <label for="resultsperpage">Results per page :</label><select name="resultsperpage" id="resultsperpage">
193                 <option value="20">20</option>
194                 <option value="30">30</option>
195                 <option value="50">50</option>
196                 <option value="100">100</option>
197                 </select></li>
198         </ol>
199         <fieldset class="action"><input type="submit" class="button" value="Filter" /> <a href="/cgi-bin/koha/acqui/parcels.pl?booksellerid=[% booksellerid | html %]">Clear</a></fieldset>
200         </fieldset>
201 </form>[% END %]
202 </div>
203 </div>
204
205 [% MACRO jsinclude BLOCK %]
206     [% Asset.js("js/acquisitions-menu.js") | $raw %]
207     [% INCLUDE 'calendar.inc' %]
208     [% INCLUDE 'datatables.inc' %]
209     <script type="text/javascript">
210         $(document).ready(function() {
211             var parcelst = $("#parcelst").dataTable($.extend(true, {}, dataTablesDefaults, {
212                 "aoColumnDefs": [
213                   { "sType": "title-string", "aTargets" : [ "title-string" ] }
214                 ],
215                 'bPaginate': false,
216             }));
217
218             //keep a copy of all budgets before removing the inactives
219             var budgetId = $("#shipmentcost_budgetid");
220             var disabledBudgetsCopy = budgetId.html();
221             $('.b_inactive').remove();
222
223             $('#showallfunds').click(function() {
224                 if ($(this).is(":checked")) {
225                     budgetId.html(disabledBudgetsCopy); //Puts back all the funds
226                 }
227                 else {
228                     $('.b_inactive').remove();
229                 }
230             });
231         });
232     </script>
233 [% END %]
234
235 [% INCLUDE 'intranet-bottom.inc' %]