From 137102399eccb99ba846e93d5e1f00a8c4967b8f Mon Sep 17 00:00:00 2001 From: chaideqing Date: Wed, 6 Dec 2023 05:46:44 +0000 Subject: [PATCH] * Finish task #107588. --- module/task/config.php | 2 +- module/task/zen.php | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/module/task/config.php b/module/task/config.php index 508e1f9470..09e60048b5 100644 --- a/module/task/config.php +++ b/module/task/config.php @@ -42,7 +42,7 @@ $config->task->editor->pause = array('id' => 'comment', 'tools' => 'simpleToo $config->task->removeFields = 'objectTypeList,productList,executionList,gitlabID,gitlabProjectID,product'; $config->task->exportFields = ' - id, execution, module, story, fromBug, + id, project, execution, module, story, fromBug, name, desc, type, pri,estStarted, realStarted, deadline, status,estimate, consumed, left, mailto, progress, mode, diff --git a/module/task/zen.php b/module/task/zen.php index 35d931d240..93b7311c1e 100644 --- a/module/task/zen.php +++ b/module/task/zen.php @@ -1096,12 +1096,13 @@ class taskZen extends task * Format export task. * * @param object $task + * @param array $projects * @param array $executions * @param array $users * @access protected * @return object */ - protected function formatExportTask(object $task, array $executions, array $users): object + protected function formatExportTask(object $task, array $projects, array $executions, array $users): object { $taskLang = $this->lang->task; if($this->post->fileType == 'csv') @@ -1112,6 +1113,7 @@ class taskZen extends task $task->desc = str_replace(' ', ' ', $task->desc); } + if(isset($projects[$task->project])) $task->project = $projects[$task->project] . "(#$task->project)"; if(isset($executions[$task->execution])) $task->execution = $executions[$task->execution] . "(#$task->execution)"; if(isset($taskLang->typeList[$task->type])) $task->type = $taskLang->typeList[$task->type]; if(isset($taskLang->priList[$task->pri])) $task->pri = $taskLang->priList[$task->pri]; @@ -1285,7 +1287,8 @@ class taskZen extends task { /* Get users and executions. */ $users = $this->loadModel('user')->getPairs('noletter'); - $executions = $this->loadModel('execution')->fetchPairs($projectID, 'all', true, true); + $projects = $this->loadModel('project')->getPairs(); + $executions = $this->loadModel('execution')->fetchPairs(0, 'all', true, true); /* Get related objects id lists. */ $relatedStoryIdList = array(); @@ -1327,7 +1330,7 @@ class taskZen extends task unset($task->team); } - $task = $this->formatExportTask($task, $executions, $users); + $task = $this->formatExportTask($task, $projects, $executions, $users); /* Set related files. */ $task->files = '';