From db0fd231555cbfb91b0e9b149f7e64e18b8e239c Mon Sep 17 00:00:00 2001 From: sunjun Date: Sat, 16 Apr 2022 22:46:42 +0800 Subject: [PATCH 1/2] *Fixbug_sunjun_qijian --- module/todo/control.php | 2 +- module/todo/js/common.js | 2 +- module/todo/model.php | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/module/todo/control.php b/module/todo/control.php index fade70b864..5b40e593d4 100644 --- a/module/todo/control.php +++ b/module/todo/control.php @@ -218,7 +218,7 @@ class todo extends control $bugs = $this->bug->getUserBugPairs($account, true, 0, '', '', isset($objectIDList['bug']) ? $objectIDList['bug'] : ''); $tasks = $this->task->getUserTaskPairs($account, 'wait,doing', '', isset($objectIDList['task']) ? $objectIDList['task'] : ''); $storys = $this->loadModel('story')->getUserStoryPairs($account, 10, 'story', '', isset($objectIDList['story']) ? $objectIDList['story'] : ''); - if($this->config->edition != 'open') $this->view->feedbacks = $this->loadModel('feedback')->getUserFeedbackPairs($account); + if($this->config->edition != 'open') $this->view->feedbacks = $this->loadModel('feedback')->getUserFeedbackPairs($account,'' , isset($objectIDList['feedback']) ? $objectIDList['feedback'] : ''); if($this->config->edition == 'max') { $issues = $this->loadModel('issue')->getUserIssuePairs($account); diff --git a/module/todo/js/common.js b/module/todo/js/common.js index 860c4f6740..d0dd53402a 100644 --- a/module/todo/js/common.js +++ b/module/todo/js/common.js @@ -12,7 +12,7 @@ function switchDateTodo(switcher) /** * Load data. * @param type $type Type of selected todo. - * @param id $id ID of selected todo. + * @param id $id ID of selected todo. * @param defaultType $defaultType Default type of selected todo. * @param idvalue $idvalue ID of the closed todo type. * @access public diff --git a/module/todo/model.php b/module/todo/model.php index d25fb1bd4d..512756c9d5 100644 --- a/module/todo/model.php +++ b/module/todo/model.php @@ -347,10 +347,10 @@ class todoModel extends model foreach($todos as $todoID => $todo) { $oldTodo = $oldTodos[$todoID]; - if($oldTodo->type == 'bug' or $oldTodo->type == 'task' or $oldTodo->type == 'story' or $oldTodo->type == 'feedback') $oldTodo->name = ''; + if(in_array($todo->type, $this->config->todo->moduList)) $oldTodo->name = ''; $this->dao->update(TABLE_TODO)->data($todo) ->autoCheck() - ->checkIF(in_array($todo->type, array('custom', 'feedback')), $this->config->todo->edit->requiredFields, 'notempty') + ->checkIF(!in_array($todo->type, $this->config->todo->moduleList), $this->config->todo->edit->requiredFields, 'notempty') ->checkIF($todo->type == 'bug' and $todo->idvalue == 0, 'idvalue', 'notempty') ->checkIF($todo->type == 'task' and $todo->idvalue == 0, 'idvalue', 'notempty') ->checkIF($todo->type == 'story' and $todo->idvalue == 0, 'idvalue', 'notempty') @@ -435,6 +435,7 @@ class todoModel extends model if($todo->type == 'opportunity' and $this->config->edition == 'max') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_OPPORTUNITY)->fetch('name'); if($todo->type == 'review' and $this->config->edition == 'max') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_REVIEW)->fetch('title'); if($todo->type == 'testtask') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_TESTTASK)->fetch('name'); + if($todo->type == 'feedback') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_FEEDBACK)->fetch('title'); $todo->date = str_replace('-', '', $todo->date); return $todo; } @@ -552,6 +553,7 @@ class todoModel extends model if($todo->type == 'risk' && $this->config->edition == 'max') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_RISK)->fetch('name'); if($todo->type == 'opportunity' && $this->config->edition == 'max') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_OPPORTUNITY)->fetch('name'); if($todo->type == 'review' && $this->config->edition == 'max') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_REVIEW)->fetch('title'); + if($todo->type == 'feedback' && $this->config->edition == 'max') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_FEEDBACK)->fetch('title'); $todo->begin = date::formatTime($todo->begin); $todo->end = date::formatTime($todo->end); From ccca03fb974a8f0d83b853d76f5edfdfd4a6aa0e Mon Sep 17 00:00:00 2001 From: sunjun Date: Sat, 16 Apr 2022 22:52:43 +0800 Subject: [PATCH 2/2] *Fixbug_sunjun_qijian --- module/todo/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/todo/control.php b/module/todo/control.php index 5b40e593d4..3644d47731 100644 --- a/module/todo/control.php +++ b/module/todo/control.php @@ -218,7 +218,7 @@ class todo extends control $bugs = $this->bug->getUserBugPairs($account, true, 0, '', '', isset($objectIDList['bug']) ? $objectIDList['bug'] : ''); $tasks = $this->task->getUserTaskPairs($account, 'wait,doing', '', isset($objectIDList['task']) ? $objectIDList['task'] : ''); $storys = $this->loadModel('story')->getUserStoryPairs($account, 10, 'story', '', isset($objectIDList['story']) ? $objectIDList['story'] : ''); - if($this->config->edition != 'open') $this->view->feedbacks = $this->loadModel('feedback')->getUserFeedbackPairs($account,'' , isset($objectIDList['feedback']) ? $objectIDList['feedback'] : ''); + if($this->config->edition != 'open') $this->view->feedbacks = $this->loadModel('feedback')->getUserFeedbackPairs($account, '', isset($objectIDList['feedback']) ? $objectIDList['feedback'] : ''); if($this->config->edition == 'max') { $issues = $this->loadModel('issue')->getUserIssuePairs($account);