Ticket #186 增加了“我负责的元数据”查看和搜索功能

This commit is contained in:
Li Jianxuan 2011-09-30 03:25:37 +00:00
parent 84f2de89d3
commit 35bfe01f73
3 changed files with 113 additions and 2 deletions

View File

@ -104,6 +104,44 @@ class Admin_ReviewController extends Zend_Controller_Action
}//将数据放入评审
function myreviewAction(){
$auth = Zend_Auth::getInstance();
if($auth->hasIdentity())
{
$user = $auth->getIdentity();
$userid = $user->id;
}
$search=$this->_request->getParam('search');
$keyword = $this->_request->getParam('keyword');
$searchjoin = "";
if(!empty($search) && !empty($keyword))
{
$searchjoin = " and md.title like '%$keyword%'";
$this->view->keyword = $keyword;
}
$sql = "select md.title,u.username,u.realname,m.status from mdstatus m
left join metadata md on md.uuid=m.uuid
left join users u on u.id=m.userid
where u.id='$userid' $searchjoin";
$re = $this->db->query($sql);
$rows = $re->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;
}
function expertsAction()
{

View File

@ -39,7 +39,7 @@
<table>
<tr style="color:#FFF;background:#0a3e68;line-height:30px;">
<td width='500'>元数据标题</td>
<td width='150'>操作管理员</td>
<td width='150'>状态</td>
<td width='150'>操作</td>
</tr>
<?php if (count($this->paginator)): ?>
@ -50,7 +50,7 @@
<td><?= $item['title']?></td>
<td><?php echo $item['realname'].'['.$item['username'].']'; ?></td>
<td>
<a href='/admin/review/experts/del/<?php echo $item['mid'];?>' onclick="return confirm('是否确定取消评审')">删除</a>
<a href='/admin/review/experts/del/<?php echo $item['mid'];?>' onclick="return confirm('是否确定取消评审')">取消评审</a>
</td>
</tr>
<?php endforeach; ?>

View File

@ -0,0 +1,73 @@
<?php
$this->headTitle($this->config->title->site);
$this->headTitle('后台管理');
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/admin.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/admin">后台首页</a>');
$this->breadcrumb('元数据评审');
$this->breadcrumb()->setSeparator(' > ');
?>
<div id="divContent">
<div id="leftPanel">
<?= $this->partial('review/left.phtml'); ?>
</div>
<?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 id="rightPanel">
<div class="search">
<form action="" method="get">
<input type="hidden" name="search" value='1' />
<ul>
<li><label>搜索关键字</label><input type="text" name="keyword" value="<?php echo $this->keyword; ?>" /></li>
<li><input type="submit" class="searchbtn" value="搜索" /></li>
</ul>
</form>
</div><!-- search DIV -->
<table>
<tr style="color:#FFF;background:#0a3e68;line-height:30px;">
<td width='500'>元数据标题</td>
<td width='150'>状态</td>
<td width='150'>操作</td>
</tr>
<?php if (count($this->paginator)): ?>
<?php $autoindex=0;?>
<?php foreach ($this->paginator as $item): ?>
<?php $autoindex++;?>
<tr <?php if($autoindex%2 == 0) echo 'bgcolor="#CCCCCC"'; else echo 'bgcolor="#FFFFFF"'; ?>>
<td><?= $item['title']?></td>
<td><?php
if($item['status'] == 0) echo "初始";
if($item['status'] == -1) echo "取消审核";
if($item['status'] == 1) echo "进入评审";
if($item['status'] == 2) echo "邀请专家";
if($item['status'] == 3) echo "专家接受邀请";
if($item['status'] == 4) echo "专家反馈";
if($item['status'] == 5) echo "已发布";
?></td>
<td>
<a href='/admin/review/experts/del/<?php echo $item['mid'];?>' onclick="return confirm('是否确定取消评审')">取消评审</a>
</td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</table>
<div style="width:50%;text-align:left;">
<?= $this->paginator; ?>
</div>
</div>