* modify function create edit finish
This commit is contained in:
@@ -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()));
|
||||
|
||||
Reference in New Issue
Block a user