From 86a067263958bd5a07c8ad3f5cc1556ba030f431 Mon Sep 17 00:00:00 2001 From: berick Date: Thu, 7 Apr 2011 16:27:22 -0400 Subject: [PATCH] repaired circ history paging --- .../src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm | 7 +++++-- .../web/templates/default/opac/myopac/circ_history.tt2 | 16 +++++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) 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 fb82d550af..627d94f752 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm @@ -505,9 +505,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, @@ -525,7 +528,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') %] -- 2.11.0