增加了用户评论后推送系统消息的功能

This commit is contained in:
Li Jianxuan 2011-11-16 10:14:50 +00:00
parent 0de477b381
commit e3a25bdf1d
1 changed files with 15 additions and 9 deletions

View File

@ -632,6 +632,12 @@ class DataController extends Zend_Controller_Action
$patt['uuid'] = $formdata['uuid']; $patt['uuid'] = $formdata['uuid'];
$patt['title']= $this->view->metadata->title; $patt['title']= $this->view->metadata->title;
$patt['content']= $content; $patt['content']= $content;
$title = "收到新数据评论";
$msg = "用户".$user->username."对元数据《".$patt['title']."》进行了评论,<a href=\"/admin/data/comment\">点击查看</a>";
include_once("message.php");
message::post($this->db,0,-1,$title,$msg);
$mailtp=new EmailText($this->db,"data-comment-note",$patt); $mailtp=new EmailText($this->db,"data-comment-note",$patt);
$mail=new WestdcMailer($this->view->config->smtp); $mail=new WestdcMailer($this->view->config->smtp);
$mail->setBodyText($mailtp->getBody()); $mail->setBodyText($mailtp->getBody());
@ -647,15 +653,15 @@ class DataController extends Zend_Controller_Action
$formdata['email']=$user->email; $formdata['email']=$user->email;
} }
$commentForm->populate($formdata); $commentForm->populate($formdata);
$this->view->commentForm=$commentForm; $this->view->commentForm=$commentForm;
//自动跳转 //自动跳转
$sql="select s.* from datasource d left join source s on d.sourceid=s.id where d.uuid=?"; $sql="select s.* from datasource d left join source s on d.sourceid=s.id where d.uuid=?";
$row=$this->db->fetchRow($this->db->quoteInto($sql,$uuid)); $row=$this->db->fetchRow($this->db->quoteInto($sql,$uuid));
$jump=(int)$this->_request->getParam('jump'); $jump=(int)$this->_request->getParam('jump');
if (empty($jump)) $jump=1;//默认跳转 if (empty($jump)) $jump=1;//默认跳转
if (@$row->has_pages && ($jump!=0)) if (@$row->has_pages && ($jump!=0))
{ {
$this->_helper->viewRenderer($row->code.'/view',null,true); $this->_helper->viewRenderer($row->code.'/view',null,true);
} }
} }
/* /*