westdc-zf1/application/admin/views/scripts/data/newdata.phtml

120 lines
5.1 KiB
PHTML

<?php
$this->headTitle($this->config->title->site);
$this->headTitle('后台管理');
$this->headTitle()->setSeparator(' - ');
$this->headScript()->appendFile('/js/jquery-1.7.min.js');
$this->headLink()->appendStylesheet('/css/author.css');
$this->headLink()->appendStylesheet('/css/admin.css');
$this->headLink()->appendStylesheet('/js/lib/colorbox/colorbox.css');
$this->headScript()->appendFile('/js/lib/colorbox/jquery.colorbox-min.js');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/admin">后台首页</a>');
$this->breadcrumb('<a href="/admin/data">数据管理</a>');
$this->breadcrumb('新建元数据');
$this->breadcrumb()->setSeparator(' > ');
?>
<div class="row">
<!-- 左侧导航 -->
<div class="hidden-sm hidden-xs col-md-2">
<?= $this->partial('data/left.phtml'); ?>
</div>
<!-- //左侧导航 -->
<!-- 页面内容 -->
<div class="col-md-10 col-sm-12">
<div class="form-group">
<a class="btn btn-primary btn-sm" href="/admin/data/newdata">未提交数据列表</a>
<a class="btn btn-primary btn-sm" href="/service/geonetwork?url=metadata.xmlinsert.form">导入元数据</a>
<a class="btn btn-primary btn-sm" href="/admin/data/newdata/ac/add-by-template">根据模板新建元数据</a>
<a class="btn btn-primary btn-sm" href="/admin/data/newdata/ac/add-by-data">根据已有数据新建元数据</a>
</div>
<div id="datalistZ">
<?php
if (count($this->paginator)):
echo "<ul class=list-unstyled>";
$autoindex=0;
foreach ($this->paginator as $item):
$autoindex++;
?>
<li class="well well-sm">
<h4><?php echo $item['title'];?><small>&nbsp;<?php echo $item['username'];?>( <?php echo $item['realname'];?> ) </small></h4>
<a class="label label-info" href="/service/geonetwork?url=metadata.show?id=<?php echo $item['id']; ?>" target="_blank"><span class="glyphicon glyphicon-zoom-in"></span>&nbsp;在geonetwork里查看</a>
<a class="label label-primary" href="/service/geonetwork?url=metadata.edit?id=<?php echo $item['id']; ?>" target="_blank"><span class="glyphicon glyphicon-pencil"></span>&nbsp;在geonetwork里修改</a>
<a class="label label-danger" href="/service/geonetwork?url=metadata.delete?id=<?php echo $item['id']; ?>" target="_blank"><span class="glyphicon glyphicon-remove"></span>&nbsp;删除此条数据</a>
<a class="label label-primary" onclick="validate(<?php echo $item['id'];?>);" class="more inline"><span class="glyphicon glyphicon-search"></span>&nbsp;检查元数据错误</a>
<a class="label label-success more inline" onclick="$('#commit_submit').attr('onclick','commit(\'<?php echo $item['id'];?>\');');" href="#commitform" ><span class="glyphicon glyphicon-ok"></span>&nbsp;提交评审发布</a>
<span class="text-primary"> &nbsp;版本数:<?= $item['version_count'] ?></span>
</li>
<?php
endforeach;
echo "</ul>";
else :
echo "<p>您当前没有未提交的数据。</p>";
endif; ?>
</div>
<div class="pagenavi"><?= $this->paginator; ?></div>
</div>
</div>
<!-- //页面内容 -->
<script>
$('#wapper').width($('body').width()-300);
function errorContentHtml(err){
var html = "";
if(err && err.error)
html += "<h4>" + err.error + "</h4>";
if(err && err.detail)
html += "<p>" + err.detail + "</p>";
return html;
}
function action(ac,id){
$.ajax({
'type':"POST",
'url':'/admin/data/newdata/',
'data':'ac='+ ac +'&id='+id,
'success':function(data){
if (typeof(data)=='object')
{
if(typeof(data.error)!='undefined')
{$.colorbox({'innerWidth':'50%','html': errorContentHtml(data)});}
if(typeof(data.deleted)!='undefined')
{$('#list_'+data.deleted).fadeOut("slow",function(){$(this).remove();});}
if(typeof(data.commited)!='undefined')
{$('#changelog').val('');$('#commit_submit').attr('onclick','');}
}
else{
$.colorbox({'innerWidth':'50%','html':'<img src="/images/alert_big_warning.png" /><h4>出现错误,请稍候再试</h4>'});
}
},
'timeout': 30000,
'error': function(){
$.colorbox({'innerWidth':'50%','html':'<img src="/images/alert_big_error.png" /><h4>处理中出现错误,请刷新页面后重试</h4>'});
}
});
}
$(".inline").colorbox({inline:true, width:"50%", height:"50%"});
$(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
function commit(id){
action('commit&changelog='+$('#changelog').val(),id);
}
function validate(id){
action('validate',id);
}
</script>
<div class="colorbox" style="display:none;">
<div id="commitform">
<form>
<p>
<label>简要功能:</label><br />
<textarea rows="12" class="full" style="width:100%;" id="changelog"></textarea>
<br /><small>请输入此数据的简要功能和特色</small>
</p>
<input type="button" onclick="" id="commit_submit" class="btn btn-success pull-right" value="提交"/>
</form>
</div>
<div class="error"><img src="/images/alert_big_error.png" /><span></span></div>
<div class="ok"><img src="/images/alert_big_ok.png" /><span></span></div>
<div class="warning"><img src="/images/alert_big_warning.png" /><span></span></div>
</div>