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 130-135 Link Here
130
                search = 0;
130
                search = 0;
131
            [% END %]
131
            [% END %]
132
132
133
            // Prepare DataTables settings
134
            var aLengthMenu = [10, 20, 50, 100, -1];
135
            var aLengthMenuLabel = [10, 20, 50, 100, _("All")];
136
            var patronsPerPage = [% Koha.Preference('PatronsPerPage') | html %];
137
            for ( var i = 0; i < aLengthMenu.length; i++ ) {
138
                if ( aLengthMenu[i] == patronsPerPage ) {
139
                    break;
140
                }
141
                if ( aLengthMenu[i] > patronsPerPage || aLengthMenu[i] == -1 ) {
142
                    aLengthMenu.splice(i, 0, patronsPerPage);
143
                    aLengthMenuLabel.splice(i, 0, patronsPerPage);
144
                    break;
145
                }
146
            }
147
133
            // Apply DataTables on the results table
148
            // Apply DataTables on the results table
134
            dtMemberResults = $("#memberresultst").dataTable($.extend(true, {}, dataTablesDefaults, {
149
            dtMemberResults = $("#memberresultst").dataTable($.extend(true, {}, dataTablesDefaults, {
135
                'bServerSide': true,
150
                'bServerSide': true,
Lines 214-220 Link Here
214
                ],
229
                ],
215
                'bAutoWidth': false,
230
                'bAutoWidth': false,
216
                'sPaginationType': 'full_numbers',
231
                'sPaginationType': 'full_numbers',
217
                "iDisplayLength": [% Koha.Preference('PatronsPerPage') | html %],
232
                'aLengthMenu': [aLengthMenu, aLengthMenuLabel],
233
                'iDisplayLength': patronsPerPage,
234
                'pageLength': patronsPerPage,
218
                'aaSorting': [[[% aaSorting || 0 | html %], 'asc']],
235
                'aaSorting': [[[% aaSorting || 0 | html %], 'asc']],
219
                'bFilter': false,
236
                'bFilter': false,
220
                'bProcessing': true,
237
                'bProcessing': true,
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt (-20 / +12 lines)
Lines 363-390 Link Here
363
            [% END %]
363
            [% END %]
364
364
365
            // Build the aLengthMenu
365
            // Build the aLengthMenu
366
            var aLengthMenu = [
366
            var aLengthMenu = [10, 20, 50, 100, -1];
367
                [% PatronsPerPage | html %], 10, 20, 50, 100, -1
367
            var aLengthMenuLabel = [10, 20, 50, 100, _("All")];
368
            ];
368
            var patronsPerPage = [% PatronsPerPage | html %];
369
            jQuery.unique(aLengthMenu);
369
            for ( var i = 0; i < aLengthMenu.length; i++ ) {
370
            aLengthMenu.sort(function( a, b ){
370
                if ( aLengthMenu[i] == patronsPerPage ) {
371
                // Put "All" at the end
371
                    break;
372
                if ( a == -1 ) {
373
                    return 1;
374
                } else if ( b == -1 ) {
375
                    return -1;
376
                }
372
                }
377
                return parseInt(a) < parseInt(b) ? -1 : 1;}
373
                if ( aLengthMenu[i] > patronsPerPage || aLengthMenu[i] == -1 ) {
378
            );
374
                    aLengthMenu.splice(i, 0, patronsPerPage);
379
            var aLengthMenuLabel = [];
375
                    aLengthMenuLabel.splice(i, 0, patronsPerPage);
380
            $(aLengthMenu).each(function(){
376
                    break;
381
                if ( this == -1 ) {
382
                    // Label for -1 is "All"
383
                    aLengthMenuLabel.push(_("All"));
384
                } else {
385
                    aLengthMenuLabel.push(this);
386
                }
377
                }
387
            });
378
            }
388
379
389
            // Apply DataTables on the results table
380
            // Apply DataTables on the results table
390
            var columns_settings = [% TablesSettings.GetColumns( 'members', 'member', 'memberresultst', 'json' ) | $raw %];
381
            var columns_settings = [% TablesSettings.GetColumns( 'members', 'member', 'memberresultst', 'json' ) | $raw %];
Lines 491-496 Link Here
491
                "aLengthMenu": [aLengthMenu, aLengthMenuLabel],
482
                "aLengthMenu": [aLengthMenu, aLengthMenuLabel],
492
                'sPaginationType': 'full_numbers',
483
                'sPaginationType': 'full_numbers',
493
                "iDisplayLength": [% PatronsPerPage | html %],
484
                "iDisplayLength": [% PatronsPerPage | html %],
485
                "pageLength": [% PatronsPerPage | html %],
494
                "bProcessing": true,
486
                "bProcessing": true,
495
                "initComplete": function(settings, json) {
487
                "initComplete": function(settings, json) {
496
                    Sticky = $("#searchheader");
488
                    Sticky = $("#searchheader");
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt (-1 / +18 lines)
Lines 245-250 Link Here
245
        };
245
        };
246
246
247
        $(document).ready(function() {
247
        $(document).ready(function() {
248
            // Prepare DataTables settings
249
            var aLengthMenu = [10, 20, 50, 100, -1];
250
            var aLengthMenuLabel = [10, 20, 50, 100, _("All")];
251
            var patronsPerPage = [% Koha.Preference('PatronsPerPage') | html %];
252
            for ( var i = 0; i < aLengthMenu.length; i++ ) {
253
                if ( aLengthMenu[i] == patronsPerPage ) {
254
                    break;
255
                }
256
                if ( aLengthMenu[i] > patronsPerPage || aLengthMenu[i] == -1 ) {
257
                    aLengthMenu.splice(i, 0, patronsPerPage);
258
                    aLengthMenuLabel.splice(i, 0, patronsPerPage);
259
                    break;
260
                }
261
            }
262
248
            [% IF table_loop %]
263
            [% IF table_loop %]
249
                $("#description").show();
264
                $("#description").show();
250
            [% ELSE %]
265
            [% ELSE %]
Lines 256-261 Link Here
256
                ],
271
                ],
257
                "aaSorting": [[ 0, "asc" ]],
272
                "aaSorting": [[ 0, "asc" ]],
258
                "sPaginationType": "full",
273
                "sPaginationType": "full",
274
                "aLengthMenu": [aLengthMenu, aLengthMenuLabel],
275
                "iDisplayLength": patronsPerPage,
276
                "pageLength": patronsPerPage,
259
                "autoWidth": false
277
                "autoWidth": false
260
            }));
278
            }));
261
            $("#additems").click(function(){
279
            $("#additems").click(function(){
262
- 

Return to bug 28864