View | Details | Raw Unified | Return to bug 27773
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/css/calendar.css (+5 lines)
Lines 1-3 Link Here
1
.controls {
2
    display: block;
3
    padding: 3px 0;
4
}
5
1
.key {
6
.key {
2
    padding: 3px;
7
    padding: 3px;
3
    white-space: nowrap;
8
    white-space: nowrap;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt (-5 / +42 lines)
Lines 242-247 Link Here
242
<!--   this will probably always have the least amount of data -->
242
<!--   this will probably always have the least amount of data -->
243
[% IF ( EXCEPTION_HOLIDAYS_LOOP ) %]
243
[% IF ( EXCEPTION_HOLIDAYS_LOOP ) %]
244
<h3>Exceptions</h3>
244
<h3>Exceptions</h3>
245
    <label class="controls">
246
        <input type="checkbox" name="show_past" id="show_past_holidayexceptions" class="show_past" />
247
        Show past entries
248
    </label>
245
  <table id="holidayexceptions">
249
  <table id="holidayexceptions">
246
<thead><tr>
250
<thead><tr>
247
  <th class="exception">Date</th>
251
  <th class="exception">Date</th>
Lines 251-257 Link Here
251
</thead>
255
</thead>
252
<tbody>
256
<tbody>
253
  [% FOREACH EXCEPTION_HOLIDAYS_LOO IN EXCEPTION_HOLIDAYS_LOOP %]
257
  [% FOREACH EXCEPTION_HOLIDAYS_LOO IN EXCEPTION_HOLIDAYS_LOOP %]
254
  <tr>
258
  <tr data-date="[% EXCEPTION_HOLIDAYS_LOO.DATE_SORT | html %]">
255
  <td data-order="[% EXCEPTION_HOLIDAYS_LOO.DATE_SORT | html %]">
259
  <td data-order="[% EXCEPTION_HOLIDAYS_LOO.DATE_SORT | html %]">
256
    <a href="/cgi-bin/koha/tools/holidays.pl?branch=[% branch | uri %]&amp;calendardate=[% EXCEPTION_HOLIDAYS_LOO.DATE | uri %]">
260
    <a href="/cgi-bin/koha/tools/holidays.pl?branch=[% branch | uri %]&amp;calendardate=[% EXCEPTION_HOLIDAYS_LOO.DATE | uri %]">
257
        [% EXCEPTION_HOLIDAYS_LOO.DATE | html %]
261
        [% EXCEPTION_HOLIDAYS_LOO.DATE | html %]
Lines 318-323 Link Here
318
322
319
[% IF ( HOLIDAYS_LOOP ) %]
323
[% IF ( HOLIDAYS_LOOP ) %]
320
<h3>Unique holidays</h3>
324
<h3>Unique holidays</h3>
325
<label class="controls">
326
    <input type="checkbox" name="show_past" id="show_past_holidaysunique" class="show_past" />
327
    Show past entries
328
</label>
321
<table id="holidaysunique">
329
<table id="holidaysunique">
322
<thead>
330
<thead>
323
<tr>
331
<tr>
Lines 328-334 Link Here
328
</thead>
336
</thead>
329
<tbody>
337
<tbody>
330
    [% FOREACH HOLIDAYS_LOO IN HOLIDAYS_LOOP %]
338
    [% FOREACH HOLIDAYS_LOO IN HOLIDAYS_LOOP %]
331
<tr>
339
<tr data-date="[% HOLIDAYS_LOO.DATE_SORT | html %]">
332
    <td data-order="[% HOLIDAYS_LOO.DATE_SORT | html %]">
340
    <td data-order="[% HOLIDAYS_LOO.DATE_SORT | html %]">
333
        <a href="/cgi-bin/koha/tools/holidays.pl?branch=[% branch | uri %]&amp;calendardate=[% HOLIDAYS_LOO.DATE | uri %]">
341
        <a href="/cgi-bin/koha/tools/holidays.pl?branch=[% branch | uri %]&amp;calendardate=[% HOLIDAYS_LOO.DATE | uri %]">
334
            [% HOLIDAYS_LOO.DATE | html %]
342
            [% HOLIDAYS_LOO.DATE | html %]
Lines 504-509 Link Here
504
                }
512
                }
505
        };
513
        };
506
514
515
            /* Custom table search configuration: If a table row
516
               has an "expired" class, hide it UNLESS the
517
               show_expired checkbox is checked */
518
            $.fn.dataTable.ext.search.push(
519
                function( settings, searchData, index, rowData, counter ) {
520
                    var table = settings.nTable.id;
521
                    var row = $(settings.aoData[index].nTr);
522
                    if( row.hasClass("date_past") && !$("#show_past_" + table ).prop("checked") ){
523
                        return false;
524
                    } else {
525
                        return true;
526
                    }
527
                }
528
            );
529
530
        // Create current date variable
531
        var date = new Date();
532
        var datestring = date.toISOString().substring(0, 10);
533
507
        $(document).ready(function() {
534
        $(document).ready(function() {
508
535
509
            $(".hint").hide();
536
            $(".hint").hide();
Lines 518-527 Link Here
518
                "sDom": 't',
545
                "sDom": 't',
519
                "bPaginate": false
546
                "bPaginate": false
520
            }));
547
            }));
521
            $("#holidayexceptions,#holidaysyearlyrepeatable,#holidaysunique").dataTable($.extend(true, {}, dataTablesDefaults, {
548
            var tables = $("#holidayexceptions,#holidaysyearlyrepeatable,#holidaysunique").DataTable($.extend(true, {}, dataTablesDefaults, {
522
                "sDom": 't',
549
                "sDom": 't',
523
                "bPaginate": false
550
                "bPaginate": false,
551
                "createdRow": function( row, data, dataIndex ) {
552
                    var holiday = $(row).data("date");
553
                    if( holiday < datestring ){
554
                        $(row).addClass("date_past");
555
                    }
556
                }
524
            }));
557
            }));
558
559
            $(".show_past").on("change", function(){
560
                tables.draw();
561
            });
562
525
            $("a.helptext").click(function(){
563
            $("a.helptext").click(function(){
526
                $(this).parent().find(".hint").toggle(); return false;
564
                $(this).parent().find(".hint").toggle(); return false;
527
            });
565
            });
528
- 

Return to bug 27773