3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Koha › Serials › Claims</title>
5 [% INCLUDE 'doc-head-close.inc' %]
6 [% INCLUDE 'calendar.inc' %]
7 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
8 [% INCLUDE 'datatables.inc' %]
9 <script type="text/javascript">
11 $(document).ready(function() {
12 var sTable = $("#claimst").dataTable($.extend(true, {}, dataTablesDefaults, {
15 { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
16 { 'sType': "anti-the", 'aTargets' : [ 'anti-the'] },
17 { 'sType': "title-string", 'aTargets' : [ 'title-string'] }
21 $('#supplierid').change(function() {
22 $('#claims').submit();
25 // Checkboxes : Select All / None
26 $("span.checkall").html("<input type=\"checkbox\" name=\"CheckAll\"> "+_("Check All")+"</input>");
28 $("#CheckAll").click(function() {
29 $("#claimst tr:visible :checkbox").attr('checked', $("#CheckAll").is(':checked'));
32 // Generates a dynamic link for exporting the selections data as CSV
33 $("#ExportSelected").click(function() {
34 // 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.
35 var selected = $("input[name=serialid]:checked");
37 if (selected.length == 0) {
38 alert(_("Please select at least one item to export."));
42 // Building the url from currently checked boxes
43 var url = '/cgi-bin/koha/serials/lateissues-export.pl?supplierid=&op=claims';
44 for (var i = 0; i < selected.length; i++) {
45 url += '&serialid=' + selected[i].value;
47 url += '&csv_profile=' + $("#csv_profile_for_export option:selected").val();
48 // And redirecting to the CSV page
53 $("#titlefilter").keyup( function () {
54 sTable.fnFilter( this.value, 3 ); // 3 is position of title column
57 $("#branchfilter").keyup(function() {
58 sTable.fnFilter( this.value, 2 ); // 2 is the position of the author column
62 // Checks if the form can be sent (at least one checkbox must be checked)
63 function checkForm() {
64 if ($("input:checked").length == 0) {
65 alert(_("Please select at least one issue."));
71 function filterByStatus() {
72 selectedStatus = $("#statusfilter").val();
73 if (selectedStatus == "all") {
76 $("table#claimst tbody tr").hide();
77 $("table#claimst tbody tr").each( function() {
78 if ( $(this).find("span.status-" + selectedStatus).size() > 0 ) {
86 function filterByBranch() {
87 selectedBranch = $("#branchfilter").val();
88 if (selectedBranch == "all") {
91 $("table#claimst tbody tr").hide();
92 $("table#claimst tbody tr").each( function() {
93 if ( $(this).find("span.branch-" + selectedBranch).size() > 0 ) {
101 function filterByDate() {
102 var beginDate = Date_from_syspref($("#from").val()).getTime();
103 var endDate = Date_from_syspref($("#to").val()).getTime();
105 // Checks if the beginning date is valid
106 if (!parseInt(beginDate)) {
107 alert(_("The beginning date is missing or invalid."));
111 // Checks if the ending date is valid
112 if (!parseInt(endDate)) {
113 alert(_("The ending date is missing or invalid."));
117 // Checks if beginning date is before ending date
118 if (beginDate > endDate) {
119 // If not, we swap them
120 var tmpDate = endDate;
125 // We hide everything
126 $("table#claimst tbody tr").hide();
128 // For each date in the table
129 $(".planneddate").each(function() {
131 // We make a JS Date Object, according to the locale
132 var pdate = Date_from_syspref($(this).text()).getTime();
134 // And checks if the date is between the beginning and ending dates
135 if (pdate > beginDate &&
137 // If so, we can show the row
138 $(this).parent().show();
144 // Clears filters : shows everything
145 function clearFilters() {
146 $("table#claimst tbody tr").show();
152 <body id="ser_claims" class="ser">
153 [% INCLUDE 'header.inc' %]
154 [% INCLUDE 'serials-search.inc' %]
156 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> › Claims</div>
158 <div id="doc3" class="yui-t2">
167 [% IF error_claim == 'no_vendor_email' %]
168 <div class="error">This vendor has no email defined for late issues.</div>
169 [% ELSIF error_claim == 'no_loggedin_user_email' %]
170 <div class="error">No email is configured for your user.</div>
172 <div class="error">[% error_claim %]</div>
176 <div class="dialog message">Email has been sent.</div>
179 [% 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 %]
181 [% IF ( SHOWCONFIRMATION ) %]
182 <div class="dialog alert">Your notification has been sent.</div>
184 [% UNLESS letters %]<div class="dialog alert">No claims notice defined. <a href="/cgi-bin/koha/tools/letter.pl">Please define one</a>.</div>[% END %]
185 <form id="claims" name="claims" action="claims.pl" method="post">
187 <label for="supplierid">Vendor: </label>
188 <select id="supplierid" name="supplierid">
189 [% FOREACH suploo IN suploop %]
190 [% IF ( suploo.selected ) %]
191 <option value="[% suploo.id %]" selected="selected" >
193 <option value="[% suploo.id %]">
200 <input type="submit" value="OK" />
204 [% IF ( missingissues ) %]
205 <h3>Missing issues</h3>
206 <form action="claims.pl" onsubmit="return false;">
207 <fieldset class="rows">
208 <legend>Filters :</legend>
212 <label for="statusfilter">Status : </label>
213 <select id="statusfilter" onchange="filterByStatus();">
214 <option value="all" selected="selected">(All)</option>
215 <option value="expected">Expected</option>
216 <option value="late">Late</option>
217 <option value="missing">Missing</option>
218 <option value="missing_never_received">Missing (never received)</option>
219 <option value="missing_sold_out">Missing (sold out)</option>
220 <option value="missing_damaged">Missing (damaged)</option>
221 <option value="missing_lost">Missing (lost)</option>
222 <option value="claimed">Claimed</option>
227 <label for="titlefilter">Title : </label>
228 <input id="titlefilter" type="text" />
231 <label for="branchfilter">Library: </label>
232 <select id="branchfilter" onchange="filterByBranch();">
233 <option value="all" selected="selected">(All)</option>
234 [% FOREACH branchloo IN branchloop %]
235 <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
241 <label for="from">From:</label>
242 <input type="text" name="begindate" id="from" value="[% begindate %]" size="10" maxlength="10" class="datepickerfrom" />
243 <label for="to" style="float:none;">To:</label>
244 <input type="text" name="enddate" id="to" value="[% enddate %]" size="10" maxlength="10" class="datepickerto" />
245 <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
246 <input type="button" value="OK" onclick="filterByDate();" />
250 <input type="reset" value="Clear filters" onclick="clearFilters();" />
257 <form action="claims.pl" method="post" class="checkboxed" onsubmit="return checkForm()">
261 <th><input type="checkbox" id="CheckAll"></th>
264 <th class="anti-the">Title</th>
266 <th>Issue number</th>
268 <th class="title-string">Since</th>
269 <th>Claims count</th>
270 <th class="title-string">Claim date</th>
273 <tbody>[% FOREACH missingissue IN missingissues %]
276 <input type="checkbox" name="serialid" value="[% missingissue.serialid %]" />
278 <td>[% missingissue.name %]</td>
280 <span class="branch-[% missingissue.branchcode %]">[% Branches.GetName( missingissue.branchcode ) %]</span>
283 <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% missingissue.subscriptionid %]">[% missingissue.title |html %]</a>
285 <td>[% missingissue.issn %]</td>
286 <td>[% missingissue.serialseq %]</td>
288 [% IF ( missingissue.status1 ) %]<span class="status-expected">Expected</span>[% END %]
289 [% IF ( missingissue.status3 ) %]<span class="status-late">Late</span>[% END %]
290 [% IF ( missingissue.status4 ) %]<span class="status-missing">Missing</span>[% END %]
291 [% IF ( missingissue.status41 ) %]<span class="status-missing_never_received">Missing (never received)</span>[% END %]
292 [% IF ( missingissue.status42 ) %]<span class="status-missing_sold_out">Missing (sold out)</span>[% END %]
293 [% IF ( missingissue.status43 ) %]<span class="status-missing_damaged">Missing (damaged)</span>[% END %]
294 [% IF ( missingissue.status44 ) %]<span class="status-missing_lost">Missing (lost)</span>[% END %]
295 [% IF ( missingissue.status7 ) %]<span class="status-claimed">Claimed</span>[% END %]
297 <td class="planneddate">
298 [% IF ( missingissue.planneddate ) %]
299 <span title="[% missingissue.planneddateISO %]">[% missingissue.planneddate %]</span>
301 <span title="0000-00-00"></span>
304 <td>[% missingissue.claims_count %]</td>
306 [% IF ( missingissue.claimdate ) %]
307 <span title="[% missingissue.claimdateISO %]">[% missingissue.claimdate %]</span>
309 <span title="0000-00-00"></span>
316 [% IF csv_profiles %]
317 <fieldset class="action">
318 <label for="csv_code">Select CSV profile:</label>
319 <select id="csv_profile_for_export">
320 [% FOR csv IN csv_profiles %]
321 <option value="[% csv.export_format_id %]">[% csv.profile %]</option>
324 <span class="exportSelected"><a id="ExportSelected" href="/cgi-bin/koha/serials/claims.pl">Download selected claims</a></span>
328 <fieldset class="action">
329 <label for="letter_code">Select notice:</label>
330 <select name="letter_code" id="letter_code">
331 [% FOREACH letter IN letters %]
332 <option value="[% letter.code %]">[% letter.name %]</option>
335 <input type="hidden" name="op" value="send_alert" />
336 <input type="hidden" name="supplierid" value="[% supplierid %]" />
337 <input type="submit" name="submit" class="button" value="Send notification" />
348 [% INCLUDE 'serials-menu.inc' %]
351 [% INCLUDE 'intranet-bottom.inc' %]