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

(-)a/koha-tmpl/intranet-tmpl/lib/jquery/plugins/dataTables.fnFilterAll.js (-39 lines)
Lines 1-39 Link Here
1
/**
2
 * Apply the same filter to all DataTable instances on a particular page. The
3
 * function call exactly matches that used by `fnFilter()` so regular expression
4
 * and individual column sorting can be used.
5
 *
6
 * DataTables 1.10+ provides this ability through its new API, which is able to
7
 * to control multiple tables at a time.
8
 * `$('.dataTable').DataTable().search( ... )` for example will apply the same
9
 * filter to all tables on the page. The new API should be used in preference
10
 * to this older method if at all possible.
11
 *
12
 *  @name fnFilterAll
13
 *  @summary Apply a common filter to all DataTables on a page
14
 *  @author [Kristoffer Karlström](http://www.kmmtiming.se/)
15
 *  @deprecated
16
 *
17
 *  @param {string} sInput Filtering input
18
 *  @param {integer} [iColumn=null] Column to apply the filter to
19
 *  @param {boolean} [bRegex] Regular expression flag
20
 *  @param {boolean} [bSmart] Smart filtering flag
21
 *
22
 *  @example
23
 *    $(document).ready(function() {
24
 *      var table = $(".dataTable").dataTable();
25
 *
26
 *      $("#search").keyup( function () {
27
 *        // Filter on the column (the index) of this element
28
 *        table.fnFilterAll(this.value);
29
 *      } );
30
 *    });
31
 */
32
33
jQuery.fn.dataTableExt.oApi.fnFilterAll = function(oSettings, sInput, iColumn, bRegex, bSmart) {
34
    var settings = $.fn.dataTableSettings;
35
36
    for ( var i=0 ; i<settings.length ; i++ ) {
37
        settings[i].oInstance.fnFilter( sInput, iColumn, bRegex, bSmart);
38
    }
39
};
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt (-9 / +9 lines)
Lines 23-38 Link Here
23
      <h1>Invoices</h1>
23
      <h1>Invoices</h1>
24
      [% IF ( do_search ) %]
24
      [% IF ( do_search ) %]
25
        [% IF invoices %]
25
        [% IF invoices %]
26
          <label for="show_only_subscription">
27
            <input type="checkbox" style="vertical-align: middle;" id="show_only_subscription" />
28
            Show only subscriptions
29
          </label>
30
          [% BLOCK invoices_table %]
26
          [% BLOCK invoices_table %]
31
            [% IF closed %]
27
            [% IF closed %]
32
                [% SET tab = 'closed' %]
28
                [% SET tab = 'closed' %]
33
            [% ELSE %]
29
            [% ELSE %]
34
                [% SET tab = 'opened' %]
30
                [% SET tab = 'opened' %]
35
            [% END %]
31
            [% END %]
32
          <label for="show_only_subscription">
33
            <input type="checkbox" style="vertical-align: middle;" class="show_only_subscription" data-tableid="[% tab %]resultst"/>
34
            Show only subscriptions
35
          </label>
36
          <table id="[% tab %]resultst" class="result">
36
          <table id="[% tab %]resultst" class="result">
37
            <thead>
37
            <thead>
38
              <tr>
38
              <tr>
Lines 357-369 Link Here
357
                autoWidth: false
357
                autoWidth: false
358
            }));
358
            }));
359
359
360
            $("#show_only_subscription").prop("checked", false);
360
            $(".show_only_subscription").prop("checked", false);
361
361
362
            $("#show_only_subscription").click(function(){
362
            $(".show_only_subscription").click(function(){
363
                var table_id = $(this).attr("data-tableid");
363
                if ( $(this).prop("checked") ) {
364
                if ( $(this).prop("checked") ) {
364
                    resultst.fnFilterAll( "1", 0, true );
365
                    $('#'+table_id).dataTable().fnFilter( "1", 0, true );
365
                } else {
366
                } else {
366
                    resultst.fnFilterAll( '', 0 );
367
                    $('#'+table_id).dataTable().fnFilter( '', 0 );
367
                }
368
                }
368
            });
369
            });
369
370
370
- 

Return to bug 22773