summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-11-15 15:14:48 -0800
committerIvan Kohler <ivan@freeside.biz>2013-11-15 15:14:48 -0800
commit060d5ba818caef48a659ed3c2e6a22b5c3d69d10 (patch)
treeaca80f4a40771cf9025e50d992e12fc6459e9b4a
parent00358dd85b3fa5d854ea508a9bb2fb9b92c7c2ba (diff)
fix sorting by a column advancing a page, RT#25740
-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>
+