[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-bugs] [Bug 1351] Auto-calculation of expiry date for new members n
From: |
bugzilla-daemon |
Subject: |
[Koha-bugs] [Bug 1351] Auto-calculation of expiry date for new members not working |
Date: |
Fri, 6 Jul 2007 11:18:11 -0700 (PDT) |
http://bugs.koha.org/cgi-bin/bugzilla/show_bug.cgi?id=1351
address@hidden changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |address@hidden
------- Comment #1 from address@hidden 2007-07-06 11:18 -------
I also experienced and had to fix this problem on 2.2.8, because with MySQL 5
Koha is useless because of this bug; users cannot be added.
The solution was to stop using those other date functions, because ParseDate(),
DateCalc(), and format_date_in_iso() do not have compatible formats.
ParseDate() doesn't output dashes, but format_date_in_iso() requires them.
Here is the code block, equally functional, using only localtime() and
strftime():
$data{'dateofbirth'}=format_date_in_iso($data{'dateofbirth'});
# $data{'joining'} = &ParseDate("today") unless $data{'joining'};
# $data{'joining'}=format_date_in_iso($data{'joining'});
$data{'joining'} = strftime("%Y-%m-%d",localtime());
# if expirydate is not set, calculate it from borrower category
subscription duration
unless ($data{'expiry'}) {
my $sth = $dbh->prepare("select enrolmentperiod from categories
where categorycode=?");
$sth->execute($data{'categorycode'});
my ($enrolmentperiod) = $sth->fetchrow;
$enrolmentperiod = 12 unless ($enrolmentperiod);
# $data{'expiry'} =
&DateCalc($data{'joining'},"$enrolmentperiod years");
my @latertime = localtime();
@latertime[4] += $enrolmentperiod;
$data{'expiry'} = strftime("%Y-%m-%d", @latertime);
}
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.
- [Koha-bugs] [Bug 1351] Auto-calculation of expiry date for new members not working,
bugzilla-daemon <=