From e92a35a83c715db0e772e2e69e79defcaee183de Mon Sep 17 00:00:00 2001 From: wlx Date: Mon, 22 Apr 2013 16:23:36 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=89=8D=E5=8F=B0=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E6=8F=90=E4=BA=A4=E4=B8=AD=E8=AF=84=E5=AE=A1=E4=B8=AD?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E7=BB=99=E4=B8=93=E5=AE=B6=E5=8F=91=E9=80=81?= =?UTF-8?q?email=E7=9A=84=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/controllers/AuthorController.php | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/application/default/controllers/AuthorController.php b/application/default/controllers/AuthorController.php index 60ec65ff..886a17ef 100644 --- a/application/default/controllers/AuthorController.php +++ b/application/default/controllers/AuthorController.php @@ -2041,7 +2041,10 @@ class AuthorController extends Zend_Controller_Action return true; } else if ($row['status']==2 || $row['status']==3 || $row['status']==4)//已发送过外审邮件,需由编辑告知变化信息 - { + { + //同步元数据 + $iso=new ISO19115(); + @$iso->loadXML($row['xml']); //email to admin $mail=new WestdcMailer($this->view->config->smtp); $mail->setFrom($this->view->config->service->email,'西部数据中心服务组'); @@ -2086,10 +2089,12 @@ class AuthorController extends Zend_Controller_Action } @$mail->send(); - //email to experts, sync to database? - //todo!!! - //should generate new pdf? or user could not commit a new version when it is in the reviewing process? - /* + //email to experts + $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=?"; + $sth = $this->db->prepare($sql); + $sth->execute(array($row['uuid'])); + $experts = $sth->fetchAll(); + unset($mail); unset($mailtp); $mail=new WestdcMailer($this->view->config->smtp); @@ -2103,15 +2108,19 @@ class AuthorController extends Zend_Controller_Action )); $mail->setBodyText($mailtp->getBody()); $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) { - $mail->addTo($user->email); + foreach ($experts as $expert) $mail->addTo($expert['email']); $mail->addCc($this->view->config->service->email); }else{ $mail->addTo($this->debug_email); } @$mail->send(); - */ + $data = array("commited"=>1,"error"=>$this->alertbox('ok','该版本已经成功提交,请等待数据中心进一步处理!')); $this->jsonexit($data); return true;