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 14-20 Link Here
14
var MSG_REMOVE_PATRON = _("Remove");
14
var MSG_REMOVE_PATRON = _("Remove");
15
 $(document).ready(function() {
15
 $(document).ready(function() {
16
    var columns_settings = [% ColumnsSettings.GetColumns( 'acqui', 'histsearch', 'histsearcht', 'json' ) %];
16
    var columns_settings = [% ColumnsSettings.GetColumns( 'acqui', 'histsearch', 'histsearcht', 'json' ) %];
17
    KohaTable("#histsearcht", {
17
    KohaTable("histsearcht", {
18
        "aoColumnDefs": [
18
        "aoColumnDefs": [
19
            { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
19
            { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
20
            { "sType": "title-string", "aTargets" : [ "title-string" ] }
20
            { "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 26-32 Link Here
26
26
27
    $(document).ready(function() {
27
    $(document).ready(function() {
28
        columns_settings = [% ColumnsSettings.GetColumns( 'admin', 'currency', 'currencies-table', 'json' ) %]
28
        columns_settings = [% ColumnsSettings.GetColumns( 'admin', 'currency', 'currencies-table', 'json' ) %]
29
        var issuest = KohaTable("#currencies-table", {
29
        var issuest = KohaTable("currencies-table", {
30
            dom: 'B<"clearfix">t',
30
            dom: 'B<"clearfix">t',
31
            "columnDefs": [
31
            "columnDefs": [
32
                { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
32
                { "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 55-61 $(document).ready(function(){ Link Here
55
    // Skip the first column
55
    // Skip the first column
56
    columns_settings.unshift( { cannot_be_toggled: "1" } );
56
    columns_settings.unshift( { cannot_be_toggled: "1" } );
57
57
58
    var itemst = KohaTable("#itemst", {
58
    var itemst = KohaTable("itemst", {
59
        "aoColumnDefs": [
59
        "aoColumnDefs": [
60
          { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
60
          { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
61
        ],
61
        ],
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt (-1 / +1 lines)
Lines 15-21 Link Here
15
//<![CDATA[
15
//<![CDATA[
16
$(document).ready(function() {
16
$(document).ready(function() {
17
  var columns_settings = [% ColumnsSettings.GetColumns('circ', 'holds', 'holds-to-pull', 'json') %];
17
  var columns_settings = [% ColumnsSettings.GetColumns('circ', 'holds', 'holds-to-pull', 'json') %];
18
  var holdst = KohaTable("#holdst", {
18
  var holdst = KohaTable("holdst", {
19
    "aoColumnDefs": [
19
    "aoColumnDefs": [
20
        { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
20
        { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
21
        { "sType": "title-string", "aTargets" : [ "title-string" ] },
21
        { "sType": "title-string", "aTargets" : [ "title-string" ] },
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-1 / +1 lines)
Lines 59-65 $(document).ready(function () { Link Here
59
    [% END %]
59
    [% END %]
60
60
61
    var columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'returns', 'checkedintable', 'json' ) %]
61
    var columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'returns', 'checkedintable', 'json' ) %]
62
    var returns_table = KohaTable("#checkedintable", {
62
    var returns_table = KohaTable("checkedintable", {
63
            "bFilter":false,
63
            "bFilter":false,
64
            "bPaginate":false,
64
            "bPaginate":false,
65
            "bInfo":false,
65
            "bInfo":false,
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt (-1 / +1 lines)
Lines 30-36 $(document).ready(function() { Link Here
30
    $('#holdst thead input').on('change keyup keydown', filterColumn);
30
    $('#holdst thead input').on('change keyup keydown', filterColumn);
31
31
32
    var columns_settings = [% ColumnsSettings.GetColumns('circ', 'view_holdsqueue', 'holds-table', 'json') %];
32
    var columns_settings = [% ColumnsSettings.GetColumns('circ', 'view_holdsqueue', 'holds-table', 'json') %];
33
    var holdst = KohaTable("#holdst", {
33
    var holdst = KohaTable("holdst", {
34
        "aaSorting": [[ 3, "asc" ]],
34
        "aaSorting": [[ 3, "asc" ]],
35
        "aoColumns": [
35
        "aoColumns": [
36
            { "sType": "anti-the" },null,null,null,null,null,null,null,null,{ "sType": "title-string" },null
36
            { "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 7-27 Link Here
7
[% INCLUDE 'doc-head-close.inc' %]
7
[% INCLUDE 'doc-head-close.inc' %]
8
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
8
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
9
[% INCLUDE 'datatables.inc' %]
9
[% INCLUDE 'datatables.inc' %]
10
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.columnFilter.js"></script>
10
[% INCLUDE 'columns_settings.inc' %]
11
[% INCLUDE 'columns_settings.inc' %]
12
<script type="text/javascript" src="[% interface %]/[% theme %]/js/table_filters.js"></script>
11
<script type='text/javascript'>
13
<script type='text/javascript'>
12
//<![CDATA[
14
//<![CDATA[
13
    $(document).ready(function() {
15
    $(document).ready(function() {
14
        var columns_settings = [% ColumnsSettings.GetColumns( 'reports', 'lostitems', 'lostitems-table', 'json' ) %];
16
        var columns_settings = [% ColumnsSettings.GetColumns( 'reports', 'lostitems', 'lostitems-table', 'json' ) %];
15
        var lostitems_table = KohaTable("#lostitems-table", {
17
        var lostitems_table = KohaTable("lostitems-table", {
16
            "dom": 'B<"clearfix">t',
18
            "dom": 'B<"clearfix">t',
17
            "aaSorting": [],
19
            "aaSorting": [],
18
            "aoColumnDefs": [
20
            "aoColumnDefs": [
19
                { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
21
                { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
20
                { "sType": "title-string", "aTargets" : [ "title-string" ] }
22
                { "sType": "title-string", "aTargets" : [ "title-string" ] }
21
            ],
23
            ],
24
            'bAutoWidth': false,
22
            "bPaginate": false,
25
            "bPaginate": false,
23
        }, columns_settings);
26
        }, columns_settings, 'with_filters');
24
25
    });
27
    });
26
//]]>
28
//]]>
27
</script>
29
</script>
(-)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