* Add drag review point deadline and gantt color.
This commit is contained in:
@@ -345,7 +345,15 @@ class programplan extends control
|
||||
if(!isset($_POST['id']) or empty($_POST['id'])) return $this->send(array('result' => 'fail', 'message' => ''));
|
||||
$objectID = $_POST['id'];
|
||||
|
||||
$this->loadModel('task')->updateEsDateByGantt($objectID, $_POST['type']);
|
||||
if($_POST['type'] == 'point')
|
||||
{
|
||||
$this->loadModel('review')->updateReviewDate($objectID, $_POST['type']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->loadModel('task')->updateEsDateByGantt($objectID, $_POST['type']);
|
||||
}
|
||||
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
return $this->send(array('result' => 'success'));
|
||||
|
||||
@@ -126,3 +126,9 @@ $lang->programplan->error->sameType = 'Type of the stage must be as same
|
||||
|
||||
$lang->programplan->ganttBrowseType['gantt'] = 'Group by Stage';
|
||||
$lang->programplan->ganttBrowseType['assignedTo'] = 'Group by AssignedTo';
|
||||
|
||||
$lang->programplan->gantt = new stdclass();
|
||||
$lang->programplan->gantt->reviewColorList['draft'] = '#FC913F';
|
||||
$lang->programplan->gantt->reviewColorList['reviewing'] = '#CD6F27';
|
||||
$lang->programplan->gantt->reviewColorList['pass'] = '#0DBB7D';
|
||||
$lang->programplan->gantt->reviewColorList['fail'] = '#FB2B2B';
|
||||
|
||||
@@ -126,3 +126,9 @@ $lang->programplan->error->sameType = 'Type of the stage must be as same
|
||||
|
||||
$lang->programplan->ganttBrowseType['gantt'] = 'Group by Stage';
|
||||
$lang->programplan->ganttBrowseType['assignedTo'] = 'Group by AssignedTo';
|
||||
|
||||
$lang->programplan->gantt = new stdclass();
|
||||
$lang->programplan->gantt->reviewColorList['draft'] = '#FC913F';
|
||||
$lang->programplan->gantt->reviewColorList['reviewing'] = '#CD6F27';
|
||||
$lang->programplan->gantt->reviewColorList['pass'] = '#0DBB7D';
|
||||
$lang->programplan->gantt->reviewColorList['fail'] = '#FB2B2B';
|
||||
|
||||
@@ -126,3 +126,9 @@ $lang->programplan->error->sameType = 'Type of the stage must be as same
|
||||
|
||||
$lang->programplan->ganttBrowseType['gantt'] = 'Group by Stage';
|
||||
$lang->programplan->ganttBrowseType['assignedTo'] = 'Group by AssignedTo';
|
||||
|
||||
$lang->programplan->gantt = new stdclass();
|
||||
$lang->programplan->gantt->reviewColorList['draft'] = '#FC913F';
|
||||
$lang->programplan->gantt->reviewColorList['reviewing'] = '#CD6F27';
|
||||
$lang->programplan->gantt->reviewColorList['pass'] = '#0DBB7D';
|
||||
$lang->programplan->gantt->reviewColorList['fail'] = '#FB2B2B';
|
||||
|
||||
@@ -126,3 +126,9 @@ $lang->programplan->error->sameType = '父阶段类型为"%s",阶段类
|
||||
|
||||
$lang->programplan->ganttBrowseType['gantt'] = '按阶段分组';
|
||||
$lang->programplan->ganttBrowseType['assignedTo'] = '按指派给分组';
|
||||
|
||||
$lang->programplan->gantt = new stdclass();
|
||||
$lang->programplan->gantt->reviewColorList['draft'] = '#FC913F';
|
||||
$lang->programplan->gantt->reviewColorList['reviewing'] = '#CD6F27';
|
||||
$lang->programplan->gantt->reviewColorList['pass'] = '#0DBB7D';
|
||||
$lang->programplan->gantt->reviewColorList['fail'] = '#FB2B2B';
|
||||
|
||||
@@ -381,25 +381,33 @@ class programplanModel extends model
|
||||
foreach($reviewPoints as $id => $point)
|
||||
{
|
||||
if(!isset($this->config->stage->ipdReviewPoint->{$plan->attribute})) continue;
|
||||
if(!isset($point->status)) $point->status = '';
|
||||
|
||||
$categories = $this->config->stage->ipdReviewPoint->{$plan->attribute};
|
||||
if(in_array($point->category, $categories))
|
||||
{
|
||||
$end = $reviewDeadline[$plan->id]['stageEnd'];
|
||||
if(strpos($point->category, "TR") !== false)
|
||||
if($point->end)
|
||||
{
|
||||
if(isset($reviewDeadline[$plan->id]['taskEnd']) and !helper::isZeroDate($reviewDeadline[$plan->id]['taskEnd']))
|
||||
{
|
||||
$end = $reviewDeadline[$plan->id]['taskEnd'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$end = $this->getReviewDeadline($end);
|
||||
}
|
||||
$end = $point->end;
|
||||
}
|
||||
elseif(strpos($point->category, "DCP") !== false)
|
||||
else
|
||||
{
|
||||
$end = $this->getReviewDeadline($end, 2);
|
||||
$end = $reviewDeadline[$plan->id]['stageEnd'];
|
||||
if(strpos($point->category, "TR") !== false)
|
||||
{
|
||||
if(isset($reviewDeadline[$plan->id]['taskEnd']) and !helper::isZeroDate($reviewDeadline[$plan->id]['taskEnd']))
|
||||
{
|
||||
$end = $reviewDeadline[$plan->id]['taskEnd'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$end = $this->getReviewDeadline($end);
|
||||
}
|
||||
}
|
||||
elseif(strpos($point->category, "DCP") !== false)
|
||||
{
|
||||
$end = $this->getReviewDeadline($end, 2);
|
||||
}
|
||||
}
|
||||
|
||||
$data = new stdclass();
|
||||
@@ -410,7 +418,7 @@ class programplanModel extends model
|
||||
$data->attribute = '';
|
||||
$data->milestone = '';
|
||||
$data->owner_id = '';
|
||||
$data->status = isset($point->status) ? zget($this->lang->review->statusList, $point->status) : $this->lang->review->wait;
|
||||
$data->status = $point->status ? zget($this->lang->review->statusList, $point->status) : $this->lang->review->wait;
|
||||
$data->begin = $end;
|
||||
$data->deadline = $end;
|
||||
$data->realBegan = $point->createdDate;
|
||||
@@ -420,7 +428,7 @@ class programplanModel extends model
|
||||
$data->start_date = $end;
|
||||
$data->endDate = $end;
|
||||
$data->duration = 1;
|
||||
$data->color = '#FC913F';
|
||||
$data->color = isset($this->lang->program->gantt->reviewColorList[$point->status]) ? $this->lang->program->gantt->reviewColorList[$point->status] : '#FC913F';
|
||||
$data->progressColor = $this->lang->execution->gantt->stage->progressColor;
|
||||
$data->textColor = $this->lang->execution->gantt->stage->textColor;
|
||||
$data->bar_height = $this->lang->execution->gantt->bar_height;
|
||||
|
||||
@@ -484,7 +484,7 @@ function validateResources(id)
|
||||
flag = true;
|
||||
|
||||
/* Check status. */
|
||||
if(status !== statusLang)
|
||||
if(status !== statusLang && type != 'point')
|
||||
{
|
||||
if(type == 'task')
|
||||
{
|
||||
@@ -502,9 +502,23 @@ function validateResources(id)
|
||||
return false;
|
||||
}
|
||||
|
||||
var itemID;
|
||||
if(type == 'task')
|
||||
{
|
||||
itemID = task.id.split("-")[1];
|
||||
}
|
||||
else if(type == 'plan')
|
||||
{
|
||||
itemID = task.id;
|
||||
}
|
||||
else if(type == 'point')
|
||||
{
|
||||
itemID = task.id.split("-")[2];
|
||||
}
|
||||
|
||||
/* Check data. */
|
||||
var postData = {
|
||||
'id' : type == 'task' ? task.id.split("-")[1] : task.id,
|
||||
'id' : itemID,
|
||||
'startDate' : from.toLocaleDateString('en-CA'),
|
||||
'endDate' : to.toLocaleDateString('en-CA'),
|
||||
'type' : type
|
||||
|
||||
Reference in New Issue
Block a user