* finish task #2420.

This commit is contained in:
wangyidong
2015-11-24 09:12:27 +08:00
parent 5923c8e637
commit c3a9804a56
6 changed files with 75 additions and 26 deletions
+6 -5
View File
@@ -1,7 +1,8 @@
<?php
/* Open daily reminder.*/
$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 = 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;
+7 -4
View File
@@ -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.*/
+10 -8
View File
@@ -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 = '<a href="http://api.zentao.net/goto.php?item=proversion&from=reportpage" target="_blank">Try pro version for more!</a>';
+11 -9
View File
@@ -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 = '<a href="http://api.zentao.net/goto.php?item=proversion&from=reportpage" target="_blank">更多精彩,尽在专业版!</a>';
+20
View File
@@ -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)
+21
View File
@@ -69,3 +69,24 @@ tr, th, td {padding:5px}
<?php endforeach;?>
</table>
<?php endif;?>
<?php if(isset($mail->testtasks)):?>
<table width='66%' align='center'>
<tr class='header'>
<th class='w-id'><?php echo $lang->report->idAB;?></th>
<th><?php echo $lang->report->testtaskName;?></th>
</tr>
<?php foreach($mail->testtasks as $testtask):?>
<tr>
<td><?php echo $testtask->id;?></td>
<td>
<?php
$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);
?>
</td>
</tr>
<?php endforeach;?>
</table>
<?php endif;?>