From 39928a235fda64bc9383146fbef5ffaf877690cd Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 18 Feb 2016 09:14:37 +0800 Subject: [PATCH] * adjust code for testtask. --- module/report/config.php | 2 +- module/report/control.php | 8 ++++---- module/report/lang/en.php | 4 ++-- module/report/lang/zh-cn.php | 4 ++-- module/report/lang/zh-tw.php | 4 ++-- module/report/model.php | 12 ++++-------- module/report/view/dailyreminder.html.php | 12 ++++++------ 7 files changed, 21 insertions(+), 25 deletions(-) diff --git a/module/report/config.php b/module/report/config.php index 4d0c9aab81..d7a940968b 100644 --- a/module/report/config.php +++ b/module/report/config.php @@ -5,4 +5,4 @@ $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; +$config->report->dailyreminder->testTask = true; diff --git a/module/report/control.php b/module/report/control.php index a1109b8d42..fe3d63d381 100644 --- a/module/report/control.php +++ b/module/report/control.php @@ -161,17 +161,17 @@ class report extends control 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(); + 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), array_keys($testtasks))); + $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; + if(!empty($testTasks)) foreach($testTasks as $user => $testTask) $reminder[$user]->testTasks = $testTask; $this->loadModel('mail'); @@ -194,7 +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 .= 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 c2e85b43c9..deac6e1fe9 100644 --- a/module/report/lang/en.php +++ b/module/report/lang/en.php @@ -87,13 +87,13 @@ $lang->report->idAB = 'ID'; $lang->report->bugTitle = 'Bug Title'; $lang->report->taskName = 'Task Name'; $lang->report->todoName = 'Todo Name'; -$lang->report->testtaskName = 'Testtask 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->testtask = " Testtask(%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 64876c6ba2..5295a71129 100644 --- a/module/report/lang/zh-cn.php +++ b/module/report/lang/zh-cn.php @@ -87,13 +87,13 @@ $lang->report->idAB = 'ID'; $lang->report->bugTitle = 'Bug标题'; $lang->report->taskName = '任务名称'; $lang->report->todoName = '待办名称'; -$lang->report->testtaskName = '版本名称'; +$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->testtask = " 测试版本(%s),"; +$lang->report->mailtitle->testTask = " 测试版本(%s),"; $lang->report->proVersion = '更多精彩,尽在专业版!'; diff --git a/module/report/lang/zh-tw.php b/module/report/lang/zh-tw.php index 2142831cc6..01038324c2 100644 --- a/module/report/lang/zh-tw.php +++ b/module/report/lang/zh-tw.php @@ -87,13 +87,13 @@ $lang->report->idAB = 'ID'; $lang->report->bugTitle = 'Bug標題'; $lang->report->taskName = '任務名稱'; $lang->report->todoName = '待辦名稱'; -$lang->report->testtaskName = '版本名稱'; +$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->testtask = " 測試版本(%s),"; +$lang->report->mailtitle->testTask = " 測試版本(%s),"; $lang->report->proVersion = '更多精彩,盡在專業版!'; diff --git a/module/report/model.php b/module/report/model.php index 8a7975ca6c..b796015fc1 100644 --- a/module/report/model.php +++ b/module/report/model.php @@ -377,23 +377,19 @@ class reportModel extends model } /** - * Get user testtasks. + * Get user testTasks. * * @access public * @return array */ - public function getUserTesttasks() + public function getUserTestTasks() { - $stmt = $this->dao->select('t1.*, t2.account as user')->from(TABLE_TESTTASK)->alias('t1') + return $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.deleted')->eq('0') ->andWhere('t2.deleted')->eq('0') ->andWhere("(t1.status='wait' OR t1.status='doing')") - ->query(); - - $testtasks = array(); - while($testtask = $stmt->fetch()) $testtasks[$testtask->user][] = $testtask; - return $testtasks; + ->fetchGroup('user'); } } diff --git a/module/report/view/dailyreminder.html.php b/module/report/view/dailyreminder.html.php index fabd82ed3e..64e75d3ecc 100755 --- a/module/report/view/dailyreminder.html.php +++ b/module/report/view/dailyreminder.html.php @@ -63,20 +63,20 @@ -testtasks)):?> +testTasks)):?> - + - testtasks as $testtask):?> + testTasks as $testTask):?> - +
report->idAB;?>report->testtaskName;?>report->testTaskName;?>
id;?>id;?> createLink('testtask', 'view', "testtask=$testtask->id"); + $link = $this->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); + echo html::a($url . $link, $testTask->name); ?>