dotProject Fix: Task Dates on Task Log

Last month there were quite a few angsts in the dotProject's Mantis about a mysteriously shifting end date time (#1729).

Here's the primary scenario:

You – being the good team member that you are – log hours on your projects as soon as you work them. Somewhere along the line, you realized that an estimate was off and now you want to shift the date. The easiest way is to simply fill in a new estimated end date on your task log. Ideally, from this change all dependent tasks would shift accordingly. Unfortunately, with the existing code, it would accept the new date but put the completion time at midnight that morning. For tasking and dependencies, it causes problems as all of your tasks will be slightly off. For small projects, this “rounding error” may result in a few hours difference, but on large projects, this “rounding error” could result in days or weeks.

Regardless, I've managed to track down the core of the bug. It stems from the fact that on the addedit screen, it allowed users to select the relevant time when a task is to end. This screen did not implement it. Therefore, when you'd select a new date, it would default the time to null and the database would translate this to midnight.

Updated: Added the second file.
The fixed files for dotProject 2.0.4 are available here: vw_log_update.txt and do_updatetask.txt should both be installed into modules/tasks/. Don't forget to change the extensions to “.php”.

If you have questions, let me know. I'll be making the equivalent change in Head this weekend.