[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] CVS: koha/members deletemem.pl,1.2,1.3
From: |
Paul POULAIN |
Subject: |
[Koha-cvs] CVS: koha/members deletemem.pl,1.2,1.3 |
Date: |
Tue, 05 Oct 2004 01:59:59 -0700 |
Update of /cvsroot/koha/koha/members
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29373/members
Modified Files:
deletemem.pl
Log Message:
templating deletemember impossible when issues/debts/guarantees
Index: deletemem.pl
===================================================================
RCS file: /cvsroot/koha/koha/members/deletemem.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** deletemem.pl 20 Sep 2004 13:21:12 -0000 1.2
--- deletemem.pl 5 Oct 2004 08:59:56 -0000 1.3
***************
*** 30,36 ****
use C4::Context;
use C4::Search;
use C4::Output;
use C4::Circulation::Circ2;
- #use C4::Acquisitions;
use C4::Auth;
--- 30,36 ----
use C4::Context;
use C4::Search;
+ use C4::Interface::CGI::Output;
use C4::Output;
use C4::Circulation::Circ2;
use C4::Auth;
***************
*** 48,59 ****
my %env;
$env{'nottodayissues'}=1;
! my %member2;
! $member2{'borrowernumber'}=$member;
! my $issues=currentissues(\%env,\%member2);
! my $i=0;
! foreach (sort keys %$issues) {
! $i++;
! }
! my ($bor,$flags)=getpatroninformation(\%env, $member,'');
my $dbh = C4::Context->dbh;
my $sth=$dbh->prepare("Select * from borrowers where guarantor=?");
--- 48,59 ----
my %env;
$env{'nottodayissues'}=1;
! my %member2;
! $member2{'borrowernumber'}=$member;
! my $issues=currentissues(\%env,\%member2);
! my $i=0;
! foreach (sort keys %$issues) {
! $i++;
! }
! my ($bor,$flags)=getpatroninformation(\%env, $member,'');
my $dbh = C4::Context->dbh;
my $sth=$dbh->prepare("Select * from borrowers where guarantor=?");
***************
*** 64,100 ****
if ($i > 0 || $flags->{'CHARGES'} ne '' || $data ne ''){
! print $input->header;
! print "<table border=1>";
! if ($i > 0){
! print "<TR><TD>Items on Issue</td><td align=right>$i</td></tr>";
! }
! if ($flags->{'CHARGES'} ne ''){
! print "<TR><TD>Charges</td><td>$flags->{'CHARGES'}->{'message'}</tr>";
! }
! if ($data ne ''){
! print "<TR><TD>Guarantees</td></tr>";
! }
! print "</table>";
} else {
! delmember($member);
! print $input->redirect("/cgi-bin/koha/members/members-home.pl");
}
sub delmember{
! my ($member)address@hidden;
! my $dbh = C4::Context->dbh;
! my $sth=$dbh->prepare("Select * from borrowers where borrowernumber=?");
! $sth->execute($member);
! my @data=$sth->fetchrow_array;
! $sth->finish;
! $sth=$dbh->prepare("Insert into deletedborrowers values
(".("?,"x(scalar(@data)-1))."?)");
! $sth->execute(@data);
! $sth->finish;
! $sth=$dbh->prepare("Delete from borrowers where borrowernumber=?");
! $sth->execute($member);
! $sth->finish;
! $sth=$dbh->prepare("Delete from reserves where borrowernumber=?");
! $sth->execute($member);
! $sth->finish;
}
--- 64,118 ----
if ($i > 0 || $flags->{'CHARGES'} ne '' || $data ne ''){
! my ($template, $borrowernumber, $cookie)
! = get_template_and_user({template_name =>
"members/deletemem.tmpl",
! query => $input,
! type => "intranet",
! authnotrequired => 0,
! flagsrequired => {circulate => 1},
! debug => 1,
! });
! # print $input->header;
! if ($i >0) {
! $template->param(ItemsOnIssues => $i);
! }
! if ($flags->{'CHARGES'} ne '') {
! $template->param(charges => $flags->{'CHARGES'}->{'message'});
! }
! if ($data ne '') {
! $template->param(guarantees => 1);
! }
! # print "<table border=1>";
! # if ($i > 0){
! # print "<TR><TD>Items on Issue</td><td align=right>$i</td></tr>";
! # }
! # if ($flags->{'CHARGES'} ne ''){
! # print
"<TR><TD>Charges</td><td>$flags->{'CHARGES'}->{'message'}</tr>";
! # }
! # if ($data ne ''){
! # print "<TR><TD>Guarantees</td></tr>";
! # }
! # print "</table>";
! output_html_with_http_headers $input, $cookie, $template->output;
} else {
! delmember($member);
! print $input->redirect("/cgi-bin/koha/members/members-home.pl");
}
sub delmember{
! my ($member)address@hidden;
! my $dbh = C4::Context->dbh;
! my $sth=$dbh->prepare("Select * from borrowers where borrowernumber=?");
! $sth->execute($member);
! my @data=$sth->fetchrow_array;
! $sth->finish;
! $sth=$dbh->prepare("Insert into deletedborrowers values
(".("?,"x(scalar(@data)-1))."?)");
! $sth->execute(@data);
! $sth->finish;
! $sth=$dbh->prepare("Delete from borrowers where borrowernumber=?");
! $sth->execute($member);
! $sth->finish;
! $sth=$dbh->prepare("Delete from reserves where borrowernumber=?");
! $sth->execute($member);
! $sth->finish;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Koha-cvs] CVS: koha/members deletemem.pl,1.2,1.3,
Paul POULAIN <=