fix #417, send email to westdc when author permitted the application.

This commit is contained in:
wlx 2012-11-15 03:16:51 +00:00
parent d759c34417
commit 0b26aa6aff
1 changed files with 14 additions and 1 deletions

View File

@ -142,7 +142,20 @@ class AuthorController extends Zend_Controller_Action
$sql = "UPDATE dataorder SET authorpermitted=1 WHERE uuid=? and id=?";
$sth = $this->db->prepare($sql);
if($sth->execute(array($uuid,$oid)))
{
{
//发送相关邮件给数据中心服务人员
$sql="select m.title,a.username from dataorder o left join metadata m on o.uuid=m.uuid left join offlineapp a on o.offlineappid=a.id where o.id=?";
$sth = $this->db->prepare($sql);
$sth->execute(array($oid));
$row = $sth->fetch();
$mail = new WestdcMailer($this->view->config->smtp);
$mailtp=new EmailText($this->db,'offline-author-yes',array('user'=>$row['username'],'data'=>$row['title'],'email'=>$u_email));
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
$mail->setBodyText($mailtp->getBody());
$mail->setSubject($mailtp->getSubject());
$mail->addTo($this->view->config->service->email,'西部数据中心服务组');
$mail->send();
$btn = $this->createOfflineCtBtn($uuid,'c',$oid);
echo ''.$btn.'<script>alert("您已经同意用户的离线数据申请");</script>';
exit();