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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/common/patron_search.tt (-1 / +18 lines)
Lines 158-163 Link Here
158
                search = 0;
158
                search = 0;
159
            [% END %]
159
            [% END %]
160
160
161
            // Prepare DataTables settings
162
            var aLengthMenu = [10, 20, 50, 100, -1];
163
            var aLengthMenuLabel = [10, 20, 50, 100, _("All")];
164
            var patronsPerPage = [% Koha.Preference('PatronsPerPage') | html %];
165
            for ( var i = 0; i < aLengthMenu.length; i++ ) {
166
                if ( aLengthMenu[i] == patronsPerPage ) {
167
                    break;
168
                }
169
                if ( aLengthMenu[i] > patronsPerPage || aLengthMenu[i] == -1 ) {
170
                    aLengthMenu.splice(i, 0, patronsPerPage);
171
                    aLengthMenuLabel.splice(i, 0, patronsPerPage);
172
                    break;
173
                }
174
            }
175
161
            // Apply DataTables on the results table
176
            // Apply DataTables on the results table
162
            dtMemberResults = $("#memberresultst").dataTable($.extend(true, {}, dataTablesDefaults, {
177
            dtMemberResults = $("#memberresultst").dataTable($.extend(true, {}, dataTablesDefaults, {
163
                'bServerSide': true,
178
                'bServerSide': true,
Lines 250-256 Link Here
250
                ],
265
                ],
251
                'bAutoWidth': false,
266
                'bAutoWidth': false,
252
                'sPaginationType': 'full_numbers',
267
                'sPaginationType': 'full_numbers',
253
                "iDisplayLength": [% Koha.Preference('PatronsPerPage') | html %],
268
                'aLengthMenu': [aLengthMenu, aLengthMenuLabel],
269
                'iDisplayLength': patronsPerPage,
270
                'pageLength': patronsPerPage,
254
                'aaSorting': [[[% aaSorting || 0 | html %], 'asc']],
271
                'aaSorting': [[[% aaSorting || 0 | html %], 'asc']],
255
                'bFilter': false,
272
                'bFilter': false,
256
                'bProcessing': true,
273
                'bProcessing': true,
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt (-21 / +12 lines)
Lines 366-393 Link Here
366
            [% END %]
366
            [% END %]
367
367
368
            // Build the aLengthMenu
368
            // Build the aLengthMenu
369
            var aLengthMenu = [
369
            var aLengthMenu = [10, 20, 50, 100, -1];
370
                [% PatronsPerPage | html %], 10, 20, 50, 100, -1
370
            var aLengthMenuLabel = [10, 20, 50, 100, _("All")];
371
            ];
371
            var patronsPerPage = [% PatronsPerPage | html %];
372
            jQuery.unique(aLengthMenu);
372
            for ( var i = 0; i < aLengthMenu.length; i++ ) {
373
            aLengthMenu.sort(function( a, b ){
373
                if ( aLengthMenu[i] == patronsPerPage ) {
374
                // Put "All" at the end
374
                    break;
375
                if ( a == -1 ) {
376
                    return 1;
377
                } else if ( b == -1 ) {
378
                    return -1;
379
                }
375
                }
380
                return parseInt(a) < parseInt(b) ? -1 : 1;}
376
                if ( aLengthMenu[i] > patronsPerPage || aLengthMenu[i] == -1 ) {
381
            );
377
                    aLengthMenu.splice(i, 0, patronsPerPage);
382
            var aLengthMenuLabel = [];
378
                    aLengthMenuLabel.splice(i, 0, patronsPerPage);
383
            $(aLengthMenu).each(function(){
379
                    break;
384
                if ( this == -1 ) {
385
                    // Label for -1 is "All"
386
                    aLengthMenuLabel.push(_("All"));
387
                } else {
388
                    aLengthMenuLabel.push(this);
389
                }
380
                }
390
            });
381
            }
391
382
392
            // Apply DataTables on the results table
383
            // Apply DataTables on the results table
393
            var columns_settings = [% TablesSettings.GetColumns( 'members', 'member', 'memberresultst', 'json' ) | $raw %];
384
            var columns_settings = [% TablesSettings.GetColumns( 'members', 'member', 'memberresultst', 'json' ) | $raw %];
Lines 486-491 Link Here
486
                "aLengthMenu": [aLengthMenu, aLengthMenuLabel],
477
                "aLengthMenu": [aLengthMenu, aLengthMenuLabel],
487
                'sPaginationType': 'full_numbers',
478
                'sPaginationType': 'full_numbers',
488
                "iDisplayLength": [% PatronsPerPage | html %],
479
                "iDisplayLength": [% PatronsPerPage | html %],
480
                "pageLength": [% PatronsPerPage | html %],
489
                "bProcessing": true,
481
                "bProcessing": true,
490
                "initComplete": function(settings, json) {
482
                "initComplete": function(settings, json) {
491
                    Sticky = $("#searchheader");
483
                    Sticky = $("#searchheader");
492
- 

Return to bug 28864