[Koha-patches] [PATCH] New feature Number of Returned Items to Show

Michael Hafen mdhafen at tech.washk12.org
Fri Apr 24 19:43:01 CEST 2009


Hmm, you're right.  I didn't look into that loop far enough.  Though
this begs the question: why is there a limit on the number of items you
can check in?  That hard coded limit of 20 suddenly seems out of place
to me.  Unless it's to protect against D.O.S. attacks on this script.
But that loop is after the call to get_template_and_user() so that isn't
the case.

I'll fix the patch and re-submit then.  Thanks for catching that.

On Fri, 2009-04-24 at 13:05 -0400, Galen Charlton wrote:
> Hi,
> 
> On Wed, Feb 25, 2009 at 6:48 PM, Michael Hafen <mdhafen at tech.washk12.org> wrote:
> > This adds a system preference controlled feature.  This controls how
> > many returned items are shown on the check-in page.
> 
> This patch doesn't seem to be doing that - instead, it seems to be
> establishing a limit on the number of items you can check in at once
> from the patron details page, which is not desirable.  See below:
> 
> > --- a/circ/returns.pl
> > +++ b/circ/returns.pl
> > @@ -82,11 +82,12 @@ my %returneditems;
> >  my %riduedate;
> >  my %riborrowernumber;
> >  my @inputloop;
> > +my $returned_counter = ( C4::Context->preference('numReturnedItemsToShow') ) ? C4::Context->preference('numReturnedItemsToShow') : 20;
> >  foreach ( $query->param ) {
> >     (next) unless (/ri-(\d*)/);
> >     my %input;
> >     my $counter = $1;
> > -    (next) if ( $counter > 20 );
> > +    (next) if ( $counter > $returned_counter );
> 
> This is in the query parameter processing loop, and says to stop
> looking for additional items to return after the counter goes over the
> limit.  If you're looking to limit the number of returned items that
> are displayed, should it not be doing in the loop that generates
> @riloop?
> 
> Regards,
> 
> Galen
-- 
Michael Hafen
Systems Analyst and Programmer
Washington County School District
Utah, USA

for Koha checkout
http://development.washk12.org/gitweb/
or
git://development.washk12.org/koha




More information about the Koha-patches mailing list