Bug 337 - Wrong rowcolor in employee administration
: Wrong rowcolor in employee administration
Status: RESOLVED FIXED
: Achievo
Employee management
: 1.1.RC1
: All Windows NT/2000/XP
: P2 minor
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2004-08-24 13:01 by
Modified: 2004-09-01 22:57 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2004-08-24 13:01:18
The rowcolor in the employee administration seems not to be set adequate in all
cases.
Whenever the employee administration is started, the following error message
appears - one for each employee in my configuration.
---[cut start]---
error: [+00.08666s] [2] mktime(): Windows does not support negative values for
this function in D:\www\achievo\modules\utils\class.dateutil.inc (line 17)
---[cut stop]---

Facts about the employees:
All have a contract that starts before the current date and the date they have
been added to the system.

I guess the error comes from modules\employee\class.employee.inc:function
rowColor, which calls date_diff.
------- Comment #1 From 2004-08-24 13:41:43 -------
The problem is dat class.dateutil.inc calls PHP's mktime() method directly. This
indeed fails on some installations. It should've used adodb_mktime, from
achievo/atk/utils/adodb-time.inc.php.

Can you try if replacing mktime with adodb_mktime solves the problem? (maybe you
have to include adodb-time.inc.php first)
------- Comment #2 From 2004-08-24 17:15:03 -------
Received this in the mail from Udo:

"Taking adodb_mktime actually solves the problem. Including
 adodb-time.inc.php is not necessary. I didn't have time to get through the api 
 documentation yet and neither to try to rebuild some structures of the code. 
 Where or how should the system choose to take the right implementation of mktime?
 Perhaps it is possible to find a solution that fits to all installtions?"

Actually, I believe adodb_mktime already does that check. We should in all cases
use adodb_mktime. I'll change the call so it works in the next RC.
------- Comment #3 From 2004-09-01 22:57:55 -------
I've replaced all mktime() calls with adodb_mktime() and committed it to CVS.