修复邀请专家问题

This commit is contained in:
wlx 2011-11-23 10:34:17 +00:00
parent 53bb04bdcb
commit f77f2c5457
1 changed files with 23 additions and 21 deletions

View File

@ -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))