From a594f5d1dec1aa76e7e188cbbc3e992e346f8d9d Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Thu, 11 May 2023 16:26:39 +0800 Subject: [PATCH] * Add paragraph comments to programplan. --- module/programplan/model.php | 9 ++++----- module/programplan/zen.php | 4 +++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/module/programplan/model.php b/module/programplan/model.php index 4558b73057..3b17aceb87 100755 --- a/module/programplan/model.php +++ b/module/programplan/model.php @@ -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; diff --git a/module/programplan/zen.php b/module/programplan/zen.php index de71274f6e..a5893b9a96 100644 --- a/module/programplan/zen.php +++ b/module/programplan/zen.php @@ -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);