diff -rc koha-2.2.5-orig/intranet-cgi/circ/circulation.pl koha-2.2.5-patch/intranet-cgi/circ/circulation.pl *** koha-2.2.5-orig/intranet-cgi/circ/circulation.pl 2006-01-13 14:24:18.000000000 -0700 --- koha-2.2.5-patch/intranet-cgi/circ/circulation.pl 2006-05-23 17:10:33.000000000 -0600 *************** *** 168,180 **** year => $year); if ($noerror && ($noquestion || $issueconfirmed)) { issuebook(\%env, $borrower, $barcode, $datedue); } } } # reload the borrower info for the sake of reseting the flags..... if ($borrowernumber) { $borrower = getpatroninformation(\%env,$borrowernumber,0); } --- 203,237 ---- year => $year); if ($noerror && ($noquestion || $issueconfirmed)) { issuebook(\%env, $borrower, $barcode, $datedue); + } else { + if ($$error{'UNKNOWN_BARCODE'}) { + # FIXME This is a sort of temporary feature. + # Couldnt find that number as barcode, check for patron + # This assumes that barcodes and cardnumbers never collide + my ($count,$borrowers)=BornameSearch(\%env,$barcode,'cardnumber','web'); + if ($count == 1) { + # its a patron. Assume thats what they want + # and start over. + $query->param('borrnumber', $$borrowers[0]->{'borrowernumber'}); + $query->param('barcode',''); + $template->param(IMPOSSIBLE => 0); + $template->param(NEEDSCONFIRMATION => 0); + $borrowernumber=$$borrowers[0]->{'borrowernumber'}; + $patroncookie = $query->cookie(-name=>'patron', -value=>"$borrowernumber", -expires=>'+1y'); + } + } } } } # reload the borrower info for the sake of reseting the flags..... if ($borrowernumber && $barcode) { $borrower = getpatroninformation(\%env,$borrowernumber,0); ($od,$issue,$fines)=borrdata2(\%env,$borrowernumber); $template->param(overduecount => $od, issuecount => $issue, finetotal => sprintf ("%0.2d",$fines)); }