From a713e90d9b044a59e0ef22d8327db184b4aa68cc Mon Sep 17 00:00:00 2001 From: Drake Date: Fri, 6 Oct 2006 23:28:52 +0000 Subject: [PATCH] Fix project manager project completion not working correctly, and task editor not preserving duration. --- docs/changelog/7.x.x.txt | 2 ++ lib/WebGUI/Asset/Wobject/ProjectManager.pm | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 5f0e1c970..ab5ba1f4b 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -10,6 +10,8 @@ - fixed a bug where the calendar would break if a language other than English has been selected (Martin Kamerbeek / Procolix) - fix: Events Calendar: error in "big" template (Martin Kamerbeek / Procolix) + - fix: PM task editor not preserving duration + - fix: PM project completion percentage updates not working right 7.0.9 - Removed the need for DateTime::Cron::Simple, which also added the ability diff --git a/lib/WebGUI/Asset/Wobject/ProjectManager.pm b/lib/WebGUI/Asset/Wobject/ProjectManager.pm index 9e43b3316..90725c8be 100644 --- a/lib/WebGUI/Asset/Wobject/ProjectManager.pm +++ b/lib/WebGUI/Asset/Wobject/ProjectManager.pm @@ -279,7 +279,7 @@ sub _updateProject { my ($minStart, $maxEnd) = $db->quickArray("select min(startDate), max(endDate) from PM_task where projectId=?", [$projectId]); my ($projectTotal, $complete) = 0; - my $tasks = $db->buildArrayRefOfHashRefs("select * from PM_task where projectId=? and taskType <> 'timed' order by sequenceNumber asc", [$projectId]); + my $tasks = $db->buildArrayRefOfHashRefs("select * from PM_task where projectId=? and taskType = 'timed' order by sequenceNumber asc", [$projectId]); foreach my $task (@{$tasks}) { $projectTotal += $task->{duration}; $complete += ($task->{duration} * ($task->{percentComplete}/100)); @@ -857,7 +857,7 @@ sub www_editTask { my ($startEpoch, $endEpoch) = $db->quickArray('SELECT startDate, startDate FROM PM_task WHERE projectId = ? ORDER BY sequenceNumber LIMIT 1', [$projectId]); my $dependant = $task->{dependants}; - my $duration = $task->{duration} || ($taskType eq 'timed')? (($project->{durationUnits} eq 'hours')? $project->{hoursPerDay} : 1) : 0; + my $duration = $task->{duration} || (($taskType eq 'timed')? (($project->{durationUnits} eq 'hours')? $project->{hoursPerDay} : 1) : 0); $startEpoch = $endEpoch = time unless defined $startEpoch and defined $endEpoch; $startEpoch = $task->{startDate} if $task->{startDate};