summaryrefslogtreecommitdiff
path: root/httemplate/elements/pager.html
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-11-15 15:14:47 -0800
committerIvan Kohler <ivan@freeside.biz>2013-11-15 15:14:47 -0800
commit75873f3e9e5f1da270589fd3dadba593d2b92d01 (patch)
treee7633bbe93f15399b8e274b5c7d640d3f8865593 /httemplate/elements/pager.html
parent0be78acfcd733ca079ab946f4ba4b46429c28c1c (diff)
fix sorting by a column advancing a page, RT#25740
Diffstat (limited to 'httemplate/elements/pager.html')
-rw-r--r--httemplate/elements/pager.html17
1 files changed, 10 insertions, 7 deletions
diff --git a/httemplate/elements/pager.html b/httemplate/elements/pager.html
index a53300f53..d360e6478 100644
--- a/httemplate/elements/pager.html
+++ b/httemplate/elements/pager.html
@@ -1,13 +1,8 @@
-% my %opt = @_;
-% my $pager = '';
-%
% if ( $opt{'total'} != $opt{'num_rows'} && $opt{'maxrecords'} ) {
%
% unless ( $opt{'offset'} == 0 ) {
% $cgi->param('offset', $opt{'offset'} - $opt{'maxrecords'});
-
<A HREF="<% $cgi->self_url %>"><B><FONT SIZE="+1">Previous</FONT></B></A>
-
% }
%
% my $page = 0;
@@ -47,9 +42,17 @@
%
% unless ( $opt{'offset'} + $opt{'maxrecords'} > $opt{'total'} ) {
% $cgi->param('offset', $opt{'offset'} + $opt{'maxrecords'});
-
<A HREF="<% $cgi->self_url %>"><B><FONT SIZE="+1">Next</FONT></B></A>
-%
% }
%
+% $cgi->param('offset', $orig_offset); #so future $self_url invocations don't advance a page
+%
% }
+<%init>
+
+my %opt = @_;
+
+my $orig_offset = $opt{'offset'};
+
+</%init>
+