* adjust for mail.

This commit is contained in:
wangyidong
2015-09-17 15:34:25 +08:00
parent adf49b7dd5
commit 9665abb8ed
6 changed files with 52 additions and 8 deletions

View File

@@ -22,7 +22,7 @@ class mail extends control
parent::__construct($moduleName, $methodName);
/* Task #1967. check the function of fsocket. */
if(!function_exists('fsockopen'))
if(isset($this->config->mail->mta) and $this->config->mail->mta != 'sendcloud' and !function_exists('fsockopen'))
{
echo js::alert($this->lang->mail->nofsocket);
die(js::locate('back'));
@@ -40,9 +40,12 @@ class mail extends control
if($this->config->mail->turnon)
{
if($this->config->mail->mta == 'sendcloud') $this->locate(inlink('sendcloud'));
$this->locate(inlink('edit'));
if($this->config->mail->mta == 'smtp') $this->locate(inlink('edit'));
}
$this->locate(inlink('detect'));
$this->view->title = $this->lang->mail->common . $this->lang->colon . $this->lang->mail->index;
$this->view->position[] = html::a(inlink('index'), $this->lang->mail->common);
$this->view->position[] = $this->lang->mail->index;
$this->display();
}
/**
@@ -275,7 +278,7 @@ class mail extends control
public function reset()
{
$this->dao->delete('*')->from(TABLE_CONFIG)->where('module')->eq('mail')->exec();
$this->locate(inlink('detect'));
$this->locate(inlink('index'));
}
/**

View File

@@ -28,6 +28,9 @@ $lang->mail->charset = 'Charset';
$lang->mail->accessKey = 'accessKey';
$lang->mail->secretKey = 'secretKey';
$lang->mail->selectMTA = 'Select MTA';
$lang->mail->smtp = 'SMTP';
$lang->mail->syncedUser = 'Synced user';
$lang->mail->unsyncUser = 'Unsync user';
$lang->mail->sync = 'Sync';
@@ -80,3 +83,4 @@ $lang->mail->sendCloudHelp = <<<EOD
<p>Letter, The nickname of Notice SendCloud contact must to be consistent with the email. You may not succeed in sending.</p>
EOD;
$lang->mail->sendCloudSuccess = 'Success';
$lang->mail->closeSendCloud = 'Close SendCloud';

View File

@@ -10,7 +10,7 @@ $lang->mail->browse = '邮件列表';
$lang->mail->delete = '删除邮件';
$lang->mail->sendCloud = 'SendCloud发信';
$lang->mail->batchDelete = '批量删除';
$lang->mail->sendcloudUser = 'SendCloud 联系人';
$lang->mail->sendcloudUser = '同步联系人';
$lang->mail->turnon = '是否打开';
$lang->mail->async = '异步发送';
@@ -28,6 +28,9 @@ $lang->mail->charset = '编码';
$lang->mail->accessKey = 'accessKey';
$lang->mail->secretKey = 'secretKey';
$lang->mail->selectMTA = '请选择发信方式:';
$lang->mail->smtp = 'SMTP发信';
$lang->mail->syncedUser = '已经同步';
$lang->mail->unsyncUser = '未同步';
$lang->mail->sync = '同步';
@@ -77,6 +80,7 @@ $lang->mail->sendCloudFail = '操作失败,原因:';
$lang->mail->sendCloudHelp = <<<EOD
<p>1、Notice SendCloud是SendCloud的团队通知服务。具体可以到<a href="http://notice.sendcloud.net/" target="_blank">notice.sendcloud.net</a>查看</p>
<p>2、accessKey和secretKey可以到登陆后的"设置"页面查看。发信人地址和名称也在"设置"页面设置。</p>
<p>3、发信时Notice SendCloud联系人里面的昵称要跟邮箱一致否则无法成功发信。可以到[<a href='%s'>SendCloud 联系人</a>]页面将禅道用户同步到SendCloud联系人中</p>
<p>3、发信时Notice SendCloud联系人里面的昵称要跟邮箱一致否则无法成功发信。可以到[<a href='%s'>同步联系人</a>]页面将禅道用户同步到SendCloud联系人中</p>
EOD;
$lang->mail->sendCloudSuccess = '操作成功';
$lang->mail->closeSendCloud = '关闭SendCloud';

View File

@@ -18,7 +18,6 @@ include '../../common/view/header.html.php';
<strong><?php echo $lang->mail->common;?></strong>
<small class='text-muted'> <?php echo $lang->mail->detect;?> <?php echo html::icon('cog');?></small>
</div>
<div class='actions'><?php if($this->app->getClientLang() != 'en') common::printLink('mail', 'sendCloud', '', $lang->mail->sendCloud, '', "class='btn btn-primary'")?></div>
</div>
<form class='form-condensed pdt-20' method='post' target='hiddenwin'>
<table class='table table-form'>

34
module/mail/view/index.html.php Executable file
View File

@@ -0,0 +1,34 @@
<?php
/**
* The index view file of mail module of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv11.html)
* @author Yidong Wang <yidong@cnezsoft.com>
* @package mail
* @version $Id$
* @link http://www.zentao.net
*/
include '../../common/view/header.html.php';
?>
<div class='container mw-700px'>
<div id='titlebar'>
<div class='heading'>
<span class='prefix'><?php echo html::icon($lang->icons['mail']);?></span>
<strong><?php echo $lang->mail->selectMTA;?></strong>
</div>
</div>
<table class='table table-form' id='selectmta'>
<tr>
<td class='text-center'>
<?php if(common::hasPriv('mail', 'detect')):?>
<?php echo html::a(inlink('detect'), $lang->mail->smtp, '', "class='btn btn-lg w-200px'")?>
<?php endif;?>
<?php if($this->app->getClientLang() != 'en' and common::hasPriv('mail', 'sendCloud')):?>
<?php echo html::a(inlink('sendCloud'), $lang->mail->sendCloud, '', "class='btn btn-lg w-200px'")?>
<?php endif;?>
</td>
</tr>
</table>
</div>
<?php include '../../common/view/footer.html.php';?>

View File

@@ -44,8 +44,8 @@ include '../../common/view/header.html.php';
<?php
echo html::submitButton();
if($this->config->mail->turnon and $mailExist) echo html::linkButton($lang->mail->test, inlink('test'));
echo html::linkButton($lang->mail->closeSendCloud, inlink('reset'));
if($this->config->mail->turnon and common::hasPriv('mail', 'sendcloudUser')) echo html::linkButton($lang->mail->sendcloudUser, inlink('sendcloudUser'));
echo html::linkButton($lang->mail->reset, inlink('reset'));
?>
</td>
</tr>