添加前台版本提交中评审中状态给专家发送email的方法

This commit is contained in:
wlx 2013-04-22 16:23:36 +00:00
parent 0077cf2ac7
commit e92a35a83c
1 changed files with 16 additions and 7 deletions

View File

@ -2041,7 +2041,10 @@ class AuthorController extends Zend_Controller_Action
return true; return true;
} }
else if ($row['status']==2 || $row['status']==3 || $row['status']==4)//已发送过外审邮件,需由编辑告知变化信息 else if ($row['status']==2 || $row['status']==3 || $row['status']==4)//已发送过外审邮件,需由编辑告知变化信息
{ {
//同步元数据
$iso=new ISO19115();
@$iso->loadXML($row['xml']);
//email to admin //email to admin
$mail=new WestdcMailer($this->view->config->smtp); $mail=new WestdcMailer($this->view->config->smtp);
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组'); $mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
@ -2086,10 +2089,12 @@ class AuthorController extends Zend_Controller_Action
} }
@$mail->send(); @$mail->send();
//email to experts, sync to database? //email to experts
//todo!!! $sql="select u.username,u.email from mdexpertreview e left join users u on e.id=u.id where e.status in (0,1) and e.uuid=?";
//should generate new pdf? or user could not commit a new version when it is in the reviewing process? $sth = $this->db->prepare($sql);
/* $sth->execute(array($row['uuid']));
$experts = $sth->fetchAll();
unset($mail); unset($mail);
unset($mailtp); unset($mailtp);
$mail=new WestdcMailer($this->view->config->smtp); $mail=new WestdcMailer($this->view->config->smtp);
@ -2103,15 +2108,19 @@ class AuthorController extends Zend_Controller_Action
)); ));
$mail->setBodyText($mailtp->getBody()); $mail->setBodyText($mailtp->getBody());
$mail->setSubject($mailtp->getSubject()); $mail->setSubject($mailtp->getSubject());
$filecontent=file_get_contents("http://" . $_SERVER['HTTP_HOST'].'/data/doc/review/1/uuid/'.$uuid);
$mail->createAttachment($filecontent,'application/octet-stream',Zend_Mime::DISPOSITION_ATTACHMENT, Zend_Mime::ENCODING_BASE64, $row['title'].'.doc');
$filecontent=file_get_contents("http://" . $_SERVER['HTTP_HOST'].'/service/pdf/uuid/'.$uuid);
$mail->createAttachment($filecontent,'application/octet-stream',Zend_Mime::DISPOSITION_ATTACHMENT, Zend_Mime::ENCODING_BASE64, $row['title'].'.pdf');
if($this->debug==0) if($this->debug==0)
{ {
$mail->addTo($user->email); foreach ($experts as $expert) $mail->addTo($expert['email']);
$mail->addCc($this->view->config->service->email); $mail->addCc($this->view->config->service->email);
}else{ }else{
$mail->addTo($this->debug_email); $mail->addTo($this->debug_email);
} }
@$mail->send(); @$mail->send();
*/
$data = array("commited"=>1,"error"=>$this->alertbox('ok','该版本已经成功提交,请等待数据中心进一步处理!')); $data = array("commited"=>1,"error"=>$this->alertbox('ok','该版本已经成功提交,请等待数据中心进一步处理!'));
$this->jsonexit($data); $this->jsonexit($data);
return true; return true;