#416 完善黑河数据汇交计划功能
This commit is contained in:
parent
9b20bab70e
commit
568203006b
|
@ -119,9 +119,13 @@ class Admin_HeiheController extends Zend_Controller_Action
|
|||
|
||||
$expert_name = $this->getArray($row['expert_name']);
|
||||
$expert_email = $this->getArray($row['expert_email']);
|
||||
$expert_validation = $this->getArray($row['expert_validation']);
|
||||
$expert_created = $this->getArray($row['expert_created']);
|
||||
|
||||
$name_list = array();
|
||||
$email_list = array();
|
||||
$validation_list = array();
|
||||
$created_list = array();
|
||||
|
||||
if(is_array($expert_name) && count($expert_name)>0)
|
||||
{
|
||||
|
@ -144,16 +148,27 @@ class Admin_HeiheController extends Zend_Controller_Action
|
|||
|
||||
$expert_name[] = $name;
|
||||
$expert_email[] = $email;
|
||||
$code = substr(md5($email),5,12);
|
||||
$expert_validation[] = $code;
|
||||
$expert_created[] = date("Y-m-d H:i:s",time());
|
||||
|
||||
|
||||
$name_list = $this->mkArray($expert_name);
|
||||
$email_list = $this->mkArray($expert_email);
|
||||
$validation_list = $this->mkArray($expert_validation);
|
||||
$created_list = $this->mkArray($expert_created);
|
||||
|
||||
$update = array("expert_name"=>$name_list,"expert_email"=>$email_list);
|
||||
$update = array(
|
||||
"expert_name"=>$name_list,
|
||||
"expert_email"=>$email_list,
|
||||
"expert_validation"=>$validation_list,
|
||||
"expert_created"=>$created_list
|
||||
);
|
||||
$where = "id=$pid";
|
||||
|
||||
if($this->db->update($projectTable,$update,$where))
|
||||
{
|
||||
$this->sendMailToExpert($email);
|
||||
$this->sendMailToExpert($pid,$name,$email,$code);
|
||||
$this->jsonexit(array("msg"=>"专家邀请成功!","invited"=>1));
|
||||
return true;
|
||||
}else{
|
||||
|
@ -200,12 +215,20 @@ class Admin_HeiheController extends Zend_Controller_Action
|
|||
|
||||
$names = $this->getArray($row['expert_name']);
|
||||
$emails = $this->getArray($row['expert_email']);
|
||||
$validations = $this->getArray($row['expert_validation']);
|
||||
$created = $this->getArray($row['expert_created']);
|
||||
|
||||
$experts = array();
|
||||
|
||||
foreach($names as $k=>$v)
|
||||
{
|
||||
$experts[$k] = array("name"=>$names[$k],"email"=>$emails[$k]);
|
||||
$experts[$k] = array(
|
||||
"name"=>$names[$k],
|
||||
"email"=>$emails[$k],
|
||||
"validation"=>$validations[$k],
|
||||
"created"=>$created[$k],
|
||||
"url"=>$this->makeInviteLink($pid,$validations[$k])
|
||||
);
|
||||
}
|
||||
|
||||
$this->view->experts = $experts;
|
||||
|
@ -223,10 +246,14 @@ class Admin_HeiheController extends Zend_Controller_Action
|
|||
|
||||
unset($names[$del]);
|
||||
unset($emails[$del]);
|
||||
unset($validations[$del]);
|
||||
unset($created[$del]);
|
||||
|
||||
$update = array(
|
||||
"expert_name"=>$this->mkArray($names),
|
||||
"expert_email"=>$this->mkArray($emails)
|
||||
"expert_email"=>$this->mkArray($emails),
|
||||
"expert_validation"=>$this->mkArray($validations),
|
||||
"expert_created"=>$this->mkArray($created),
|
||||
);
|
||||
$where = "id=$pid";
|
||||
|
||||
|
@ -309,55 +336,51 @@ class Admin_HeiheController extends Zend_Controller_Action
|
|||
}
|
||||
|
||||
//发送邀请专家的邮件
|
||||
function sendMailToExpert($name,$email)
|
||||
function sendMailToExpert($pid,$name,$email,$code)
|
||||
{
|
||||
$http_base = "http://".$_SERVER ['HTTP_HOST'];
|
||||
$code = substr(md5($email),5,12);
|
||||
$url = $http_base."/heihe/projects/invite/".$code;
|
||||
$url = $this->makeInviteLink($pid,$code);
|
||||
|
||||
include_once("EmailText.php");
|
||||
$mailtp=new EmailText($this->db,"expert_invite",array(
|
||||
$mailtp=new EmailText($this->db,"expert-invite",array(
|
||||
'name' => $name,
|
||||
'url' => $url,
|
||||
));
|
||||
|
||||
//Email test code
|
||||
|
||||
/*
|
||||
$mail_config = array(
|
||||
'ssl' => 'ssl',
|
||||
'port' => 465,
|
||||
'auth' => 'login',
|
||||
'username' => 'liujin834@gmail.com',
|
||||
'password' => 'hhagecysbgispqoz'
|
||||
'username' => 'la5c@qq.com',
|
||||
'password' => ''
|
||||
);
|
||||
$transport = new Zend_Mail_Transport_Smtp('smtp.gmail.com', $mail_config);
|
||||
$transport = new Zend_Mail_Transport_Smtp('smtp.qq.com', $mail_config);
|
||||
Zend_Mail::setDefaultTransport($transport);
|
||||
|
||||
$mail=new Zend_Mail();
|
||||
$body="aaa";
|
||||
$mail->setBodyText($body);
|
||||
$mail->setFrom('liujin834@gmail.com','liujin834');
|
||||
$mail->setBodyText($mailtp->getBody());
|
||||
$mail->setFrom('la5c@qq.com','Jack');
|
||||
$mail->addTo($email);
|
||||
$mail->setSubject('数据跟踪专家邀请');
|
||||
$mail->setSubject($mailtp->getSubject());
|
||||
$mail->send();
|
||||
|
||||
/*
|
||||
include_once("EmailText.php");
|
||||
$mail=new WestdcMailer($this->view->config->smtp);
|
||||
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
|
||||
$mailtp=new EmailText($this->db,"author-new",array(
|
||||
'user' => $row['realname'],
|
||||
'uuid' => $row['uuid'],
|
||||
'title'=> $row['title'],
|
||||
'email'=> $row['email'],
|
||||
));
|
||||
$mail->setBodyText($mailtp->getBody());
|
||||
$mail->setSubject($mailtp->getSubject());
|
||||
$mail->addTo($this->debug_email);
|
||||
$mail->send();
|
||||
*/
|
||||
|
||||
}
|
||||
$mail=new WestdcMailer($this->view->config->smtp);
|
||||
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
|
||||
$mail->setBodyText($mailtp->getBody());
|
||||
$mail->setSubject($mailtp->getSubject());
|
||||
$mail->addTo($email);
|
||||
$mail->send();
|
||||
}//发送邀请邮件
|
||||
|
||||
//生成邀请连接
|
||||
function makeInviteLink($pid,$code)
|
||||
{
|
||||
$http_base = "http://".$_SERVER ['HTTP_HOST'];
|
||||
$url = $http_base."/heihe/projects/invite/".$code.'/pid/'.$pid;
|
||||
return $url;
|
||||
}//生成邀请连接
|
||||
|
||||
public function jsonexit($data){
|
||||
$this->getResponse()
|
||||
|
|
|
@ -24,7 +24,14 @@ if(!empty($this->error))
|
|||
<?php
|
||||
foreach($this->experts as $k=>$v)
|
||||
{
|
||||
echo '<li id="item_'.$k.'">'.$v['name'] ." - ".$v['email'].' <lable id="delBtn_'.$k.'">【<a href="javascript:void(0);" onclick="del(\''.$k.'\')">删除</a>】</lable></li>';
|
||||
echo '<li id="item_'.$k.'"><p>'.$v['name'] ." - ".
|
||||
$v['email'].' - '.
|
||||
$v['validation'].' - '.
|
||||
str_replace("\"","",$v['created']) .'
|
||||
<lable id="delBtn_'.$k.'">
|
||||
【<a href="javascript:void(0);" onclick="del(\''.$k.'\')">删除</a>】</lable</p>
|
||||
<p>邀请链接:'.$v['url'].'</p>
|
||||
</li>';
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
|
|
|
@ -741,6 +741,7 @@ class HeiheController extends DataController
|
|||
{
|
||||
|
||||
$ac = $this->_getParam('ac');
|
||||
$invite = $this->_getParam('invite');
|
||||
|
||||
if(empty($ac) || $ac == "index")
|
||||
{
|
||||
|
@ -779,6 +780,36 @@ class HeiheController extends DataController
|
|||
|
||||
}//ac == submit 已提交
|
||||
|
||||
if(!empty($invite))
|
||||
{
|
||||
|
||||
$this->_helper->viewRenderer('project-invite');
|
||||
|
||||
if(!preg_match("/[A-Za-z0-9]/",$invite))
|
||||
{
|
||||
$this->view->error = "参数错误!";
|
||||
return true;
|
||||
}
|
||||
|
||||
if(strlen($invite)!=12)
|
||||
{
|
||||
$this->view->error = "参数错误";
|
||||
return true;
|
||||
}
|
||||
|
||||
$pid = $this->_getParam('pid');
|
||||
|
||||
if(!is_numeric($pid))
|
||||
{
|
||||
$this->view->error = "参数错误";
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}//专家邀请链接
|
||||
|
||||
}//projectsAction()
|
||||
|
||||
function replacestatus($status)
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
$this->headTitle($this->config->title->site);
|
||||
$this->headTitle($this->config->title->data);
|
||||
$this->headTitle()->setSeparator(' - ');
|
||||
$this->headLink()->appendStylesheet('/css/water.css');
|
||||
$this->breadcrumb('<a href="/">首页</a>');
|
||||
$this->breadcrumb('<a href="/data">'.$this->config->title->data.'</a>');
|
||||
$this->breadcrumb('<a href="/heihe/">'.$this->config->title->heihe.'</a>');
|
||||
$this->breadcrumb('数据汇交计划');
|
||||
$this->breadcrumb()->setSeparator(' > ');
|
||||
$this->headScript()->appendFile('/js/jquery-1.7.min.js');
|
||||
$this->headScript()->appendFile('/js/jquery.colorbox-min.js');
|
||||
$this->headLink()->appendStylesheet('/css/colorbox.css');
|
||||
?>
|
||||
<div id='sidebar'>
|
||||
<div id='leftnavi'>
|
||||
<?= $this->partial('heihe/navi.phtml'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='right'>
|
||||
<div class="clear"> </div>
|
||||
<?php if(!empty($this->error)) {?>
|
||||
<div id="intro"><?php echo $this->error;?></div>
|
||||
<?php }else{?>
|
||||
|
||||
<?php } ?>
|
||||
</div>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
$(document).ready(function(){
|
||||
$(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
|
||||
});
|
||||
</script>
|
Loading…
Reference in New Issue