From c73c2d91684a0acc2112be4d9c22b4cb93bf96d9 Mon Sep 17 00:00:00 2001 From: wlx Date: Tue, 18 Oct 2011 12:37:07 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=87=8D=E6=96=B0=E9=82=80?= =?UTF-8?q?=E8=AF=B7=E4=B8=93=E5=AE=B6=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controllers/ReviewController.php | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/application/admin/controllers/ReviewController.php b/application/admin/controllers/ReviewController.php index 40532b08..d27fae95 100644 --- a/application/admin/controllers/ReviewController.php +++ b/application/admin/controllers/ReviewController.php @@ -10,7 +10,7 @@ class Admin_ReviewController extends Zend_Controller_Action } function postDispatch() { - $this->view->messages = $this->messenger->getMessages(); + //$this->view->messages = $this->messenger->getMessages(); } function indexAction() { @@ -211,7 +211,7 @@ class Admin_ReviewController extends Zend_Controller_Action $v['status']="未答复"; } $expname[] = '
  • '.$v['realname'].' [状态:'.$v['status'].'] - [再次发送邀请邮件]
  • '; + [再次发送邀请邮件]'; } } if(count($expname>0)) @@ -259,7 +259,8 @@ class Admin_ReviewController extends Zend_Controller_Action function inviteAction(){//邀请 - $id = $this->_request->getParam('id'); + $id = $this->_request->getParam('id'); + $user = $this->_request->getParam('user'); if(empty($id)) { $this->_redirect("/admin/review"); @@ -302,7 +303,6 @@ class Admin_ReviewController extends Zend_Controller_Action { $sql = "insert into mdexpertreview (id,uuid) values ('$v','$uuid')"; - $expinfo="select realname,email from users where id='$v'"; $rs = $this->db->query($expinfo); $expinfo = $rs->fetch(); @@ -344,6 +344,28 @@ class Admin_ReviewController extends Zend_Controller_Action $this->messenger->addMessage('请选择要邀请的专家'); $this->_redirect("/admin/review/invite/?id=$id"); } + } elseif ($user>0) { + $uuid=$this->_request->getParam('uuid'); + $sql="update mdexpertreview set ts_modified=now() where id='$user' and uuid='$uuid'"; + $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'])); + $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'].'/data/doc/review/1/uuid/'.$uuid); + $mail->createAttachment($filecontent,'application/octet-stream',Zend_Mime::DISPOSITION_ATTACHMENT, Zend_Mime::ENCODING_BASE64, $row['title'].'.doc'); + if($mail->send()) + { + $this->messenger->addMessage('成功再次邀请专家:'.$row['realname']); + }else + { + $this->messenger->addMessage('邀请专家'.$row['realname'].'的邮件发送失败,请尝试手动发送邀请邮件'); + } } $searchjoin = ""; if(!empty($search) && !empty($keyword))