* Add paragraph comments to programplan.
This commit is contained in:
@@ -140,14 +140,11 @@ class programplanModel extends model
|
||||
*/
|
||||
public function getDataForGantt(int $executionID, int $productID, int $baselineID = 0, string $selectCustom = '', bool $returnJson = true): string|array
|
||||
{
|
||||
$this->loadModel('stage');
|
||||
$this->loadModel('execution');
|
||||
|
||||
$plans = $this->getStage($executionID, $productID, 'all', 'order');
|
||||
|
||||
/* Set plan baseline data. */
|
||||
if($baselineID)
|
||||
{
|
||||
/* Set plan baseline. */
|
||||
$baseline = $this->loadModel('cm')->getByID($baselineID);
|
||||
$oldData = json_decode($baseline->data);
|
||||
$oldPlans = $oldData->stage;
|
||||
@@ -165,6 +162,7 @@ class programplanModel extends model
|
||||
|
||||
$tasks = $this->dao->select('*')->from(TABLE_TASK)->where('deleted')->eq(0)->andWhere('execution')->in($planIdList)->orderBy('execution_asc, order_asc, id_desc')->fetchAll('id');
|
||||
|
||||
/* Set task baseline data. */
|
||||
if($baselineID)
|
||||
{
|
||||
$oldTasks = isset($oldData->task) ? $oldData->task : array();
|
||||
@@ -186,7 +184,8 @@ class programplanModel extends model
|
||||
$datas['data'][$index]->consumed = $stage['progress']['totalConsumed'];
|
||||
}
|
||||
|
||||
$datas = $this->setRelationTask($planIdList, $datas);
|
||||
/* Set relation task data. */
|
||||
$datas = $this->programplanTao->setRelationTask($planIdList, $datas);
|
||||
|
||||
$datas['data'] = isset($datas['data']) ? array_values($datas['data']) : array();
|
||||
return $returnJson ? json_encode($datas) : $datas;
|
||||
|
||||
@@ -194,6 +194,7 @@ class programplanZen extends programplan
|
||||
$selectCustom = 0; // Display date and task settings.
|
||||
$dateDetails = 1; // Gantt chart detail date display.
|
||||
|
||||
/* Get data of type lists. */
|
||||
if($type == 'lists')
|
||||
{
|
||||
$sort = common::appendOrder($orderBy);
|
||||
@@ -203,18 +204,19 @@ class programplanZen extends programplan
|
||||
return $stages;
|
||||
}
|
||||
|
||||
/* Obtain user page configuration items. */
|
||||
$owner = $this->app->user->account;
|
||||
if(!isset($this->config->programplan->browse->stageCustom)) $this->loadModel('setting')->setItem("$owner.programplan.browse.stageCustom", 'date,task');
|
||||
$selectCustom = $this->loadModel('setting')->getItem("owner={$owner}&module=programplan§ion=browse&key=stageCustom");
|
||||
$dateDetails = strpos($selectCustom, 'date') !== false ? 0 : 1; // Gantt chart detail date display.
|
||||
|
||||
/* Set Custom. */
|
||||
foreach(explode(',', $this->config->programplan->custom->customGanttFields) as $field) $customFields[$field] = $this->lang->programplan->ganttCustom[$field];
|
||||
$this->view->customFields = $customFields;
|
||||
$this->view->showFields = $this->config->programplan->ganttCustom->ganttFields;
|
||||
$this->view->dateDetails = $dateDetails;
|
||||
$this->view->selectCustom = $selectCustom;
|
||||
|
||||
/* Get data for gantt. */
|
||||
if($type == 'gantt' ) $stages = $this->programplan->getDataForGantt($projectID, $productID, $baselineID, $selectCustom, false);
|
||||
if($type == 'assignedTo') $stages = $this->programplan->getDataForGanttGroupByAssignedTo($projectID, $productID, $baselineID, $selectCustom, false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user