Merge branch 'master' of github.com:easysoft/zentaopms

This commit is contained in:
tengfei
2017-01-11 16:45:10 +08:00
5 changed files with 44 additions and 1 deletions
+4
View File
@@ -31,6 +31,10 @@ js::set('page', 'confirmbug');
<td class='w-p25-f'><?php echo html::select('assignedTo', $users, $bug->assignedTo, "class='select-2 chosen'");?></td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->bug->type;?></th>
<td><?php echo html::select('type', $lang->bug->typeList, $bug->type, 'class=form-control');?></td>
</tr>
<tr>
<th><?php echo $lang->bug->pri;?></th>
<td><?php echo html::select('pri', $lang->bug->priList, $bug->pri, 'class=form-control');?></td>
+33 -1
View File
@@ -337,12 +337,44 @@ class mail extends control
$unSendNum = $this->dao->select('count(id) as count')->from(TABLE_MAILQUEUE)->where('status')->eq('wait')->fetch('count');
if($unSendNum == 0) $this->dao->exec('TRUNCATE table ' . TABLE_MAILQUEUE);
}
$this->dao->delete()->from(TABLE_MAILQUEUE)->where('status')->ne('wait')->andWhere('sendTime')->le(date('Y-m-d H:i:s', time() - 2 * 24 * 3600))->exec();
$this->dao->delete()->from(TABLE_MAILQUEUE)->where('status')->eq('send')->andWhere('sendTime')->le(date('Y-m-d H:i:s', time() - 2 * 24 * 3600))->exec();
echo $log;
echo "OK\n";
}
/**
* Resend fail mails.
*
* @access public
* @return void
*/
public function resend()
{
$queueList = $this->mail->getQueue('fail', 'id_asc');
$now = helper::now();
if(isset($this->config->mail->async)) $this->config->mail->async = 0;
$log = '';
foreach($queueList as $queue)
{
$this->mail->send($queue->toList, $queue->subject, $queue->body, $queue->ccList);
$data = new stdclass();
$data->sendTime = $now;
$data->status = 'send';
$data->failReason = '';
if($this->mail->isError())
{
$data->status = 'fail';
$data->failReason = join("\n", $this->mail->getError());
}
$this->dao->update(TABLE_MAILQUEUE)->data($data)->where('id')->in($queue->id)->exec();
}
echo js::alert($this->lang->mail->noticeResend);
die(js::reload('parent'));
}
/**
* Browse mail queue.
*
+2
View File
@@ -6,6 +6,7 @@ $lang->mail->edit = '编辑配置';
$lang->mail->save = '成功保存';
$lang->mail->test = '测试发信';
$lang->mail->reset = '重置';
$lang->mail->resend = '重发失败邮件';
$lang->mail->browse = '邮件列表';
$lang->mail->delete = '删除邮件';
$lang->mail->ztCloud = '禅道云发信';
@@ -69,6 +70,7 @@ $lang->mail->secureList['ssl'] = 'ssl';
$lang->mail->secureList['tls'] = 'tls';
$lang->mail->more = '更多...';
$lang->mail->noticeResend = '已经重新发信!';
$lang->mail->inputFromEmail = '请输入发信邮箱:';
$lang->mail->nextStep = '下一步';
$lang->mail->successSaved = '配置信息已经成功保存。';
+1
View File
@@ -58,6 +58,7 @@
echo "<div class='table-actions'>";
echo html::selectButton();
if(common::hasPriv('mail', 'batchDelete')) echo html::submitButton($lang->delete);
if(common::hasPriv('mail', 'resend')) echo html::a(inlink('resend'), $lang->mail->resend, 'hiddenwin', "class='btn'");
echo '</div>';
}
$pager->show();
+4
View File
@@ -46,8 +46,10 @@ $config->testcase->search['fields']['stage'] = $lang->testcase->stage;
$config->testcase->search['fields']['module'] = $lang->testcase->module;
$config->testcase->search['fields']['pri'] = $lang->testcase->pri;
$config->testcase->search['fields']['lastRunner'] = $lang->testcase->lastRunner;
$config->testcase->search['fields']['openedDate'] = $lang->testcase->openedDate;
$config->testcase->search['fields']['lastEditedDate'] = $lang->testcase->lastEditedDateAB;
$config->testcase->search['fields']['lastRunDate'] = $lang->testcase->lastRunDate;
$config->testcase->search['params']['title'] = array('operator' => 'include', 'control' => 'input', 'values' => '');
$config->testcase->search['params']['module'] = array('operator' => 'belong', 'control' => 'select', 'values' => 'modules');
@@ -62,8 +64,10 @@ $config->testcase->search['params']['product'] = array('operator' => '=',
$config->testcase->search['params']['branch'] = array('operator' => '=', 'control' => 'select', 'values' => '');
$config->testcase->search['params']['stage'] = array('operator' => 'include', 'control' => 'select', 'values' => $lang->testcase->stageList);
$config->testcase->search['params']['lastRunner'] = array('operator' => '=', 'control' => 'select', 'values' => 'users');
$config->testcase->search['params']['openedDate'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date');
$config->testcase->search['params']['lastEditedDate'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date');
$config->testcase->search['params']['lastRunDate'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date');
$config->testcase->datatable = new stdclass();
$config->testcase->datatable->defaultField = array('id', 'pri', 'title', 'type', 'openedBy', 'lastRunner', 'lastRunDate', 'lastRunResult', 'status', 'bugs', 'results', 'actions');