From f77f2c5457fd852f8b3b818ea3281e0301beeef0 Mon Sep 17 00:00:00 2001 From: wlx Date: Wed, 23 Nov 2011 10:34:17 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=82=80=E8=AF=B7=E4=B8=93?= =?UTF-8?q?=E5=AE=B6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controllers/ReviewController.php | 44 ++++++++++--------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/application/admin/controllers/ReviewController.php b/application/admin/controllers/ReviewController.php index 2b74ac11..d719dd1e 100644 --- a/application/admin/controllers/ReviewController.php +++ b/application/admin/controllers/ReviewController.php @@ -316,7 +316,7 @@ class Admin_ReviewController extends Zend_Controller_Action @$this->db->exec($update); } //实例化EmailText - $mailtp=new EmailText($this->db,'invite-expert-review',array('user'=>$expinfo['realname'],'uuid'=>$uuid,'title'=>$md['title'])); + $mailtp=new EmailText($this->db,'invite-expert-review',array('user'=>$expinfo['realname'],'uuid'=>$uuid,'title'=>$md['title'],'userid'=>$v)); $mail=new WestdcMailer($this->view->config->smtp); $mail->setBodyText($mailtp->getBody()); $mail->setFrom($this->view->config->service->email,'西部数据中心服务组'); @@ -324,6 +324,8 @@ class Admin_ReviewController extends Zend_Controller_Action $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, $md['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, $md['title'].'.pdf'); if($mail->send()) { $this->messenger->addMessage('成功邀请专家:'.$expinfo['realname']); @@ -350,26 +352,26 @@ class Admin_ReviewController extends Zend_Controller_Action $this->db->exec($sql); $sql="select realname,email,(select title from metadata where uuid='$uuid') as title from users where id='$user'"; $row=$this->db->fetchRow($sql); - //实例化EmailText - $mailtp=new EmailText($this->db,'invite-expert-review',array('user'=>$row['realname'],'uuid'=>$uuid,'title'=>$row['title'],'userid'=>$user)); - $mail=new WestdcMailer($this->view->config->smtp); - $mail->setBodyText($mailtp->getBody()); - $mail->setFrom($this->view->config->service->email,'西部数据中心服务组'); - $mail->addTo($row['email']); - $mail->setSubject($mailtp->getSubject()); - $filecontent=file_get_contents("http://" . $_SERVER['HTTP_HOST'].'/service/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($mail->send()) - { - $this->messenger->addMessage('成功再次邀请专家:'.$row['realname']); - $this->_redirect("/admin/review/inreview/show/$id"); - }else - { - $this->messenger->addMessage('邀请专家'.$row['realname'].'的邮件发送失败,请尝试手动发送邀请邮件'); - $this->_redirect("/admin/review/inreview/show/$id"); - } + //实例化EmailText + $mailtp=new EmailText($this->db,'invite-expert-review',array('user'=>$row['realname'],'uuid'=>$uuid,'title'=>$row['title'],'userid'=>$user)); + $mail=new WestdcMailer($this->view->config->smtp); + $mail->setBodyText($mailtp->getBody()); + $mail->setFrom($this->view->config->service->email,'西部数据中心服务组'); + $mail->addTo($row['email']); + $mail->setSubject($mailtp->getSubject()); + $filecontent=file_get_contents("http://" . $_SERVER['HTTP_HOST'].'/service/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($mail->send()) + { + $this->messenger->addMessage('成功再次邀请专家:'.$row['realname']); + $this->_redirect("/admin/review/inreview/show/$id"); + }else + { + $this->messenger->addMessage('邀请专家'.$row['realname'].'的邮件发送失败,请尝试手动发送邀请邮件'); + $this->_redirect("/admin/review/inreview/show/$id"); + } } $searchjoin = ""; if(!empty($search) && !empty($keyword))