添加了数据版本查看功能,修改了文件列表的显示bug
This commit is contained in:
parent
eced991349
commit
b1cda37b4f
|
@ -621,6 +621,12 @@ class DataController extends Zend_Controller_Action
|
||||||
//数据附件
|
//数据附件
|
||||||
$sql = $this->db->quoteInto("select m.id,a.realname from mdattach m left join attachments a on m.id=a.id where m.uuid=?",$uuid);
|
$sql = $this->db->quoteInto("select m.id,a.realname from mdattach m left join attachments a on m.id=a.id where m.uuid=?",$uuid);
|
||||||
$this->view->attachments = $this->db->fetchAll($sql);
|
$this->view->attachments = $this->db->fetchAll($sql);
|
||||||
|
//数据版本
|
||||||
|
$sql = "SELECT count(id) as c FROM mdversion WHERE uuid=? AND changelog IS NOT NULL";
|
||||||
|
$sth = $this->db->prepare($sql);
|
||||||
|
$sth->execute(array($uuid));
|
||||||
|
$row = $sth->fetch();
|
||||||
|
$this->view->version = $row;
|
||||||
//自动跳转
|
//自动跳转
|
||||||
$sql="select s.* from datasource d left join source s on d.sourceid=s.id where d.uuid=?";
|
$sql="select s.* from datasource d left join source s on d.sourceid=s.id where d.uuid=?";
|
||||||
$row=$this->db->fetchRow($this->db->quoteInto($sql,$uuid));
|
$row=$this->db->fetchRow($this->db->quoteInto($sql,$uuid));
|
||||||
|
@ -632,6 +638,45 @@ class DataController extends Zend_Controller_Action
|
||||||
}
|
}
|
||||||
} //viewAction
|
} //viewAction
|
||||||
|
|
||||||
|
/*
|
||||||
|
getversionAction() 获取数据版本
|
||||||
|
*/
|
||||||
|
function getversionAction(){
|
||||||
|
|
||||||
|
$ac = $this->_getParam('ac');
|
||||||
|
$uuid = $this->_getParam('uuid');
|
||||||
|
|
||||||
|
if($ac == 'list')
|
||||||
|
{
|
||||||
|
$this->_helper->layout->disableLayout();
|
||||||
|
$this->_helper->viewRenderer->setNoRender();
|
||||||
|
|
||||||
|
$sql = "SELECT v.changelog,v.ts_created,u.username FROM mdversion v
|
||||||
|
LEFT JOIN users u ON v.userid=u.id
|
||||||
|
WHERE v.uuid=? AND v.changelog IS NOT NULL
|
||||||
|
ORDER BY v.ts_created DESC";
|
||||||
|
$sth = $this->db->prepare($sql);
|
||||||
|
$sth->execute(array($uuid));
|
||||||
|
$rows = $sth->fetchAll();
|
||||||
|
|
||||||
|
if($rows)
|
||||||
|
{
|
||||||
|
foreach($rows as $k=>$v)
|
||||||
|
{
|
||||||
|
$rows[$k]['ts_created'] = date("Y-m-d H:i",strtotime($v['ts_created']));
|
||||||
|
}
|
||||||
|
$data = array("list"=>$rows);
|
||||||
|
$this->jsonexit($data);
|
||||||
|
return true;
|
||||||
|
}else{
|
||||||
|
$data = array("error"=>"处理中出现错误");
|
||||||
|
$this->jsonexit($data);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}//getversionAction()
|
||||||
|
|
||||||
function replace($string){
|
function replace($string){
|
||||||
$patterns = array("/\"/i","/\'/i");
|
$patterns = array("/\"/i","/\'/i");
|
||||||
$replacements = array("“","‘");
|
$replacements = array("“","‘");
|
||||||
|
@ -1632,5 +1677,10 @@ class DataController extends Zend_Controller_Action
|
||||||
->setHeader('Pragma','public')
|
->setHeader('Pragma','public')
|
||||||
->setBody($content);
|
->setBody($content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function jsonexit($data){
|
||||||
|
$this->getResponse()->setHeader('Content-Type', 'application/json')->appendBody(json_encode($data,JSON_NUMERIC_CHECK));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -150,6 +150,9 @@ endforeach;
|
||||||
<ul>
|
<ul>
|
||||||
<li>元数据更新时间:<?php print date('Y-m-d',strtotime($md->ts_created)); ?> <a href="/service/xml/uuid/<?php echo $md->uuid;?>"><img src="/images/xml.gif" alt="查看XML源文件"></a><a href="/service/doc/uuid/<?php echo $md->uuid; ?>"><img src="/images/doc-icon.png" alt="Word doc格式"></a></li>
|
<li>元数据更新时间:<?php print date('Y-m-d',strtotime($md->ts_created)); ?> <a href="/service/xml/uuid/<?php echo $md->uuid;?>"><img src="/images/xml.gif" alt="查看XML源文件"></a><a href="/service/doc/uuid/<?php echo $md->uuid; ?>"><img src="/images/doc-icon.png" alt="Word doc格式"></a></li>
|
||||||
<!--<li><a href="/data/detail/id/<?php echo $md->id;?>">详细元数据</a></li>-->
|
<!--<li><a href="/data/detail/id/<?php echo $md->id;?>">详细元数据</a></li>-->
|
||||||
|
<?php if($this->version->c>0):?>
|
||||||
|
<li id="dataversion">数据版本:<a href="javascript:void(0);" onclick="dataVersion()" title=""><?= $this->version->c ?> 个 <img src="/images/list_extensions.gif" style="vertical-align:middle" /></a></li>
|
||||||
|
<?php endif;?>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -466,7 +469,7 @@ function getSubFileList(uuid,id,depth){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$('<div/>', {
|
$('<div/>', {
|
||||||
'style':'max-height:400px; overflow:auto; overflow-x:hidden;',
|
'style':'overflow:auto;',
|
||||||
'id': 'div_'+id,
|
'id': 'div_'+id,
|
||||||
"html": '<li><img src="/images/loading.gif" />加载中</li>'
|
"html": '<li><img src="/images/loading.gif" />加载中</li>'
|
||||||
}).appendTo('#li_'+id);
|
}).appendTo('#li_'+id);
|
||||||
|
@ -588,7 +591,41 @@ function cnkiSearch(keyword){
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function dataVersion()
|
||||||
|
{
|
||||||
|
$.ajax({
|
||||||
|
'type':"POST",
|
||||||
|
'url':'/data/getversion',
|
||||||
|
'data':'ac=list&uuid=<?php echo $md->uuid; ?>',
|
||||||
|
'success':onDataVersionLoad,
|
||||||
|
'timeout': 30000,
|
||||||
|
'error': function(){Alert('处理中出现错误,请刷新页面后重试');return false;}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
function onDataVersionLoad(data){
|
||||||
|
if (typeof(data)=='object')
|
||||||
|
{
|
||||||
|
if(typeof(data.error)!='undefined')
|
||||||
|
{Alert(data.error);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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function Alert(html){
|
||||||
|
$.colorbox({'innerWidth':'50%','html':'<h4 style="font-size:16px;font-weight:bold;">'+html+'</h4>'});
|
||||||
|
}
|
||||||
function gmaploaded()
|
function gmaploaded()
|
||||||
{
|
{
|
||||||
//google map
|
//google map
|
||||||
|
|
|
@ -83,11 +83,9 @@ img{border:0px;}
|
||||||
top:-3px;
|
top:-3px;
|
||||||
left:-3px;
|
left:-3px;
|
||||||
background:#FFFFFF none repeat scroll 0 0;
|
background:#FFFFFF none repeat scroll 0 0;
|
||||||
border:1px solid #555555;
|
|
||||||
font-weight:normal;
|
font-weight:normal;
|
||||||
padding:2px;
|
padding:2px;
|
||||||
position:relative;
|
position:relative;
|
||||||
max-height:500px;
|
|
||||||
overflow:auto;
|
overflow:auto;
|
||||||
}
|
}
|
||||||
#window-closer-container {
|
#window-closer-container {
|
||||||
|
@ -145,3 +143,12 @@ h2 {margin-top:10px;}
|
||||||
.recommend .pagnv img{vertical-align:middle;}
|
.recommend .pagnv img{vertical-align:middle;}
|
||||||
.recommend .pagnv .pleft{display:block;width:100%;}
|
.recommend .pagnv .pleft{display:block;width:100%;}
|
||||||
.recommend .pagnv .pright{display:block;width:100%;}
|
.recommend .pagnv .pright{display:block;width:100%;}
|
||||||
|
|
||||||
|
.datalist{overflow:hidden;}
|
||||||
|
.datalist ul li{margin:5px 0px;padding:5px 0px;background:#f6f6f6;border:1px solid #FFF;border-radius:3px;}
|
||||||
|
.datalist ul li:hover,#datalist ul li:focus{border:1px solid #ccc;background:#fefefe;}
|
||||||
|
.datalist ul li a{font-size:12px;}
|
||||||
|
.datalist ul li a.title{font-size:14px;}
|
||||||
|
.datalist ul li a.more{font-size:12px;}
|
||||||
|
.datalist ul li p{text-indent:24px;font-size:12px;line-height:24px;}
|
||||||
|
.datalist ul li p img {vertical-align:middle;}
|
Loading…
Reference in New Issue