add dataset action

This commit is contained in:
Li Jianxuan 2013-04-26 08:24:42 +00:00
parent 3130e6f665
commit 9a5f173c57
3 changed files with 1815 additions and 1606 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,99 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>数据存档</title>
<link rel="stylesheet" type="text/css" media="screen" href="/css/default.css" />
<script src='/static/js/jquery-1.7.2.min.js' type="text/javascript"></script>
<script type="text/javascript" src="/js/jquery.colorbox-min.js"></script>
<link href="/css/author.css" media="screen" rel="stylesheet" type="text/css"/>
<link href="/static/js/uploadify/uploadify.css" media="screen" rel="stylesheet" type="text/css" />
<link href="/css/colorbox.css" media="screen" rel="stylesheet" type="text/css" />
<style>
#loading{margin:0px;border:none;height:50px;width:98%;background:url(/static/img/colorbox-images/loading.gif) center center no-repeat;display:none;position:absolute;left:0px;top:0px;overflow:hidden;background:#ccc;}
</style>
</head>
<body>
<!-- 页面内容 -->
<div id="warpper">
<div id="loading" class="info info-box"></div>
<div id="datalist">
<?php
if(!empty($this->dataset))
{?>
<p>主机:<br /><input type="text" id="host" name="host" value="<?= $this->dataset['host']?>" class="full" /></p>
<p>路径:<br /><input type="text" id="path" name="path" value="<?= $this->dataset['path']?>" class="full" /></p>
<p><button type="button" class="btn btn-green" onclick="updateDataSet()">修改</button></p>
<?php }else{ ?>
<p>主机:<br /><input type="text" id="host" name="host" value="" class="full" /></p>
<p>路径:<br /><input type="text" id="path" name="path" value="" class="full" /></p>
<p><button type="button" class="btn btn-green" onclick="addDataSet()">添加</button></p>
<?php } ?>
</div>
</div>
<!-- //页面内容 -->
<script>
function updateDataSet(){
if(confirm("是否确定修改") == false)
{return false;}
$.ajax({
'type':"POST",
'url':'/admin/data/dataset',
'data':'ac=update&uuid=<?= $this->uuid ?>&host='+$('#host').val()+'&path='+$('#path').val(),
'success':function(data){
if (typeof(data)=='object')
{
if(typeof(data.error)!='undefined')
{Alert(data.error);return false;}
if(data.ok != null)
{
Alert('修改成功!');
setTimeout("parent.$.fn.colorbox.close();",2000);
}
}
else{
Alert('出现错误,请稍后再试');
}
},
'timeout': 30000,
'error': function(){
Alert('出现错误,请稍后再试');
}
});
}
function addDataSet(){
$.ajax({
'type':"POST",
'url':'/admin/data/dataset',
'data':'ac=add&uuid=<?= $this->uuid ?>&host='+$('#host').val()+'&path='+$('#path').val(),
'success':function(data){
if (typeof(data)=='object')
{
if(typeof(data.error)!='undefined')
{Alert(data.error);return false;}
if(data.ok != null)
{
Alert('添加成功!');
setTimeout("parent.$.fn.colorbox.close();parent.window.location.href=parent.window.location.href;",2000);
}
}
else{
Alert('出现错误,请稍后再试');
}
},
'timeout': 30000,
'error': function(){
Alert('出现错误,请稍后再试');
}
});
}
$(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
$(".inline").colorbox({inline:true, width:"50%"});
function Alert(html){
$.colorbox({'innerWidth':'50%','html':'<h4 style="font-size:16px;font-weight:bold;">'+html+'</h4>'});
}
</script>
</body>
</html>

View File

@ -1,64 +1,76 @@
<?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('<a href="/admin/data">数据管理</a>');
$this->breadcrumb('元数据管理</a>');
$this->breadcrumb()->setSeparator(' > ');
?>
<div id="leftPanel">
<?= $this->partial('data/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="right_title">元数据管理</div>
<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 -->
<a href="/admin/data/md/down/1">下载全部xml元数据</a>
<?php if (count($this->paginator)): ?>
<div id="datalist">
<ul>
<?php foreach ($this->paginator as $item): ?>
<li>
<p><a href="/data/<?= $item['uuid']; ?>" style="font-size:14px;"><?= $item['title']; ?></a></p>
<p>
[大小:<?= $item['filesize']; ?>M创建时间<?= date('Y-m-d',strtotime($item['ts_created'])); ?>
,查看:<?= $item['viewed']; ?>次。 操作:
<a href="/service/geonetwork?url=metadata.edit?id=<?= $item['gid']; ?>" target="_blank">编辑</a>
<a href="/admin/data/md/delete/<?= $item['id']; ?>">删除</a>
<a href="/admin/data/sync/uuid/<?= $item['uuid']; ?>">同步</a> <a href="/admin/data/md/att/1/uuid/<?php echo $item['uuid'];?>">附件管理</a>
<?php if (@!is_numeric($item['mdstatus'])) : ?>
<a href="/admin/review/addon/uuid/<?php echo $item['uuid'];?>">放入元数据评审</a>
<?php endif; ?>
<!--<a href="/admin/data/source/do/datasource/uuid/<?php echo $item['uuid'];?>">编辑数据来源</a>-->
</p>
<!--<p>数据贡献者:<?= $item['author']; ?></p>-->
<p><?= $item['description']; ?></p>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
<?php echo $this->paginator; ?>
</div>
<?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('<a href="/admin/data">数据管理</a>');
$this->breadcrumb('元数据管理</a>');
$this->breadcrumb()->setSeparator(' > ');
$this->headScript()->appendFile('/js/jquery-1.7.min.js');
$this->headScript()->appendFile('/js/jquery.colorbox-min.js');
$this->headLink()->appendStylesheet('/css/colorbox.css');
?>
<div id="leftPanel">
<?= $this->partial('data/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="right_title">元数据管理</div>
<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 -->
<a href="/admin/data/md/down/1">下载全部xml元数据</a>
<?php if (count($this->paginator)): ?>
<div id="datalist">
<ul>
<?php foreach ($this->paginator as $item): ?>
<li>
<p><a href="/data/<?= $item['uuid']; ?>" style="font-size:14px;"><?= $item['title']; ?></a></p>
<p>
[大小:<?= $item['filesize']; ?>M创建时间<?= date('Y-m-d',strtotime($item['ts_created'])); ?>
,查看:<?= $item['viewed']; ?>次。 操作:
<a href="/service/geonetwork?url=metadata.edit?id=<?= $item['gid']; ?>" target="_blank">编辑</a>
<a href="/admin/data/md/delete/<?= $item['id']; ?>">删除</a>
<a href="/admin/data/sync/uuid/<?= $item['uuid']; ?>">同步</a> <a href="/admin/data/md/att/1/uuid/<?php echo $item['uuid'];?>">附件管理</a>
<?php if (@!is_numeric($item['mdstatus'])) : ?>
<a href="/admin/review/addon/uuid/<?php echo $item['uuid'];?>">放入元数据评审</a>
<?php endif; ?>
<a href="/admin/data/source/do/datasource/uuid/<?php echo $item['uuid'];?>">编辑数据来源</a> |
<?php if(!empty($item['datasetid'])):?>
<a href="/admin/data/dataset/ac/getdataset/uuid/<?php echo $item['uuid'];?>" class="iframe">存档</a>
<?php else: ?>
<a href="/admin/data/dataset/ac/getdataset/uuid/<?php echo $item['uuid'];?>" class="iframe">添加存档</a>
<?php endif;?>
<!--<a href="/admin/data/source/do/datasource/uuid/<?php echo $item['uuid'];?>">编辑数据来源</a>-->
</p>
<!--<p>数据贡献者:<?= $item['author']; ?></p>-->
<p><?= $item['description']; ?></p>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
<?php echo $this->paginator; ?>
</div>
<script>
$(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
</script>