3 [% INCLUDE 'doc-head-open.inc' %]
4 [% USE AuthorisedValues %]
5 <title>Koha › Serials › Claims</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 [% INCLUDE 'calendar.inc' %]
8 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
9 [% INCLUDE 'datatables.inc' %]
10 <script type="text/javascript">
13 $(document).ready(function() {
14 sTable = $("#claimst").dataTable($.extend(true, {}, dataTablesDefaults, {
17 { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
18 { 'sType': "anti-the", 'aTargets' : [ 'anti-the'] },
19 { 'sType': "title-string", 'aTargets' : [ 'title-string'] }
23 sTable.fnAddFilters("filter", "200");
24 $('#supplierid').change(function() {
25 $('#claims').submit();
28 // Checkboxes : Select All / None
29 $("span.checkall").html("<input type=\"checkbox\" name=\"CheckAll\"> "+_("Check All")+"</input>");
31 $("#CheckAll").click(function() {
32 $("#claimst tr:visible :checkbox").prop('checked', $("#CheckAll").is(':checked'));
35 // Generates a dynamic link for exporting the selections data as CSV
36 $("#ExportSelected").click(function() {
37 // 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.
38 var selected = $("input[name=serialid]:checked");
40 if (selected.length == 0) {
41 alert(_("Please select at least one item to export."));
45 // Building the url from currently checked boxes
46 var url = '/cgi-bin/koha/serials/lateissues-export.pl?supplierid=&op=claims';
47 for (var i = 0; i < selected.length; i++) {
48 url += '&serialid=' + selected[i].value;
50 url += '&csv_profile=' + $("#csv_profile_for_export option:selected").val();
51 // And redirecting to the CSV page
55 $("#filterByDate").on("click",function(e){
59 $("#clearfilter").on("click",function(e){
61 $("#from,#to").val("");
62 $("table#claimst tbody tr").show();
64 $("#claims_form").on("submit",function(){
67 $("#filter_claims_form").on("submit",function(){
72 // Checks if the form can be sent (at least one checkbox must be checked)
73 function checkForm() {
74 if ($("input:checked").length == 0) {
75 alert(_("Please select at least one issue."));
81 function filterByDate() {
82 var beginDate = Date_from_syspref($("#from").val()).getTime();
83 var endDate = Date_from_syspref($("#to").val()).getTime();
85 // Checks if the beginning date is valid
86 if (!parseInt(beginDate)) {
87 alert(_("The beginning date is missing or invalid."));
91 // Checks if the ending date is valid
92 if (!parseInt(endDate)) {
93 alert(_("The ending date is missing or invalid."));
97 // Checks if beginning date is before ending date
98 if (beginDate > endDate) {
99 // If not, we swap them
100 var tmpDate = endDate;
105 // We hide everything
106 $("table#claimst tbody tr").hide();
108 // For each date in the table
109 $(".planneddate").each(function() {
111 // We make a JS Date Object, according to the locale
112 var pdate = Date_from_syspref($(this).text()).getTime();
114 // And checks if the date is between the beginning and ending dates
115 if (pdate > beginDate &&
117 // If so, we can show the row
118 $(this).parent().show();
128 <body id="ser_claims" class="ser">
129 [% INCLUDE 'header.inc' %]
130 [% INCLUDE 'serials-search.inc' %]
132 <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>
134 <div id="doc3" class="yui-t2">
143 [% IF error_claim == 'no_vendor_email' %]
144 <div class="dialog alert">This vendor has no email defined for late issues.</div>
145 [% ELSIF error_claim == 'bad_or_missing_sender' %]
146 <div class="dialog alert">Bad or missing sender address; check your branch email address or preference KohaAdminEmailAddress.</div>
148 <div class="dialog alert">[% error_claim %]</div>
152 <div class="dialog message">Email has been sent.</div>
155 [% 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 %]
157 [% IF ( SHOWCONFIRMATION ) %]
158 <div class="dialog alert">Your notification has been sent.</div>
160 [% UNLESS letters %]<div class="dialog alert">No claims notice defined. <a href="/cgi-bin/koha/tools/letter.pl">Please define one</a>.</div>[% END %]
161 <form id="claims" name="claims" action="claims.pl" method="post">
163 <label for="supplierid">Vendor: </label>
164 <select id="supplierid" name="supplierid">
165 [% FOREACH suploo IN suploop %]
166 [% IF ( suploo.selected ) %]
167 <option value="[% suploo.id %]" selected="selected" >
169 <option value="[% suploo.id %]">
176 <input type="submit" value="OK" />
180 [% IF ( missingissues ) %]
181 <h3>Missing issues</h3>
182 <form action="claims.pl" id="filter_claims_form">
183 <fieldset class="rows">
184 <legend>Filters :</legend>
188 <label for="from">From:</label>
189 <input type="text" name="begindate" id="from" value="[% begindate %]" size="10" maxlength="10" class="datepickerfrom" />
190 <label for="to" style="float:none;">To:</label>
191 <input type="text" name="enddate" id="to" value="[% enddate %]" size="10" maxlength="10" class="datepickerto" />
192 <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
193 <input id="filterByDate" type="button" value="OK" />
194 <a href="#" id="clearfilter"><i class="fa fa-remove"></i> Clear filter</a>
201 <form action="claims.pl" method="post" id="claims_form">
205 <th><input type="checkbox" id="CheckAll"></th>
208 <th class="anti-the">Title</th>
210 <th>Issue number</th>
212 <th class="title-string">Since</th>
213 <th>Claims count</th>
214 <th class="title-string">Claim date</th>
215 [% FOR field IN additional_fields_for_subscription %]
216 <th>[% field.name %]</th>
223 <td><input type="text" class="filter" data-column_num="1" placeholder="Search vendor" /></td>
224 <td><input type="text" class="filter" data-column_num="2" placeholder="Search library" /></td>
225 <td><input type="text" class="filter" data-column_num="3" placeholder="Search title" /></td>
226 <td><input type="text" class="filter" data-column_num="4" placeholder="Search ISSN" /></td>
227 <td><input type="text" class="filter" data-column_num="5" placeholder="Search issue number" /></td>
228 <td><input type="text" class="filter" data-column_num="6" placeholder="Search status" /></td>
229 <td><input type="text" class="filter" data-column_num="7" placeholder="Search since" /></td>
230 <td><input type="text" class="filter" data-column_num="8" placeholder="Search claim count" /></td>
231 <td><input type="text" class="filter" data-column_num="9" placeholder="Search claim date" /></td>
232 [% FOR field IN additional_fields_for_subscription %]
233 <td><input type="text" class="filter" data-column_num="[% loop.count + 9 %]" placeholder="Search [% field.name %]" /></td>
237 <tbody>[% FOREACH missingissue IN missingissues %]
240 [% UNLESS missingissue.cannot_claim %]
241 <input type="checkbox" name="serialid" value="[% missingissue.serialid %]" />
244 <td>[% missingissue.name %]</td>
246 <span class="branch-[% missingissue.branchcode %]">[% Branches.GetName( missingissue.branchcode ) %]</span>
249 <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% missingissue.subscriptionid %]">[% missingissue.title |html %]</a>
251 <td>[% missingissue.issn %]</td>
252 <td>[% missingissue.serialseq %]</td>
254 [% IF ( missingissue.status1 ) %]<span class="status-expected">Expected</span>[% END %]
255 [% IF ( missingissue.status3 ) %]<span class="status-late">Late</span>[% END %]
256 [% IF ( missingissue.status4 ) %]<span class="status-missing">Missing</span>[% END %]
257 [% IF ( missingissue.status41 ) %]<span class="status-missing_never_received">Missing (never received)</span>[% END %]
258 [% IF ( missingissue.status42 ) %]<span class="status-missing_sold_out">Missing (sold out)</span>[% END %]
259 [% IF ( missingissue.status43 ) %]<span class="status-missing_damaged">Missing (damaged)</span>[% END %]
260 [% IF ( missingissue.status44 ) %]<span class="status-missing_lost">Missing (lost)</span>[% END %]
261 [% IF ( missingissue.status7 ) %]<span class="status-claimed">Claimed</span>[% END %]
263 <td class="planneddate">
264 [% IF ( missingissue.planneddate ) %]
265 <span title="[% missingissue.planneddateISO %]">[% missingissue.planneddate %]</span>
267 <span title="0000-00-00"></span>
270 <td>[% missingissue.claims_count %]</td>
272 [% IF ( missingissue.claimdate ) %]
273 <span title="[% missingissue.claimdateISO %]">[% missingissue.claimdate %]</span>
275 <span title="0000-00-00"></span>
278 [% FOR field IN additional_fields_for_subscription %]
279 [% IF field.authorised_value_category %]
280 <td>[% AuthorisedValues.GetByCode( field.authorised_value_category, missingissue.additional_fields.${field.name} ) %]</td>
282 <td>[% missingissue.additional_fields.${field.name} %]</td>
289 [% IF csv_profiles %]
290 <fieldset class="action">
291 <label for="csv_code">Select CSV profile:</label>
292 <select id="csv_profile_for_export">
293 [% FOR csv IN csv_profiles %]
294 <option value="[% csv.export_format_id %]">[% csv.profile %]</option>
297 <span class="exportSelected"><a id="ExportSelected" href="/cgi-bin/koha/serials/claims.pl">Download selected claims</a></span>
301 <fieldset class="action">
302 <label for="letter_code">Select notice:</label>
303 <select name="letter_code" id="letter_code">
304 [% FOREACH letter IN letters %]
305 <option value="[% letter.code %]">[% letter.name %]</option>
308 <input type="hidden" name="op" value="send_alert" />
309 <input type="hidden" name="supplierid" value="[% supplierid %]" />
310 <input type="submit" name="submit" class="button" value="Send notification" />
321 [% INCLUDE 'serials-menu.inc' %]
324 [% INCLUDE 'intranet-bottom.inc' %]