[Koha-patches] [PATCH] [1/2] New Feature - restrict previously issued titles
Galen Charlton
gmcharlt at gmail.com
Fri Feb 19 05:02:14 CET 2010
Hi Michael,
On Thu, Oct 8, 2009 at 5:59 PM, Michael Hafen <mdhafen at tech.washk12.org> wrote:
> + #
> + # Check if borrower has checked this title out before
> + #
> + if ( C4::Context->preference("CircRestrictPreviouslyIssued") ) {
> + my $sth = $dbh->prepare("SELECT old_issues.itemnumber FROM old_issues CROSS JOIN items USING (itemnumber) WHERE biblionumber = ?");
> + $sth->execute($item->{'biblionumber'});
> + my $alreadyissued = $sth->fetchrow_hashref();
> + $sth->finish();
> + if ( $alreadyissued->{'itemnumber'} ) {
> + $needsconfirmation{PATRON_PREVIOUSLY_ISSUED} = 1;
> + }
> + }
The query would seem to trigger the warning if *any* patron had
checked out the item, and I don't see why it should be a cross join
instead of an inner join. Shouldn't it also filter by the borrower?
Regards,
Galen
--
Galen Charlton
gmcharlt at gmail.com
More information about the Koha-patches
mailing list