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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc (-5 / +7 lines)
Lines 2-13 Link Here
2
2
3
<script type="text/javascript">
3
<script type="text/javascript">
4
function KohaTable(id_selector, dt_parameters, columns_settings, add_filters) {
4
function KohaTable(id_selector, dt_parameters, columns_settings, add_filters) {
5
    var id = 0;
5
    var counter = 0;
6
    var hidden_ids = [];
6
    var hidden_ids = [];
7
    var included_ids = [];
7
    var included_ids = [];
8
    var selector = '#' + id_selector;
9
8
    $(columns_settings).each( function() {
10
    $(columns_settings).each( function() {
9
        var named_id = $( 'thead th[data-colname="' + this.columnname + '"]', selector ).index( 'th' );
11
        var named_id = $( 'thead th[data-colname="' + this.columnname + '"]', selector ).index( 'th' );
10
        var used_id = dt_parameters.bKohaColumnsUseNames ? named_id : id;
12
        var used_id = dt_parameters.bKohaColumnsUseNames ? named_id : counter;
11
        if ( used_id == -1 ) return;
13
        if ( used_id == -1 ) return;
12
14
13
        if ( this['is_hidden'] == "1" ) {
15
        if ( this['is_hidden'] == "1" ) {
Lines 16-22 function KohaTable(id_selector, dt_parameters, columns_settings, add_filters) { Link Here
16
        if ( this['cannot_be_toggled'] == "0" ) {
18
        if ( this['cannot_be_toggled'] == "0" ) {
17
            included_ids.push( used_id );
19
            included_ids.push( used_id );
18
        }
20
        }
19
        id++;
21
        counter++;
20
    });
22
    });
21
    dt_parameters[ "buttons" ] = [
23
    dt_parameters[ "buttons" ] = [
22
        {
24
        {
Lines 26-32 function KohaTable(id_selector, dt_parameters, columns_settings, add_filters) { Link Here
26
        }
28
        }
27
    ];
29
    ];
28
30
29
    var table = $('#' + id_selector + ' table');
31
    var table = $(selector);
30
    if ( add_filters ) {
32
    if ( add_filters ) {
31
        // Duplicate the table header row for columnFilter
33
        // Duplicate the table header row for columnFilter
32
        thead_row = table.find('thead tr');
34
        thead_row = table.find('thead tr');
Lines 46-52 function KohaTable(id_selector, dt_parameters, columns_settings, add_filters) { Link Here
46
        link = $('<a>')
48
        link = $('<a>')
47
            .attr('href', '#')
49
            .attr('href', '#')
48
            .attr('id', id_selector + '_activate_filters');
50
            .attr('id', id_selector + '_activate_filters');
49
        $("." + id_selector + "_table_controls").prepend(link);
51
        $("." + id_selector  + "_table_controls").prepend(link);
50
        deactivate_filters(id_selector);
52
        deactivate_filters(id_selector);
51
    }
53
    }
52
54
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt (-1 / +1 lines)
Lines 216-222 Link Here
216
        var MSG_REMOVE_PATRON = _("Remove");
216
        var MSG_REMOVE_PATRON = _("Remove");
217
        $(document).ready(function() {
217
        $(document).ready(function() {
218
            var columns_settings = [% ColumnsSettings.GetColumns( 'acqui', 'histsearch', 'histsearcht', 'json' ) %];
218
            var columns_settings = [% ColumnsSettings.GetColumns( 'acqui', 'histsearch', 'histsearcht', 'json' ) %];
219
            KohaTable("#histsearcht", {
219
            KohaTable("histsearcht", {
220
                "aoColumnDefs": [
220
                "aoColumnDefs": [
221
                    { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
221
                    { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
222
                    { "sType": "title-string", "aTargets" : [ "title-string" ] }
222
                    { "sType": "title-string", "aTargets" : [ "title-string" ] }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt (-1 / +1 lines)
Lines 26-32 function check_uncheck() { Link Here
26
$(document).ready(function() {
26
$(document).ready(function() {
27
27
28
    var columns_settings = [% ColumnsSettings.GetColumns( 'acqui', 'lateorders', 'late_orders', 'json' ) %];
28
    var columns_settings = [% ColumnsSettings.GetColumns( 'acqui', 'lateorders', 'late_orders', 'json' ) %];
29
    late_orderst = KohaTable("#late_orders", {
29
    late_orderst = KohaTable("late_orders", {
30
        "aoColumnDefs": [
30
        "aoColumnDefs": [
31
            { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
31
            { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
32
            { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
32
            { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt (-1 / +1 lines)
Lines 235-241 Link Here
235
235
236
        $(document).ready(function() {
236
        $(document).ready(function() {
237
            columns_settings = [% ColumnsSettings.GetColumns( 'admin', 'currency', 'currencies-table', 'json' ) %]
237
            columns_settings = [% ColumnsSettings.GetColumns( 'admin', 'currency', 'currencies-table', 'json' ) %]
238
            var issuest = KohaTable("#currencies-table", {
238
            var issuest = KohaTable("currencies-table", {
239
                dom: 'B<"clearfix">t',
239
                dom: 'B<"clearfix">t',
240
                "columnDefs": [
240
                "columnDefs": [
241
                    { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
241
                    { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-3 / +3 lines)
Lines 310-316 Link Here
310
[% items_table_block_iter = 0 %]
310
[% items_table_block_iter = 0 %]
311
[% BLOCK items_table %]
311
[% BLOCK items_table %]
312
    [% items_table_block_iter = items_table_block_iter + 1 %]
312
    [% items_table_block_iter = items_table_block_iter + 1 %]
313
    <div class="[% tab %]_table_controls">
313
    <div class="[% tab %]_table_table_controls">
314
        [% IF (StaffDetailItemSelection) %]
314
        [% IF (StaffDetailItemSelection) %]
315
            | <a href="#" class="SelectAll" data-tab="[% tab %]"><i class="fa fa-check"></i> Select all</a> |
315
            | <a href="#" class="SelectAll" data-tab="[% tab %]"><i class="fa fa-check"></i> Select all</a> |
316
            <a href="#" class="ClearAll" data-tab="[% tab %]"><i class="fa fa-remove"></i> Clear all</a>
316
            <a href="#" class="ClearAll" data-tab="[% tab %]"><i class="fa fa-remove"></i> Clear all</a>
Lines 325-331 Link Here
325
            </span>
325
            </span>
326
        [% END %]
326
        [% END %]
327
    </div>
327
    </div>
328
    <table class="items_table">
328
    <table class="items_table" id="[% tab %]_table">
329
        <thead>
329
        <thead>
330
            <tr>
330
            <tr>
331
                [% IF (StaffDetailItemSelection) %]<th class="NoSort"></th>[% END %]
331
                [% IF (StaffDetailItemSelection) %]<th class="NoSort"></th>[% END %]
Lines 1049-1055 Link Here
1049
        browser.show();
1049
        browser.show();
1050
1050
1051
        $(document).ready(function() {
1051
        $(document).ready(function() {
1052
            var ids = ['holdings', 'otherholdings'];
1052
            var ids = ['holdings_table', 'otherholdings_table'];
1053
1053
1054
            for (var i in ids) {
1054
            for (var i in ids) {
1055
                var id = ids[i];
1055
                var id = ids[i];
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt (-1 / +1 lines)
Lines 58-64 $(document).ready(function(){ Link Here
58
    // Skip the first column
58
    // Skip the first column
59
    columns_settings.unshift( { cannot_be_toggled: "1" } );
59
    columns_settings.unshift( { cannot_be_toggled: "1" } );
60
60
61
    var itemst = KohaTable("#itemst", {
61
    var itemst = KohaTable("itemst", {
62
        "aoColumnDefs": [
62
        "aoColumnDefs": [
63
          { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
63
          { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
64
        ],
64
        ],
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt (-1 / +1 lines)
Lines 155-161 Link Here
155
    <script type="text/javascript">
155
    <script type="text/javascript">
156
        $(document).ready(function() {
156
        $(document).ready(function() {
157
          var columns_settings = [% ColumnsSettings.GetColumns('circ', 'holds', 'holds-to-pull', 'json') %];
157
          var columns_settings = [% ColumnsSettings.GetColumns('circ', 'holds', 'holds-to-pull', 'json') %];
158
          var holdst = KohaTable("#holdst", {
158
          var holdst = KohaTable("holdst", {
159
            "aoColumnDefs": [
159
            "aoColumnDefs": [
160
                { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
160
                { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
161
                { "sType": "title-string", "aTargets" : [ "title-string" ] },
161
                { "sType": "title-string", "aTargets" : [ "title-string" ] },
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-1 / +1 lines)
Lines 715-721 Link Here
715
            [% END %]
715
            [% END %]
716
716
717
            var columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'returns', 'checkedintable', 'json' ) %]
717
            var columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'returns', 'checkedintable', 'json' ) %]
718
            var returns_table = KohaTable("#checkedintable", {
718
            var returns_table = KohaTable("checkedintable", {
719
                    "bFilter":false,
719
                    "bFilter":false,
720
                    "bPaginate":false,
720
                    "bPaginate":false,
721
                    "bInfo":false,
721
                    "bInfo":false,
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt (-1 / +1 lines)
Lines 215-221 Link Here
215
            $('#holdst thead input').on('change keyup keydown', filterColumn);
215
            $('#holdst thead input').on('change keyup keydown', filterColumn);
216
216
217
            var columns_settings = [% ColumnsSettings.GetColumns('circ', 'view_holdsqueue', 'holds-table', 'json') %];
217
            var columns_settings = [% ColumnsSettings.GetColumns('circ', 'view_holdsqueue', 'holds-table', 'json') %];
218
            var holdst = KohaTable("#holdst", {
218
            var holdst = KohaTable("holdst", {
219
                "aaSorting": [[ 3, "asc" ]],
219
                "aaSorting": [[ 3, "asc" ]],
220
                "aoColumns": [
220
                "aoColumns": [
221
                    { "sType": "anti-the" },null,null,null,null,null,null,null,null,{ "sType": "title-string" },null
221
                    { "sType": "anti-the" },null,null,null,null,null,null,null,null,{ "sType": "title-string" },null
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt (-1 / +1 lines)
Lines 13-19 $(document).ready(function() { Link Here
13
    var txtActivefilter = _("Filter paid transactions");
13
    var txtActivefilter = _("Filter paid transactions");
14
    var txtInactivefilter = _("Show all transactions");
14
    var txtInactivefilter = _("Show all transactions");
15
    var columns_settings = [% ColumnsSettings.GetColumns('members', 'fines', 'account-fines', 'json') %];
15
    var columns_settings = [% ColumnsSettings.GetColumns('members', 'fines', 'account-fines', 'json') %];
16
    var table_account_fines = KohaTable("#table_account_fines", {
16
    var table_account_fines = KohaTable("table_account_fines", {
17
        "sPaginationType": "four_button",
17
        "sPaginationType": "four_button",
18
        'aaSorting': [[0, 'desc']],
18
        'aaSorting': [[0, 'desc']],
19
        "sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
19
        "sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt (-1 / +1 lines)
Lines 166-172 $(document).ready(function() { Link Here
166
        [%# Remove the first column if we do not display the checkbox %]
166
        [%# Remove the first column if we do not display the checkbox %]
167
        columns_settings.splice(0, 1);
167
        columns_settings.splice(0, 1);
168
    [% END %]
168
    [% END %]
169
    dtMemberResults = KohaTable("#memberresultst", {
169
    dtMemberResults = KohaTable("memberresultst", {
170
        'bServerSide': true,
170
        'bServerSide': true,
171
        'sAjaxSource': "/cgi-bin/koha/svc/members/search",
171
        'sAjaxSource': "/cgi-bin/koha/svc/members/search",
172
        'fnServerData': function(sSource, aoData, fnCallback) {
172
        'fnServerData': function(sSource, aoData, fnCallback) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tt (-3 / +5 lines)
Lines 141-160 Link Here
141
141
142
[% MACRO jsinclude BLOCK %]
142
[% MACRO jsinclude BLOCK %]
143
    [% INCLUDE 'datatables.inc' %]
143
    [% INCLUDE 'datatables.inc' %]
144
    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.columnFilter.js"></script>
144
    [% INCLUDE 'columns_settings.inc' %]
145
    [% INCLUDE 'columns_settings.inc' %]
146
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/table_filters.js"></script>
145
    <script type='text/javascript'>
147
    <script type='text/javascript'>
146
        $(document).ready(function() {
148
        $(document).ready(function() {
147
            var columns_settings = [% ColumnsSettings.GetColumns( 'reports', 'lostitems', 'lostitems-table', 'json' ) %];
149
            var columns_settings = [% ColumnsSettings.GetColumns( 'reports', 'lostitems', 'lostitems-table', 'json' ) %];
148
            var lostitems_table = KohaTable("#lostitems-table", {
150
            var lostitems_table = KohaTable("lostitems-table", {
149
                "dom": 'B<"clearfix">t',
151
                "dom": 'B<"clearfix">t',
150
                "aaSorting": [],
152
                "aaSorting": [],
151
                "aoColumnDefs": [
153
                "aoColumnDefs": [
152
                    { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
154
                    { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
153
                    { "sType": "title-string", "aTargets" : [ "title-string" ] }
155
                    { "sType": "title-string", "aTargets" : [ "title-string" ] }
154
                ],
156
                ],
157
                'bAutoWidth': false,
155
                "bPaginate": false,
158
                "bPaginate": false,
156
            }, columns_settings);
159
            }, columns_settings, 'with_filters');
157
158
        });
160
        });
159
    </script>
161
    </script>
160
[% END %]
162
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/table_filters.js (-3 / +2 lines)
Lines 1-5 Link Here
1
function activate_filters(id) {
1
function activate_filters(id) {
2
    var table = $("#" + id + " table");
2
    var table = $("#" + id );
3
    if (table.length == 1) {
3
    if (table.length == 1) {
4
        filters_row = table.find('thead tr.filters_row');
4
        filters_row = table.find('thead tr.filters_row');
5
5
Lines 32-38 function activate_filters(id) { Link Here
32
}
32
}
33
33
34
function deactivate_filters(id) {
34
function deactivate_filters(id) {
35
    filters_row = $("#" + id + " table").find('thead tr.filters_row');
35
    filters_row = $("#" + id ).find('thead tr.filters_row');
36
36
37
    filters_row.find('input[type="text"]')
37
    filters_row.find('input[type="text"]')
38
        .val('')            // Empty filter text boxes
38
        .val('')            // Empty filter text boxes
39
- 

Return to bug 9573