Lines 63-68
Link Here
|
63 |
<div class="dialog alert">No missing issues found.</div> |
63 |
<div class="dialog alert">No missing issues found.</div> |
64 |
[% ELSE %] |
64 |
[% ELSE %] |
65 |
<div class="dialog message">Please choose a vendor.</div> |
65 |
<div class="dialog message">Please choose a vendor.</div> |
|
|
66 |
[% PROCESS select_vendor context => "main" %] |
66 |
[% END %] |
67 |
[% END %] |
67 |
[% END %] |
68 |
[% END %] |
68 |
[% END %] |
69 |
[% END %] |
Lines 77-229
Link Here
|
77 |
</div> |
78 |
</div> |
78 |
[% END %] |
79 |
[% END %] |
79 |
|
80 |
|
80 |
<form id="claims" name="claims" action="claims.pl" method="get"> |
|
|
81 |
<fieldset> |
82 |
<label for="supplierid">Vendor: </label> |
83 |
<select id="supplierid" name="supplierid"> |
84 |
[% FOREACH suploo IN suploop %] |
85 |
[% IF ( suploo.selected ) %] |
86 |
<option value="[% suploo.id | html %]" selected="selected" > |
87 |
[% ELSE %] |
88 |
<option value="[% suploo.id | html %]"> |
89 |
[% END %] |
90 |
[% suploo.name | html %] |
91 |
([% suploo.count | html %]) |
92 |
</option> |
93 |
[% END %] |
94 |
</select> |
95 |
<input type="submit" class="btn btn-primary" value="OK" /> |
96 |
</fieldset> |
97 |
</form> <!-- /#claims --> |
98 |
|
99 |
[% IF ( missingissues ) %] |
81 |
[% IF ( missingissues ) %] |
100 |
<h3>Missing issues</h3> |
82 |
<h3>Missing issues</h3> |
101 |
<form method="get" action="claims.pl" id="filter_claims_form"> |
|
|
102 |
<fieldset class="rows"> |
103 |
<legend>Filters:</legend> |
104 |
<ol> |
105 |
<li> |
106 |
<label for="from">From:</label> |
107 |
<input type="text" name="begindate" id="from" value="[% begindate | html %]" size="10" maxlength="10" class="flatpickr" data-date_to="to"/> |
108 |
<label for="to" style="float:none;">To:</label> |
109 |
<input type="text" name="enddate" id="to" value="[% enddate | html %]" size="10" maxlength="10" class="flatpickr" /> |
110 |
<span class="hint">[% INCLUDE 'date-format.inc' %]</span> |
111 |
<input id="filterByDate" type="button" value="OK" /> |
112 |
<a href="#" id="clearfilter"><i class="fa fa-times"></i> Clear filter</a> |
113 |
</li> |
114 |
</ol> |
115 |
</fieldset> |
116 |
</form> |
117 |
|
83 |
|
118 |
<fieldset> |
|
|
119 |
<form action="claims.pl" method="post" id="claims_form"> |
84 |
<form action="claims.pl" method="post" id="claims_form"> |
120 |
[% INCLUDE 'csrf-token.inc' %] |
85 |
<div class="page-section"> |
121 |
<table id="claimst"> |
86 |
[% INCLUDE 'csrf-token.inc' %] |
122 |
<thead> |
87 |
<table id="claimst"> |
123 |
<tr> |
88 |
<thead> |
124 |
<th><input type="checkbox" id="CheckAll"></th> |
|
|
125 |
<th>Vendor</th> |
126 |
<th>Library</th> |
127 |
<th class="anti-the">Title</th> |
128 |
<th>ISSN</th> |
129 |
<th>Issue number</th> |
130 |
<th>Status</th> |
131 |
<th>Since</th> |
132 |
<th>Publication date</th> |
133 |
<th>Claims count</th> |
134 |
<th>Claim date</th> |
135 |
[% FOR field IN additional_fields_for_subscription %] |
136 |
<th>[% field.name | html %]</th> |
137 |
[% END %] |
138 |
</tr> |
139 |
</thead> |
140 |
<tbody> |
141 |
[% FOREACH missingissue IN missingissues %] |
142 |
<tr> |
89 |
<tr> |
143 |
<td> |
90 |
<th class="NoSort"><input type="checkbox" id="CheckAll"></th> |
144 |
[% UNLESS missingissue.cannot_claim %] |
91 |
<th>Vendor</th> |
145 |
<input type="checkbox" name="serialid" value="[% missingissue.serialid | html %]" /> |
92 |
<th>Library</th> |
146 |
[% END %] |
93 |
<th class="anti-the">Title</th> |
147 |
</td> |
94 |
<th>ISSN</th> |
148 |
<td>[% missingissue.name | html %]</td> |
95 |
<th>Issue number</th> |
149 |
<td> |
96 |
<th>Status</th> |
150 |
<span class="branch-[% missingissue.branchcode | html %]">[% Branches.GetName( missingissue.branchcode ) | html %]</span> |
97 |
<th>Since</th> |
151 |
</td> |
98 |
<th>Publication date</th> |
152 |
<td> |
99 |
<th>Claims count</th> |
153 |
<a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% missingissue.subscriptionid | uri %]">[% missingissue.title | html %]</a> |
100 |
<th>Claim date</th> |
154 |
</td> |
|
|
155 |
<td>[% missingissue.issn | html %]</td> |
156 |
<td>[% missingissue.serialseq | html %]</td> |
157 |
<td> |
158 |
[% INCLUDE 'serial-status.inc' serial = missingissue %] |
159 |
</td> |
160 |
<td class="planneddate" data-order="[% missingissue.planneddate | html %]"> |
161 |
[% missingissue.planneddate | $KohaDates %] |
162 |
</td> |
163 |
<td class="publisheddate" data-order="[% missingissue.publisheddate | html %]"> |
164 |
[% missingissue.publisheddate | $KohaDates %] |
165 |
</td> |
166 |
<td>[% missingissue.claims_count | html %]</td> |
167 |
<td data-order="[% missingissue.claimdate | html %]"> |
168 |
[% missingissue.claimdate | $KohaDates %] |
169 |
</td> |
170 |
[% FOR field IN additional_fields_for_subscription %] |
101 |
[% FOR field IN additional_fields_for_subscription %] |
171 |
[% IF field.authorised_value_category %] |
102 |
<th>[% field.name | html %]</th> |
172 |
<td>[% AuthorisedValues.GetByCode( field.authorised_value_category, missingissue.additional_fields.${field.name} ) | html %]</td> |
103 |
[% END %] |
173 |
[% ELSE %] |
104 |
</tr> |
174 |
<td>[% missingissue.additional_fields.${field.name} | html %]</td> |
105 |
</thead> |
|
|
106 |
<tbody> |
107 |
[% FOREACH missingissue IN missingissues %] |
108 |
<tr> |
109 |
<td> |
110 |
[% UNLESS missingissue.cannot_claim %] |
111 |
<input type="checkbox" class="select_serial" name="serialid" value="[% missingissue.serialid | html %]" /> |
175 |
[% END %] |
112 |
[% END %] |
|
|
113 |
</td> |
114 |
<td>[% missingissue.name | html %]</td> |
115 |
<td> |
116 |
<span class="branch-[% missingissue.branchcode | html %]">[% Branches.GetName( missingissue.branchcode ) | html %]</span> |
117 |
</td> |
118 |
<td> |
119 |
<a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% missingissue.subscriptionid | uri %]">[% missingissue.title | html %]</a> |
120 |
</td> |
121 |
<td>[% missingissue.issn | html %]</td> |
122 |
<td>[% missingissue.serialseq | html %]</td> |
123 |
<td> |
124 |
[% INCLUDE 'serial-status.inc' serial = missingissue %] |
125 |
</td> |
126 |
<td class="planneddate" data-order="[% missingissue.planneddate | html %]"> |
127 |
[% missingissue.planneddate | $KohaDates %] |
128 |
</td> |
129 |
<td class="publisheddate" data-order="[% missingissue.publisheddate | html %]"> |
130 |
[% missingissue.publisheddate | $KohaDates %] |
131 |
</td> |
132 |
<td>[% missingissue.claims_count | html %]</td> |
133 |
<td data-order="[% missingissue.claimdate | html %]"> |
134 |
[% missingissue.claimdate | $KohaDates %] |
135 |
</td> |
136 |
[% FOR field IN additional_fields_for_subscription %] |
137 |
[% IF field.authorised_value_category %] |
138 |
<td>[% AuthorisedValues.GetByCode( field.authorised_value_category, missingissue.additional_fields.${field.name} ) | html %]</td> |
139 |
[% ELSE %] |
140 |
<td>[% missingissue.additional_fields.${field.name} | html %]</td> |
141 |
[% END %] |
142 |
[% END %] |
143 |
</tr> |
144 |
[% END # /FOREACH missingissue %] |
145 |
</tbody> |
146 |
<tfoot> |
147 |
<tr> |
148 |
<td></td> |
149 |
<td><input type="text" class="filter" data-column_num="1" placeholder="Search vendor" /></td> |
150 |
<td><input type="text" class="filter" data-column_num="2" placeholder="Search library" /></td> |
151 |
<td><input type="text" class="filter" data-column_num="3" placeholder="Search title" /></td> |
152 |
<td><input type="text" class="filter" data-column_num="4" placeholder="Search ISSN" /></td> |
153 |
<td><input type="text" class="filter" data-column_num="5" placeholder="Search issue number" /></td> |
154 |
<td><input type="text" class="filter" data-column_num="6" placeholder="Search status" /></td> |
155 |
<td><input type="text" class="filter" data-column_num="7" placeholder="Search since" /></td> |
156 |
<td><input type="text" class="filter" data-column_num="8" placeholder="Search publication date" /></td> |
157 |
<td><input type="text" class="filter" data-column_num="9" placeholder="Search claim count" /></td> |
158 |
<td><input type="text" class="filter" data-column_num="10" placeholder="Search claim date" /></td> |
159 |
[% FOR field IN additional_fields_for_subscription %] |
160 |
<td><input type="text" class="filter" data-column_num="[% loop.count + 10 | html %]" placeholder="Search [% field.name | html %]" /></td> |
176 |
[% END %] |
161 |
[% END %] |
177 |
</tr> |
162 |
</tr> |
178 |
[% END # /FOREACH missingissue %] |
163 |
</tfoot> |
179 |
</tbody> |
164 |
</table> <!-- /#claimst --> |
180 |
<tfoot> |
165 |
</div> <!-- /.page-section --> |
181 |
<tr> |
166 |
|
182 |
<td></td> |
167 |
<hr /> |
183 |
<td><input type="text" class="filter" data-column_num="1" placeholder="Search vendor" /></td> |
168 |
|
184 |
<td><input type="text" class="filter" data-column_num="2" placeholder="Search library" /></td> |
169 |
[% IF ( csv_profiles.count && letters ) %] |
185 |
<td><input type="text" class="filter" data-column_num="3" placeholder="Search title" /></td> |
170 |
<div class="row"> |
186 |
<td><input type="text" class="filter" data-column_num="4" placeholder="Search ISSN" /></td> |
171 |
<div class="col-sm-6"> |
187 |
<td><input type="text" class="filter" data-column_num="5" placeholder="Search issue number" /></td> |
172 |
[% ELSIF ( csv_profiles.count || letters ) %] |
188 |
<td><input type="text" class="filter" data-column_num="6" placeholder="Search status" /></td> |
173 |
<div class="row"> |
189 |
<td><input type="text" class="filter" data-column_num="7" placeholder="Search since" /></td> |
174 |
<div class="col-sm-12"> |
190 |
<td><input type="text" class="filter" data-column_num="8" placeholder="Search publication date" /></td> |
175 |
[% END %] |
191 |
<td><input type="text" class="filter" data-column_num="9" placeholder="Search claim count" /></td> |
|
|
192 |
<td><input type="text" class="filter" data-column_num="10" placeholder="Search claim date" /></td> |
193 |
[% FOR field IN additional_fields_for_subscription %] |
194 |
<td><input type="text" class="filter" data-column_num="[% loop.count + 10 | html %]" placeholder="Search [% field.name | html %]" /></td> |
195 |
[% END %] |
196 |
</tr> |
197 |
</tfoot> |
198 |
</table> <!-- /#claimst --> |
199 |
|
176 |
|
200 |
[% IF csv_profiles.count %] |
177 |
[% IF csv_profiles.count %] |
201 |
<fieldset class="action"> |
178 |
<fieldset class="serial_batch_op" disabled="disabled"> |
202 |
<label for="csv_code">Select CSV profile:</label> |
179 |
<fieldset class="brief"> |
203 |
<select id="csv_profile_for_export"> |
180 |
<legend>Download selected claims</legend> |
204 |
[% FOR csv IN csv_profiles %] |
181 |
<label for="csv_profile_for_export">Select CSV profile:</label> |
205 |
<option value="[% csv.export_format_id | html %]">[% csv.profile | html %]</option> |
182 |
<select id="csv_profile_for_export"> |
206 |
[% END %] |
183 |
[% FOR csv IN csv_profiles %] |
207 |
</select> |
184 |
<option value="[% csv.export_format_id | html %]">[% csv.profile | html %]</option> |
208 |
<span class="exportSelected"><a id="ExportSelected" href="/cgi-bin/koha/serials/claims.pl">Download selected claims</a></span> |
185 |
[% END %] |
|
|
186 |
</select> |
187 |
<fieldset class="action"> |
188 |
<button class="btn btn-primary" id="ExportSelected" type="button">Download selected claims</button> |
189 |
</fieldset> |
190 |
</fieldset> |
209 |
</fieldset> |
191 |
</fieldset> |
210 |
[% END %] |
192 |
[% END %] |
211 |
|
193 |
|
|
|
194 |
[% IF ( csv_profiles.count && letters ) %] |
195 |
</div> |
196 |
<div class="col-sm-6"> |
197 |
[% END %] |
198 |
|
212 |
[% IF letters %] |
199 |
[% IF letters %] |
213 |
<fieldset class="action"> |
200 |
<fieldset class="serial_batch_op" disabled="disabled"> |
214 |
<label for="letter_code">Select notice:</label> |
201 |
<fieldset class="brief"> |
215 |
<select name="letter_code" id="letter_code"> |
202 |
<legend>Send claim notification</legend> |
216 |
[% FOREACH letter IN letters %] |
203 |
<label for="letter_code">Select notice:</label> |
217 |
<option value="[% letter.code | html %]">[% letter.name | html %]</option> |
204 |
<select name="letter_code" id="letter_code"> |
218 |
[% END %] |
205 |
[% FOREACH letter IN letters %] |
219 |
</select> |
206 |
<option value="[% letter.code | html %]">[% letter.name | html %]</option> |
220 |
<input type="hidden" name="op" value="cud-send_alert" /> |
207 |
[% END %] |
221 |
<input type="hidden" name="supplierid" value="[% supplierid | html %]" /> |
208 |
</select> |
222 |
<input type="submit" name="submit" class="btn btn-primary" value="Send notification" /> |
209 |
<fieldset class="action"> |
|
|
210 |
<input type="hidden" name="op" value="cud-send_alert" /> |
211 |
<input type="hidden" name="supplierid" value="[% supplierid | html %]" /> |
212 |
<input type="submit" name="submit" class="btn btn-primary" value="Send notification" /> |
213 |
</fieldset> |
214 |
</fieldset> |
223 |
</fieldset> |
215 |
</fieldset> |
224 |
[% END %] |
216 |
[% END %] |
|
|
217 |
|
218 |
[% IF ( csv_profiles.count && letters ) %] |
219 |
</div> |
220 |
<div class="col-sm-6"> |
221 |
[% END %] |
225 |
</form> <!-- /#claims_form --> |
222 |
</form> <!-- /#claims_form --> |
226 |
</fieldset> |
223 |
|
227 |
[% END # /missingissues %] |
224 |
[% END # /missingissues %] |
228 |
|
225 |
|
229 |
</main> |
226 |
</main> |
Lines 231-265
Link Here
|
231 |
|
228 |
|
232 |
<div class="col-sm-2 col-sm-pull-10"> |
229 |
<div class="col-sm-2 col-sm-pull-10"> |
233 |
<aside> |
230 |
<aside> |
|
|
231 |
[% IF letters %] |
232 |
[% IF ( missingissues && supplierid ) %] |
233 |
[% PROCESS select_vendor context => "sidebar" %] |
234 |
[% END %] |
235 |
[% END %] |
236 |
|
237 |
[% IF ( missingissues ) %] |
238 |
<form action="claims.pl" id="filter_claims_form"> |
239 |
<fieldset class="brief"> |
240 |
<h4>Filter missing issues</h4> |
241 |
<legend class="sr-only">Filter missing issues</legend> |
242 |
<ol> |
243 |
<li> |
244 |
<label for="from">From:</label> |
245 |
<input type="text" name="begindate" id="from" value="[% begindate | html %]" size="10" maxlength="10" class="flatpickr" data-date_to="to"/> |
246 |
</li> |
247 |
<li> |
248 |
<label for="to">To:</label> |
249 |
<input type="text" name="enddate" id="to" value="[% enddate | html %]" size="10" maxlength="10" class="flatpickr" /> |
250 |
<span class="hint">[% INCLUDE 'date-format.inc' %]</span> |
251 |
</li> |
252 |
</ol> |
253 |
</fieldset> |
254 |
<fieldset class="action"> |
255 |
<input id="filterByDate" class="btn btn-primary" type="button" value="OK" /> |
256 |
<input type="reset" class="btn btn-default" value="Clear" id="clearfilter" /> |
257 |
</fieldset> |
258 |
</form> |
259 |
[% END %] |
260 |
|
234 |
[% INCLUDE 'serials-menu.inc' %] |
261 |
[% INCLUDE 'serials-menu.inc' %] |
235 |
</aside> |
262 |
</aside> |
236 |
</div> <!-- /.col-sm-2.col-sm-pull-10 --> |
263 |
</div> <!-- /.col-sm-2.col-sm-pull-10 --> |
237 |
</div> <!-- /.row --> |
264 |
</div> <!-- /.row --> |
238 |
|
265 |
|
|
|
266 |
[% BLOCK select_vendor %] |
267 |
<form class="select_vendor" name="claims" action="claims.pl" method="get"> |
268 |
[% IF ( context == "main") %] |
269 |
<fieldset class="rows"> |
270 |
[% ELSE %] |
271 |
<fieldset class="brief"> |
272 |
[% END %] |
273 |
<h4>Choose vendor</h4> |
274 |
<label class="sr-only" for="supplierid">Choose vendor: </label> |
275 |
<select id="supplierid" name="supplierid"> |
276 |
[% FOREACH suploo IN suploop %] |
277 |
[% IF ( suploo.selected ) %] |
278 |
<option value="[% suploo.id | html %]" selected="selected" > |
279 |
[% ELSE %] |
280 |
<option value="[% suploo.id | html %]"> |
281 |
[% END %] |
282 |
[% suploo.name | html %] |
283 |
([% suploo.count | html %]) |
284 |
</option> |
285 |
[% END %] |
286 |
</select> |
287 |
</fieldset> |
288 |
<fieldset class="action"> |
289 |
<input type="submit" class="btn btn-primary" value="OK" /> |
290 |
</fieldset> |
291 |
</form> <!-- /#claims --> |
292 |
[% END %] |
293 |
|
239 |
[% MACRO jsinclude BLOCK %] |
294 |
[% MACRO jsinclude BLOCK %] |
240 |
[% INCLUDE 'calendar.inc' %] |
295 |
[% INCLUDE 'calendar.inc' %] |
241 |
[% INCLUDE 'datatables.inc' %] |
296 |
[% INCLUDE 'datatables.inc' %] |
242 |
<script> |
297 |
<script> |
243 |
var sTable; |
298 |
var sTable; |
244 |
$(document).ready(function() { |
299 |
$(document).ready(function() { |
|
|
300 |
enableSelectedActions(); |
245 |
sTable = $("#claimst").dataTable($.extend(true, {}, dataTablesDefaults, { |
301 |
sTable = $("#claimst").dataTable($.extend(true, {}, dataTablesDefaults, { |
246 |
"dom": 't', |
302 |
"dom": 't', |
|
|
303 |
"order": [[ 7, "asc" ]], |
247 |
"columnDefs": [ |
304 |
"columnDefs": [ |
248 |
{ "targets": [ 0 ], "orderable": false, "searchable": false }, |
305 |
{ 'sortable': false, 'targets': [ 'NoSort' ] }, |
249 |
{ "type": "anti-the", "targets": [ 'anti-the'] } |
306 |
{ "type": "anti-the", "targets": [ 'anti-the'] } |
250 |
], |
307 |
], |
251 |
"paginate": false |
308 |
"paginate": false |
252 |
})); |
309 |
})); |
253 |
sTable.fnAddFilters("filter", "200"); |
310 |
sTable.fnAddFilters("filter", "200"); |
254 |
$('#supplierid').change(function() { |
|
|
255 |
$('#claims').submit(); |
256 |
}); |
257 |
|
311 |
|
258 |
// Checkboxes : Select All / None |
312 |
// Checkboxes : Select All / None |
259 |
$("span.checkall").html("<input type=\"checkbox\" name=\"CheckAll\"> "+_("Check all")+"</input>"); |
313 |
$("span.checkall").html("<input type=\"checkbox\" name=\"CheckAll\"> "+_("Check all")+"</input>"); |
260 |
|
314 |
|
261 |
$("#CheckAll").click(function() { |
315 |
$("#CheckAll").click(function() { |
262 |
$("#claimst tr:visible :checkbox").prop('checked', $("#CheckAll").is(':checked')); |
316 |
$("#claimst tr:visible :checkbox").prop('checked', $("#CheckAll").is(':checked')); |
|
|
317 |
enableSelectedActions(); |
263 |
}); |
318 |
}); |
264 |
|
319 |
|
265 |
// Generates a dynamic link for exporting the selections data as CSV |
320 |
// Generates a dynamic link for exporting the selections data as CSV |
Lines 298-305
Link Here
|
298 |
$("#filter_claims_form").on("submit",function(){ |
353 |
$("#filter_claims_form").on("submit",function(){ |
299 |
return false; |
354 |
return false; |
300 |
}); |
355 |
}); |
|
|
356 |
|
357 |
$(".select_serial").on("change", function(){ |
358 |
enableSelectedActions(); |
359 |
}); |
301 |
}); |
360 |
}); |
302 |
|
361 |
|
|
|
362 |
function enableSelectedActions() { |
363 |
var checkedBoxes = $(".select_serial:checked"); |
364 |
if ( checkedBoxes.length ) { |
365 |
$(".serial_batch_op").prop( "disabled", false ); |
366 |
} else { |
367 |
$(".serial_batch_op").prop( "disabled", true ); |
368 |
} |
369 |
} |
370 |
|
303 |
// Checks if the form can be sent (at least one checkbox must be checked) |
371 |
// Checks if the form can be sent (at least one checkbox must be checked) |
304 |
function checkForm() { |
372 |
function checkForm() { |
305 |
if ($("input:checked").length == 0) { |
373 |
if ($("input:checked").length == 0) { |
306 |
- |
|
|