* Remove stage's output and put review points into gantt.
This commit is contained in:
@@ -152,7 +152,7 @@ class programplanModel extends model
|
||||
/**
|
||||
* Get gantt data.
|
||||
*
|
||||
* @param int $executionID
|
||||
* @param int $projectID
|
||||
* @param int $productID
|
||||
* @param int $baselineID
|
||||
* @param string $selectCustom
|
||||
@@ -160,12 +160,12 @@ class programplanModel extends model
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getDataForGantt($executionID, $productID, $baselineID = 0, $selectCustom = '', $returnJson = true)
|
||||
public function getDataForGantt($projectID, $productID, $baselineID = 0, $selectCustom = '', $returnJson = true)
|
||||
{
|
||||
$this->loadModel('stage');
|
||||
$this->loadModel('execution');
|
||||
|
||||
$plans = $this->getStage($executionID, $productID, 'all', 'order');
|
||||
$plans = $this->getStage($projectID, $productID, 'all', 'order');
|
||||
if($baselineID)
|
||||
{
|
||||
$baseline = $this->loadModel('cm')->getByID($baselineID);
|
||||
@@ -182,6 +182,7 @@ class programplanModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
$project = $this->loadModel('project')->getByID($projectID);
|
||||
$today = helper::today();
|
||||
$datas = array();
|
||||
$planIdList = array();
|
||||
@@ -351,6 +352,57 @@ class programplanModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
/* Build review points tree for ipd project. */
|
||||
if($project->model == 'ipd')
|
||||
{
|
||||
$reviewPoints = $this->dao->select('*')->from(TABLE_OBJECT)
|
||||
->where('deleted')->eq('0')
|
||||
->andWhere('project')->eq($projectID)
|
||||
->beginIF($productID)->andWhere('product')->eq($productID)->fi()
|
||||
->fetchAll('id');
|
||||
|
||||
foreach($datas['data'] as $plan)
|
||||
{
|
||||
if($plan->type != 'plan') continue;
|
||||
|
||||
foreach($reviewPoints as $id => $point)
|
||||
{
|
||||
if(!isset($this->config->stage->ipdReviewPoint->{$plan->attribute})) continue;
|
||||
|
||||
$categories = $this->config->stage->ipdReviewPoint->{$plan->attribute};
|
||||
if(in_array($point->category, $categories))
|
||||
{
|
||||
$data = new stdclass();
|
||||
$data->id = $plan->id . '-' . $point->category . '-' . $point->id;
|
||||
$data->type = 'point';
|
||||
$data->text = $point->title;
|
||||
$data->name = $point->title;
|
||||
$data->attribute = '';
|
||||
$data->milestone = '';
|
||||
$data->owner_id = '';
|
||||
$data->status = '';
|
||||
$data->begin = helper::today();
|
||||
$data->deadline = '';
|
||||
$data->realBegan = $point->createdDate;
|
||||
$data->realEnd = '';;
|
||||
$data->parent = $plan->id;
|
||||
$data->open = true;
|
||||
$data->start_date = helper::today();
|
||||
$data->endDate = helper::today();
|
||||
$data->duration = 1;
|
||||
$data->color = '#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;
|
||||
|
||||
if($data->start_date) $data->start_date = date('d-m-Y', strtotime($data->start_date));
|
||||
|
||||
$datas['data'][$data->id] = $data;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Calculate the progress of the phase. */
|
||||
foreach($stageIndex as $index => $stage)
|
||||
{
|
||||
@@ -878,7 +930,6 @@ class programplanModel extends model
|
||||
$data->days = helper::diffDate($data->end, $data->begin) + 1;
|
||||
$data->order = current($orders);
|
||||
|
||||
|
||||
if($data->id)
|
||||
{
|
||||
$stageID = $data->id;
|
||||
@@ -954,6 +1005,10 @@ class programplanModel extends model
|
||||
if(!dao::isError())
|
||||
{
|
||||
$stageID = $this->dao->lastInsertID();
|
||||
|
||||
/* Ipd project create default review points. */
|
||||
if($project->model == 'ipd' && $this->config->edition == 'ipd') $this->loadModel('review')->createDefaultPoint($projectID, $productID, $data->attribute);
|
||||
|
||||
if($data->type == 'kanban')
|
||||
{
|
||||
$execution = $this->execution->getByID($stageID);
|
||||
|
||||
@@ -100,9 +100,6 @@
|
||||
<th class='c-date <?php echo zget($visibleFields, 'realBegan', ' hidden') . zget($requiredFields, 'realBegan', '', ' required');?>'><?php echo $lang->programplan->realBegan;?></th>
|
||||
<th class='c-date <?php echo zget($visibleFields, 'realEnd', ' hidden') . zget($requiredFields, 'realEnd', '', ' required');?>'><?php echo $lang->programplan->realEnd;?></th>
|
||||
<th class='c-desc <?php echo zget($visibleFields, 'desc', ' hidden') . zget($requiredFields, 'desc', '', ' required');?>'><?php echo $lang->programplan->desc;?></th>
|
||||
<?php if(($this->config->edition == 'max' or $this->config->edition == 'ipd') and $executionType == 'stage'):?>
|
||||
<th class='w-110px'><?php echo $lang->programplan->output;?></th>
|
||||
<?php endif;?>
|
||||
<th class="c-action text-center w-110px"> <?php echo $lang->actions;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -129,9 +126,6 @@
|
||||
<td><input type='text' name='end[<?php echo $i;?>]' id='end<?php echo $i;?>' value='' class='form-control form-date' /></td>
|
||||
<td <?php echo zget($visibleFields, 'realBegan', ' hidden') . zget($requiredFields, 'realBegan', '', ' required');?>><input type='text' name='realBegan[<?php echo $i;?>]' id='realBegan<?php echo $i;?>' value='' class='form-control form-date' /></td>
|
||||
<td <?php echo zget($visibleFields, 'realEnd', ' hidden') . zget($requiredFields, 'realEnd', '', ' required');?>><input type='text' name='realEnd[<?php echo $i;?>]' id='realEnd<?php echo $i;?>' value='' class='form-control form-date' /></td>
|
||||
<?php if(($this->config->edition == 'max' or $this->config->edition == 'ipd') and $executionType == 'stage'):?>
|
||||
<td><?php echo html::select("output[$i][]", $documentList, '', "class='form-control picker-select' data-drop-width='auto' multiple");?></td>
|
||||
<?php endif;?>
|
||||
<td class='c-actions text-center'>
|
||||
<a href='javascript:;' onclick='addItem(this)' class='btn btn-link'><i class='icon-plus'></i></a>
|
||||
<button type="button" class='btn btn-link btn-sm btn-icon btn-move'><i class='icon-move'></i></button>
|
||||
@@ -166,10 +160,6 @@
|
||||
<td <?php echo zget($visibleFields, 'realBegan', ' hidden') . zget($requiredFields, 'realBegan', '', ' required');?>><input type='text' name='realBegan[<?php echo $i;?>] ' id='realBegan<?php echo $i;?>' value='<?php echo $plan->realBegan;?>' class='form-control form-date' /></td>
|
||||
<td <?php echo zget($visibleFields, 'realEnd', ' hidden') . zget($requiredFields, 'realEnd', '', ' required');?>><input type='text' name='realEnd[<?php echo $i;?>]' id='realEnd<?php echo $i;?>' value='<?php echo $plan->realEnd;?>' class='form-control form-date' /></td>
|
||||
<td class='<?php echo zget($visibleFields, 'desc', 'hidden')?>'><?php echo html::textarea("desc[$i]", $plan->desc, "rows='1' class='form-control autosize'");?></td>
|
||||
<?php if(($this->config->edition == 'max' or $this->config->edition == 'ipd') and $executionType == 'stage'):?>
|
||||
<?php $option = empty($plan->output) ? 0 : explode(',', $plan->output);?>
|
||||
<td><?php echo html::select("output[$i][]", $documentList, $option, "class='form-control picker-select' data-drop-width='auto' multiple");?></td>
|
||||
<?php endif;?>
|
||||
<td class='c-actions text-center'>
|
||||
<a href='javascript:;' onclick='addItem(this)' class='btn btn-link'><i class='icon-plus'></i></a>
|
||||
<button type="button" class='btn btn-link btn-sm btn-icon btn-move'><i class='icon-move'></i></button>
|
||||
@@ -202,9 +192,6 @@
|
||||
<td <?php echo zget($visibleFields, 'realBegan', ' hidden') . zget($requiredFields, 'realBegan', '', ' required');?>><input type='text' name='realBegan[<?php echo $i;?>] ' id='realBegan<?php echo $i;?>' value='' class='form-control form-date' /></td>
|
||||
<td <?php echo zget($visibleFields, 'realEnd', ' hidden') . zget($requiredFields, 'realEnd', '', ' required');?>><input type='text' name='realEnd[<?php echo $i;?>]' id='realEnd<?php echo $i;?>' value='' class='form-control form-date' /></td>
|
||||
<td class='<?php echo zget($visibleFields, 'desc', 'hidden')?>'><?php echo html::textarea("desc[$i]", '', "rows='1' class='form-control autosize'");?></td>
|
||||
<?php if(($this->config->edition == 'max' or $this->config->edition == 'ipd') and $executionType == 'stage'):?>
|
||||
<td><?php echo html::select("output[$i][]", $documentList, '', "class='form-control picker-select' data-drop-width='auto' multiple");?></td>
|
||||
<?php endif;?>
|
||||
<td class='c-actions text-center'>
|
||||
<a href='javascript:;' onclick='addItem(this)' class='btn btn-link'><i class='icon-plus'></i></a>
|
||||
<button type="button" class='btn btn-link btn-sm btn-icon btn-move'><i class='icon-move'></i></button>
|
||||
@@ -250,9 +237,6 @@
|
||||
<td <?php echo zget($visibleFields, 'realBegan', ' hidden') . zget($requiredFields, 'realBegan', '', ' required');?>><input type='text' name='<?php echo "realBegan[$i]";?>' id='realBegan<?php echo $i;?>' class='form-control form-date' /></td>
|
||||
<td <?php echo zget($visibleFields, 'realEnd', ' hidden') . zget($requiredFields, 'realEnd', '', ' required');?>><input type='text' name='<?php echo "realEnd[$i]";?>' id='realEnd<?php echo $i;?>' class='form-control form-date' /></td>
|
||||
<td class='<?php echo zget($visibleFields, 'desc', 'hidden')?>'><?php echo html::textarea("desc[$i]", '', "rows='1' class='form-control autosize'");?></td>
|
||||
<?php if(($this->config->edition == 'max' or $this->config->edition == 'ipd') and $executionType == 'stage'):?>
|
||||
<td><?php echo html::select("output[$i][]", $documentList, '', "class='form-control' data-drop-width='auto' multiple");?></td>
|
||||
<?php endif;?>
|
||||
<td class='c-actions text-center'>
|
||||
<a href='javascript:;' onclick='addItem(this)' class='btn btn-link'><i class='icon-plus'></i></a>
|
||||
<button type="button" class='btn btn-link btn-sm btn-icon btn-move'><i class='icon-move'></i></button>
|
||||
|
||||
Reference in New Issue
Block a user