diff --git a/module/report/config.php b/module/report/config.php index 7289d78d27..4d0c9aab81 100644 --- a/module/report/config.php +++ b/module/report/config.php @@ -1,7 +1,8 @@ report = new stdclass(); -$config->report->dailyreminder = new stdclass(); -$config->report->dailyreminder->bug = true; -$config->report->dailyreminder->task = true; -$config->report->dailyreminder->todo = true; +$config->report = new stdclass(); +$config->report->dailyreminder = new stdclass(); +$config->report->dailyreminder->bug = true; +$config->report->dailyreminder->task = true; +$config->report->dailyreminder->todo = true; +$config->report->dailyreminder->testtask = true; diff --git a/module/report/control.php b/module/report/control.php index f20fcfed34..a1109b8d42 100644 --- a/module/report/control.php +++ b/module/report/control.php @@ -158,18 +158,20 @@ class report extends control */ public function remind() { - if($this->config->report->dailyreminder->bug) $bugs = $this->report->getUserBugs(); - if($this->config->report->dailyreminder->task) $tasks = $this->report->getUserTasks(); - if($this->config->report->dailyreminder->todo) $todos = $this->report->getUserTodos(); + if($this->config->report->dailyreminder->bug) $bugs = $this->report->getUserBugs(); + if($this->config->report->dailyreminder->task) $tasks = $this->report->getUserTasks(); + if($this->config->report->dailyreminder->todo) $todos = $this->report->getUserTodos(); + if($this->config->report->dailyreminder->testtask) $testtasks = $this->report->getUserTesttasks(); $reminder = array(); - $users = array_unique(array_merge(array_keys($bugs), array_keys($tasks), array_keys($todos))); + $users = array_unique(array_merge(array_keys($bugs), array_keys($tasks), array_keys($todos), array_keys($testtasks))); if(!empty($users)) foreach($users as $user) $reminder[$user] = new stdclass(); if(!empty($bugs)) foreach($bugs as $user => $bug) $reminder[$user]->bugs = $bug; if(!empty($tasks)) foreach($tasks as $user => $task) $reminder[$user]->tasks = $task; if(!empty($todos)) foreach($todos as $user => $todo) $reminder[$user]->todos = $todo; + if(!empty($testtasks)) foreach($testtasks as $user => $testtask) $reminder[$user]->testtasks = $testtask; $this->loadModel('mail'); @@ -192,6 +194,7 @@ class report extends control $mailTitle .= isset($mail->bugs) ? sprintf($this->lang->report->mailtitle->bug, count($mail->bugs)) : ''; $mailTitle .= isset($mail->tasks) ? sprintf($this->lang->report->mailtitle->task, count($mail->tasks)) : ''; $mailTitle .= isset($mail->todos) ? sprintf($this->lang->report->mailtitle->todo, count($mail->todos)) : ''; + $mailTitle .= isset($mail->testtasks) ? sprintf($this->lang->report->mailtitle->testtask, count($mail->testtasks)) : ''; $mailTitle = rtrim($mailTitle, ','); /* Send email.*/ diff --git a/module/report/lang/en.php b/module/report/lang/en.php index 7960738b65..c2e85b43c9 100644 --- a/module/report/lang/en.php +++ b/module/report/lang/en.php @@ -84,14 +84,16 @@ $lang->report->overduePlan = 'Overdue plan'; /* daily reminder. */ $lang->report->idAB = 'ID'; -$lang->report->bugTitle = 'Bug Title'; -$lang->report->taskName = 'Task Name'; -$lang->report->todoName = 'Todo Name'; +$lang->report->bugTitle = 'Bug Title'; +$lang->report->taskName = 'Task Name'; +$lang->report->todoName = 'Todo Name'; +$lang->report->testtaskName = 'Testtask Name'; -$lang->report->mailtitle = new stdclass(); -$lang->report->mailtitle->begin = 'Notice : Your'; -$lang->report->mailtitle->bug = " Bugs(%s),"; -$lang->report->mailtitle->task = " Tasks(%s),"; -$lang->report->mailtitle->todo = " Todos(%s),"; +$lang->report->mailtitle = new stdclass(); +$lang->report->mailtitle->begin = 'Notice : Your'; +$lang->report->mailtitle->bug = " Bugs(%s),"; +$lang->report->mailtitle->task = " Tasks(%s),"; +$lang->report->mailtitle->todo = " Todos(%s),"; +$lang->report->mailtitle->testtask = " Testtask(%s),"; $lang->report->proVersion = 'Try pro version for more!'; diff --git a/module/report/lang/zh-cn.php b/module/report/lang/zh-cn.php index 4d4e1d8b73..64876c6ba2 100644 --- a/module/report/lang/zh-cn.php +++ b/module/report/lang/zh-cn.php @@ -83,15 +83,17 @@ $lang->report->closedProduct = '关闭' . $lang->productCommon; $lang->report->overduePlan = '过期计划'; /* daily reminder. */ -$lang->report->idAB = 'ID'; -$lang->report->bugTitle = 'Bug标题'; -$lang->report->taskName = '任务名称'; -$lang->report->todoName = '待办名称'; +$lang->report->idAB = 'ID'; +$lang->report->bugTitle = 'Bug标题'; +$lang->report->taskName = '任务名称'; +$lang->report->todoName = '待办名称'; +$lang->report->testtaskName = '版本名称'; -$lang->report->mailtitle = new stdclass(); -$lang->report->mailtitle->begin = '提醒:您有'; -$lang->report->mailtitle->bug = " Bugs(%s),"; -$lang->report->mailtitle->task = " 任务(%s),"; -$lang->report->mailtitle->todo = " 待办(%s),"; +$lang->report->mailtitle = new stdclass(); +$lang->report->mailtitle->begin = '提醒:您有'; +$lang->report->mailtitle->bug = " Bugs(%s),"; +$lang->report->mailtitle->task = " 任务(%s),"; +$lang->report->mailtitle->todo = " 待办(%s),"; +$lang->report->mailtitle->testtask = " 测试版本(%s),"; $lang->report->proVersion = '更多精彩,尽在专业版!'; diff --git a/module/report/model.php b/module/report/model.php index 3cf4df6d35..70e196e1c1 100644 --- a/module/report/model.php +++ b/module/report/model.php @@ -375,6 +375,26 @@ class reportModel extends model } return $todos; } + + /** + * Get user testtasks. + * + * @access public + * @return array + */ + public function getUserTesttasks() + { + $stmt = $this->dao->select('t1.*, t2.account as user')->from(TABLE_TESTTASK)->alias('t1') + ->leftJoin(TABLE_USER)->alias('t2') + ->on('t1.owner = t2.account') + ->where('t1.status')->eq('wait') + ->orWhere('t1.status')->eq('doing') + ->query(); + + $testtasks = array(); + while($testtask = $stmt->fetch()) $testtasks[$testtask->user][] = $testtask; + return $testtasks; + } } function sortSummary($pre, $next) diff --git a/module/report/view/dailyreminder.html.php b/module/report/view/dailyreminder.html.php index 8f88e09497..69b7f2b5e5 100755 --- a/module/report/view/dailyreminder.html.php +++ b/module/report/view/dailyreminder.html.php @@ -69,3 +69,24 @@ tr, th, td {padding:5px} + +testtasks)):?> + + + + + + testtasks as $testtask):?> + + + + + +
report->idAB;?>report->testtaskName;?>
id;?> + createLink('testtask', 'view', "testtask=$testtask->id"); + if($config->requestType == 'GET' and strpos($link, 'ztcli') !== false) $link = str_replace($this->server->php_self, $config->webRoot, $link); + echo html::a($url . $link, $testtask->name); + ?> +
+