在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

@ -802,5 +802,124 @@ class Admin_ReviewController extends Zend_Controller_Action
}//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>