From 7814cb8ec80064cd4df368fc16daaedf21ee0289 Mon Sep 17 00:00:00 2001 From: sunguangming Date: Thu, 15 Jun 2023 16:27:05 +0800 Subject: [PATCH] * Add parent-child task. --- module/execution/model.php | 4 ++-- module/task/config/dtable.php | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index 61050edab7..75d97b2445 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -5402,7 +5402,7 @@ class executionModel extends model $execution->name = "{$this->lang->execution->typeList[$execution->type]} " . (empty($execution->isParent) ? html::a($link, $execution->name, '_self', 'class="text-primary"') : $execution->name) . (strtotime($today) > strtotime($execution->end) ? '' . $this->lang->execution->delayed . '' : ''); $execution->project = $execution->projectName; $execution->parent = ($execution->parent and $execution->grade > 1) ? 'pid' . (string)$execution->parent : ''; - $execution->asParent = !empty($execution->isParent) or !empty($execution->tasks); + $execution->isParent = !empty($execution->isParent) or !empty($execution->tasks); $execution->progress = $execution->hours->progress; $execution->totalEstimate = $execution->hours->totalEstimate; $execution->totalConsumed = $execution->hours->totalConsumed; @@ -5457,7 +5457,7 @@ class executionModel extends model $task->totalEstimate = $task->estimate; $task->totalConsumed = $task->consumed; $task->totalLeft = $task->left; - $task->asParent = ($task->parent < 0); + $task->isParent = ($task->parent < 0); $task->parent = $task->parent <= 0 ? 'pid' . (string)$task->execution : 'tid' . (string)$task->parent; $task->progress = ($task->consumed + $task->left) == 0 ? 0 : round($task->consumed / ($task->consumed + $task->left), 2) * 100; diff --git a/module/task/config/dtable.php b/module/task/config/dtable.php index 073cba33be..f2b27e8e3a 100644 --- a/module/task/config/dtable.php +++ b/module/task/config/dtable.php @@ -7,12 +7,13 @@ $config->task->dtable->fieldList['id']['sortType'] = 'desc'; $config->task->dtable->fieldList['id']['checkbox'] = true; $config->task->dtable->fieldList['id']['required'] = true; -$config->task->dtable->fieldList['name']['fixed'] = 'left'; -$config->task->dtable->fieldList['name']['flex'] = 1; -$config->task->dtable->fieldList['name']['type'] = 'nestedTitle'; -$config->task->dtable->fieldList['name']['sortType'] = true; -$config->task->dtable->fieldList['name']['link'] = array('module' => 'task', 'method' => 'view', 'params' => 'taskID={id}'); -$config->task->dtable->fieldList['name']['required'] = true; +$config->task->dtable->fieldList['name']['fixed'] = 'left'; +$config->task->dtable->fieldList['name']['flex'] = 1; +$config->task->dtable->fieldList['name']['type'] = 'nestedTitle'; +$config->task->dtable->fieldList['name']['nestedToggle'] = true; +$config->task->dtable->fieldList['name']['sortType'] = true; +$config->task->dtable->fieldList['name']['link'] = array('module' => 'task', 'method' => 'view', 'params' => 'taskID={id}'); +$config->task->dtable->fieldList['name']['required'] = true; $config->task->dtable->fieldList['pri']['title'] = $lang->priAB; $config->task->dtable->fieldList['pri']['type'] = 'pri';