X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/8378f2cf7bde1116fd9618781fc14b991f5e2290..3f214c128c8eb8a7ebf44a5a9d37c6a4e0fe5209:/SL/DB/Helper/Paginated.pm diff --git a/SL/DB/Helper/Paginated.pm b/SL/DB/Helper/Paginated.pm index e170ad383..a24d4d7e0 100644 --- a/SL/DB/Helper/Paginated.pm +++ b/SL/DB/Helper/Paginated.pm @@ -4,7 +4,7 @@ use strict; require Exporter; our @ISA = qw(Exporter); -our @EXPORT = qw(paginate); +our @EXPORT = qw(paginate disable_paginating); use List::MoreUtils qw(any); @@ -59,9 +59,16 @@ sub make_common_pages { sub calc_visibility { my ($cur, $max, $this) = @_; any { $_ } abs($cur - $this) < 5, - $cur <= 3, - $cur == $max, - any { ! abs ($cur - $this) % $_ } 10, 50, 100, 500, 1000, 5000; + $this <= 3, + $this == $max, + any { abs ($cur - $this) == $_ } 10, 50, 100, 500, 1000, 5000; +} + +sub disable_paginating { + my ($self, %params) = @_; + + delete $params{args}{page}; + delete $params{args}{per_page}; } 1;