Achievo/ATK - Bugzilla – Bug 337
Wrong rowcolor in employee administration
Last modified: 2004-09-01 22:57:55
You need to log in before you can comment on or make changes to this bug.
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.
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)
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.
I've replaced all mktime() calls with adodb_mktime() and committed it to CVS.