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

(-)a/koha-tmpl/intranet-tmpl/lib/jquery/plugins/jquery.dataTables.columnFilter.js (-1 / +1 lines)
Lines 250-256 Link Here
250
            //th.html(_fnRangeLabelPart(0));
250
            //th.html(_fnRangeLabelPart(0));
251
            var sFromId = oTable.attr("id") + '_range_from_' + i;
251
            var sFromId = oTable.attr("id") + '_range_from_' + i;
252
            var from = $('<input type="text" class="date_range_filter" id="' + sFromId + '" rel="' + i + '"/>');
252
            var from = $('<input type="text" class="date_range_filter" id="' + sFromId + '" rel="' + i + '"/>');
253
            from.datepicker();
254
            //th.append(from);
253
            //th.append(from);
255
            //th.append(_fnRangeLabelPart(1));
254
            //th.append(_fnRangeLabelPart(1));
256
            var sToId = oTable.attr("id") + '_range_to_' + i;
255
            var sToId = oTable.attr("id") + '_range_to_' + i;
Lines 275-280 Link Here
275
274
276
275
277
            th.wrapInner('<span class="filter_column filter_date_range" />');
276
            th.wrapInner('<span class="filter_column filter_date_range" />');
277
            from.datepicker();
278
            to.datepicker();
278
            to.datepicker();
279
            var index = i;
279
            var index = i;
280
            aiCustomSearch_Indexes.push(i);
280
            aiCustomSearch_Indexes.push(i);
(-)a/koha-tmpl/intranet-tmpl/prog/en/css/datatables.css (+11 lines)
Lines 243-248 span.filter_column > input.text_filter { Link Here
243
    font-size: 80%;
243
    font-size: 80%;
244
    width: 100%;
244
    width: 100%;
245
    padding: 0;
245
    padding: 0;
246
    box-sizing: border-box;
247
}
248
249
span.filter_column.filter_date_range {
250
    white-space: nowrap;
251
}
252
253
span.filter_column > input.date_range_filter {
254
    font-size: 80%;
255
    width: 6em;
256
    padding: 0;
246
}
257
}
247
258
248
/* Row grouping */
259
/* Row grouping */
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc (+19 lines)
Lines 8-13 Link Here
8
        <form name="issues" action="/cgi-bin/koha/tools/export.pl" method="post" class="checkboxed">
8
        <form name="issues" action="/cgi-bin/koha/tools/export.pl" method="post" class="checkboxed">
9
            <table id="issues-table" style="width: 100% !Important;">
9
            <table id="issues-table" style="width: 100% !Important;">
10
                <thead>
10
                <thead>
11
                    <tr class="filters_row" style="display: none">
12
                        <th>&nbsp;</th>
13
                        <th>&nbsp;</th>
14
                        <th>&nbsp;</th>
15
                        <th>Due date</th>
16
                        <th>Due date</th>
17
                        <th>Title</th>
18
                        <th>Item type</th>
19
                        <th>Location</th>
20
                        <th>Checked out on</th>
21
                        <th>Checked out from</th>
22
                        <th>Call no</th>
23
                        <th>&nbsp;</th>
24
                        <th>&nbsp;</th>
25
                        <th>&nbsp;</th>
26
                        <th>&nbsp;</th>
27
                        <th>&nbsp;</th>
28
                        <th>&nbsp;</th>
29
                    </tr>
11
                    <tr>
30
                    <tr>
12
                        <th scope="col">&nbsp;</th>
31
                        <th scope="col">&nbsp;</th>
13
                        <th scope="col">&nbsp;</th>
32
                        <th scope="col">&nbsp;</th>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc (+1 lines)
Lines 31-35 Link Here
31
    var YES = _("Yes");
31
    var YES = _("Yes");
32
    var INHOUSE_USE = _("On-site checkout");
32
    var INHOUSE_USE = _("On-site checkout");
33
    var GROUP_TODAYS_CHECKOUTS = _("Group today's checkouts");
33
    var GROUP_TODAYS_CHECKOUTS = _("Group today's checkouts");
34
    var SHOW_COLUMN_FILTERS = _("Show column filters");
34
//]]>
35
//]]>
35
</script>
36
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js (+63 lines)
Lines 21-26 function disableGrouping(datatable) { Link Here
21
    }
21
    }
22
}
22
}
23
23
24
function enableFiltering(datatable) {
25
    var oSettings = datatable.fnSettings();
26
    var filters_row = $(oSettings.nTable).find('thead tr.filters_row');
27
    if (!filters_row.hasClass('columnFilter')) {
28
        datatable.columnFilter({
29
            sPlaceHolder: "head:after",
30
            bUseColVis: true,
31
            sRangeFormat: "From {from}<br>to {to}",
32
            aoColumns: [
33
                null,
34
                null,
35
                null,
36
                null,
37
                { type: "date-range" },
38
                { type: "text" },
39
                { type: "text" },
40
                { type: "text" },
41
                { type: "date-range" },
42
                { type: "text" },
43
                { type: "text" },
44
                null,
45
                null,
46
                null,
47
                null,
48
                null,
49
                null,
50
                null
51
            ]
52
        });
53
        filters_row.addClass('columnFilter');
54
    }
55
    filters_row.show();
56
}
57
58
function disableFiltering(datatable) {
59
    var oSettings = datatable.fnSettings();
60
    var filters_row = $(oSettings.nTable).find('thead tr.filters_row');
61
    filters_row.find('input[type="text"]')
62
        .val('')            // Empty filter text boxes
63
        .trigger('keyup')   // Filter (display all rows)
64
        .trigger('blur');   // Reset value to the column name
65
    filters_row.hide();
66
}
67
24
function loadTableData(datatable, borrowernumbers, offset, count) {
68
function loadTableData(datatable, borrowernumbers, offset, count) {
25
    offset = offset ? offset : 0;
69
    offset = offset ? offset : 0;
26
    count = count ? count : 100;
70
    count = count ? count : 100;
Lines 522-527 $(document).ready(function() { Link Here
522
          .append('<label for="issues-table-row-grouping-switch">' + GROUP_TODAYS_CHECKOUTS + '</label>')
566
          .append('<label for="issues-table-row-grouping-switch">' + GROUP_TODAYS_CHECKOUTS + '</label>')
523
          .appendTo('#issues-table_wrapper .top.pager');
567
          .appendTo('#issues-table_wrapper .top.pager');
524
568
569
        var filteringSwitch = $('<input type="checkbox">')
570
          .attr('id', 'issues-table-filtering-switch')
571
          .css('vertical-align', 'middle')
572
          .change(function() {
573
              if ($(this).is(':checked')) {
574
                  enableFiltering(issuesTable);
575
              } else {
576
                  disableFiltering(issuesTable);
577
              }
578
          });
579
        $('<div></div>')
580
          .css('float', 'left')
581
          .css('padding', '0.3em 0.5em')
582
          .css('line-height', '1.9em')
583
          .append(filteringSwitch)
584
          .append('&nbsp;')
585
          .append('<label for="issues-table-filtering-switch">' + SHOW_COLUMN_FILTERS + '</label>')
586
          .appendTo('#issues-table_wrapper .top.pager');
587
525
        loadTableData(issuesTable, borrowernumber);
588
        loadTableData(issuesTable, borrowernumber);
526
589
527
        if ( $("#issues-table").length ) {
590
        if ( $("#issues-table").length ) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (+1 lines)
Lines 25-30 Link Here
25
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery-ui-timepicker-addon.min.js"></script>
25
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery-ui-timepicker-addon.min.js"></script>
26
[% INCLUDE 'timepicker.inc' %]
26
[% INCLUDE 'timepicker.inc' %]
27
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.rowGrouping.js"></script>
27
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.rowGrouping.js"></script>
28
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.columnFilter.js"></script>
28
<script type="text/javascript" src="[% themelang %]/js/pages/circulation.js"></script>
29
<script type="text/javascript" src="[% themelang %]/js/pages/circulation.js"></script>
29
<script type="text/javascript" src="[% themelang %]/js/checkouts.js"></script>
30
<script type="text/javascript" src="[% themelang %]/js/checkouts.js"></script>
30
<script type="text/javascript" src="[% themelang %]/js/holds.js"></script>
31
<script type="text/javascript" src="[% themelang %]/js/holds.js"></script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (-1 / +1 lines)
Lines 22-27 Link Here
22
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery-ui-timepicker-addon.min.js"></script>
22
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery-ui-timepicker-addon.min.js"></script>
23
[% INCLUDE 'timepicker.inc' %]
23
[% INCLUDE 'timepicker.inc' %]
24
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.rowGrouping.js"></script>
24
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.rowGrouping.js"></script>
25
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.columnFilter.js"></script>
25
<script type="text/javascript" src="[% themelang %]/js/pages/circulation.js"></script>
26
<script type="text/javascript" src="[% themelang %]/js/pages/circulation.js"></script>
26
<script type="text/javascript" src="[% themelang %]/js/checkouts.js"></script>
27
<script type="text/javascript" src="[% themelang %]/js/checkouts.js"></script>
27
<script type="text/javascript" src="[% themelang %]/js/holds.js"></script>
28
<script type="text/javascript" src="[% themelang %]/js/holds.js"></script>
28
- 

Return to bug 15235