在review中增加了查看评审意见的功能

This commit is contained in:
Li Jianxuan 2011-10-19 04:03:13 +00:00
parent e0b6e8ebe0
commit eac73402f9
4 changed files with 300 additions and 10 deletions

View File

@ -259,8 +259,8 @@ class Admin_ReviewController extends Zend_Controller_Action
function inviteAction(){//邀请
$id = $this->_request->getParam('id');
$user = $this->_request->getParam('user');
$id = $this->_request->getParam('id');
$user = $this->_request->getParam('user');
if(empty($id))
{
$this->_redirect("/admin/review");
@ -344,12 +344,12 @@ class Admin_ReviewController extends Zend_Controller_Action
$this->messenger->addMessage('请选择要邀请的专家');
$this->_redirect("/admin/review/invite/?id=$id");
}
} elseif ($user>0) {
$uuid=$this->_request->getParam('uuid');
$sql="update mdexpertreview set ts_modified=now() where id='$user' and uuid='$uuid'";
$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);
} elseif ($user>0) {
$uuid=$this->_request->getParam('uuid');
$sql="update mdexpertreview set ts_modified=now() where id='$user' and uuid='$uuid'";
$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']));
$mail=new WestdcMailer($this->view->config->smtp);
@ -365,7 +365,7 @@ class Admin_ReviewController extends Zend_Controller_Action
}else
{
$this->messenger->addMessage('邀请专家'.$row['realname'].'的邮件发送失败,请尝试手动发送邀请邮件');
}
}
}
$searchjoin = "";
if(!empty($search) && !empty($keyword))
@ -801,6 +801,125 @@ class Admin_ReviewController extends Zend_Controller_Action
}//列表
}//expertsAction 专家库
}//expertsAction 专家库
function commentsAction(){
$ac = $this->_request->getParam('ac');
$uuid = $this->_request->getParam('uuid');
$id = $this->_request->getParam('id');
$q = $this->_request->getParam('q');
$search = $this->_request->getParam('search');
if($ac=='view' && !empty($uuid))
{
$redirect = "/admin/review/comments";
$this->_helper->viewRenderer('');
}//查看单个元数据的评审
else if($ac=='list')
{
try{
$redirect = "/admin/review/comments/ac/list/";
$wheresql = array();
if(!empty($uuid))
{
$redirect.="/uuid/$uuid";
$wheresql[] = " md.uuid='$uuid' ";
}
if(!empty($q) && !empty($search))
{
if (preg_match("/[<|>|#|$|%|^|*|(|)|{|}|'|\"|;|:]/i",$q) || !is_numeric($search))
{
$this->messenger->addMessage('您的输入的搜索条件包含非法请求,请不要输入特殊符号');
$this->_redirect($redirect);
}
$this->view->q = $q;
$wheresql[] = " (md.title like '%$q%' or u.realname like '%$q%') ";
}
if(count($wheresql>0))$wheresql = join(' and ',$wheresql);
else $wheresql='';
if($wheresql!='')
{
$wheresql = 'where '.$wheresql;
}
$sql = "select md.title,md.uuid,u.realname,r.id,r.ts_created,r.is_expert from mdreview r
left join metadata md on md.uuid=r.uuid
left join users u on u.id=r.userid
$wheresql
";
$rs = $this->db->query($sql);
$rows = $rs->fetchAll();
$paginator = Zend_Paginator::factory($rows);
$paginator->setCurrentPageNumber($this->_getParam('page'));
$paginator->setItemCountPerPage($this->view->config->page->max);
$paginator->setView($this->view);
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
$this->view->paginator=$paginator;
}catch(Exception $e){
echo $e->getMessage().'<br />';
}
$this->_helper->viewRenderer('commentslist');
}//评审意见列表 or 某条元数据的评审意见列表
else
{
try{
$redirect = "/admin/review/comments";
$wheresql = array();
if(!empty($q) && !empty($search))
{
if (preg_match("/[<|>|#|$|%|^|*|(|)|{|}|'|\"|;|:]/i",$q) || !is_numeric($search))
{
$this->messenger->addMessage('您的输入的搜索条件包含非法请求,请不要输入特殊符号');
$this->_redirect($redirect);
}//非法请求过滤
$this->view->q = $q;
$wheresql[] = " md.title like '%$q%' ";
}
if(count($wheresql>0))$wheresql = join(' and ',$wheresql);
else $wheresql='';
if($wheresql!='')
{
$wheresql = 'where '.$wheresql;
}
$sql = "select md.title,md.uuid,count(r.id) as c from mdreview r
left join metadata md on md.uuid=r.uuid
$wheresql
GROUP BY md.title,md.uuid
";
$rs = $this->db->query($sql);
$rows = $rs->fetchAll();
$paginator = Zend_Paginator::factory($rows);
$paginator->setCurrentPageNumber($this->_getParam('page'));
$paginator->setItemCountPerPage($this->view->config->page->max);
$paginator->setView($this->view);
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
$this->view->paginator=$paginator;
}catch(Exception $e){
echo $e->getMessage().'<br />';
}
}//列表
}//commentsAction 查看所有评审意见
}

View File

@ -0,0 +1,58 @@
<?php
$this->headTitle($this->config->title->site);
$this->headTitle('后台管理');
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/admin.css');
$this->headScript()->appendFile('/js/jquery-1.6.4.min.js');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/admin">后台首页</a>');
$this->breadcrumb('元数据评审');
$this->breadcrumb()->setSeparator(' > ');
?>
<div id="leftPanel">
<?= $this->partial('review/left.phtml'); ?>
</div>
<div id="rightPanel">
<?php if ($this->msg or $this->messages) :?>
<div id="message">
<?php if ($this->msg) : ?>
<p><?php echo $this->msg; ?></p>
<?php endif; if ($this->messages): foreach($this->messages as $msg): ?>
<p><?php echo $msg; ?></p>
<?php endforeach;endif; ?>
</div>
<?php endif; ?>
<div class="ctrlplan">
<a href="/admin/review/comments/ac/list">直接查看评审意见列表</a>
</div>
<div class="search">
<form action="" method="get">
<input type="hidden" name="search" value='1' />
<input type="hidden" name="id" value='<?php echo $this->id;?>' />
<label>搜索关键字</label><input type="text" name="q" value="<?php echo $this->q; ?>" />
<input type="submit" class="btn" value="搜索" />
</form>
</div><!-- search DIV -->
<table class="stylized">
<thead>
<tr>
<td width='600'>标题</td>
<td width='80'>评审条数</td>
<td width='80'>操作</td>
</tr>
</thead>
<?php if (count($this->paginator)): ?>
<tbody id="list">
<?php foreach ($this->paginator as $item): ?>
<tr>
<td><a href="/data/<?php echo $item['uuid'];?>"><?php echo $item['title']; ?></a></td>
<td><?php echo $item['c'];?></td>
<td><a href="/admin/review/comments/ac/list/uuid/<?php echo $item['uuid']?>">查看评审</a></td>
</tr>
<?php endforeach; ?>
</tbody>
<?php endif; ?>
</table>
<div class="pagenavi"><?= $this->paginator; ?></div>
</div>
<script>$("#list tr").mouseover(function(){$(this).addClass("high")}).mouseout(function(){$(this).removeClass("high")})</script>

View File

@ -0,0 +1,58 @@
<?php
$this->headTitle($this->config->title->site);
$this->headTitle('后台管理');
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/admin.css');
$this->headScript()->appendFile('/js/jquery-1.6.4.min.js');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/admin">后台首页</a>');
$this->breadcrumb('元数据评审');
$this->breadcrumb()->setSeparator(' > ');
?>
<div id="leftPanel">
<?= $this->partial('review/left.phtml'); ?>
</div>
<div id="rightPanel">
<?php if ($this->msg or $this->messages) :?>
<div id="message">
<?php if ($this->msg) : ?>
<p><?php echo $this->msg; ?></p>
<?php endif; if ($this->messages): foreach($this->messages as $msg): ?>
<p><?php echo $msg; ?></p>
<?php endforeach;endif; ?>
</div>
<?php endif; ?>
<div class="search">
<form action="" method="get">
<input type="hidden" name="search" value='1' />
<input type="hidden" name="id" value='<?php echo $this->id;?>' />
<label>搜索关键字</label><input type="text" name="q" value="<?php echo $this->q; ?>" />
<input type="submit" class="btn" value="搜索" />
</form>
</div><!-- search DIV -->
<table class="stylized">
<thead>
<tr>
<td width='600'>标题</td>
<td width='80'>评审人</td>
<td width='80'>操作</td>
</tr>
</thead>
<?php if (count($this->paginator)): ?>
<tbody id="list">
<?php foreach ($this->paginator as $item): ?>
<tr>
<td><a href="/data/<?php echo $item['uuid'];?>"><?php echo $item['title']; ?></a>
<br />评审时间: <?php echo date("Y-m-d H:i",strtotime($item['ts_created'])); ?>  是否为受邀专家:<?php
if($item['is_expert']==false)echo "否";else echo "是";
?></td>
<td><?php echo $item['realname'];?></td>
<td><a href="/admin/review/comments/ac/view/uuid/<?php echo $item['uuid']?>">查看评审</a></td>
</tr>
<?php endforeach; ?>
</tbody>
<?php endif; ?>
</table>
<div class="pagenavi"><?= $this->paginator; ?></div>
</div>
<script>$("#list tr").mouseover(function(){$(this).addClass("high")}).mouseout(function(){$(this).removeClass("high")})</script>

View File

@ -0,0 +1,55 @@
<?php
$this->headTitle($this->config->title->site);
$this->headTitle('后台管理');
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/admin.css');
$this->headScript()->appendFile('/js/jquery-1.6.4.min.js');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/admin">后台首页</a>');
$this->breadcrumb('元数据评审');
$this->breadcrumb()->setSeparator(' > ');
?>
<div id="leftPanel">
<?= $this->partial('review/left.phtml'); ?>
</div>
<div id="rightPanel">
<?php if ($this->msg or $this->messages) :?>
<div id="message">
<?php if ($this->msg) : ?>
<p><?php echo $this->msg; ?></p>
<?php endif; if ($this->messages): foreach($this->messages as $msg): ?>
<p><?php echo $msg; ?></p>
<?php endforeach;endif; ?>
</div>
<?php endif; ?>
<div class="search">
<form action="" method="get">
<input type="hidden" name="search" value='1' />
<input type="hidden" name="id" value='<?php echo $this->id;?>' />
<label>搜索关键字</label><input type="text" name="q" value="<?php echo $this->q; ?>" />
<input type="submit" class="btn" value="搜索" />
</form>
</div><!-- search DIV -->
<table class="stylized">
<thead>
<tr>
<td width='600'>标题</td>
<td width='80'>评审条数</td>
<td width='80'>操作</td>
</tr>
</thead>
<?php if (count($this->paginator)): ?>
<tbody id="list">
<?php foreach ($this->paginator as $item): ?>
<tr>
<td><a href="/data/<?php echo $item['uuid'];?>"><?php echo $item['title']; ?></a></td>
<td><?php echo $item['c'];?></td>
<td><a href="/admin/review/comments/ac/view/uuid/<?php echo $item['uuid']?>">查看评审</a></td>
</tr>
<?php endforeach; ?>
</tbody>
<?php endif; ?>
</table>
<div class="pagenavi"><?= $this->paginator; ?></div>
</div>
<script>$("#list tr").mouseover(function(){$(this).addClass("high")}).mouseout(function(){$(this).removeClass("high")})</script>