在黑河计划数据整理服务中加入数据汇交
This commit is contained in:
parent
7872226002
commit
06121a2953
|
@ -7,6 +7,7 @@ class HeiheController extends DataController
|
|||
{
|
||||
parent::preDispatch();
|
||||
$this->_helper->layout->setLayout('heihe');
|
||||
$this->debug = 1;
|
||||
}
|
||||
|
||||
function indexAction()
|
||||
|
@ -308,4 +309,482 @@ class HeiheController extends DataController
|
|||
$this->view->page=new Pagination($sum,$page,$this->limit);
|
||||
$this->view->offset=$offset+1;
|
||||
}
|
||||
|
||||
/*
|
||||
* submitAction() //数据汇交
|
||||
*
|
||||
* param string $ac //动作
|
||||
* param int $id //数据模版ID
|
||||
* param int $group //geonetwork页面跳转参数
|
||||
*
|
||||
* return view
|
||||
*/
|
||||
function submitAction(){
|
||||
|
||||
$ac = $this->_getParam('ac');
|
||||
$id = $this->_request->getParam('id');
|
||||
$this->wdb=Zend_Db::factory($this->view->config->geonetwork);
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
if($auth->hasIdentity())
|
||||
{
|
||||
$user = $auth->getIdentity();
|
||||
$u_id = $user->id;
|
||||
$this->view->isadmin=false;
|
||||
if ($user->usertype=='administrator') $this->view->isadmin=true;
|
||||
}
|
||||
|
||||
if(empty($ac) || $ac == "index")
|
||||
{
|
||||
$this->_helper->viewRenderer('submit-index');
|
||||
return true;
|
||||
}
|
||||
|
||||
//新建元数据
|
||||
if($ac == "newdata")
|
||||
{
|
||||
|
||||
$do = $this->_getParam('do');
|
||||
|
||||
if(empty($do))
|
||||
{
|
||||
$this->_helper->viewRenderer('submit-newdata');
|
||||
|
||||
$keywords = $this->_request->getParam('q');
|
||||
$sql="select id,(regexp_matches(data,'<resTitle>(.*)</resTitle>'))[1] as title,(owner-".$u_id.") as isowner from metadata where istemplate='y' and schemaid='iso19115'";
|
||||
if(!empty($keywords))
|
||||
{
|
||||
$this->view->q = $keywords;
|
||||
$search=new Search($keywords);
|
||||
$where=$search->sql_expr(array("data"));
|
||||
$sql.=' and '.$where;
|
||||
}
|
||||
$sql.=" order by changedate desc";
|
||||
$sth = $this->wdb->prepare($sql);
|
||||
$sth->execute();
|
||||
$rows = $sth->fetchAll();
|
||||
|
||||
$paginator = Zend_Paginator::factory($rows);
|
||||
$paginator->setCurrentPageNumber($this->_getParam('page'));
|
||||
$paginator->setItemCountPerPage(10);
|
||||
$paginator->setView($this->view);
|
||||
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
|
||||
$this->view->paginator=$paginator;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if($do == "add")
|
||||
{
|
||||
$this->_helper->viewRenderer('submit-newdata-add');
|
||||
$this->view->pageNav = "newdata-add";
|
||||
|
||||
$keywords = $this->_request->getParam('q');
|
||||
$sql = "SELECT md.title,md.uuid,md.description,gn.id as gid FROM normalmetadata md
|
||||
left join geonetworkmetadata gn on md.uuid=gn.uuid
|
||||
WHERE gn.id is not null";
|
||||
if(!empty($keywords))
|
||||
{
|
||||
$this->view->q = $keywords;
|
||||
$search=new Search($keywords);
|
||||
$where=$search->sql_expr(array("md.title","md.description"));
|
||||
$sql.=' and '.$where;
|
||||
}
|
||||
$sql.=" order by md.ts_created desc";
|
||||
$sth = $this->db->prepare($sql);
|
||||
$sth->execute();
|
||||
$rows = $sth->fetchAll();
|
||||
|
||||
$paginator = Zend_Paginator::factory($rows);
|
||||
$paginator->setCurrentPageNumber($this->_getParam('page'));
|
||||
$paginator->setItemCountPerPage(10);
|
||||
$paginator->setView($this->view);
|
||||
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
|
||||
$this->view->paginator=$paginator;
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}//newdata
|
||||
|
||||
//未提交数据
|
||||
if($ac == "unsubmit")
|
||||
{
|
||||
$do = $this->_getParam('do');
|
||||
|
||||
//未提交的数据列表
|
||||
if(empty($do) || $do=="index")
|
||||
{
|
||||
$this->_helper->viewRenderer('submit-unsubmit');
|
||||
|
||||
$sql = "SELECT (regexp_matches(gn.data,'<resTitle>(.*)</resTitle>'))[1] as title,gn.id,gn.uuid FROM geonetworkmetadata gn
|
||||
WHERE gn.uuid not in (select uuid from metadata) and gn.owner=?
|
||||
order by gn.id desc
|
||||
";
|
||||
$sth = $this->db->prepare($sql);
|
||||
$sth->execute(array($u_id));
|
||||
$rows = $sth->fetchAll();
|
||||
|
||||
$paginator = Zend_Paginator::factory($rows);
|
||||
$paginator->setCurrentPageNumber($this->_getParam('page'));
|
||||
$paginator->setItemCountPerPage(15);
|
||||
$paginator->setView($this->view);
|
||||
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
|
||||
$this->view->paginator=$paginator;
|
||||
|
||||
return true;
|
||||
}//index
|
||||
|
||||
//提交
|
||||
if($do=="commit")
|
||||
{
|
||||
$this->_helper->layout->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
|
||||
$data = "";
|
||||
try{
|
||||
$id = $this->_request->getParam('id');
|
||||
if(empty($id) || !is_numeric($id))
|
||||
{
|
||||
$data = array("error"=>"参数错误");
|
||||
$this->jsonexit($data);
|
||||
return true;
|
||||
}
|
||||
|
||||
$changelog = $this->_request->getParam('changelog');
|
||||
|
||||
if(empty($changelog))
|
||||
{
|
||||
$data = array("error"=>'请输入变更信息');
|
||||
$this->jsonexit($data);
|
||||
return true;
|
||||
}
|
||||
|
||||
// 1. 权限认定:当前用户必须和其owner相同
|
||||
// 数据应当没有评审状态,没有作者信息
|
||||
$sql="select gn.id from geonetworkmetadata gn
|
||||
left join mdstatus s on gn.uuid=s.uuid
|
||||
left join mdauthor a on s.uuid=a.uuid
|
||||
where s.id is not null and a.id is not null and gn.id=?";
|
||||
$sth=$this->db->prepare($sql);
|
||||
$sth->execute(array($id));
|
||||
$row=$sth->fetch();
|
||||
if (!empty($row))
|
||||
{
|
||||
$data = array("error"=>'错误的入口');
|
||||
$this->jsonexit($data);
|
||||
return true;
|
||||
}
|
||||
|
||||
$sql="select uuid,data as xml from metadata where id=? and owner=?";
|
||||
$sth=$this->wdb->prepare($sql);
|
||||
$sth->execute(array($id,$u_id));
|
||||
$row=$sth->fetch();
|
||||
if (empty($row))
|
||||
{
|
||||
$data = array("error"=>'无权限修改数据');
|
||||
$this->jsonexit($data);
|
||||
return true;
|
||||
}else{
|
||||
$uuid = $row['uuid'];
|
||||
}
|
||||
|
||||
$messages = array();
|
||||
|
||||
// 保存数据作者信息
|
||||
$sql="insert into mdauthor (uuid,userid,ts_activated,status) values(?,?,now(),1)";
|
||||
$sth=$this->db->query($sql,array($row['uuid'],$u_id));
|
||||
|
||||
// 2. 保存变化记录 save changelog & userid for the latest version
|
||||
$sql = "UPDATE mdversion SET changelog=?,userid=? WHERE id in (select id from mdversion where uuid=? order by ts_created desc limit 1)";
|
||||
$this->db->query($sql,array($changelog,$u_id,$row['uuid']));
|
||||
|
||||
// 处理文件权限和数据信息
|
||||
$ftp_user = "qherc".$u_id."upload";
|
||||
$sql = "SELECT * FROM pureftp WHERE userid=? AND homedir LIKE ?";
|
||||
$sth = $this->db->prepare($sql);
|
||||
$sth->execute(array($ftp_user,'%'.$uuid.'%'));
|
||||
$row1 = $sth->fetch();
|
||||
|
||||
if(!empty($row1['passwd']))
|
||||
{
|
||||
$old=umask(0);
|
||||
$this->chmodr($row1['homedir'],0444);
|
||||
umask($old);
|
||||
}
|
||||
|
||||
$path = $row1['homedir'];
|
||||
|
||||
//delete dataset & datafile records
|
||||
$sql="delete from dataset where uuid=?";
|
||||
$sth = $this->db->prepare($sql);
|
||||
$sth->execute(array($uuid));
|
||||
|
||||
$sql = "INSERT INTO dataset (uuid,path) VALUES (?,?) RETURNING id";
|
||||
$sth = $this->db->prepare($sql);
|
||||
$rs = $sth->execute(array($uuid,$path));
|
||||
|
||||
if(!$rs)
|
||||
{
|
||||
$messages[] = "元数据信息写入失败";
|
||||
/*
|
||||
$data = array("error"=>'元数据信息写入失败');
|
||||
$this->jsonexit($data);
|
||||
return true;
|
||||
*/
|
||||
}
|
||||
|
||||
$temp = $sth->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
$dsid = $temp['id'];
|
||||
|
||||
$dir = new mydir();
|
||||
$files=$dir->recursive($path);
|
||||
|
||||
foreach ($files as $k=>$v)
|
||||
{
|
||||
//$pathinfo = pathinfo($path.$v);
|
||||
$filename = mb_substr($v,mb_strlen($path)+1);
|
||||
$filesize = filesize($v);
|
||||
$isdir=is_dir($v)?1:0;
|
||||
$depth=substr_count($filename,"/")+1;
|
||||
if (substr($filename,-1,1)=='/') $depth--;
|
||||
//$this->chmodr($path.$v,0444);
|
||||
$sql = "INSERT INTO datafile (dsid,filename,filesize,isdir,depth) VALUES (?,?,?,?,?)";
|
||||
$sth = $this->db->prepare($sql);
|
||||
$rs = $sth->execute(array($dsid,$filename,$filesize,$isdir,$depth));
|
||||
if(!$rs)
|
||||
{
|
||||
$messages[] = "数据文件".$filename.'写入失败';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 3. 保存数据评审状态
|
||||
//导入元数据
|
||||
$iso=new ISO19115();
|
||||
$iso->saveDB($this->db,$row['xml']);
|
||||
//进入评审库
|
||||
$sql="insert into mdstatus (uuid,status,userid) values(?,?,?)";
|
||||
$this->db->query($sql,array($uuid,0,$u_id));
|
||||
|
||||
//email to admin
|
||||
$mail=new WestdcMailer($this->view->config->smtp);
|
||||
$mail->setFrom($this->view->config->service->email,'数据服务组');
|
||||
$mailtp=new EmailText($this->db,"metadata-new-admin",array(
|
||||
'user' => $user->username,
|
||||
'uuid' => $iso->uuid,
|
||||
'email'=> $user->email,
|
||||
//元数据标题
|
||||
'title'=> $iso->resTitle,
|
||||
));
|
||||
$mail->setBodyText($mailtp->getBody());
|
||||
$mail->setSubject($mailtp->getSubject());
|
||||
$mail->addTo($this->view->config->service->email);
|
||||
$mail->send();
|
||||
|
||||
unset($mail);
|
||||
unset($mailtp);
|
||||
//email to author
|
||||
$mail=new WestdcMailer($this->view->config->smtp);
|
||||
$mail->setFrom($this->view->config->service->email,'数据服务组');
|
||||
$mailtp=new EmailText($this->db,"metadata-new-author",array(
|
||||
'user' => $user->username,
|
||||
'uuid' => $iso->uuid,
|
||||
'email'=> $user->email,
|
||||
//元数据标题
|
||||
'title'=> $iso->resTitle,
|
||||
));
|
||||
$mail->setBodyText($mailtp->getBody());
|
||||
$mail->setSubject($mailtp->getSubject());
|
||||
$mail->addTo($user->email);
|
||||
$mail->addCc($this->view->config->service->email);
|
||||
@$mail->send();
|
||||
|
||||
$data = array("commited"=>1,"error"=>'该版本已经成功提交,请等待数据中心进一步处理!');
|
||||
$this->jsonexit($data);
|
||||
return true;
|
||||
}catch(Exception $e) {
|
||||
$msg = "提交失败,请确认权限后重试";
|
||||
if($this->debug>0)
|
||||
{$msg .= $e->getMessage();}
|
||||
$data = array("error"=>$msg);
|
||||
$this->jsonexit($data);
|
||||
return true;
|
||||
}
|
||||
}//commit
|
||||
|
||||
return true;
|
||||
}//unsubmit
|
||||
|
||||
//FTP
|
||||
if($ac == "ftp")
|
||||
{
|
||||
$this->_helper->layout->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
|
||||
$uuid = $this->_getParam('uuid');
|
||||
|
||||
$this->view->uuid = $uuid;
|
||||
|
||||
if(empty($uuid) || !preg_match("/^[0-9A-Za-z]{8}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{12}$/",$uuid))
|
||||
{
|
||||
$data = array(
|
||||
'error'=>"参数错误"
|
||||
);
|
||||
$this->jsonexit($data);
|
||||
return true;
|
||||
}
|
||||
|
||||
//ftp 用户名
|
||||
$uname = 'qherc'.$userid.'upload';
|
||||
|
||||
//ftp路径
|
||||
$homedir = "/home/wlx/qhhdata/upload/".$uuid."/";
|
||||
|
||||
$sql = "SELECT * FROM pureftp WHERE userid='$uname' ORDER BY pkid DESC";
|
||||
$sth = $this->db->prepare($sql);
|
||||
$sth->execute();
|
||||
$row = $sth->fetch();
|
||||
|
||||
$old=umask(0);
|
||||
@mkdir($homedir,0777);
|
||||
umask($old);
|
||||
|
||||
if(!empty($row['pkid']))
|
||||
{
|
||||
if(preg_match("/.*".$uuid.".*/",$row['homedir']))
|
||||
{
|
||||
$data = array(
|
||||
'statu'=>1,
|
||||
'user'=>$row['userid'],
|
||||
'passwd'=>$row['passwd']
|
||||
);
|
||||
|
||||
$this->jsonexit($data);
|
||||
return true;
|
||||
|
||||
}else{
|
||||
$uid = 1001;
|
||||
$gid = 1001;
|
||||
|
||||
$passwd = $this->genRandomString(16);
|
||||
$sql = "UPDATE pureftp SET passwd=?,uid=?,gid=?,homedir=? WHERE userid=?";
|
||||
$sth = $this->db->prepare($sql);
|
||||
$rs = $sth->execute(array($passwd,$uid,$gid,$homedir,$uname));
|
||||
if($rs)
|
||||
{
|
||||
$data = array(
|
||||
'statu'=>1,
|
||||
'user'=>$uname,
|
||||
'passwd'=>$passwd
|
||||
);
|
||||
$this->jsonexit($data);
|
||||
return true;
|
||||
}else{
|
||||
$data = array(
|
||||
'error'=>"FTP信息更新失败,请重试"
|
||||
);
|
||||
$this->jsonexit($data);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else{
|
||||
$uid = 1001;
|
||||
$gid = 1001;
|
||||
$passwd = $this->genRandomString(16);
|
||||
|
||||
$sql = "INSERT INTO pureftp (userid,passwd,uid,gid,homedir) VALUES (?,?,?,?,?)";
|
||||
$sth = $this->db->prepare($sql);
|
||||
$rs = $sth->execute(array($uname,$passwd,$uid,$gid,$homedir));
|
||||
if($rs)
|
||||
{
|
||||
$data = array(
|
||||
'statu'=>1,
|
||||
'user'=>$uname,
|
||||
'passwd'=>$passwd
|
||||
);
|
||||
$this->jsonexit($data);
|
||||
return true;
|
||||
}else{
|
||||
$data = array(
|
||||
'error'=>"FTP信息更新失败,请重试"
|
||||
);
|
||||
$this->jsonexit($data);
|
||||
return true;
|
||||
}
|
||||
}//end if
|
||||
|
||||
}//ftp
|
||||
|
||||
}//function submitAction()
|
||||
|
||||
function genRandomString($len)
|
||||
{
|
||||
$chars = array(
|
||||
"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k",
|
||||
"l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v",
|
||||
"w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G",
|
||||
"H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R",
|
||||
"S", "T", "U", "V", "W", "X", "Y", "Z", "0", "1", "2",
|
||||
"3", "4", "5", "6", "7", "8", "9"
|
||||
);
|
||||
$charsLen = count($chars) - 1;
|
||||
|
||||
shuffle($chars); // 将数组打乱
|
||||
|
||||
$output = "";
|
||||
for ($i=0; $i<$len; $i++)
|
||||
{
|
||||
$output .= $chars[mt_rand(0, $charsLen)];
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
function chmodr($path, $filemode) {
|
||||
if (!is_dir($path))
|
||||
return chmod($path, $filemode);
|
||||
|
||||
$dh = opendir($path);
|
||||
while (($file = readdir($dh)) !== false) {
|
||||
if($file != '.' && $file != '..') {
|
||||
$fullpath = $path.'/'.$file;
|
||||
if(is_link($fullpath))
|
||||
return FALSE;
|
||||
elseif(!is_dir($fullpath) && !chmod($fullpath, $filemode))
|
||||
return FALSE;
|
||||
elseif(!$this->chmodr($fullpath, $filemode))
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
if(chmod($path, $filemode))
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//成为作者后的后继处理工作
|
||||
private function author_first($uuid,$author)
|
||||
{
|
||||
$sql="insert into mdversion (xml,ts_created,uuid,changelog,userid)
|
||||
select x.data,m.ts_created,?,?,? from metadata m left join xml x on m.id=x.id
|
||||
left join mdversion v on m.uuid=v.uuid
|
||||
where m.uuid=? and v.changelog is null";
|
||||
$sth=$this->db->prepare($sql);
|
||||
try
|
||||
{
|
||||
$sth->execute(array($uuid,'初始版本 version 1.0',$author,$uuid));
|
||||
} catch(Exception $e){
|
||||
// do nothing here.
|
||||
// 说明之前已经有对应数据
|
||||
}
|
||||
$this->wdb=Zend_Db::factory($this->view->config->geonetwork);
|
||||
$sql="update metadata set owner=? where uuid=?";
|
||||
$sth=$this->wdb->prepare($sql);
|
||||
$sth->execute(array($author,$uuid));
|
||||
}
|
||||
|
||||
}
|
|
@ -9,6 +9,7 @@ $this->headScript()->appendFile('/js/jquery-1.7.min.js');
|
|||
$this->breadcrumb($this->config->title->heihe);
|
||||
$this->breadcrumb()->setSeparator(' > ');
|
||||
?>
|
||||
<style>.next:hover{cursor:pointer;}</style>
|
||||
<div id='sidebar'>
|
||||
<div id='leftnavi'>
|
||||
<?= $this->partial('heihe/navi.phtml'); ?>
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
<li><a href="/heihe/tag">关键词导航</a></li>
|
||||
<li><a href="/heihe/timeline">时间轴导航</a></li>
|
||||
<li><a href="/heihe/timemap">时空联合导航</a></li>
|
||||
<li><a href="/heihe/submit">新建元数据</a></li>
|
||||
<!-- <li>WebGIS地图浏览</li>
|
||||
<li>黑河计划数据汇交</li>
|
||||
<li>数据使用协议</li> -->
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
$this->headTitle($this->config->title->site);
|
||||
$this->headTitle($this->config->title->data);
|
||||
$this->headTitle()->setSeparator(' - ');
|
||||
$this->headLink()->appendStylesheet('/css/water.css');
|
||||
$this->breadcrumb('<a href="/">首页</a>');
|
||||
$this->breadcrumb('<a href="/data">'.$this->config->title->data.'</a>');
|
||||
$this->breadcrumb('<a href="/heihe/">'.$this->config->title->heihe.'</a>');
|
||||
$this->breadcrumb('新建元数据');
|
||||
$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='sidebar'>
|
||||
<div id='leftnavi'>
|
||||
<?= $this->partial('heihe/navi.phtml'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='right'>
|
||||
<div class="clear"> </div>
|
||||
<?php if(!empty($this->error)) {?>
|
||||
<div id="intro"><?php echo $this->error;?></div>
|
||||
<?php }else{?>
|
||||
<div style="overflow:hidden;">
|
||||
<div id="tabs-controller">
|
||||
<ul>
|
||||
<li class="box-shadow"><a class="text-shadow" href="/heihe/submit/ac/newdata">根据模板创建元数据</a></li>
|
||||
<li class="box-shadow"><a class="text-shadow" href="/heihe/submit/ac/newdata/do/add">根据已有数据创建元数据</a></li>
|
||||
<li class="box-shadow"><a class="text-shadow iframe" href="/service/geonetwork?url=metadata.xmlinsert.form">导入元数据</a></li>
|
||||
<li class="box-shadow"><a class="text-shadow" href="/heihe/submit/ac/unsubmit">未提交元数据</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
</div>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
$(document).ready(function(){
|
||||
$(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,70 @@
|
|||
<?php
|
||||
$this->headTitle($this->config->title->site);
|
||||
$this->headTitle($this->config->title->data);
|
||||
$this->headTitle()->setSeparator(' - ');
|
||||
$this->headLink()->appendStylesheet('/css/water.css');
|
||||
$this->breadcrumb('<a href="/">首页</a>');
|
||||
$this->breadcrumb('<a href="/data">'.$this->config->title->data.'</a>');
|
||||
$this->breadcrumb('<a href="/heihe/">'.$this->config->title->heihe.'</a>');
|
||||
$this->breadcrumb('新建元数据');
|
||||
$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='sidebar'>
|
||||
<div id='leftnavi'>
|
||||
<?= $this->partial('heihe/navi.phtml'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='right'>
|
||||
<div class="clear"> </div>
|
||||
<?php if(!empty($this->error)) {?>
|
||||
<div id="intro"><?php echo $this->error;?></div>
|
||||
<?php }else{?>
|
||||
<div style="overflow:hidden;">
|
||||
<div id="tabs-controller">
|
||||
<ul>
|
||||
<li class="box-shadow"><a class="text-shadow" href="/heihe/submit/ac/newdata">根据模板创建元数据</a></li>
|
||||
<li class="box-shadow active"><a class="text-shadow" href="/heihe/submit/ac/newdata/do/add">根据已有数据创建元数据</a></li>
|
||||
<li class="box-shadow"><a class="text-shadow iframe" href="/service/geonetwork?url=metadata.xmlinsert.form">导入元数据</a></li>
|
||||
<li class="box-shadow"><a class="text-shadow" href="/heihe/submit/ac/unsubmit">未提交元数据</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div style="width:70%;overflow:hidden;padding-left:20px;">
|
||||
<h2>根据已有元数据来创建数据</h2>
|
||||
<form id="datasearch" class="search_form" action="/submit/newdata/ac/add">
|
||||
<input type="text" id="keyword" name="q" value="<?php if(!empty($this->q)) echo $this->q; ?>" />
|
||||
<button type="submit" class="btn" id="search_btn">搜索</button>
|
||||
</form>
|
||||
</div>
|
||||
<div id="datalist">
|
||||
<?php
|
||||
if (count($this->paginator)):
|
||||
echo "<ul>";
|
||||
$autoindex=0;
|
||||
foreach ($this->paginator as $item):
|
||||
$autoindex++;
|
||||
?>
|
||||
<li>
|
||||
<p><span class="title"><?php echo $item['title'];?></span>
|
||||
【<a href="/service/geonetwork?url=metadata.create?group=2<?php echo urlencode('&id='.$item['gid']); ?>">以此为模板新建</a>
|
||||
| <a href="/data/<?php echo $item['uuid'];?>" target="_blank">查看数据</a>】</p>
|
||||
<p><?php echo mb_strlen($item['description'])>400?$this->escape(mb_substr($item['description'],0,400,'UTF-8').'...'):$this->escape($item['description']); ?></p>
|
||||
</li>
|
||||
<?php
|
||||
endforeach;
|
||||
echo "</ul>";
|
||||
endif; ?>
|
||||
</div>
|
||||
<div class="pagenavi"><?= $this->paginator; ?></div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
</div>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
$(document).ready(function(){
|
||||
$(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
$this->headTitle($this->config->title->site);
|
||||
$this->headTitle($this->config->title->data);
|
||||
$this->headTitle()->setSeparator(' - ');
|
||||
$this->headLink()->appendStylesheet('/css/water.css');
|
||||
$this->breadcrumb('<a href="/">首页</a>');
|
||||
$this->breadcrumb('<a href="/data">'.$this->config->title->data.'</a>');
|
||||
$this->breadcrumb('<a href="/heihe/">'.$this->config->title->heihe.'</a>');
|
||||
$this->breadcrumb('新建元数据');
|
||||
$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='sidebar'>
|
||||
<div id='leftnavi'>
|
||||
<?= $this->partial('heihe/navi.phtml'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='right'>
|
||||
<div class="clear"> </div>
|
||||
<?php if(!empty($this->error)) {?>
|
||||
<div id="intro"><?php echo $this->error;?></div>
|
||||
<?php }else{?>
|
||||
<div style="overflow:hidden;">
|
||||
<div id="tabs-controller">
|
||||
<ul>
|
||||
<li class="box-shadow active"><a class="text-shadow" href="/heihe/submit/ac/newdata">根据模板创建元数据</a></li>
|
||||
<li class="box-shadow"><a class="text-shadow" href="/heihe/submit/ac/newdata/do/add">根据已有数据创建元数据</a></li>
|
||||
<li class="box-shadow"><a class="text-shadow iframe" href="/service/geonetwork?url=metadata.xmlinsert.form">导入元数据</a></li>
|
||||
<li class="box-shadow"><a class="text-shadow" href="/heihe/submit/ac/unsubmit">未提交元数据</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
</div>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
$(document).ready(function(){
|
||||
$(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,6 @@
|
|||
<ul>
|
||||
<li class="box-shadow <?php if($this->pageNav == "newdata") echo 'active';?>"><a class="text-shadow" href="/heihe/submit/ac/newdata">根据模板创建元数据</a></li>
|
||||
<li class="box-shadow <?php if($this->pageNav == "newdata-add") echo 'active';?>"><a class="text-shadow" href="/heihe/submit/ac/newdata/do/add">根据已有数据创建元数据</a></li>
|
||||
<li class="box-shadow"><a class="text-shadow iframe" href="/service/geonetwork?url=metadata.xmlinsert.form">导入元数据</a></li>
|
||||
<li class="box-shadow"><a class="text-shadow" href="/heihe/submit/ac/unsubmit">导入元数据</a></li>
|
||||
</ul>
|
|
@ -0,0 +1,142 @@
|
|||
<?php
|
||||
$this->headTitle($this->config->title->site);
|
||||
$this->headTitle($this->config->title->data);
|
||||
$this->headTitle()->setSeparator(' - ');
|
||||
$this->headLink()->appendStylesheet('/css/water.css');
|
||||
$this->breadcrumb('<a href="/">首页</a>');
|
||||
$this->breadcrumb('<a href="/data">'.$this->config->title->data.'</a>');
|
||||
$this->breadcrumb('<a href="/heihe/">'.$this->config->title->heihe.'</a>');
|
||||
$this->breadcrumb('数据列表');
|
||||
$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='sidebar'>
|
||||
<div id='leftnavi'>
|
||||
<?= $this->partial('heihe/navi.phtml'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='right'>
|
||||
<div class="clear"> </div>
|
||||
<div id="tabs-controller">
|
||||
<ul>
|
||||
<li class="box-shadow"><a class="text-shadow" href="/heihe/submit/ac/newdata">根据模板创建元数据</a></li>
|
||||
<li class="box-shadow"><a class="text-shadow" href="/heihe/submit/ac/newdata/do/add">根据已有数据创建元数据</a></li>
|
||||
<li class="box-shadow"><a class="text-shadow iframe" href="/service/geonetwork?url=metadata.xmlinsert.form">导入元数据</a></li>
|
||||
<li class="box-shadow active"><a class="text-shadow" href="/heihe/submit/ac/unsubmit">未提交元数据</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<?php if(!empty($this->error)) {?>
|
||||
<div id="intro"><?php echo $this->error;?></div>
|
||||
<?php }else{?>
|
||||
<div id="datalist">
|
||||
<?php
|
||||
if (count($this->paginator)):
|
||||
echo "<ul>";
|
||||
$autoindex=0;
|
||||
foreach ($this->paginator as $item):
|
||||
$autoindex++;
|
||||
?>
|
||||
<li>
|
||||
<p><span class="title"><?php echo $item['title'];?></span> </p>
|
||||
<p>【<a href="/service/geonetwork?url=metadata.show?id=<?php echo $item['id']; ?>">在geonetwork里查看</a>
|
||||
| <a href="/service/geonetwork?url=metadata.edit?id=<?php echo $item['id']; ?>">在geonetwork里修改</a>
|
||||
| <a href="/service/geonetwork?url=metadata.delete?id=<?php echo $item['id']; ?>">删除此条数据</a>
|
||||
| <a href="javascript:;" onclick="getFtp('<?php echo $item['uuid'];?>')">FTP数据上传</a>
|
||||
| <a onclick="$('#commit_submit').attr('onclick','commit(\'<?php echo $item['id'];?>\');');" href="#commitform" class="more inline">提交评审发布</a>
|
||||
】</p>
|
||||
</li>
|
||||
<?php
|
||||
endforeach;
|
||||
echo "</ul>";
|
||||
else :
|
||||
echo "<p>您当前没有未提交的数据。</p>";
|
||||
endif; ?>
|
||||
</div>
|
||||
<div class="pagenavi"><?= $this->paginator; ?></div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<script>
|
||||
$(".iframe").colorbox({iframe:true, width:"80%",height:"80%"});
|
||||
function action(ac,id){
|
||||
$.ajax({
|
||||
'type':"POST",
|
||||
'url':'/heihe/submit/ac/unsubmit',
|
||||
'data':'do='+ ac +'&id='+id,
|
||||
'success':function(data){
|
||||
if (typeof(data)=='object')
|
||||
{
|
||||
if(typeof(data.error)!='undefined')
|
||||
{$.colorbox({'innerWidth':'50%','html':data.error});}
|
||||
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{
|
||||
Alert('出现错误,请稍候再试</h4>');
|
||||
}
|
||||
},
|
||||
'timeout': 30000,
|
||||
'error': function(){
|
||||
Alert('处理中出现错误,请刷新页面后重试</h4>');
|
||||
}
|
||||
});
|
||||
}
|
||||
function getFtp(uuid){
|
||||
$.ajax({
|
||||
'type':"POST",
|
||||
'url':'/heihe/submit/ac/ftp/uuid/'+uuid,
|
||||
'data':'',
|
||||
'success':function(data){
|
||||
if (typeof(data)=='object')
|
||||
{
|
||||
if(typeof(data.error)!='undefined')
|
||||
{Alert(data.error);return false;}
|
||||
if(typeof(data.statu)!='undefined')
|
||||
{
|
||||
if(data.statu > 0)
|
||||
{
|
||||
var html = '<p>临时FTP帐号信息</p><p>ftp://deep.qherc.org/</p>'+
|
||||
'<p>用户名:'+data.user+
|
||||
'</p><p>密码:'+data.passwd+'</p>'
|
||||
+'<p><a href="ftp://'+data.user+':'+data.passwd+'@deep.qherc.org/">或直接点击此链接</a></p>';
|
||||
Alert(html);
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
Alert('出现错误,请稍候再试</h4>');
|
||||
}
|
||||
},
|
||||
'timeout': 30000,
|
||||
'error': function(){
|
||||
Alert('处理中出现错误,请刷新页面后重试</h4>');
|
||||
}
|
||||
});
|
||||
}
|
||||
function Alert(html){
|
||||
$.colorbox({'innerWidth':'50%','html':'<h4>'+html+'</h4>'});
|
||||
}
|
||||
$(".inline").colorbox({inline:true, width:"50%"});
|
||||
function commit(id){
|
||||
action('commit&changelog='+$('#changelog').val(),id);
|
||||
}
|
||||
</script>
|
||||
<div class="colorbox" style="display:none;">
|
||||
<div id="commitform">
|
||||
<form>
|
||||
<p>
|
||||
<label>简要功能:</label><br />
|
||||
<textarea class="full" style="resize:none;height:200px;" id="changelog"></textarea>
|
||||
<br /><small>请输入此数据的简要功能和特色</small>
|
||||
</p>
|
||||
<input type="button" onclick="" id="commit_submit" class="btn btn-green big" 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>
|
|
@ -72,22 +72,13 @@ ul{list-style-type: none;}
|
|||
.clear-div{height:0px;overflow:hidden;}
|
||||
#watermap{height:300px;width:300px;}
|
||||
#window-outter {
|
||||
background:#3d3d3d none repeat scroll 0 0;
|
||||
border:1px solid #DDDDDD;
|
||||
display:block;
|
||||
position:absolute;
|
||||
width:960px;
|
||||
top:0;
|
||||
}
|
||||
#window-inner {
|
||||
top:-3px;
|
||||
left:-3px;
|
||||
background:#FFFFFF none repeat scroll 0 0;
|
||||
border:1px solid #555555;
|
||||
font-weight:normal;
|
||||
padding:2px;
|
||||
position:relative;
|
||||
max-height:600px;
|
||||
}
|
||||
#window-closer-container {
|
||||
top:2px;
|
||||
|
@ -98,7 +89,6 @@ ul{list-style-type: none;}
|
|||
#window-content-container{
|
||||
margin:10px;
|
||||
padding:0;
|
||||
max-height:400px;
|
||||
overflow:auto;
|
||||
}
|
||||
#window-loading {
|
||||
|
|
|
@ -103,3 +103,27 @@ ol,ol li{list-style:decimal;margin-left:20px;}
|
|||
background:#ffffff; margin-top:5px; padding-left:5px; position: absolute; width: 180px;
|
||||
font-size:12px;font-weight:bold;color:#00A9FF;white-space: normal;}
|
||||
.singleline img{height:20px;vertical-align:middle;}
|
||||
|
||||
#tabs-controller {overflow:hidden;padding:5px 0;margin:5px 0px;}
|
||||
#tabs-controller ul li{float:left;padding:3px 10px;border:1px solid #93bee2;border-radius:5px;margin:0 5px;}
|
||||
#tabs-controller ul li:hover{background:#f1f8fe;}
|
||||
#tabs-controller ul li.active{background:#e8f4ff;}
|
||||
.box-shadow{
|
||||
box-shadow:2px 2px 2px #ccc;
|
||||
-webkit-box-shadow:2px 2px 2px #ccc;
|
||||
-moz-box-shadow:2px 2px 2px #ccc;
|
||||
filter: progid:DXImageTransform.Microsoft.Shadow(Strength=3, Direction=125, Color='#cccccc');
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=3, Direction=125, Color='#cccccc')";
|
||||
}
|
||||
.text-shadow{
|
||||
text-shadow:#ccc 2px 2px 2px;
|
||||
}
|
||||
|
||||
#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