* modify function create edit finish

This commit is contained in:
zhaohaibo
2020-05-19 13:11:46 +08:00
parent 7cd2453f35
commit 1e69c201f8
+14
View File
@@ -90,6 +90,13 @@ class program extends control
if($_POST)
{
/* Add the planDuration. */
$begin = $this->post->begin;
$end = $this->post->end;
$planDuration = $this->loadModel('holiday')->getActualWorkingDays($begin, $end);
$planDuration = count($planDuration);
$_POST['planDuration'] = $planDuration;
$projectID = $this->program->create();
if(dao::isError())
{
@@ -245,6 +252,13 @@ class program extends control
if(!empty($_POST))
{
/* Add the realDuration. */
$realStarted = $project->realStarted;
$realFinished = $this->post->realFinished;
$realDuration = $this->loadModel('holiday')->getActualWorkingDays($realStarted, $realFinished);
$realDuration = count($realDuration);
$_POST['realDuration'] = $realDuration;
$this->loadModel('action');
$changes = $this->project->finish($projectID);
if(dao::isError()) die(js::error(dao::getError()));