From 0b26aa6aff65c81ab294c472b9e9b7dfbad4bb0d Mon Sep 17 00:00:00 2001 From: wlx Date: Thu, 15 Nov 2012 03:16:51 +0000 Subject: [PATCH] fix #417, send email to westdc when author permitted the application. --- .../default/controllers/AuthorController.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/application/default/controllers/AuthorController.php b/application/default/controllers/AuthorController.php index a960c3a5..7f311cba 100644 --- a/application/default/controllers/AuthorController.php +++ b/application/default/controllers/AuthorController.php @@ -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.''; exit();