修改了review的视图

增加了收稿元数据的查看功能
This commit is contained in:
Li Jianxuan 2011-10-17 09:23:30 +00:00
parent 7ad0531728
commit 3eba55b7a8
5 changed files with 131 additions and 30 deletions

View File

@ -105,6 +105,50 @@ class ReviewController extends Zend_Controller_Action
$keyword = $this->_request->getParam('q');
$search = $this->_request->getParam('search');
try{
$wheresql = array();
$wheresql[]=" ms.status=0 ";
if(!empty($keyword) && !empty($search))
{
if (preg_match("/[<|>|#|$|%|^|*|(|)|{|}|'|\"|;|:]/i",$keyword) || !is_numeric($search))
{
$this->messenger->addMessage('您的输入的搜索条件包含非法请求,请不要输入特殊符号');
$this->_redirect('/review/draft');
}//非法请求过滤
$this->view->keyword = $keyword;
$wheresql[] = " md.title like '%$keyword%' ";
}
$wheresql = join(' and ',$wheresql);
$sql = "select ms.uuid,ms.status,ms.ts_created,md.title,md.author from mdstatus ms
left join metadata md on md.uuid=ms.uuid
where $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_param.phtml');
$this->view->paginator=$paginator;
}catch(Exception $e){
$this->messenger->addMessage('查询失败,请稍后重试 :(');
$this->_redirect('/review/draft');
}
}//最新收稿
function acceptAction(){
$keyword = $this->_request->getParam('q');
$search = $this->_request->getParam('search');
try{
$wheresql = array();

View File

@ -0,0 +1,57 @@
<?php
$config = Zend_Registry::get('config');
$this->headTitle($config->title->site);
$this->headTitle($config->title->mdreview);
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/mdreview.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/review">元数据评审</a>');
$this->breadcrumb()->setSeparator(' > ');
?>
<div id='rightPanel'>
<?php if ($this->msg or $this->messages) :?>
<div class="box box-info">
<?php if ($this->msg) : ?>
<?php echo $this->msg; ?>
<?php endif; if ($this->messages): foreach($this->messages as $msg): ?>
<?php echo $msg; ?>
<?php endforeach;endif; ?>
<script language="javascript">
setTimeout("document.getElementsByClassName('box-info').remove(0)",5000);
</script>
</div>
<?php endif; ?>
<h3>最新收稿的元数据:</h3>
<form action="/review/draft" method="POST">
<input class="q" type="text" id="q" name="q" value="<?php echo $this->keyword;?>" />
<input type="hidden" name="search" value="1" />
<input type="submit" class="btn" value="搜索" /></form>
<table class="stylized">
<thead>
<tr>
<th>元数据标题</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<?php
if (count($this->paginator)):
$autoindex=0;
foreach ($this->paginator as $item):
$autoindex++;?>
<tr class="<?php if($autoindex%2 == 0) echo 'even'; else echo 'odd'; ?>">
<td> <img src="/images/westdc_20w.gif" /> <a href="<?php echo $item['uuid'];?>"><?php echo $item['title'];?></a></td>
<td>
<a href="/review/review/uuid/<?php echo $item['uuid'];?>">评审</a> <a href="/data/<?php echo $item['uuid'];?>">查看</a>
</td>
</tr>
<?php endforeach; endif; ?>
</tbody>
</table>
<div class="pagenavi"><?= $this->paginator; ?></div>
</div>

View File

@ -26,11 +26,11 @@ setTimeout("document.getElementsByClassName('box-info').remove(0)",5000);
<h3>最新收稿的元数据:</h3>
<form action="/review/draft" method="POST">
<input class="" type="text" id="q" name="q" value="<?php echo $this->keyword;?>" />
<input class="q" type="text" id="q" name="q" value="<?php echo $this->keyword;?>" />
<input type="hidden" name="search" value="1" />
<input type="submit" value="搜索" /></form>
<input type="submit" class="btn" value="搜索" /></form>
<table>
<table class="stylized">
<thead>
<tr>
<th>元数据标题</th>

View File

@ -26,11 +26,11 @@ setTimeout("document.getElementsByClassName('box-info').remove(0)",5000);
<h3>我参审的元数据:</h3>
<form action="/review/myreview" method="POST">
<input class="" type="text" id="q" name="q" value="<?php echo $this->keyword;?>" />
<input class="q" type="text" id="q" name="q" value="<?php echo $this->keyword;?>" />
<input type="hidden" name="search" value="1" />
<input type="submit" value="搜索" /></form>
<table>
<table class="stylized">
<thead>
<tr>
<th>元数据标题</th>