*** empty log message ***
This commit is contained in:
parent
a0de7c08fd
commit
2ee3977b0e
3 changed files with 30 additions and 15 deletions
|
@ -323,7 +323,7 @@ sub issueitem{
|
|||
info_msg($env,"Can't issue $item->{'cardnumber'}");
|
||||
}
|
||||
} else {
|
||||
my $valid = checkdigit($env,$itemnum);
|
||||
my $valid = checkdigit($env,$itemnum, 1);
|
||||
if ($valid ==1) {
|
||||
if (substr($itemnum,0,1) = "V") {
|
||||
#this is a borrower
|
||||
|
|
26
C4/Input.pm
26
C4/Input.pm
|
@ -79,11 +79,33 @@ C<$env> is ignored.
|
|||
=cut
|
||||
#'
|
||||
sub checkdigit {
|
||||
|
||||
my ($env,$infl, $nounique) = @_;
|
||||
$infl = uc $infl;
|
||||
|
||||
|
||||
#Check to make sure the cardnumber is unique
|
||||
|
||||
#FIXME: We should make the error for a nonunique cardnumber
|
||||
#different from the one where the checkdigit on the number is
|
||||
#not correct
|
||||
|
||||
unless ( $nounique )
|
||||
{
|
||||
my $dbh=C4::Context->dbh;
|
||||
my $query=qq{SELECT * FROM borrowers WHERE cardnumber="$infl"};
|
||||
my $sth=$dbh->prepare($query);
|
||||
$sth->execute;
|
||||
my %results = $sth->fetchrow_hashref();
|
||||
if ( $sth->rows != 0 )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (C4::Context->preference("checkdigit") eq "none") {
|
||||
return 1;
|
||||
} else {
|
||||
my ($env,$infl) = @_;
|
||||
$infl = uc $infl;
|
||||
my @weightings = (8,4,6,3,5,2,1);
|
||||
my $sum;
|
||||
my $i = 1;
|
||||
|
|
|
@ -66,23 +66,16 @@
|
|||
<TMPL_VAR NAME="borrowernotes"><!--</a>-->
|
||||
<p align=right>
|
||||
</font>
|
||||
<TMPL_IF name="A">
|
||||
<form action=/cgi-bin/koha/memberentry.pl method=post>
|
||||
<input type=hidden name=bornum value="<TMPL_VAR NAME="bornum">">
|
||||
<INPUT TYPE=submit class="button" value="Modify">
|
||||
</form>
|
||||
</TMPL_IF>
|
||||
<TMPL_IF name="C">
|
||||
<form action=/cgi-bin/koha/memberentry.pl method=post>
|
||||
<input type=hidden name=bornum value="<TMPL_VAR NAME="bornum">">
|
||||
<INPUT TYPE=submit class="button" value="Modify">
|
||||
</form>
|
||||
</TMPL_IF>
|
||||
<TMPL_IF name="I">
|
||||
<form action=/cgi-bin/koha/imemberentry.pl method=post>
|
||||
<input type=hidden name=bornum value="<TMPL_VAR NAME="bornum">">
|
||||
<INPUT TYPE=submit class="button" value="Modify">
|
||||
</form>
|
||||
<TMPL_ELSE>
|
||||
<form action=/cgi-bin/koha/memberentry.pl method=post>
|
||||
<input type=hidden name=bornum value="<TMPL_VAR NAME="bornum">">
|
||||
<INPUT TYPE=submit class="button" value="Modify">
|
||||
</form>
|
||||
</TMPL_IF>
|
||||
<form action=/cgi-bin/koha/deletemem.pl method=post>
|
||||
<input type=hidden name=member value="<TMPL_VAR NAME="bornum">">
|
||||
|
|
Loading…
Reference in a new issue