From c75b84fac735816738146cdcfe5b1d40b4a2fa7e Mon Sep 17 00:00:00 2001 From: rangi Date: Mon, 2 Jul 2007 00:38:17 +0000 Subject: [PATCH] Fix for bug 1365 --- C4/Members.pm | 2 ++ members/deletemem.pl | 13 +++++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/C4/Members.pm b/C4/Members.pm index 0a03aebf64..a978ca825c 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -1620,6 +1620,8 @@ sub DelMember { WHERE borrowernumber = ? "; $sth = $dbh->prepare($query); + $sth->execute($borrowernumber); + $sth->finish; &logaction(C4::Context->userenv->{'number'},"MEMBERS","DELETE",$borrowernumber,"") if C4::Context->preference("BorrowersLog"); return $sth->rows; diff --git a/members/deletemem.pl b/members/deletemem.pl index 429b99d04f..f343b49189 100755 --- a/members/deletemem.pl +++ b/members/deletemem.pl @@ -46,10 +46,7 @@ my $member=$input->param('member'); my %member2; $member2{'borrowernumber'}=$member; my ($countissues,$issues)=GetPendingIssues($member); -my $i=0; -foreach (sort keys %$issues) { - $i++; -} + my ($bor,$flags)=GetMemberDetails($member,''); if (C4::Context->preference("IndependantBranches")) { my $userenv = C4::Context->userenv; @@ -66,8 +63,8 @@ my $sth=$dbh->prepare("Select * from borrowers where guarantorid=?"); $sth->execute($member); my $data=$sth->fetchrow_hashref; $sth->finish; -if ($i > 0 or $flags->{'CHARGES'} or $data->{'borrowernumber'}){ -warn"je suis rentre dans la boucle"; +if ($countissues > 0 or $flags->{'CHARGES'} or $data->{'borrowernumber'}){ + my ($template, $borrowernumber, $cookie) = get_template_and_user({template_name => "members/deletemem.tmpl", query => $input, @@ -78,8 +75,8 @@ warn"je suis rentre dans la boucle"; }); # print $input->header; $template->param(borrowernumber => $member); - if ($i >0) { - $template->param(ItemsOnIssues => $i); + if ($countissues >0) { + $template->param(ItemsOnIssues => $countissues); } if ($flags->{'CHARGES'} ne '') { $template->param(charges => $flags->{'CHARGES'}->{'message'}); -- 2.39.5