修复邀请专家问题
This commit is contained in:
parent
53bb04bdcb
commit
f77f2c5457
|
@ -316,7 +316,7 @@ class Admin_ReviewController extends Zend_Controller_Action
|
||||||
@$this->db->exec($update);
|
@$this->db->exec($update);
|
||||||
}
|
}
|
||||||
//实例化EmailText
|
//实例化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=new WestdcMailer($this->view->config->smtp);
|
||||||
$mail->setBodyText($mailtp->getBody());
|
$mail->setBodyText($mailtp->getBody());
|
||||||
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
|
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
|
||||||
|
@ -324,6 +324,8 @@ class Admin_ReviewController extends Zend_Controller_Action
|
||||||
$mail->setSubject($mailtp->getSubject());
|
$mail->setSubject($mailtp->getSubject());
|
||||||
$filecontent=file_get_contents("http://" . $_SERVER['HTTP_HOST'].'/data/doc/review/1/uuid/'.$uuid);
|
$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');
|
$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())
|
if($mail->send())
|
||||||
{
|
{
|
||||||
$this->messenger->addMessage('成功邀请专家:'.$expinfo['realname']);
|
$this->messenger->addMessage('成功邀请专家:'.$expinfo['realname']);
|
||||||
|
@ -350,26 +352,26 @@ class Admin_ReviewController extends Zend_Controller_Action
|
||||||
$this->db->exec($sql);
|
$this->db->exec($sql);
|
||||||
$sql="select realname,email,(select title from metadata where uuid='$uuid') as title from users where id='$user'";
|
$sql="select realname,email,(select title from metadata where uuid='$uuid') as title from users where id='$user'";
|
||||||
$row=$this->db->fetchRow($sql);
|
$row=$this->db->fetchRow($sql);
|
||||||
//实例化EmailText
|
//实例化EmailText
|
||||||
$mailtp=new EmailText($this->db,'invite-expert-review',array('user'=>$row['realname'],'uuid'=>$uuid,'title'=>$row['title'],'userid'=>$user));
|
$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=new WestdcMailer($this->view->config->smtp);
|
||||||
$mail->setBodyText($mailtp->getBody());
|
$mail->setBodyText($mailtp->getBody());
|
||||||
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
|
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
|
||||||
$mail->addTo($row['email']);
|
$mail->addTo($row['email']);
|
||||||
$mail->setSubject($mailtp->getSubject());
|
$mail->setSubject($mailtp->getSubject());
|
||||||
$filecontent=file_get_contents("http://" . $_SERVER['HTTP_HOST'].'/service/doc/review/1/uuid/'.$uuid);
|
$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');
|
$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);
|
$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');
|
$mail->createAttachment($filecontent,'application/octet-stream',Zend_Mime::DISPOSITION_ATTACHMENT, Zend_Mime::ENCODING_BASE64, $row['title'].'.pdf');
|
||||||
if($mail->send())
|
if($mail->send())
|
||||||
{
|
{
|
||||||
$this->messenger->addMessage('成功再次邀请专家:'.$row['realname']);
|
$this->messenger->addMessage('成功再次邀请专家:'.$row['realname']);
|
||||||
$this->_redirect("/admin/review/inreview/show/$id");
|
$this->_redirect("/admin/review/inreview/show/$id");
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
$this->messenger->addMessage('邀请专家'.$row['realname'].'的邮件发送失败,请尝试手动发送邀请邮件');
|
$this->messenger->addMessage('邀请专家'.$row['realname'].'的邮件发送失败,请尝试手动发送邀请邮件');
|
||||||
$this->_redirect("/admin/review/inreview/show/$id");
|
$this->_redirect("/admin/review/inreview/show/$id");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$searchjoin = "";
|
$searchjoin = "";
|
||||||
if(!empty($search) && !empty($keyword))
|
if(!empty($search) && !empty($keyword))
|
||||||
|
|
Loading…
Reference in New Issue