* Adjust getExecutionsByProject method.

This commit is contained in:
leiyong
2020-11-24 23:23:54 +08:00
parent 3eafb1ac5d
commit 302a68291c
4 changed files with 26 additions and 14 deletions
+8 -5
View File
@@ -675,12 +675,15 @@ class programplanModel extends model
/* If child plan has milestone, update parent plan set milestone eq 0 . */
if($plan->milestone and $parentPlan->milestone) $this->dao->update(TABLE_PROJECT)->set('milestone')->eq(0)->where('id')->eq($oldPlan->parent)->exec();
}
else
{
/* The workload of the parent plan cannot exceed 100%. */
$oldPlan->parent = $plan->parent;
$totalPercent = $this->getTotalPercent($oldPlan);
$totalPercent = $totalPercent + $plan->percent;
if($totalPercent > 100) return dao::$errors['percent'][] = $this->lang->programplan->error->percentOver;
}
/* The workload of the parent plan cannot exceed 100%. */
$oldPlan->parent = $plan->parent;
$totalPercent = $this->getTotalPercent($oldPlan);
$totalPercent = $totalPercent + $plan->percent;
if($totalPercent > 100) return dao::$errors['percent'][] = $this->lang->programplan->error->percentOver;
/* Set planDuration and realDuration. */
$plan->planDuration = $this->getDuration($plan->begin, $plan->end);