From 34a9f7bec681165458aae32cb1c73d57b1360053 Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Thu, 13 Oct 2011 07:54:02 +0000 Subject: [PATCH] =?UTF-8?q?Ticket=20#195=20=E5=A2=9E=E5=8A=A0=E4=BA=86?= =?UTF-8?q?=E9=80=9A=E8=BF=87=E9=82=AE=E4=BB=B6=E6=A8=A1=E6=9D=BF=E4=B8=BA?= =?UTF-8?q?=E4=B8=93=E5=AE=B6=E5=8F=91=E9=80=81=E9=82=80=E8=AF=B7=E5=87=BD?= =?UTF-8?q?=E7=9A=84=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 | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/application/admin/controllers/ReviewController.php b/application/admin/controllers/ReviewController.php index 549b2958..c021c482 100644 --- a/application/admin/controllers/ReviewController.php +++ b/application/admin/controllers/ReviewController.php @@ -290,47 +290,47 @@ class Admin_ReviewController extends Zend_Controller_Action $sql = "insert into mdexpertreview (id,uuid) values ('$v','$uuid')"; + $expinfo="select realname from users where id='$v'"; + $rs = $this->db->query($expinfo); + $expinfo = $rs->fetch(); + try{ if($this->db->exec($sql)>0) { if($md['status']<2) { $update = "update mdstatus set status=2 where uuid='$uuid'"; - $this->db->exec($update); + @$this->db->exec($update); } - /* - $mailbody=new emailtext(); - $mailbody->db = $this->db;//为邮件模板类传入PDO对象 - $mailbody->tmpid = $id;//传入模板的ID - - //设置要替换的变量 - $mailbody->data = array( - 'user' => $this->_request->getParam('user') + $mailtp=new EmailText(); + $mailtp->db = $this->db; + $mailtp->tmpid = "expinvite"; + $mailtp->data = array( + 'user' => $expinfo['realname'], + 'uuid' => $uuid, + 'title' => $md['title'] ); - //输出邮件正文 - $body=$mailbody->loadtmp(); - if($body){ - $body; - }else{ - $this->messenger->addMessage('模板加载出错'); - $this->_redirect(''); + $body = $mailtp->loadtmp(); + if($body === false) + { + $this->messenger->addMessage('模板加载失败'); + $this->_redirect("/admin/review/invite/?id=$id"); } - */ - $subject = "西部数据中心"; + + $subject = "西部数据中心-元数据评审邀请函"; $email = "la5c@qq.com"; $mail=new WestdcMailer($this->view->config->smtp); - $body="尊敬的西部数据中心用户:"; $mail->setBodyText($body); $mail->setFrom($this->view->config->service->email,'西部数据中心服务组'); $mail->addTo($email); $mail->setSubject($subject); if($mail->send()) { - $this->messenger->addMessage('成功邀请专家:'.$rows['realname']); + $this->messenger->addMessage('成功邀请专家:'.$expinfo['realname']); }else { - $this->messenger->addMessage('邀请专家:'.$rows['realname'].'的邮件发送失败,请尝试手动发送邀请邮件'); + $this->messenger->addMessage('邀请专家'.$expinfo['realname'].'的邮件发送失败,请尝试手动发送邀请邮件'); } } }catch(Exception $e){