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>
256 lines
9.8 KiB
Text
256 lines
9.8 KiB
Text
[% USE raw %]
|
|
[% USE Asset %]
|
|
[% USE Price %]
|
|
[% USE Branches %]
|
|
[% SET footerjs = 1 %]
|
|
[% INCLUDE 'doc-head-open.inc' %]
|
|
<title>Koha › Acquisitions</title>
|
|
[% INCLUDE 'doc-head-close.inc' %]
|
|
[% Asset.css("css/datatables.css") | $raw %]
|
|
[% Asset.css("lib/jquery/plugins/treetable/stylesheets/jquery.treetable.css") | $raw %]
|
|
</head>
|
|
|
|
<body id="acq_acqui-home" class="acq">
|
|
[% INCLUDE 'header.inc' %]
|
|
[% INCLUDE 'acquisitions-search.inc' %]
|
|
|
|
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › Acquisitions</div>
|
|
|
|
<div class="main container-fluid">
|
|
<div class="row">
|
|
<div class="col-sm-10 col-sm-push-2">
|
|
<main>
|
|
|
|
[% INCLUDE 'acquisitions-toolbar.inc' %]
|
|
|
|
<h1>Acquisitions</h1>
|
|
[% INCLUDE 'budgets-active-currency.inc' hide = 'yes' %]
|
|
[% UNLESS ( loop_budget ) %]
|
|
[% IF ( CAN_user_acquisition_period_manage ) %]
|
|
<div class="dialog alert"><a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">You must define a budget in Administration</a></div>
|
|
[% ELSE %]
|
|
<div class="dialog alert">Your administrator must define a budget in Administration</div>
|
|
[% END %]
|
|
[% END %]
|
|
<div class="row">
|
|
[% IF ( suggestion && suggestions_count ) %]
|
|
<div class="col-sm-6">
|
|
[% ELSE %]
|
|
<div class="col-sm-12">
|
|
[% END %]
|
|
<div id="acqui_acqui_home_order">
|
|
<fieldset>
|
|
<legend>Manage orders</legend>
|
|
<form name="findsupplier" action="/cgi-bin/koha/acqui/booksellers.pl" method="post">
|
|
<p><label for="supplierpage">Vendor: </label><input type="text" size="25" name="supplier" id="supplierpage" class="focus" />
|
|
<input type="submit" value="Search" />
|
|
</p>
|
|
</form>
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
|
|
[% IF ( CAN_user_acquisition_suggestions_manage && suggestion && suggestions_count ) %]
|
|
<div class="col-sm-6">
|
|
<div id="acqui_acqui_home_suggestions">
|
|
<fieldset>
|
|
<legend>Pending suggestions</legend>
|
|
<p>[% suggestions_count | html %] suggestions waiting. <a href="/cgi-bin/koha/suggestion/suggestion.pl#ASKED">Manage suggestions</a>.</p>
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
[% END %]
|
|
|
|
</div>
|
|
|
|
[% IF ( loop_budget ) %]
|
|
|
|
<h3>All available funds[% IF LoginBranchname %] for [% LoginBranchname | html %][% END %]</h3>
|
|
|
|
<div id="BudgetsAndFunds">
|
|
<table id="accounts">
|
|
<caption>
|
|
<span class="actions"><a href="#" id="expand_all">Expand all</a>
|
|
| <a href="#" id="collapse_all">Collapse all</a>
|
|
| <a href="#" id="hide_inactive">Hide inactive budgets</a>
|
|
| <a href="#" id="show_inactive">Show inactive budgets</a></span>
|
|
</caption>
|
|
|
|
<thead>
|
|
<tr>
|
|
<th>Active</th>
|
|
<th>Budget period description</th>
|
|
<th>Fund code</th>
|
|
<th>Fund name</th>
|
|
<th>Owner</th>
|
|
<th>Library</th>
|
|
<th>Amount</th>
|
|
<th>Ordered</th>
|
|
<th>Spent</th>
|
|
<th>Total available</th>
|
|
</tr>
|
|
</thead>
|
|
<tfoot id="funds_total">
|
|
<tr>
|
|
<th></th>
|
|
<th></th>
|
|
<th colspan="4">Total</th>
|
|
<th class="data"></th>
|
|
<th class="data"></th>
|
|
<th class="data"></th>
|
|
<th class="data"></th>
|
|
</tr>
|
|
</tfoot>
|
|
<tbody>
|
|
[% FOREACH loop_budge IN loop_budget %]
|
|
[% IF loop_budge.budget_parent_id %]
|
|
<tr data-tt-id="[% loop_budge.budget_id | html %]" data-tt-parent-id="[% loop_budge.budget_parent_id | html %]">
|
|
[% ELSE %]
|
|
<tr data-tt-id="[% loop_budge.budget_id | html %]">
|
|
[% END %]
|
|
|
|
<td>[% loop_budge.budget_period_active | html %]</td>
|
|
<td>Budget [% loop_budge.budget_period_description | html %] [id=[% loop_budge.budget_period_id | html %]][% UNLESS loop_budge.budget_period_active %] (inactive)[% END %]</td>
|
|
<td>
|
|
[% IF ( CAN_user_acquisition_budget_manage ) %]
|
|
<a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% loop_budge.budget_period_id | html %]">[% loop_budge.budget_code | html %]</a>
|
|
[% ELSE %]
|
|
[% loop_budge.budget_code | html %]
|
|
[% END %]
|
|
</td>
|
|
<td>[% loop_budge.budget_name | html %]</td>
|
|
<td>[% IF ( loop_budge.budget_owner ) %]
|
|
<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loop_budge.budget_owner.borrowernumber | html %]">[% loop_budge.budget_owner.surname | html %], [% loop_budge.budget_owner.firstname | html %]</a>
|
|
[% ELSE %]
|
|
|
|
[% END %]
|
|
</td>
|
|
<td>[% Branches.GetName( loop_budge.budget_branchcode ) | html %]</td>
|
|
<td class="data">
|
|
[% IF loop_budge.budget_parent_id %]
|
|
[% loop_budge.budget_amount | $Price | html %]
|
|
[% ELSE %]
|
|
<span class="total_amount">[% loop_budge.budget_amount | $Price | html %]</span>
|
|
[% END %]
|
|
</td>
|
|
<td class="data">
|
|
<a href="ordered.pl?fund=[% loop_budge.budget_id | html %]&fund_code=[% loop_budge.budget_code | html %]">
|
|
[% IF loop_budge.budget_parent_id %]
|
|
[% loop_budge.budget_ordered | $Price | html %]
|
|
[% ELSE %]
|
|
<span class="total_amount">[% loop_budge.budget_ordered | $Price | html %]</span>
|
|
[% END %]
|
|
</a>
|
|
</td>
|
|
<td class="data">
|
|
<a href="spent.pl?fund=[% loop_budge.budget_id | html %]&fund_code=[% loop_budge.budget_code | html %]">
|
|
[% IF loop_budge.budget_parent_id %]
|
|
[% loop_budge.budget_spent | $Price | html %]
|
|
[% ELSE %]
|
|
<span class="total_amount">[% loop_budge.budget_spent | $Price | html %]</span>
|
|
[% END %]
|
|
</a>
|
|
</td>
|
|
<td class="data">
|
|
[% IF loop_budge.budget_parent_id %]
|
|
[% loop_budge.budget_avail | $Price | html %]
|
|
[% ELSE %]
|
|
<span class="total_amount">[% loop_budge.budget_avail | $Price | html %]</span>
|
|
[% END %]
|
|
</td>
|
|
</tr>
|
|
[% END %]
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
[% 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>
|
|
</div> <!-- /.row -->
|
|
|
|
[% MACRO jsinclude BLOCK %]
|
|
[% INCLUDE 'datatables.inc' %]
|
|
[% Asset.js("lib/jquery/plugins/treetable/jquery.treetable.js") | $raw %]
|
|
[% Asset.js("js/acquisitions-menu.js") | $raw %]
|
|
<script>
|
|
dt_overwrite_html_sorting_localeCompare();
|
|
|
|
$(document).ready(function() {
|
|
|
|
var oTable = $("#accounts").dataTable($.extend(true, {}, dataTablesDefaults, {
|
|
"fnDrawCallback": function ( oSettings ) {
|
|
if ( oSettings.aiDisplay.length == 0 )
|
|
{
|
|
return;
|
|
}
|
|
|
|
var nTrs = $('#accounts tbody tr');
|
|
var iColspan = nTrs[0].getElementsByTagName('td').length;
|
|
var sLastGroup = "";
|
|
for ( var i=0 ; i<nTrs.length ; i++ )
|
|
{
|
|
var iDisplayIndex = oSettings._iDisplayStart + i;
|
|
var sGroup = oSettings.aoData[ oSettings.aiDisplay[iDisplayIndex] ]._aData[1];
|
|
if ( sGroup != sLastGroup )
|
|
{
|
|
var nGroup = document.createElement( 'tr' );
|
|
var nCell = document.createElement( 'td' );
|
|
nCell.colSpan = iColspan;
|
|
nCell.className = "group";
|
|
nCell.innerHTML = sGroup;
|
|
nGroup.appendChild( nCell );
|
|
nTrs[i].parentNode.insertBefore( nGroup, nTrs[i] );
|
|
sLastGroup = sGroup;
|
|
}
|
|
}
|
|
},
|
|
"footerCallback": function ( row, data, start, end, display ) {
|
|
var api = this.api(), data;
|
|
footer_column_sum( api, [ 6, 7, 8, 9 ] );
|
|
},
|
|
"aoColumnDefs": [
|
|
{ "bVisible": false, "aTargets": [ 0, 1 ] },
|
|
{ "bSortable": false, "aTargets": ["_all"] }
|
|
],
|
|
'dom': '<"top pager"ilpf>tr<"bottom pager"ip>',
|
|
'bSort': true,
|
|
'aaSortingFixed': [[ 1, 'asc' ]],
|
|
'bPaginate': false,
|
|
"bAutoWidth": false
|
|
}));
|
|
|
|
$(oTable).treetable({
|
|
expandable: true
|
|
});
|
|
$(oTable).treetable('expandAll');
|
|
$("#expand_all").click(function(e){
|
|
e.preventDefault();
|
|
$(oTable).treetable('expandAll');
|
|
});
|
|
$("#collapse_all").click(function(e){
|
|
e.preventDefault();
|
|
$(oTable).treetable('collapseAll');
|
|
});
|
|
|
|
$("#hide_inactive").click(function(e){
|
|
e.preventDefault();
|
|
oTable.fnFilter( 1, 0 ); // Show only active=1
|
|
});
|
|
$("#show_inactive").click(function(e){
|
|
e.preventDefault();
|
|
oTable.fnFilter( '', 0 );
|
|
});
|
|
$("#hide_inactive").click();
|
|
|
|
});
|
|
</script>
|
|
[% END %]
|
|
|
|
[% INCLUDE 'intranet-bottom.inc' %]
|