* Add parent-child task.

This commit is contained in:
sunguangming
2023-06-15 16:58:00 +08:00
parent c1a655c463
commit 7814cb8ec8
2 changed files with 9 additions and 8 deletions
+2 -2
View File
@@ -5402,7 +5402,7 @@ class executionModel extends model
$execution->name = "<span class='label secondary-pale'>{$this->lang->execution->typeList[$execution->type]}</span> " . (empty($execution->isParent) ? html::a($link, $execution->name, '_self', 'class="text-primary"') : $execution->name) . (strtotime($today) > strtotime($execution->end) ? '<span class="label danger-pale">' . $this->lang->execution->delayed . '</span>' : '');
$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;
+7 -6
View File
@@ -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';