Lines 225-231
Link Here
|
225 |
<div id="holiday-list"> |
225 |
<div id="holiday-list"> |
226 |
[% IF ( NEED_VALIDATION_HOLIDAYS ) %] |
226 |
[% IF ( NEED_VALIDATION_HOLIDAYS ) %] |
227 |
<h3>Need validation holidays</h3> |
227 |
<h3>Need validation holidays</h3> |
228 |
<table id="holidaysvalidation"> |
228 |
<table id="holidaysvalidation" class="dataTable no-footer"> |
229 |
<thead> |
229 |
<thead> |
230 |
<tr> |
230 |
<tr> |
231 |
<th class="validation">Date</th> |
231 |
<th class="validation">Date</th> |
Lines 247-253
Link Here
|
247 |
|
247 |
|
248 |
[% IF ( WEEKLY_HOLIDAYS ) %] |
248 |
[% IF ( WEEKLY_HOLIDAYS ) %] |
249 |
<h3>Weekly - Repeatable holidays</h3> |
249 |
<h3>Weekly - Repeatable holidays</h3> |
250 |
<table id="holidayweeklyrepeatable"> |
250 |
<table id="holidayweeklyrepeatable" class="dataTable no-footer"> |
251 |
<thead> |
251 |
<thead> |
252 |
<tr> |
252 |
<tr> |
253 |
<th class="repeatableweekly">Day of week</th> |
253 |
<th class="repeatableweekly">Day of week</th> |
Lines 269-275
Link Here
|
269 |
|
269 |
|
270 |
[% IF ( REPEATABLE_HOLIDAYS ) %] |
270 |
[% IF ( REPEATABLE_HOLIDAYS ) %] |
271 |
<h3>Yearly - Repeatable holidays</h3> |
271 |
<h3>Yearly - Repeatable holidays</h3> |
272 |
<table id="holidaysyearlyrepeatable"> |
272 |
<table id="holidaysyearlyrepeatable" class="dataTable no-footer"> |
273 |
<thead> |
273 |
<thead> |
274 |
<tr> |
274 |
<tr> |
275 |
[% IF ( dateformat == "metric" ) %] |
275 |
[% IF ( dateformat == "metric" ) %] |
Lines 299-305
Link Here
|
299 |
|
299 |
|
300 |
[% IF ( UNIQUE_HOLIDAYS ) %] |
300 |
[% IF ( UNIQUE_HOLIDAYS ) %] |
301 |
<h3>Unique holidays</h3> |
301 |
<h3>Unique holidays</h3> |
302 |
<table id="holidaysunique"> |
302 |
<label class="controls"> |
|
|
303 |
<input type="checkbox" name="show_past" id="show_past_holidaysunique" class="show_past" /> |
304 |
Show past entries |
305 |
</label> |
306 |
<table id="holidaysunique" class="dataTable no-footer"> |
303 |
<thead> |
307 |
<thead> |
304 |
<tr> |
308 |
<tr> |
305 |
<th class="holiday">Date</th> |
309 |
<th class="holiday">Date</th> |
Lines 309-315
Link Here
|
309 |
</thead> |
313 |
</thead> |
310 |
<tbody> |
314 |
<tbody> |
311 |
[% FOREACH HOLIDAYS_LOO IN UNIQUE_HOLIDAYS %] |
315 |
[% FOREACH HOLIDAYS_LOO IN UNIQUE_HOLIDAYS %] |
312 |
<tr> |
316 |
<tr data-date="[% HOLIDAYS_LOO.date | html %]"> |
313 |
<td><a href="#main" onclick="go_to_date('[% HOLIDAYS_LOO.date | html %]')"><span title="[% HOLIDAYS_LOO.DATE_SORT | html %]">[% HOLIDAYS_LOO.outputdate | html %]</span></a></td> |
317 |
<td><a href="#main" onclick="go_to_date('[% HOLIDAYS_LOO.date | html %]')"><span title="[% HOLIDAYS_LOO.DATE_SORT | html %]">[% HOLIDAYS_LOO.outputdate | html %]</span></a></td> |
314 |
<td>[% HOLIDAYS_LOO.note | html %]</td> |
318 |
<td>[% HOLIDAYS_LOO.note | html %]</td> |
315 |
<td>[% HOLIDAYS_LOO.description.replace('\\\r\\\n', '<br />') | html %]</td> |
319 |
<td>[% HOLIDAYS_LOO.description.replace('\\\r\\\n', '<br />') | html %]</td> |
Lines 321-327
Link Here
|
321 |
|
325 |
|
322 |
[% IF ( FLOAT_HOLIDAYS ) %] |
326 |
[% IF ( FLOAT_HOLIDAYS ) %] |
323 |
<h3>Floating holidays</h3> |
327 |
<h3>Floating holidays</h3> |
324 |
<table id="holidaysfloat"> |
328 |
<label class="controls"> |
|
|
329 |
<input type="checkbox" name="show_past" id="show_past_holidaysfloat" class="show_past" /> |
330 |
Show past entries |
331 |
</label> |
332 |
<table id="holidaysfloat" class="dataTable no-footer"> |
325 |
<thead> |
333 |
<thead> |
326 |
<tr> |
334 |
<tr> |
327 |
<th class="float">Date</th> |
335 |
<th class="float">Date</th> |
Lines 331-337
Link Here
|
331 |
</thead> |
339 |
</thead> |
332 |
<tbody> |
340 |
<tbody> |
333 |
[% FOREACH float_holiday IN FLOAT_HOLIDAYS %] |
341 |
[% FOREACH float_holiday IN FLOAT_HOLIDAYS %] |
334 |
<tr> |
342 |
<tr data-date="[% float_holiday.date | html %]"> |
335 |
<td><a href="#main" onclick="go_to_date('[% float_holiday.date | html %]')"><span title="[% float_holiday.DATE_SORT | html %]">[% float_holiday.outputdate | html %]</span></a></td> |
343 |
<td><a href="#main" onclick="go_to_date('[% float_holiday.date | html %]')"><span title="[% float_holiday.DATE_SORT | html %]">[% float_holiday.outputdate | html %]</span></a></td> |
336 |
<td>[% float_holiday.note | html %]</td> |
344 |
<td>[% float_holiday.note | html %]</td> |
337 |
<td>[% float_holiday.description.replace('\\\r\\\n', '<br />') | html %]</td> |
345 |
<td>[% float_holiday.description.replace('\\\r\\\n', '<br />') | html %]</td> |
Lines 601-606
Link Here
|
601 |
return true; |
609 |
return true; |
602 |
} |
610 |
} |
603 |
|
611 |
|
|
|
612 |
/* Custom table search configuration: If a table row |
613 |
has an "expired" class, hide it UNLESS the |
614 |
show_expired checkbox is checked */ |
615 |
$.fn.dataTable.ext.search.push( |
616 |
function( settings, searchData, index, rowData, counter ) { |
617 |
var table = settings.nTable.id; |
618 |
var row = $(settings.aoData[index].nTr); |
619 |
if( row.hasClass("date_past") && !$("#show_past_" + table ).prop("checked") ){ |
620 |
return false; |
621 |
} else { |
622 |
return true; |
623 |
} |
624 |
} |
625 |
); |
626 |
|
627 |
// Create current date variable |
628 |
var date = new Date(); |
629 |
var datestring = date.toISOString().substring(0, 10); |
630 |
|
604 |
$(document).ready(function() { |
631 |
$(document).ready(function() { |
605 |
$(".hint").hide(); |
632 |
$(".hint").hide(); |
606 |
$("#days_of_week").hide(); |
633 |
$("#days_of_week").hide(); |
Lines 616-621
Link Here
|
616 |
var first_td = $(this).find('td').first(); |
643 |
var first_td = $(this).find('td').first(); |
617 |
first_td.html(weekdays[first_td.html()]); |
644 |
first_td.html(weekdays[first_td.html()]); |
618 |
}); |
645 |
}); |
|
|
646 |
$("#holidayweeklyrepeatable").dataTable($.extend(true, {}, dataTablesDefaults, { |
647 |
"sDom": 't', |
648 |
"bPaginate": false |
649 |
})); |
650 |
var tables = $("#holidaysyearlyrepeatable, #holidaysunique, #holidaysfloat").DataTable($.extend(true, {}, dataTablesDefaults, { |
651 |
"sDom": 't', |
652 |
"bPaginate": false, |
653 |
"createdRow": function( row, data, dataIndex ) { |
654 |
var holiday = $(row).data("date"); |
655 |
if( holiday < datestring ){ |
656 |
$(row).addClass("date_past"); |
657 |
} |
658 |
} |
659 |
})); |
660 |
|
661 |
$(".show_past").on("change", function(){ |
662 |
tables.draw(); |
663 |
}); |
619 |
|
664 |
|
620 |
$("a.helptext").click(function () { |
665 |
$("a.helptext").click(function () { |
621 |
$(this).parent().find(".hint").toggle(); |
666 |
$(this).parent().find(".hint").toggle(); |