dcd1f5d48c
Here we go, next step then. As we did not fix the performance issue when autofiltering the variables (see bug 20975), the only solution we have is to add the filters explicitely. This patch has been autogenerated (using add_html_filters.pl, see next pathces) and add the html filter to all the variables displayed in the template. Exceptions are made (using the new 'raw' TT filter) to the variable we already listed in the previous versions of this patch. To test: - Use t/db_dependent/Koha/Patrons.t to populate your DB with autogenerated data which contain <script> tags - Remove them from borrower_debarments.comments (there are allowed here) update borrower_debarments set comment="html tags possible here"; - From the interface hit page and try to catch alert box. If you find one it means you find a possible XSS. To know where it comes from: * note the exact URL where you found it * note the alert box content * Dump your DB and search for the string in the dump to identify its location (for instance table.field) Next: * Ideally we would like to use the raw filter when it is not necessary to HTML escape the variables (in big loop for instance) * Provide a QA script to catch missing filters (we want html, uri, url or raw, certainly others that I am forgetting now) * Replace the html filters with uri when needed (!) Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
273 lines
12 KiB
Text
273 lines
12 KiB
Text
[% USE raw %]
|
|
[% USE Asset %]
|
|
[% USE KohaDates %]
|
|
[% USE ColumnsSettings %]
|
|
[% SET footerjs = 1 %]
|
|
[% INCLUDE 'doc-head-open.inc' %]
|
|
<title>Koha › Acquisitions › [% IF ( order_loop ) %]Orders search › Search results[% ELSE %]Order search[% END %]</title>
|
|
[% Asset.css("css/datatables.css") | $raw %]
|
|
[% INCLUDE 'doc-head-close.inc' %]
|
|
[% INCLUDE 'calendar.inc' %]
|
|
[% INCLUDE 'datatables.inc' %]
|
|
[% INCLUDE 'columns_settings.inc' %]
|
|
|
|
<script type="text/javascript" src="[% interface | html %]/js/autocomplete/patrons.js"></script>
|
|
<script type="text/javascript">
|
|
//<![CDATA[
|
|
var MSG_REMOVE_PATRON = _("Remove");
|
|
$(document).ready(function() {
|
|
var columns_settings = [% ColumnsSettings.GetColumns( 'acqui', 'histsearch', 'histsearcht', 'json' ) | $raw %];
|
|
KohaTable("#histsearcht", {
|
|
"aoColumnDefs": [
|
|
{ "sType": "anti-the", "aTargets" : [ "anti-the" ] },
|
|
{ "sType": "title-string", "aTargets" : [ "title-string" ] }
|
|
],
|
|
"sPaginationType": "four_button"
|
|
}, columns_settings );
|
|
|
|
[% UNLESS order_loop %]
|
|
patron_autocomplete({
|
|
patron_container: $("#basket_creators"),
|
|
input_autocomplete: $("#find_patron"),
|
|
patron_input_name: 'created_by',
|
|
field_to_retrieve: 'borrowernumber'
|
|
});
|
|
[% END %]
|
|
});
|
|
|
|
//]]>
|
|
</script>
|
|
</head>
|
|
|
|
<body id="acq_histsearch" class="acq">
|
|
[% INCLUDE 'header.inc' %]
|
|
[% INCLUDE 'acquisitions-search.inc' %]
|
|
|
|
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> › [% IF ( order_loop ) %]<a href="/cgi-bin/koha/acqui/histsearch.pl">Orders search</a> › Search results[% ELSE %]Order search[% END %]</div>
|
|
|
|
<div class="main container-fluid">
|
|
<div class="row">
|
|
<div class="col-sm-10 col-sm-push-2">
|
|
<main>
|
|
|
|
[% UNLESS ( order_loop ) %]<form action="/cgi-bin/koha/acqui/histsearch.pl" method="post">
|
|
<fieldset class="rows">
|
|
<legend>Search orders</legend>
|
|
<ol>
|
|
<li><label for="title">Title: </label> <input type="text" name="title" id="title" value="[% title | html %]" /></li>
|
|
<li><label for="author">Author: </label> <input type="text" name="author" id="author" value="[% author | html %]" /></li>
|
|
<li><label for="isbn">ISBN: </label> <input type="text" name="isbn" id="isbn" value="[% isbn | html %]" /></li>
|
|
[% IF (UNIMARC) %]
|
|
<li><label for="ean">EAN: </label> <input type="text" name="ean" id="ean" value="[% ean | html %]" /></li>
|
|
[% END %]
|
|
<li><label for="name">Vendor: </label> <input type="text" name="name" id="name" value="[% name | html %]" /></li>
|
|
<li><label for="basket">Basket: </label> <input type="text" name="basket" id="basket" value="[% basket | html %]" /></li>
|
|
<li><label for="basket_creators">Basket created by: </label>
|
|
<input autocomplete="off" id="find_patron" type="text" style="width:150px" class="noEnterSubmit" />
|
|
<div>
|
|
<div id="basket_creators" style="float:left;"></div>
|
|
</div>
|
|
</li>
|
|
<li><label for="booksellerinvoicenumber ">Bookseller invoice no: </label> <input type="text" name="booksellerinvoicenumber" id="booksellerinvoicenumber" value="[% booksellerinvoicenumber | html %]" /></li>
|
|
<li>
|
|
<label for="basketgroupname">Basket group:</label>
|
|
<input type="text" name="basketgroupname" id="basketgroupname" value="[% basketgroupname | html %]" />
|
|
</li>
|
|
<li>
|
|
<label for="ordernumber">Order line:</label>
|
|
<input type="text" name="ordernumber" id="ordernumber" value="[% ordernumber | html %]" />
|
|
[% IF search_children_too %]
|
|
<input type="checkbox" name="search_children_too" id="search_children_too" value="1" checked="checked" />
|
|
[% ELSE %]
|
|
<input type="checkbox" name="search_children_too" id="search_children_too" value="1" />
|
|
[% END %]
|
|
<label class="yesno" for="search_children_too">Display children too.</label>
|
|
</li>
|
|
|
|
<li>
|
|
<label for="orderstatus">Order status: </label>
|
|
<select name="orderstatus" id="orderstatus">
|
|
[% IF orderstatus == "" %]
|
|
<option value="">Any status except cancelled</option>
|
|
[% ELSE %]
|
|
<option value="" selected="selected"></option>
|
|
[% END %]
|
|
[% IF orderstatus == "new" %]
|
|
<option value="new" selected="selected">New</option>
|
|
[% ELSE %]
|
|
<option value="new">New</option>
|
|
[% END %]
|
|
[% IF orderstatus == "ordered" %]
|
|
<option value="ordered" selected="selected">Ordered</option>
|
|
[% ELSE %]
|
|
<option value="ordered">Ordered</option>
|
|
[% END %]
|
|
[% IF orderstatus == "partial" %]
|
|
<option value="partial" selected="selected">Partially received</option>
|
|
[% ELSE %]
|
|
<option value="partial">Partially received</option>
|
|
[% END %]
|
|
[% IF orderstatus == "complete" %]
|
|
<option value="complete" selected="selected">Received</option>
|
|
[% ELSE %]
|
|
<option value="complete">Received</option>
|
|
[% END %]
|
|
[% IF orderstatus == "cancelled" %]
|
|
<option value="cancelled" selected="selected">Cancelled</option>
|
|
[% ELSE %]
|
|
<option value="cancelled">Cancelled</option>
|
|
[% END %]
|
|
</select>
|
|
</li>
|
|
<li>
|
|
<label for="fund">Fund: </label>
|
|
<select name="budget" id="fund">
|
|
<option value="">All funds</option>
|
|
[% FOREACH bp_loo IN bp_loop %]
|
|
<optgroup label="[% bp_loo.budget_period_description | html %]">
|
|
[% FOREACH h_loo IN bp_loo.hierarchy %]
|
|
[% IF h_loo.budget_id == budget_id %]
|
|
<option type="text" value="[% h_loo.budget_id | html %]" branchcode="[% h_loo.budget_branchcode | html %]" selected="selected">
|
|
[% ELSE %]
|
|
<option type="text" value="[% h_loo.budget_id | html %]" branchcode="[% h_loo.budget_branchcode | html %]">
|
|
[% END %]
|
|
[% h_loo.budget_display_name | html %]
|
|
</option>
|
|
[% END %]
|
|
</optgroup>
|
|
[% END %]
|
|
</select>
|
|
</li>
|
|
|
|
<li><label for="from">From: </label>
|
|
<input type="text" size="10" id="from" name="from" value="[% from_placed_on | $KohaDates %]" class="datepickerfrom" />
|
|
<div class="hint">[% INCLUDE 'date-format.inc' %]</div>
|
|
</li>
|
|
<li><label for="to">To: </label>
|
|
<input type="text" size="10" id="to" name="to" value="[% to_placed_on | $KohaDates %]" class="datepickerto" />
|
|
<div class="hint">[% INCLUDE 'date-format.inc' %]</div>
|
|
</li>
|
|
</ol>
|
|
</fieldset>
|
|
<input type="hidden" name="do_search" value="1" />
|
|
<fieldset class="action"><input type="submit" value="Search" /></fieldset>
|
|
</form>[% END %]
|
|
[% IF ( order_loop ) %]<h1>Search results</h1>
|
|
<div id="acqui_histsearch">
|
|
<table id="histsearcht">
|
|
<thead>
|
|
<tr>
|
|
<th>Order line (parent)</th>
|
|
<th>Status</th>
|
|
<th>Basket</th>
|
|
<th>Basket creator</th>
|
|
<th>Basket group</th>
|
|
<th>Invoice number</th>
|
|
<th class="anti-the">Summary</th>
|
|
<th>Vendor</th>
|
|
<th class="title-string">Placed on</th>
|
|
<th class="title-string">Received on</th>
|
|
<th>Quantity received</th>
|
|
<th>Pending order</th>
|
|
<th>Unit cost</th>
|
|
<th>Fund</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
[% FOREACH order IN order_loop %]
|
|
<tr>
|
|
<td>
|
|
[% order.ordernumber | html %]
|
|
[% IF order.ordernumber != order.parent_ordernumber %]([% order.parent_ordernumber | html %])[% END %]
|
|
</td>
|
|
<td>
|
|
[% SWITCH order.orderstatus %]
|
|
[% CASE 'new' %]New
|
|
[% CASE 'ordered' %]Ordered
|
|
[% CASE 'partial' %]Partially received
|
|
[% CASE 'complete' %]Received
|
|
[% CASE 'cancelled' %]Cancelled
|
|
[% END %]
|
|
</td>
|
|
<td>[% order.basketname | html %] (<a href="basket.pl?basketno=[% order.basketno | html %]">[% order.basketno | html %]</a>)</td>
|
|
<td>[% order.authorisedbyname | html %]</td>
|
|
<td>
|
|
[% IF ( order.basketgroupid ) %]
|
|
[% order.groupname | html %] (<a href="basketgroup.pl?op=add&booksellerid=[% order.id | html %]&basketgroupid=[% order.basketgroupid | html %]">[% order.basketgroupid | html %]</a>)
|
|
[% ELSE %]
|
|
|
|
[% END %]
|
|
</td>
|
|
<td>[% IF ( order.invoicenumber ) %]
|
|
<a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% order.invoiceid | html %]">[% order.invoicenumber | html %]</a>
|
|
[% ELSE %]
|
|
|
|
[% END %]
|
|
</td>
|
|
<td>
|
|
<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% order.biblionumber | html %]">[% order.title | html %]</a>
|
|
<br />[% order.author | html %] <br /> [% order.isbn | html %]
|
|
</td>
|
|
<td><a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% order.id | html %]">[% order.name | html %]</a></td>
|
|
<td><span title="[% order.creationdate | html %]">[% order.creationdate | $KohaDates %]</span></td>
|
|
<td>
|
|
[% IF order.datereceived %]
|
|
<span title="[% order.datereceived | html %]">[% order.datereceived | $KohaDates %]</span>
|
|
[% ELSE %]
|
|
<span title="0000-00-00"></span>
|
|
[% END %]
|
|
</td>
|
|
<td>[% order.quantityreceived | html %]</td>
|
|
<td>[% order.quantity | html %]</td>
|
|
<td>[% order.ecost | html %]</td>
|
|
<td>[% order.budget_name | html %]</td>
|
|
</tr>
|
|
[% END %]
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
[% ELSIF search_done %]
|
|
There is no order for this search.
|
|
[% END %]
|
|
|
|
</main>
|
|
</div> <!-- /.col-sm-10.col-sm-push-2 -->
|
|
|
|
<div class="col-sm-2 col-sm-pull-10">
|
|
<aside>
|
|
[% INCLUDE 'acquisitions-menu.inc' %]
|
|
</aside>
|
|
</div> <!-- /.col-sm-2.col-sm-pull-10 -->
|
|
</div>
|
|
|
|
[% MACRO jsinclude BLOCK %]
|
|
[% Asset.js("js/acquisitions-menu.js") | $raw %]
|
|
[% INCLUDE 'calendar.inc' %]
|
|
[% INCLUDE 'datatables.inc' %]
|
|
[% INCLUDE 'columns_settings.inc' %]
|
|
[% Asset.js("js/autocomplete/patrons.js") | $raw %]
|
|
<script>
|
|
var MSG_REMOVE_PATRON = _("Remove");
|
|
$(document).ready(function() {
|
|
var columns_settings = [% ColumnsSettings.GetColumns( 'acqui', 'histsearch', 'histsearcht', 'json' ) | $raw %];
|
|
KohaTable("histsearcht", {
|
|
"aoColumnDefs": [
|
|
{ "sType": "anti-the", "aTargets" : [ "anti-the" ] },
|
|
{ "sType": "title-string", "aTargets" : [ "title-string" ] }
|
|
],
|
|
"sPaginationType": "four_button"
|
|
}, columns_settings );
|
|
|
|
[% UNLESS order_loop %]
|
|
patron_autocomplete({
|
|
patron_container: $("#basket_creators"),
|
|
input_autocomplete: $("#find_patron"),
|
|
patron_input_name: 'created_by',
|
|
field_to_retrieve: 'borrowernumber'
|
|
});
|
|
[% END %]
|
|
});
|
|
</script>
|
|
[% END %]
|
|
|
|
[% INCLUDE 'intranet-bottom.inc' %]
|