* Finish task #38922.

This commit is contained in:
tianshujie98
2021-06-04 22:41:29 +08:00
parent cf74e5728c
commit f3921abf0a
4 changed files with 12 additions and 17 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ $config->todo->custom = new stdclass();
$config->todo->custom->batchCreateFields = 'type,pri,desc,beginAndEnd';
$config->todo->custom->batchEditFields = 'pri,beginAndEnd,status';
$config->todo->moduleList = array('bug', 'task', 'story', 'review', 'testtask');
$config->todo->moduleList = array('bug', 'task', 'story', 'testtask');
$config->todo->getUserObjectsMethod = array();
$config->todo->getUserObjectsMethod['bug'] = 'ajaxGetUserBugs';
+2 -1
View File
@@ -193,6 +193,7 @@ class todo extends control
$bugs = $this->bug->getUserBugPairs($account);
$tasks = $this->task->getUserTaskPairs($account, $status);
$storys = $this->loadModel('story')->getUserStoryPairs($account);
if(isset($this->config->bizVersion) or isset($this->config->maxVersion)) $this->view->feedbacks = $this->loadModel('feedback')->getUserFeedbackPairs($account);
if(isset($this->config->maxVersion))
{
$issues = $this->loadModel('issue')->getUserIssuePairs($account);
@@ -202,7 +203,7 @@ class todo extends control
$testtasks = $this->loadModel('testtask')->getUserTestTaskPairs($account);
$reviews = array();
if(isset($this->config->qcVersion)) $reviews = $this->loadModel('review')->getUserReviewPairs($account);
if(isset($this->config->qcVersion) or isset($this->config->maxVersion)) $reviews = $this->loadModel('review')->getUserReviewPairs($account);
$allTodos = $this->todo->getList($type, $account, $status);
if($this->post->todoIDList) $todoIDList = $this->post->todoIDList;
+4 -9
View File
@@ -297,16 +297,11 @@ class todoModel extends model
$todo->name = ($todo->type == 'custom' or $todo->type == 'cycle' or $todo->type == 'feedback') ? $data->names[$todoID] : '';
$todo->begin = isset($data->begins[$todoID]) ? $data->begins[$todoID] : 2400;
$todo->end = isset($data->ends[$todoID]) ? $data->ends[$todoID] : 2400;
if($todo->type == 'task') $todo->idvalue = isset($data->tasks[$todoID]) ? $data->tasks[$todoID] : 0;
if($todo->type == 'bug') $todo->idvalue = isset($data->bugs[$todoID]) ? $data->bugs[$todoID] : 0;
if($todo->type == 'story') $todo->idvalue = isset($data->storys[$todoID]) ? $data->storys[$todoID] : 0;
if($todo->type == 'issue') $todo->idvalue = isset($data->issues[$todoID]) ? $data->issues[$todoID] : 0;
if($todo->type == 'risk') $todo->idvalue = isset($data->risks[$todoID]) ? $data->risks[$todoID] : 0;
if($todo->type == 'opportunity') $todo->idvalue = isset($data->opportunities[$todoID]) ? $data->opportunities[$todoID] : 0;
if($todo->type == 'review') $todo->idvalue = isset($data->reviews[$todoID]) ? $data->reviews[$todoID] : 0;
if($todo->type == 'testtask') $todo->idvalue = isset($data->testtasks[$todoID]) ? $data->testtasks[$todoID] : 0;
if($todo->type == 'feedback') $todo->idvalue = isset($data->feedbacks[$todoID]) ? $data->feedbacks[$todoID] : 0;
if(in_array($todo->type, $this->config->todo->moduleList))
{
$todo->idvalue = isset($data->{$this->config->todo->objectList[$todo->type]}[$todoID]) ? $data->{$this->config->todo->objectList[$todo->type]}[$todoID] : 0;
}
if($todo->end < $todo->begin) die(js::alert(sprintf($this->lang->error->gt, $this->lang->todo->end, $this->lang->todo->begin)));
$todos[$todoID] = $todo;
+5 -6
View File
@@ -73,11 +73,6 @@
{
echo html::input("names[$todo->id]", $todo->name, "class='form-control'");
}
elseif($todo->type == 'feedback')
{
echo html::input("names[$todo->id]", $todo->name, "class='form-control'");
echo html::hidden("feedbacks[$todo->id]", $todo->idvalue, "class='form-control'");
}
elseif($todo->type == 'task')
{
echo html::select("tasks[$todo->id]", $tasks, $todo->idvalue, 'class="form-control chosen"');
@@ -88,7 +83,7 @@
}
elseif($todo->type == 'story')
{
echo html::select("storys[$todo->id]", $storys, $todo->idvalue, 'class="form-control chosen"');
echo html::select("stories[$todo->id]", $storys, $todo->idvalue, 'class="form-control chosen"');
}
elseif($todo->type == 'issue')
{
@@ -110,6 +105,10 @@
{
echo html::select("opportunities[$todo->id]", $opportunities, $todo->idvalue, 'class="form-control chosen"');
}
elseif($todo->type == 'feedback')
{
echo html::select("feedbacks[$todo->id]", $feedbacks, $todo->idvalue, 'class="form-control chosen"');
}
?>
</div>
</td>