修改后台review中若干操作

This commit is contained in:
Li Jianxuan 2013-05-14 08:57:30 +00:00
parent 8a3358b054
commit 6bf1971309
8 changed files with 242 additions and 123 deletions

View File

@ -579,37 +579,23 @@ class Admin_ReviewController extends Zend_Controller_Action
*/
function myreviewAction(){
$auth = Zend_Auth::getInstance();
if($auth->hasIdentity())
{
$user = $auth->getIdentity();
$userid = $user->id;
}
include_once("data/Review.php");
include_once("helper/view.php");
$search=$this->_request->getParam('search');
$keyword = $this->_request->getParam('keyword');
$searchjoin = "";
$review = new Review($this->db);
if(!empty($search) && !empty($keyword))
{
$searchjoin = " and md.title like '%$keyword%'";
$rows = $review->adminReviews($keyword);
$this->view->keyword = $keyword;
}else{
$rows = $review->adminReviews();
}
$sql = "select m.id,md.uuid,md.title,u.username,u.realname,m.status,md.id as mdid from mdstatus m
right join metadata md on md.uuid=m.uuid
left join users u on u.id=m.userid
where m.status in (0,1,2,3,4) and u.id='$userid' $searchjoin order by m.status desc,m.ts_accepted desc";
$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;
view::addPaginator($rows,$this->view,$this->_request);
return true;
}//我管理的元数据

View File

@ -2,7 +2,6 @@
$this->headTitle($this->config->title->site);
$this->headTitle('后台管理');
$this->headTitle()->setSeparator(' - ');
$this->headScript()->appendFile('/js/jquery-1.7.min.js');
$this->headLink()->appendStylesheet('/css/admin.css');
$this->headScript()->appendFile('/static/js/jquery.tagInput.min.js');
$this->headScript()->appendFile('/static/js/kindeditor-min.js');

View File

@ -37,7 +37,7 @@ table thead tr th {background:#EBF2F6;color:#444;}
<tr>
<th width='600'>元数据标题</th>
<th width='120'>负责编辑</th>
<th width='120'>时间</th>
<th width='120'>接收时间</th>
<th width='180'>操作</th>
</tr></thead>
<?php if (count($this->paginator)): ?>
@ -48,9 +48,7 @@ table thead tr th {background:#EBF2F6;color:#444;}
<td><?php echo $item['realname'].'['.$item['username'].']'; ?></td>
<td><?php echo date("Y-m-d H:i",strtotime($item['ts_accepted']));?></td>
<td>
<a href='/admin/review/accept/cancel/<?php echo $item['id'];?>' onclick="return confirm('是否确定取消评审')">取消评审</a>
<a href='/admin/review/invite/?id=<?php echo $item['id'];?>'>邀请专家</a>
<a href="/admin/review/changeadmin/?id=<?php echo $item['id'];?>">更改管理员</a>
<a href="/admin/review/changeadmin/?id=<?php echo $item['id'];?>">分配编辑</a>
</td>
</tr>
<?php endforeach; ?>

View File

@ -2,52 +2,52 @@
$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="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; ?>
<table><thead>
<tr>
<td width='80'>用户ID</td>
<td width='100'>用户名</td>
<td width='100'>姓名</td>
<td width="250">单位</td>
<td width="100">联系电话</td>
<td width="100">电子邮箱</td>
<td width="100">操作</td>
</tr></thead>
<?php if (count($this->paginator)): ?>
<?php $autoindex=0;?>
<?php foreach ($this->paginator as $item): ?>
<?php $autoindex++;?>
<tr class="<?php if($autoindex%2 == 0) echo 'even'; else echo 'odd'; ?>">
<td><?php echo $item['id']; ?></td>
<td><?php echo $item['username']; ?></td>
<td><?php echo $item['realname']; ?></td>
<td><?php echo $item['unit']; ?></td>
<td><?php echo $item['phone']; ?></td>
<td><?php echo $item['email']; ?></td>
<td><a href="/admin/review/changeadmin/?id=<?php echo $this->id;?>&uid=<?php echo $item['id'];?>">设置为此评审的管理员</a></td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</table>
<div class="pagenavi"><?= $this->paginator; ?></div>
</div>
<style>
table thead tr th {background:#EBF2F6;color:#444;}
.high{background:#444;color:#FFF;}
</style>
<div class="row-fluid">
<div class="span3">
<?= $this->partial('review/left.phtml'); ?>
</div>
<div class="span9">
<?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; ?>
<table class="table table-bordered table-hover"><thead>
<tr>
<th width='80'>用户ID</th>
<th width='100'>用户名</th>
<th width='100'>姓名</th>
<th width="100">电子邮箱</th>
<th width="100">操作</th>
</tr></thead>
<?php if (count($this->paginator)): ?>
<?php $autoindex=0;?>
<?php foreach ($this->paginator as $item): ?>
<?php $autoindex++;?>
<tr class="<?php if($autoindex%2 == 0) echo 'even'; else echo 'odd'; ?>">
<td><?php echo $item['id']; ?></td>
<td><?php echo $item['username']; ?></td>
<td><?php echo $item['realname']; ?></td>
<td><?php echo $item['email']; ?></td>
<td><a href="/admin/review/changeadmin/?id=<?php echo $this->id;?>&uid=<?php echo $item['id'];?>">设置为此评审的管理员</a></td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</table>
<div class="pagenavi"><?= $this->paginator; ?></div>
</div>
</div>

View File

@ -2,58 +2,61 @@
$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; ?>
<style>
table thead tr th {background:#EBF2F6;color:#444;}
.high{background:#444;color:#FFF;}
</style>
<div class="row-fluid">
<div class="span3">
<?= $this->partial('review/left.phtml'); ?>
</div>
<div class="span9">
<?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' />
<label>搜索关键字</label><input type="text" name="keyword" class="q" value="<?php echo $this->keyword; ?>" />
<input type="submit" class="btn" value="搜索" />
</form>
</div><!-- search DIV -->
<table class="stylized"><thead>
<tr>
<td>标题</td>
<td width='100'>状态</td>
<td width='100'>管理员</td>
<td width="180">操作</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['status']; ?></td>
<td><?php echo $item['realname'].'['.$item['username'].']'; ?></td>
<td><a href="/admin/review/inreview/show/<?php echo $item['id']; ?>">查看详细</a>
<a href="/admin/review/invite/?id=<?php echo $item['id'];?>">邀请专家</a>
<a href="/admin/review/changeadmin/?id=<?php echo $item['id'];?>">更改管理员</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>
<div class="search">
<form action="" method="get">
<input type="hidden" name="search" value='1' />
<label>搜索关键字</label><input type="text" name="keyword" class="q" value="<?php echo $this->keyword; ?>" />
<input type="submit" class="btn" value="搜索" />
</form>
</div><!-- search DIV -->
<table class="table table-bordered table-hover"><thead>
<tr>
<th>标题</td>
<th>状态</th>
<th>责任编辑</th>
<th>操作</th>
</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['status']; ?></td>
<td><?php echo $item['realname'].'['.$item['username'].']'; ?></td>
<td><a href="/admin/review/inreview/show/<?php echo $item['id']; ?>">查看详细</a>
<a href="/admin/review/invite/?id=<?php echo $item['id'];?>">邀请专家</a>
<a href="/admin/review/changeadmin/?id=<?php echo $item['id'];?>">分配编辑</a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
<?php endif; ?>
</table>
<div class="pagenavi"><?= $this->paginator; ?></div>
</div>
</div>

View File

@ -2,7 +2,7 @@
<span class="label"><h4>元数据评审</h4></span>
<li id="Nav-review-draft"><a href="/admin/review/draft">投稿元数据</a></li>
<li id="Nav-review-accept"><a href="/admin/review/accept">待审元数据</a></li>
<li id="Nav-review-inreview"><a href="/admin/review/inreview">在审元数据</a></li>
<!-- <li id="Nav-review-inreview"><a href="/admin/review/inreview">在审元数据</a></li> -->
<li id="Nav-review-myreview"><a href="/admin/review/myreview">我负责的元数据</a></li>
<li id="Nav-review-reviewed"><a href="/admin/review/reviewed">通过评审的元数据</a></li>
<li id="Nav-review-experts"><a href="/admin/review/experts">专家库</a></li>

View File

@ -6,6 +6,7 @@
$this->breadcrumb('<a href="/admin">后台首页</a>');
$this->breadcrumb('元数据评审');
$this->breadcrumb()->setSeparator(' > ');
$this->theme->AppendPlus($this,'colorbox');
?>
<style>
table thead tr th {background:#EBF2F6;color:#444;}
@ -36,14 +37,19 @@ table thead tr th {background:#EBF2F6;color:#444;}
<tr>
<th width='500'>元数据标题</th>
<th width='80'>状态</th>
<th>操作</th>
<th>接收时间</th>
<th>作者</th>
<th width="300">操作</th>
</tr>
</thead>
<?php if (count($this->paginator)): ?>
<tbody id="list">
<?php foreach ($this->paginator as $item): ?>
<tr>
<td><?= $item['title']?> [<a href="/service/geonetwork?url=metadata.edit?id=<?= $item['mdid'] ?>" target="_blank">编辑</a>]</td>
<td><?= $item['title']?> [
<a href="/service/geonetwork?url=metadata.edit?id=<?= $item['mdid'] ?>" target="_blank">编辑</a> |
<a href="javascript:void(0);" rel="<?= $item['uuid']?>" class="version">版本</a>
]</td>
<td><?php
if($item['status'] == 0) echo "初始";
if($item['status'] == -1) echo "取消审核";
@ -53,6 +59,8 @@ table thead tr th {background:#EBF2F6;color:#444;}
if($item['status'] == 4) echo "专家反馈";
if($item['status'] == 5) echo "已发布";
?></td>
<td><?php echo date("Y-m-d H:i",strtotime($item['ts_accepted']));?></td>
<td><?= $item['author']?></td>
<td>
<a href="/admin/review/invite/id/<?php echo $item['id'];?>">邀请专家</a>
<a href="/admin/review/changeadmin/id/<?php echo $item['id'];?>">更改管理员</a>
@ -72,5 +80,94 @@ table thead tr th {background:#EBF2F6;color:#444;}
</div>
</div>
<script>
//$("#list tr").mouseover(function(){$(this).addClass("high")}).mouseout(function(){$(this).removeClass("high")});
$(document).ready(function(e) {
$('.version').click(function(){
$(this).getversion({'id':$(this).attr('rel')});
});
});
(function( $ ){
$.fn.getversion = function( options ) {
var settings = $.extend( {
id:'',
content : '',
}, options);
var methods = {
edit : function(id)
{
methods.creatWindow(id);
},
creatWindow : function(id){
$.colorbox({
initialHeight: '0',
initialWidth: '0',
html: methods.dialog,
opacity: '0.3',
onComplete: function(){
$('.confirm_yes').click(function(e){
e.preventDefault();
methods.submited(id);
$.colorbox.close();
});
$('.confirm_no').click(function(e){
e.preventDefault();
$.colorbox.close();
});
}
});
},
getVersion : function(uuid){
$.ajax({
'type':"POST",
'url':'/data/getversion',
'data':'ac=list&uuid='+uuid,
'success':methods.onLoad,
'timeout': 30000,
'error': function(){
alert('处理中出现错误,请刷新页面后重试');
return false;
}
});
},
onLoad : function(data){
if (typeof(data)=='object')
{
if(typeof(data.error)!='undefined')
{
alert("没有版本信息");return false;
}
if(typeof(data.list)!='undefined')
{
var html = "";
for(v in data.list)
{
html+='<li><p>'+data.list[v].changelog+'</p><p>'+data.list[v].ts_created+' by '+data.list[v].username+'</p></li>';
}
$.colorbox({'innerWidth':'50%','innerHeight':'80%','html':'<div class="datalist"><ul>'+html+'</ul></div>'});
}
}
else{
alert('出现错误,请稍后再试');return false;
}
},
dialog : function(content){
HTML = '<div class=""><div class="modal-header"><h3>修改文献</h3></div>'
+ '<div class="modal-body"><textarea class="span8" id="content_input_area">'+settings.content+'</textarea></div>'
+ '<div class="modal-footer"><a href="javascript:void(0);" class="btn btn-primary confirm_yes"></a><a href="javascript:void(0);" class="btn confirm_no"></a></div></div>';
return HTML;
}
}
this.each(function() {
if( settings.id == '')
{
alert('参数错误');
}
methods.getVersion(settings.id);
});
};
})( jQuery );
</script>

View File

@ -52,4 +52,40 @@ class Review extends Zend_Controller_Plugin_Abstract
return $reviews;
}
//后台我负责的评审
function adminReviews($keyword = "",$order="")
{
include_once('helper/view.php');
$uid = view::User('id');
$wheresql = array();
$wheresql[] = " m.status in (0,1,2,3,4) ";
$wheresql[] = " u.id=$uid ";
if(!empty($keyword))
{
$wheresql[] = " md.title like '%$keyword%' ";
}
if(count($wheresql)>0)
{
$wheresql = " WHERE ".join(" AND ",$wheresql);
}else{
$wheresql = "";
}
$sql = "select m.id,md.uuid,md.title,u.username,u.realname,m.status,md.id as mdid,md.author,m.ts_accepted
FROM mdstatus m
right join metadata md on md.uuid=m.uuid
left join users u on u.id=m.userid
$wheresql
order by m.status desc,m.ts_accepted desc";
$re = $this->db->query($sql);
$rows = $re->fetchAll();
return $rows;
}
}