Koha/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt
Kyle M Hall a8942c2884 Revert bug 13618 - "Prevent XSS in the Staff Client and the OPAC" due to performance issues
Revert "DBRev to make notes of the XSS patches and the new important dependency."

This reverts commit e140603a59.

Revert "Bug 13618: Specific for branches.opac_info"

This reverts commit 06e4a50f00.

Revert "Bug 13618: (follow-up) Specific for other prefs"

This reverts commit d6475a111f.

Revert "Bug 13618: Fix for debarredcomment and patron messages"

This reverts commit dd98c9df92.

Revert "Bug 13618: Do not display html tags in patron's notices"

This reverts commit a065b243fe.

Revert "Bug 13618: Do not display   and html tags in item fields content"

This reverts commit baeeaffbf8.

Revert "Bug 13618: Fix for system preference description"

This reverts commit a967a09261.

Revert "Bug 13618: Remove html filters for newly pushed code"

This reverts commit 0e98662b10.

Revert "Bug 13618: (follow-up) add missing lines for opac-shelves"

This reverts commit fc2fb605e5.

Revert "Bug 13618: (follow-up) Specific for ColumnsSettings"

This reverts commit bc308fdd9c.

Revert "Bug 13618: Fix for edit biblios and items"

This reverts commit 811c4e8402.

Revert "Bug 13618: followup to remove tabs"

This reverts commit ca8e8c397c.

Revert "Bug 13618: Fix last occurrences recently introduced to master"

This reverts commit bb417b256b.

Revert "Bug 13618: Fix for news"

This reverts commit ae5b98020a.

Revert "Bug 13618: Fix escape on sending baskets or shelves by email"

This reverts commit a7731ffe25.

Revert "Bug 13618: Specific for XSLTBloc"

This reverts commit 11fa38dc29.

Revert "Bug 13618: Specific for Salutation on editing a patron"

This reverts commit 36c07ad6d3.

Revert "Bug 13618: Specific for other prefs"

This reverts commit e6ea281a3b.

Revert "Bug 13618 - memberentrygen.tt errors Not a GLOB reference"

This reverts commit 7824874557.

Revert "Bug 13618: Specific for ColumnsSettings"

This reverts commit 1834da3da3.

Revert "Bug 13618: Specific for IntranetUser* and OPACUser* prefs"

This reverts commit 21ae62b253.

Revert "Bug 13618: Fix error 'Not a GLOB reference'"

This reverts commit 602bdbab4c.

Revert "Bug 13618: Specific for the ISBD view"

This reverts commit d254362435.

Revert "Bug 13618: Specific for pagination_bar"

This reverts commit 8837a8ae68.

Revert "Bug 13618: Specific places where we don't need to escape variables - intra"

This reverts commit 00eff140b3.

Revert "Bug 13618: Remove html filters at the intranet"

This reverts commit 7db851ff03.

Revert "Bug 13618: Specific places where we don't need to escape variables"

This reverts commit 49a3738b8d.

Revert "Bug 13618: Remove html filters at the OPAC"

This reverts commit cedaa0e23e.

Revert "Bug 13618: Use Template::Stash::AutoEscaping to use the html filter"

This reverts commit 01b38d3b13.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-02-11 19:39:53 +00:00

318 lines
14 KiB
Text

[% USE Branches %]
[% INCLUDE 'doc-head-open.inc' %]
[% USE AuthorisedValues %]
<title>Koha &rsaquo; Serials &rsaquo; Claims</title>
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'calendar.inc' %]
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
[% INCLUDE 'datatables.inc' %]
<script type="text/javascript">
//<![CDATA[
var sTable;
$(document).ready(function() {
sTable = $("#claimst").dataTable($.extend(true, {}, dataTablesDefaults, {
"sDom": 't',
"aoColumnDefs": [
{ "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
{ 'sType': "anti-the", 'aTargets' : [ 'anti-the'] },
{ 'sType': "title-string", 'aTargets' : [ 'title-string'] }
],
"bPaginate": false
}));
sTable.fnAddFilters("filter", "200");
$('#supplierid').change(function() {
$('#claims').submit();
});
// Checkboxes : Select All / None
$("span.checkall").html("<input type=\"checkbox\" name=\"CheckAll\"> "+_("Check All")+"</input>");
$("#CheckAll").click(function() {
$("#claimst tr:visible :checkbox").attr('checked', $("#CheckAll").is(':checked'));
});
// Generates a dynamic link for exporting the selections data as CSV
$("#ExportSelected").click(function() {
// We need to use "input[name=serialid]:checked" instead of "input:checked". Otherwise, the "check all" box will pass the value of "on" as a serialid, which produces a SQL error.
var selected = $("input[name=serialid]:checked");
if (selected.length == 0) {
alert(_("Please select at least one item to export."));
return false;
}
// Building the url from currently checked boxes
var url = '/cgi-bin/koha/serials/lateissues-export.pl?supplierid=&amp;op=claims';
for (var i = 0; i < selected.length; i++) {
url += '&amp;serialid=' + selected[i].value;
}
url += '&amp;csv_profile=' + $("#csv_profile_for_export option:selected").val();
// And redirecting to the CSV page
location.href = url;
return false;
});
});
// Checks if the form can be sent (at least one checkbox must be checked)
function checkForm() {
if ($("input:checked").length == 0) {
alert(_("Please select at least one issue."));
return false;
}
}
// Filter by date
function filterByDate() {
var beginDate = Date_from_syspref($("#from").val()).getTime();
var endDate = Date_from_syspref($("#to").val()).getTime();
// Checks if the beginning date is valid
if (!parseInt(beginDate)) {
alert(_("The beginning date is missing or invalid."));
return false;
}
// Checks if the ending date is valid
if (!parseInt(endDate)) {
alert(_("The ending date is missing or invalid."));
return false;
}
// Checks if beginning date is before ending date
if (beginDate > endDate) {
// If not, we swap them
var tmpDate = endDate;
endDate = beginDate;
beginDate = tmpDate;
}
// We hide everything
$("table#claimst tbody tr").hide();
// For each date in the table
$(".planneddate").each(function() {
// We make a JS Date Object, according to the locale
var pdate = Date_from_syspref($(this).text()).getTime();
// And checks if the date is between the beginning and ending dates
if (pdate > beginDate &&
pdate < endDate) {
// If so, we can show the row
$(this).parent().show();
}
});
}
// Clears filters : shows everything
function clearFilters() {
$("table#claimst tbody tr").show();
}
//]]>
</script>
</head>
<body id="ser_claims" class="ser">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'serials-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> &rsaquo; Claims</div>
<div id="doc3" class="yui-t2">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<h1>Claims</h1>
[% IF error_claim %]
[% IF error_claim == 'no_vendor_email' %]
<div class="error">This vendor has no email defined for late issues.</div>
[% ELSIF error_claim == 'no_loggedin_user_email' %]
<div class="error">No email is configured for your user.</div>
[% ELSE %]
<div class="error">[% error_claim %]</div>
[% END %]
[% END %]
[% IF info_claim %]
<div class="dialog message">Email has been sent.</div>
[% END %]
[% IF letters %][% UNLESS ( missingissues ) %][% IF ( supplierid ) %] <div class="dialog alert">No missing issues found.</div>[% ELSE %]<div class="dialog message">Please choose a vendor.</div>[% END %][% END %][% END %]
[% IF ( SHOWCONFIRMATION ) %]
<div class="dialog alert">Your notification has been sent.</div>
[% END %]
[% UNLESS letters %]<div class="dialog alert">No claims notice defined. <a href="/cgi-bin/koha/tools/letter.pl">Please define one</a>.</div>[% END %]
<form id="claims" name="claims" action="claims.pl" method="post">
<fieldset>
<label for="supplierid">Vendor: </label>
<select id="supplierid" name="supplierid">
[% FOREACH suploo IN suploop %]
[% IF ( suploo.selected ) %]
<option value="[% suploo.id %]" selected="selected" >
[% ELSE %]
<option value="[% suploo.id %]">
[% END %]
[% suploo.name %]
([% suploo.count %])
</option>
[% END %]
</select>
<input type="submit" value="OK" />
</fieldset>
</form>
[% IF ( missingissues ) %]
<h3>Missing issues</h3>
<form action="claims.pl" onsubmit="return false;">
<fieldset class="rows">
<legend>Filters :</legend>
<ol>
<li>
<label for="from">From:</label>
<input type="text" name="begindate" id="from" value="[% begindate %]" size="10" maxlength="10" class="datepickerfrom" />
<label for="to" style="float:none;">To:</label>
<input type="text" name="enddate" id="to" value="[% enddate %]" size="10" maxlength="10" class="datepickerto" />
<span class="hint">[% INCLUDE 'date-format.inc' %]</span>
<input type="button" value="OK" onclick="filterByDate();" />
</li>
<li>
<input type="reset" value="Clear filters" onclick="clearFilters();" />
</li>
</ol>
</fieldset>
</form>
<fieldset>
<form action="claims.pl" method="post" class="checkboxed" onsubmit="return checkForm()">
<table id="claimst">
<thead>
<tr>
<th><input type="checkbox" id="CheckAll"></th>
<th>Vendor</th>
<th>Library</th>
<th class="anti-the">Title</th>
<th>ISSN</th>
<th>Issue number</th>
<th>Status</th>
<th class="title-string">Since</th>
<th>Claims count</th>
<th class="title-string">Claim date</th>
[% FOR field IN additional_fields_for_subscription %]
<th>[% field.name %]</th>
[% END %]
</tr>
</thead>
<tfoot>
<tr>
<td></td>
<td><input type="text" class="filter" data-column_num="1" placeholder="Search vendor" /></td>
<td><input type="text" class="filter" data-column_num="2" placeholder="Search library" /></td>
<td><input type="text" class="filter" data-column_num="3" placeholder="Search title" /></td>
<td><input type="text" class="filter" data-column_num="4" placeholder="Search ISSN" /></td>
<td><input type="text" class="filter" data-column_num="5" placeholder="Search issue number" /></td>
<td><input type="text" class="filter" data-column_num="6" placeholder="Search status" /></td>
<td><input type="text" class="filter" data-column_num="7" placeholder="Search since" /></td>
<td><input type="text" class="filter" data-column_num="8" placeholder="Search claim count" /></td>
<td><input type="text" class="filter" data-column_num="9" placeholder="Search claim date" /></td>
[% FOR field IN additional_fields_for_subscription %]
<td><input type="text" class="filter" data-column_num="[% loop.count + 9 %]" placeholder="Search [% field.name %]" /></td>
[% END %]
</tr>
</tfoot>
<tbody>[% FOREACH missingissue IN missingissues %]
<tr>
<td>
[% UNLESS missingissue.cannot_claim %]
<input type="checkbox" name="serialid" value="[% missingissue.serialid %]" />
[% END %]
</td>
<td>[% missingissue.name %]</td>
<td>
<span class="branch-[% missingissue.branchcode %]">[% Branches.GetName( missingissue.branchcode ) %]</span>
</td>
<td>
<a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% missingissue.subscriptionid %]">[% missingissue.title |html %]</a>
</td>
<td>[% missingissue.issn %]</td>
<td>[% missingissue.serialseq %]</td>
<td>
[% IF ( missingissue.status1 ) %]<span class="status-expected">Expected</span>[% END %]
[% IF ( missingissue.status3 ) %]<span class="status-late">Late</span>[% END %]
[% IF ( missingissue.status4 ) %]<span class="status-missing">Missing</span>[% END %]
[% IF ( missingissue.status41 ) %]<span class="status-missing_never_received">Missing (never received)</span>[% END %]
[% IF ( missingissue.status42 ) %]<span class="status-missing_sold_out">Missing (sold out)</span>[% END %]
[% IF ( missingissue.status43 ) %]<span class="status-missing_damaged">Missing (damaged)</span>[% END %]
[% IF ( missingissue.status44 ) %]<span class="status-missing_lost">Missing (lost)</span>[% END %]
[% IF ( missingissue.status7 ) %]<span class="status-claimed">Claimed</span>[% END %]
</td>
<td class="planneddate">
[% IF ( missingissue.planneddate ) %]
<span title="[% missingissue.planneddateISO %]">[% missingissue.planneddate %]</span>
[% ELSE %]
<span title="0000-00-00"></span>
[% END %]
</td>
<td>[% missingissue.claims_count %]</td>
<td>
[% IF ( missingissue.claimdate ) %]
<span title="[% missingissue.claimdateISO %]">[% missingissue.claimdate %]</span>
[% ELSE %]
<span title="0000-00-00"></span>
[% END %]
</td>
[% FOR field IN additional_fields_for_subscription %]
[% IF field.authorised_value_category %]
<td>[% AuthorisedValues.GetByCode( field.authorised_value_category, missingissue.additional_fields.${field.name} ) %]</td>
[% ELSE %]
<td>[% missingissue.additional_fields.${field.name} %]</td>
[% END %]
[% END %]
</tr>
[% END %]</tbody>
</table>
[% IF csv_profiles %]
<fieldset class="action">
<label for="csv_code">Select CSV profile:</label>
<select id="csv_profile_for_export">
[% FOR csv IN csv_profiles %]
<option value="[% csv.export_format_id %]">[% csv.profile %]</option>
[% END %]
</select>
<span class="exportSelected"><a id="ExportSelected" href="/cgi-bin/koha/serials/claims.pl">Download selected claims</a></span>
[% END %]
[% IF letters %]
<fieldset class="action">
<label for="letter_code">Select notice:</label>
<select name="letter_code" id="letter_code">
[% FOREACH letter IN letters %]
<option value="[% letter.code %]">[% letter.name %]</option>
[% END %]
</select>
<input type="hidden" name="op" value="send_alert" />
<input type="hidden" name="supplierid" value="[% supplierid %]" />
<input type="submit" name="submit" class="button" value="Send notification" />
</fieldset>
[% END %]
</form>
</fieldset>
[% END %]
</div>
</div>
<div class="yui-b">
[% INCLUDE 'serials-menu.inc' %]
</div>
</div>
[% INCLUDE 'intranet-bottom.inc' %]