From: berick Date: Thu, 7 Apr 2011 20:27:22 +0000 (-0400) Subject: repaired circ history paging X-Git-Tag: sprint4-merge-nov22~5128^2~72^2~120^2~1 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=ecb1ab8ec6c0709cc30f0af3b23f9b3e65fa6855;p=working%2FEvergreen.git repaired circ history paging --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm index 9dee8b9959..3bd5cc4b4c 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm @@ -506,9 +506,12 @@ sub load_myopac_circ_history { my $self = shift; my $e = $self->editor; my $ctx = $self->ctx; - my $limit = $self->cgi->param('limit'); + my $limit = $self->cgi->param('limit') || 15; my $offset = $self->cgi->param('offset') || 0; + $ctx->{circ_history_limit} = $limit; + $ctx->{circ_history_offset} = $offset; + my $circs = $e->json_query({ from => ['action.usr_visible_circs', $e->requestor->id], #limit => $limit || 25, @@ -526,7 +529,7 @@ sub load_myopac_circ_history { @ids = @ids[$offset..($offset + $limit - 1)] if $limit; @ids = grep { defined $_ } @ids; - $ctx->{circs} = $self->fetch_user_circs(1, \@ids, $limit, $offset); + $ctx->{circs} = $self->fetch_user_circs(1, \@ids); #$ctx->{circs} = $self->fetch_user_circs(1, [map { $_->{id} } @$circs], $limit, $offset); return Apache2::Const::OK; diff --git a/Open-ILS/web/templates/default/opac/myopac/circ_history.tt2 b/Open-ILS/web/templates/default/opac/myopac/circ_history.tt2 index 28d4b2a2e2..ed4b8ee451 100644 --- a/Open-ILS/web/templates/default/opac/myopac/circ_history.tt2 +++ b/Open-ILS/web/templates/default/opac/myopac/circ_history.tt2 @@ -1,9 +1,9 @@ [% PROCESS "default/opac/parts/header.tt2"; PROCESS "default/opac/parts/marc_misc.tt2"; WRAPPER "default/opac/parts/myopac/base.tt2"; - myopac_page = "circs"; - limit = CGI.param('limit') || 25; - offset = CGI.param('offset') || 0; + myopac_page = "circs" + limit = ctx.circ_history_limit; + offset = ctx.circ_history_offset; %]
@@ -21,13 +21,11 @@
[% l('Previously Checked Out Items') %] - [% IF offset > 0 %] - [% l('Previous') %] - [% END %] - [% IF ctx.circs.size == limit %] + [%# TODO: get total to prevent paging off then end of the list.. %] - [% l('Next') %] - [% END %] + [% l('Export List') %]