From 80b876383c3d6fee3f84ed94d6a1b3da082d8e2f Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Fri, 4 Jun 2021 17:30:09 +0800 Subject: [PATCH] * Finish task #38920. --- module/todo/control.php | 1 - module/todo/lang/de.php | 1 - module/todo/lang/en.php | 1 - module/todo/lang/fr.php | 1 - module/todo/lang/vi.php | 1 - module/todo/lang/zh-cn.php | 1 - module/todo/model.php | 39 ++------------------------------------ 7 files changed, 2 insertions(+), 43 deletions(-) diff --git a/module/todo/control.php b/module/todo/control.php index 8072fff7b3..0838a29101 100644 --- a/module/todo/control.php +++ b/module/todo/control.php @@ -24,7 +24,6 @@ class todo extends control $this->loadModel('task'); $this->loadModel('bug'); $this->loadModel('my')->setMenu(); - if(!isset($this->config->qcVersion)) unset($this->lang->todo->typeList['review']); } /** diff --git a/module/todo/lang/de.php b/module/todo/lang/de.php index 26dffdeb3c..7d1eb36eaa 100644 --- a/module/todo/lang/de.php +++ b/module/todo/lang/de.php @@ -97,7 +97,6 @@ $lang->todo->typeList['cycle'] = 'Wiederkehrend'; $lang->todo->typeList['bug'] = 'Bug'; $lang->todo->typeList['task'] = 'Aufgabe'; $lang->todo->typeList['story'] = 'Story'; -$lang->todo->typeList['review'] = 'Review'; $lang->todo->typeList['testtask'] = 'Testtask'; $lang->todo->confirmDelete = "Möchten Sie diesen ToDo löschen?"; diff --git a/module/todo/lang/en.php b/module/todo/lang/en.php index 15fa7ac310..2028431127 100644 --- a/module/todo/lang/en.php +++ b/module/todo/lang/en.php @@ -98,7 +98,6 @@ $lang->todo->typeList['cycle'] = 'Recur'; $lang->todo->typeList['bug'] = 'Bug'; $lang->todo->typeList['task'] = 'Task'; $lang->todo->typeList['story'] = 'Story'; -$lang->todo->typeList['review'] = 'Review'; $lang->todo->typeList['testtask'] = 'Testtask'; $lang->todo->confirmDelete = "Do you want to delete this todo?"; diff --git a/module/todo/lang/fr.php b/module/todo/lang/fr.php index 89ccead940..dbd582426a 100644 --- a/module/todo/lang/fr.php +++ b/module/todo/lang/fr.php @@ -97,7 +97,6 @@ $lang->todo->typeList['cycle'] = 'Récur'; $lang->todo->typeList['bug'] = 'Bug'; $lang->todo->typeList['task'] = 'Tâche'; $lang->todo->typeList['story'] = 'Story'; -$lang->todo->typeList['review'] = 'Review'; $lang->todo->typeList['testtask'] = 'Testtask'; $lang->todo->confirmDelete = "Voulez-vous supprimer cette entrée de l'agenda ?"; diff --git a/module/todo/lang/vi.php b/module/todo/lang/vi.php index 7230793679..9a3a86806d 100644 --- a/module/todo/lang/vi.php +++ b/module/todo/lang/vi.php @@ -97,7 +97,6 @@ $lang->todo->typeList['cycle'] = 'Lặp lại'; $lang->todo->typeList['bug'] = 'Bug'; $lang->todo->typeList['task'] = 'Nhiệm vụ'; $lang->todo->typeList['story'] = 'Câu chuyện'; -$lang->todo->typeList['review'] = 'Review'; $lang->todo->typeList['testtask'] = 'Testtask'; $lang->todo->confirmDelete = "Bạn có muốn xóa việc này?"; diff --git a/module/todo/lang/zh-cn.php b/module/todo/lang/zh-cn.php index 29a5f6b1c2..6121619b1d 100644 --- a/module/todo/lang/zh-cn.php +++ b/module/todo/lang/zh-cn.php @@ -98,7 +98,6 @@ $lang->todo->typeList['cycle'] = '周期'; $lang->todo->typeList['bug'] = 'Bug'; $lang->todo->typeList['task'] = '任务'; $lang->todo->typeList['story'] = $lang->SRCommon; -$lang->todo->typeList['review'] = '评审'; $lang->todo->typeList['testtask'] = '测试单'; $lang->todo->confirmDelete = "您确定要删除这条待办吗?"; diff --git a/module/todo/model.php b/module/todo/model.php index 67dd7b7327..6a2c8a8b51 100644 --- a/module/todo/model.php +++ b/module/todo/model.php @@ -39,44 +39,9 @@ class todoModel extends model ->remove(implode(',', $this->config->todo->moduleList) . ',uid') ->get(); - if(!isset($todo->pri)) + if(!isset($todo->pri) and in_array($this->post->type, $this->config->todo->moduleList) and $this->post->type !== 'review') { - if($this->post->type == 'task') - { - $todo->pri = $this->dao->select('pri')->from(TABLE_TASK)->where('id')->eq($this->post->idvalue)->fetch('pri'); - } - elseif($this->post->type == 'bug') - { - $todo->pri = $this->dao->select('pri')->from(TABLE_BUG)->where('id')->eq($this->post->idvalue)->fetch('pri'); - } - elseif($this->post->type == 'story') - { - $todo->pri = $this->dao->select('pri')->from(TABLE_STORY)->where('id')->eq($this->post->idvalue)->fetch('pri'); - } - elseif($this->post->type == 'testtask') - { - $todo->pri = $this->dao->select('pri')->from(TABLE_TESTTASK)->where('id')->eq($this->post->idvalue)->fetch('pri'); - } - elseif($this->post->type == 'issue' and isset($this->config->maxVersion)) - { - $todo->pri = $this->dao->select('pri')->from(TABLE_ISSUE)->where('id')->eq($this->post->idvalue)->fetch('pri'); - } - elseif($this->post->type == 'risk' and isset($this->config->maxVersion)) - { - $todo->pri = $this->dao->select('pri')->from(TABLE_RISK)->where('id')->eq($this->post->idvalue)->fetch('pri'); - } - elseif($this->post->type == 'review' and isset($this->config->maxVersion)) - { - $todo->pri = $this->dao->select('pri')->from(TABLE_REVIEW)->where('id')->eq($this->post->idvalue)->fetch('pri'); - } - elseif($this->post->type == 'feedback' and isset($this->config->maxVersion)) - { - $todo->pri = $this->dao->select('pri')->from(TABLE_FEEDBACK)->where('id')->eq($this->post->idvalue)->fetch('pri'); - } - elseif($this->post->type == 'opportunity' and isset($this->config->maxVersion)) - { - $todo->pri = $this->dao->select('pri')->from(TABLE_OPPORTUNITY)->where('id')->eq($this->post->idvalue)->fetch('pri'); - } + $todo->pri = $this->dao->select('pri')->from($this->config->objectTables[$this->post->type])->where('id')->eq($this->post->idvalue)->fetch('pri'); if($todo->pri == 'high') $todo->pri = 1; if($todo->pri == 'middle') $todo->pri = 2;