diff --git a/koha-tmpl/intranet-tmpl/prog/css/calendar.css b/koha-tmpl/intranet-tmpl/prog/css/calendar.css
index fd81d6fbed..b0fb065922 100644
--- a/koha-tmpl/intranet-tmpl/prog/css/calendar.css
+++ b/koha-tmpl/intranet-tmpl/prog/css/calendar.css
@@ -1,3 +1,8 @@
+.controls {
+ display: block;
+ padding: 3px 0;
+}
+
.key {
padding: 3px;
white-space: nowrap;
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt
index ca8e20c808..c473112ade 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt
@@ -242,6 +242,10 @@
[% IF ( EXCEPTION_HOLIDAYS_LOOP ) %]
Exceptions
+
| Date |
@@ -251,7 +255,7 @@
[% FOREACH EXCEPTION_HOLIDAYS_LOO IN EXCEPTION_HOLIDAYS_LOOP %]
-
+
[% EXCEPTION_HOLIDAYS_LOO.DATE | html %]
@@ -318,6 +322,10 @@
[% IF ( HOLIDAYS_LOOP ) %]
Unique holidays
+
@@ -328,7 +336,7 @@
[% FOREACH HOLIDAYS_LOO IN HOLIDAYS_LOOP %]
-
+
|
[% HOLIDAYS_LOO.DATE | html %]
@@ -504,6 +512,25 @@
}
};
+ /* Custom table search configuration: If a table row
+ has an "expired" class, hide it UNLESS the
+ show_expired checkbox is checked */
+ $.fn.dataTable.ext.search.push(
+ function( settings, searchData, index, rowData, counter ) {
+ var table = settings.nTable.id;
+ var row = $(settings.aoData[index].nTr);
+ if( row.hasClass("date_past") && !$("#show_past_" + table ).prop("checked") ){
+ return false;
+ } else {
+ return true;
+ }
+ }
+ );
+
+ // Create current date variable
+ var date = new Date();
+ var datestring = date.toISOString().substring(0, 10);
+
$(document).ready(function() {
$(".hint").hide();
@@ -518,10 +545,21 @@
"sDom": 't',
"bPaginate": false
}));
- $("#holidayexceptions,#holidaysyearlyrepeatable,#holidaysunique").dataTable($.extend(true, {}, dataTablesDefaults, {
+ var tables = $("#holidayexceptions,#holidaysyearlyrepeatable,#holidaysunique").DataTable($.extend(true, {}, dataTablesDefaults, {
"sDom": 't',
- "bPaginate": false
+ "bPaginate": false,
+ "createdRow": function( row, data, dataIndex ) {
+ var holiday = $(row).data("date");
+ if( holiday < datestring ){
+ $(row).addClass("date_past");
+ }
+ }
}));
+
+ $(".show_past").on("change", function(){
+ tables.draw();
+ });
+
$("a.helptext").click(function(){
$(this).parent().find(".hint").toggle(); return false;
});
| |