diff --git a/module/block/control.php b/module/block/control.php index 632ab4e1ee..c3d7b09f10 100644 --- a/module/block/control.php +++ b/module/block/control.php @@ -49,7 +49,6 @@ class block extends control if(!common::hasPriv($moduleKey, 'index')) unset($modules[$moduleKey]); } - if($this->config->global->flow != 'full') unset($modules['todo']); if($this->config->global->flow == 'onlyTask' or $this->config->global->flow == 'onlyStory') unset($modules['qa']); if($this->config->global->flow == 'onlyTask' or $this->config->global->flow == 'onlyTest') unset($modules['product']); if($this->config->global->flow == 'onlyStory' or $this->config->global->flow == 'onlyTest') unset($modules['project']); diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index fd603a43c5..09bde1c550 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -568,7 +568,6 @@ if(isset($config->global->flow) and $config->global->flow == 'onlyStory') /* Adjust sub menu of my dashboard. */ unset($lang->my->menu->bug); - unset($lang->my->menu->todo); unset($lang->my->menu->testtask); unset($lang->my->menu->task); unset($lang->my->menu->myProject); @@ -601,7 +600,6 @@ if(isset($config->global->flow) and $config->global->flow == 'onlyTask') /* Adjust sub menu of my dashboard. */ unset($lang->my->menu->bug); - unset($lang->my->menu->todo); unset($lang->my->menu->testtask); unset($lang->my->menu->story); @@ -647,7 +645,6 @@ if(isset($config->global->flow) and $config->global->flow == 'onlyTest') unset($lang->my->menu->task); unset($lang->my->menu->myProject); unset($lang->my->menu->story); - unset($lang->my->menu->todo); /* Remove sub menu of project module. */ unset($lang->project->menu); diff --git a/module/todo/lang/zh-cn.php b/module/todo/lang/zh-cn.php index cd5e51b266..7ef53a8e1e 100644 --- a/module/todo/lang/zh-cn.php +++ b/module/todo/lang/zh-cn.php @@ -57,6 +57,10 @@ $lang->todo->typeList['custom'] = '自定义'; $lang->todo->typeList['bug'] = 'Bug'; $lang->todo->typeList['task'] = $lang->projectCommon . '任务'; +global $config; +if($config->global->flow == 'onlyTest' or $config->global->flow == 'onlyStory') unset($lang->todo->typeList['task']); +if($config->global->flow == 'onlyTask' or $config->global->flow == 'onlyStory') unset($lang->todo->typeList['bug']); + $lang->todo->confirmDelete = "您确定要删除这条待办吗?"; $lang->todo->thisIsPrivate = '这是一条私人事务。:)'; $lang->todo->lblDisableDate = '暂时不设定时间'; diff --git a/module/todo/model.php b/module/todo/model.php index 7590031bcd..c8ac69d1de 100644 --- a/module/todo/model.php +++ b/module/todo/model.php @@ -323,6 +323,10 @@ class todoModel extends model while($todo = $stmt->fetch()) { + if($this->config->global->flow == 'onlyTest' and $todo->type == 'task') continue; + if($this->config->global->flow == 'onlyTask' and $todo->type == 'bug') continue; + if($this->config->global->flow == 'onlyStory' and $todo->type != 'custom') continue; + if($todo->type == 'task') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_TASK)->fetch('name'); if($todo->type == 'bug') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_BUG)->fetch('title'); $todo->begin = date::formatTime($todo->begin); @@ -330,6 +334,7 @@ class todoModel extends model /* If is private, change the title to private. */ if($todo->private and $this->app->user->account != $todo->account) $todo->name = $this->lang->todo->thisIsPrivate; + $todos[] = $todo; } return $todos; @@ -352,6 +357,3 @@ class todoModel extends model return true; } } - - -