merge trunk r1517.

This commit is contained in:
wlx 2011-10-28 12:52:38 +00:00
parent 425a164489
commit 6be8849c88
67 changed files with 1842 additions and 1467 deletions

View File

@ -35,7 +35,7 @@ class Admin_DataController extends Zend_Controller_Action
//$uuid=$this->_request->getParam('uuid'); //$uuid=$this->_request->getParam('uuid');
if ($source=="geonetwork" && empty($uuid) ) { if ($source=="geonetwork" && empty($uuid) ) {
//从geonetwork向WESTDC同步 //从geonetwork向WESTDC同步
$sql="select uuid,data from geonetworkmetadata where schemaid='iso19115'"; $sql="select uuid,data,source from geonetworkmetadata where schemaid='iso19115'";
$rs=$this->db->fetchAll($sql); $rs=$this->db->fetchAll($sql);
foreach($rs as $gmd) { foreach($rs as $gmd) {
$this->import($gmd->data); $this->import($gmd->data);
@ -45,12 +45,12 @@ class Admin_DataController extends Zend_Controller_Action
} elseif ($source=="watergn" && empty($uuid) ) { } elseif ($source=="watergn" && empty($uuid) ) {
//首先删除所有的黑河试验数据 //首先删除所有的黑河试验数据
//$sql="delete from metadata where source='e3ad32dc-f573-11e0-aa7b-b768cfd88d80'"; //$sql="delete from metadata where source='e3ad32dc-f573-11e0-aa7b-b768cfd88d80'";
$sql="delete from metadata where uuid in (select uuid from heihegn)"; $sql="delete from metadata where uuid in (select uuid from watergn)";
$this->db->query($sql); $this->db->query($sql);
$sql="delete from responsible where id not in (select distinct(resid) from role)"; $sql="delete from responsible where id not in (select distinct(resid) from role)";
$this->db->query($sql); $this->db->query($sql);
//同步黑河遥感实验的元数据 //同步黑河遥感实验的元数据
$sql="select uuid,data,source from heihegn where schemaid='iso19115'"; $sql="select uuid,data,source from watergn where schemaid='iso19115'";
$rs=$this->db->fetchAll($sql); $rs=$this->db->fetchAll($sql);
foreach($rs as $gmd) { foreach($rs as $gmd) {
$this->import($gmd->data); $this->import($gmd->data);
@ -74,9 +74,10 @@ class Admin_DataController extends Zend_Controller_Action
$this->view->msg='成功同步WESTDC元数据到GEONETWORK'; $this->view->msg='成功同步WESTDC元数据到GEONETWORK';
} elseif (!empty($uuid) && isset($_POST['submit'])) { } elseif (!empty($uuid) && isset($_POST['submit'])) {
//同步单条元数据 //同步单条元数据
$sql=$this->db->quoteInto("select data from geonetworkmetadata where uuid=?",$uuid); $sql=$this->db->quoteInto("select data,source from geonetworkmetadata where uuid=?",$uuid);
if ($rs=$this->db->fetchRow($sql)) { if ($rs=$this->db->fetchRow($sql)) {
$this->import($rs->data); $this->import($rs->data);
$this->db->exec($this->db->quoteInto("update metadata set source=? where uuid='$uuid'",$rs->source));
$this->view->msg='成功同步元数据:'.$uuid; $this->view->msg='成功同步元数据:'.$uuid;
} else $this->view->msg='不存在此元数据:'.$uuid; } else $this->view->msg='不存在此元数据:'.$uuid;
} elseif (!empty($uuid) && isset($_POST['gnsubmit'])) { } elseif (!empty($uuid) && isset($_POST['gnsubmit'])) {
@ -93,7 +94,7 @@ class Admin_DataController extends Zend_Controller_Action
} else $this->view->msg='不存在此元数据:'.$uuid; } else $this->view->msg='不存在此元数据:'.$uuid;
} elseif (!empty($uuid) && isset($_POST['watersubmit'])) { } elseif (!empty($uuid) && isset($_POST['watersubmit'])) {
//同步单条元数据 //同步单条元数据
$sql=$this->db->quoteInto("select data,source from heihegn where uuid=?",$uuid); $sql=$this->db->quoteInto("select data,source from watergn where uuid=?",$uuid);
if ($rs=$this->db->fetchRow($sql)) { if ($rs=$this->db->fetchRow($sql)) {
$this->import($rs->data); $this->import($rs->data);
$this->db->query("update metadata set source=? where uuid=?",array($rs->source,$uuid)); $this->db->query("update metadata set source=? where uuid=?",array($rs->source,$uuid));
@ -101,9 +102,10 @@ class Admin_DataController extends Zend_Controller_Action
} else $this->view->msg='不存在此元数据:'.$uuid; } else $this->view->msg='不存在此元数据:'.$uuid;
} elseif (!empty($uuid)) { } elseif (!empty($uuid)) {
//同步单条元数据 //同步单条元数据
$sql=$this->db->quoteInto("select data from geonetworkmetadata where uuid=?",$uuid); $sql=$this->db->quoteInto("select data,source from geonetworkmetadata where uuid=?",$uuid);
if ($rs=$this->db->fetchRow($sql)) { if ($rs=$this->db->fetchRow($sql)) {
$this->import($rs->data); $this->import($rs->data);
$this->db->query("update metadata set source=? where uuid=?",array($rs->source,$uuid));
$this->view->msg='成功同步元数据:'.$uuid; $this->view->msg='成功同步元数据:'.$uuid;
} else $this->view->msg='不存在此元数据:'.$uuid; } else $this->view->msg='不存在此元数据:'.$uuid;
} elseif ($list=='water') { } elseif ($list=='water') {
@ -113,6 +115,16 @@ class Admin_DataController extends Zend_Controller_Action
$sql="delete from metadata where uuid not in (select uuid from geonetworkmetadata where schemaid='iso19115')"; $sql="delete from metadata where uuid not in (select uuid from geonetworkmetadata where schemaid='iso19115')";
$this->db->query($sql); $this->db->query($sql);
$this->view->msg='已删除WESTDC中多出的元数据'; $this->view->msg='已删除WESTDC中多出的元数据';
} elseif ($delete=='geonetwork') {
//dblink view中删除多条有问题暂时用单条删除替代
//$sql="delete from geonetworkmetadata where uuid not in (select uuid from metadata)";
$sql="select uuid from geonetworkmetadata where uuid not in (select uuid from metadata)";
$rows=$this->db->fetchAll($sql);
foreach($rows as $row)
{
$this->db->exec($this->db->quoteInto("delete from geonetworkmetadata where uuid=?",$row->uuid));
}
$this->view->msg='已删除GEONETWORK中多出的元数据';
} elseif ($delete=='water') { } elseif ($delete=='water') {
$sql="delete from metadata where uuid not in (select uuid from watergn where schemaid='iso19115') and uuid not in (select uuid from geonetworkmetadata where schemaid='iso19115')"; $sql="delete from metadata where uuid not in (select uuid from watergn where schemaid='iso19115') and uuid not in (select uuid from geonetworkmetadata where schemaid='iso19115')";
$this->db->query($sql); $this->db->query($sql);
@ -783,23 +795,280 @@ class Admin_DataController extends Zend_Controller_Action
function sourceAction() function sourceAction()
{ {
$do = $this->_request->getParam('do');
$uuid = $this->_request->getParam('uuid');
$id = $this->_request->getParam('id');
$q = $this->_request->getParam('q');
$search = $this->_request->getParam('search');
$add=(int)$this->_getParam('add'); if ($do == 'add') {
$edit=(int)$this->_getParam('edit');
$delete=(int)$this->_getParam('delete');
$search=$this->_getParam('search');
$keyword=$this->_getParam('keyword');
if ($add) { $redirect = "/admin/data/source/";
if(!empty($_POST['submit'])) if(!empty($_POST['submit']))
{ {
try{
$title = $this->_request->getParam('title');
$uuid = $this->_request->getParam('uuid');
$code = $this->_request->getParam('code');
$description = $this->_request->getParam('description');
$has_pages = $this->_request->getParam('has_pages');
$has_agreement = $this->_request->getParam('has_agreement');
$data = array(
'title' => $title,
'uuid' => $uuid,
'code' => $code,
'description' => $description,
'has_pages' => $has_pages,
'has_agreement' => $has_agreement
);
if($this->db->insert('source',$data))
{
$this->messenger->addMessage('添加来源信息成功');
$this->_redirect($redirect);
}
}catch(Exception $e){
$this->messenger->addMessage('添加来源信息失败:'.$e->getMessage());
$this->_redirect('/admin/data/source/do/add');
}
} }
$this->_helper->viewRenderer('sourceadd'); $this->_helper->viewRenderer('sourceadd');
}// 添加项目来源 }// 添加项目来源
else if($do == 'edit' && !empty($id))
{
if(!empty($_POST['submit']))
{
try{
$title = $this->_request->getParam('title');
$uuid = $this->_request->getParam('uuid');
$code = $this->_request->getParam('code');
$description = $this->_request->getParam('description');
$has_pages = $this->_request->getParam('has_pages');
$has_agreement = $this->_request->getParam('has_agreement');
$sql = "update source set title='$title',uuid='$uuid',code='$code',description='$description',has_pages='$has_pages',has_agreement='$has_agreement' where id='$id'";
if($this->db->exec($sql))
{
$this->messenger->addMessage('修改来源信息成功');
$this->_redirect("/admin/data/source/do/edit/id/$id");
}
}catch(Exception $e){
$this->messenger->addMessage('修改来源信息失败:'.$e->getMessage());
$this->_redirect("/admin/data/source/do/edit/id/$id");
}
}
$sql = "select * from source where id='$id'";
$rs = $this->db->query($sql);
$row = $rs->fetch();
$this->view->info = $row;
$this->_helper->viewRenderer('sourceadd');
}// 编辑单条信息
else if($do == 'datasource' && !empty($uuid))
{
$redirect = "/admin/data/source/do/datasource/uuid/$uuid";
$this->view->uuid = $uuid;
$sql = "select md.title,ds.id,ds.sourceid,s.title as stitle,s.code from metadata md
left join datasource ds on ds.uuid=md.uuid
left join source s on s.id=ds.sourceid
where md.uuid='$uuid'";
$rs = $this->db->query($sql);
$row = $rs->fetch();
$this->view->info = $row;
if(!empty($_POST['submit']))
{
$sourceid = $this->_request->getParam('sourceid');
if(empty($sourceid))
{
$this->messenger->addMessage('请选择项目来源');
$this->_redirect($redirect);
}
$sql="";
if(empty($row['id']))
{
$sql = "insert into datasource (uuid,sourceid) values ('$uuid','$sourceid')";
}else
{
$sql = "update datasource set uuid='$uuid',sourceid='$sourceid' where id='{$row['id']}'";
}
try{
if($this->db->exec($sql))
{
$this->messenger->addMessage('修改项目来源成功');
$this->_redirect($redirect);
}
else
{
$this->messenger->addMessage('修改项目来源失败');
$this->_redirect($redirect);
}
}catch (Exception $e){
$this->messenger->addMessage('修改项目来源失败:'.$e->getMessage());
$this->_redirect($redirect);
}
}
$wheresql = array();
if(!empty($q) && !empty($search))
{
$this->view->q = $q;
$wheresql[] = " title like '%$q%' ";
}
if(count($wheresql>0))$wheresql = join(' and ',$wheresql);
else $wheresql='';
if($wheresql!='')
{
$wheresql = 'where '.$wheresql;
}
$sql = "select * from source $wheresql order by id desc";
$rs = $this->db->query($sql);
$rows = $rs->fetchAll();
$paginator = Zend_Paginator::factory($rows);
$paginator->setCurrentPageNumber($this->_getParam('page'));
$paginator->setItemCountPerPage(30);
$paginator->setView($this->view);
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
$this->view->paginator=$paginator;
$this->_helper->viewRenderer('sourceselect');
}// 为元数据选择项目来源
else if($do == 'del' && !empty($id))
{
$redirect = "/admin/data/source/";
$sql = "delete from source where id='$id'";
try{
if($this->db->exec($sql))
{
$this->messenger->addMessage('删除成功');
$this->_redirect($redirect);
}else{
$this->messenger->addMessage('删除失败,可能该数据已不存在');
$this->_redirect($redirect);
}
}catch (Exception $e){
$this->messenger->addMessage('删除失败:'.$e->getMessage());
$this->_redirect($redirect);
}
}// 删除项目来源
else if($do == 'fetch' && !empty($id))
{
$wheresql = array();
$wheresql[] = " ds.sourceid='$id' ";
if(!empty($q) && !empty($search))
{
$this->view->q = $q;
$wheresql[] = " title like '%$q%' ";
}
if(count($wheresql>0))$wheresql = join(' and ',$wheresql);
else $wheresql='';
if($wheresql!='')
{
$wheresql = 'where '.$wheresql;
}
$sql = "select md.title,md.uuid,ds.id,ds.sourceid,s.title as stitle,s.code from metadata md
left join datasource ds on ds.uuid=md.uuid
left join source s on s.id=ds.sourceid
$wheresql
order by id desc";
$rs = $this->db->query($sql);
$rows = $rs->fetchAll();
$paginator = Zend_Paginator::factory($rows);
$paginator->setCurrentPageNumber($this->_getParam('page'));
$paginator->setItemCountPerPage(30);
$paginator->setView($this->view);
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
$this->view->paginator=$paginator;
$this->_helper->viewRenderer('sourcefetchone');
}//查看某项目来源中的所有元数据
else if($do == 'delsource' && !empty($id))
{
$redirect = "/admin/data/source/do/datasource/uuid/$uuid";
$sql = "delete from datasource where id='$id'";
try{
if($this->db->exec($sql))
{
$this->messenger->addMessage('删除成功');
$this->_redirect($redirect);
}else{
$this->messenger->addMessage('删除失败,可能该数据已不存在');
$this->_redirect($redirect);
}
}catch (Exception $e){
$this->messenger->addMessage('删除失败:'.$e->getMessage());
$this->_redirect($redirect);
}
}// 清除元数据来源记录
else
{
$wheresql = array();
if(!empty($q) && !empty($search))
{
$this->view->q = $q;
$wheresql[] = " title like '%$q%' ";
}
if(count($wheresql>0))$wheresql = join(' and ',$wheresql);
else $wheresql='';
if($wheresql!='')
{
$wheresql = 'where '.$wheresql;
}
$sql = "select * from source $wheresql order by id desc";
$rs = $this->db->query($sql);
$rows = $rs->fetchAll();
$paginator = Zend_Paginator::factory($rows);
$paginator->setCurrentPageNumber($this->_getParam('page'));
$paginator->setItemCountPerPage(30);
$paginator->setView($this->view);
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
$this->view->paginator=$paginator;
}// 项目来源管理
}//function sourceAction }//function sourceAction

View File

@ -45,12 +45,11 @@ class Admin_DownController extends Zend_Controller_Action
$row=$this->db->fetchRow($sql,array($start)); $row=$this->db->fetchRow($sql,array($start));
//发送用户邮件进行信息提示和说明 //发送用户邮件进行信息提示和说明
$mail = new WestdcMailer($this->view->config->smtp); $mail = new WestdcMailer($this->view->config->smtp);
$body=file_get_contents($this->view->config->offline->email->start_template); $datalist=str_replace(";","\n",$row['datalist']);
$body=str_replace("[username]",$row['username'],$body); $mailtp=new EmailText($this->db,'offline-start',array('user'=>$row['username'],'datalist'=>$datalist));
$body=str_replace("[datalist]",str_replace(";","\n",$row['datalist']),$body); $mail->setBodyText($mailtp->getBody());
$mail->setBodyText($body); $mail->setSubject($mailtp->getSubject());
$mail->addTo($row['email']); $mail->addTo($row['email']);
$mail->setSubject('西部数据中心已收到您的纸质离线申请');
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组'); $mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
$mail->send(); $mail->send();
@ -270,7 +269,7 @@ class Admin_DownController extends Zend_Controller_Action
$sql="select * from offlineapp where ts_approved is not null and pdflink is not null order by ts_created desc"; $sql="select * from offlineapp where ts_approved is not null and pdflink is not null order by ts_created desc";
$rows=$this->db->fetchAll($sql); $rows=$this->db->fetchAll($sql);
foreach($rows as $row){ foreach($rows as $row){
$content.='"'.$row['username'].'","'.$row['unit'].'","'.$row['phone'].'","'.$row['address'].'","'.$row['postcoe'].'","'.str_replace("\"","'",$row['project']).'","'.str_replace("\"","'",$row['datalist']).'","'.$row['email'].'",'.$row['ts_approved']."\n"; $content.='"'.$row['username'].'","'.$row['unit'].'","'.$row['phone'].'","'.$row['address'].'","'.$row['postcoe'].'","'.str_replace("\"","'",$row['project']).'","'.str_replace("\"","'",$row['datalist']).'","'.$row['email'].'",'.$row['ts_created']."\n";
} }
$this->getResponse()->setHeader('Content-Type', 'application/octet-stream') $this->getResponse()->setHeader('Content-Type', 'application/octet-stream')
->setHeader('Content-Disposition','attachment; filename="offlineapp.csv"') ->setHeader('Content-Disposition','attachment; filename="offlineapp.csv"')

View File

@ -678,6 +678,51 @@ class Admin_ReviewController extends Zend_Controller_Action
}//已结束评审 }//已结束评审
function deleteAction(){
$id=$this->_request->getParam('id');
try{
$auth = Zend_Auth::getInstance();
if($auth->hasIdentity())
{
$user = $auth->getIdentity();
$userid = $user->id;
$sql = "select id from mdstatus where userid='$userid' and id='$id'";
$rs = $this->db->query($sql);
$row = $rs->fetch();
if(!empty($row['id']))
{
$sql = "delete from mdstatus where id='$id'";
if($this->db->exec($sql))
{
$this->messenger->addMessage('删除成功');
$this->_redirect("/admin/review/myreview");
}else{
$this->messenger->addMessage('删除失败');
$this->_redirect("/admin/review/myreview");
}
}else{
$this->messenger->addMessage('您没有权限操作其他管理员管理的元数据评审');
$this->_redirect("/admin/review/myreview");
}
}else
{
$this->messenger->addMessage('权限读取失败');
$this->_redirect("/admin/review/myreview");
}
}catch(Exception $e){
$this->messenger->addMessage('删除失败:'.$e->getMessage());
$this->_redirect("/admin/review/myreview");
}
}
function expertsAction() function expertsAction()
{ {

View File

@ -119,11 +119,11 @@ class Admin_StatController extends Zend_Controller_Action
function waterAction() function waterAction()
{ {
$sql="select count(k.keyword) as num,k.keyword from dataorder d join metadata m on d.uuid=m.uuid $sql="select count(k.keyword) as num,d.status,k.keyword from dataorder d left join metadata m on d.uuid=m.uuid
left join keyword k on m.id=k.id left join keyword k on m.id=k.id
where (d.status=5 or d.status=-1) and m.source!='' where (d.status=5 or d.status=-1) and m.source='0595169a-279e-4b95-819f-129d0ba4280d'
and (k.keyword='航空遥感' or k.keyword='卫星遥感' or k.keyword='气象水文' or k.keyword='上游寒区水文试验区' or k.keyword='森林水文试验区' or k.keyword='中游干旱区水文试验区') and (k.keyword='航空遥感' or k.keyword='卫星遥感' or k.keyword='气象水文' or k.keyword='上游寒区水文试验区' or k.keyword='森林水文试验区' or k.keyword='中游干旱区水文试验区')
group by k.keyword order by num desc"; group by k.keyword,d.status order by k.keyword desc,d.status desc";
$re =$this->db->query($sql); $re =$this->db->query($sql);
$type =$re->fetchAll();//按分类 $type =$re->fetchAll();//按分类
@ -141,12 +141,12 @@ class Admin_StatController extends Zend_Controller_Action
$this->view->month = $month; $this->view->month = $month;
$sql = "select count(extract(month from o.ts_created)) as c,extract(month from o.ts_created) as m,extract(year from o.ts_created) as y $sql = "select
extract(year from o.ts_created) as y,extract(month from o.ts_created) as m,
count(extract(month from o.ts_created)) as c
from from
(select distinct(o.id),o.ts_created (select distinct(o.id),o.ts_created
from offlineapp o left join dataorder d on d.offlineappid=o.id left join metadata m on m.uuid=d.uuid from offlineapp o where o.datalist like '%黑河综合遥感联合试验%') as o
where m.source='0595169a-279e-4b95-819f-129d0ba4280d' and (d.status=3 or d.status=5 or d.status=-1)
) as o
group by extract(month from o.ts_created),extract(year from o.ts_created) group by extract(month from o.ts_created),extract(year from o.ts_created)
order by extract(year from o.ts_created),extract(month from o.ts_created)"; order by extract(year from o.ts_created),extract(month from o.ts_created)";

View File

@ -48,6 +48,7 @@
<?php if (@!is_numeric($item['mdstatus'])) : ?> <?php if (@!is_numeric($item['mdstatus'])) : ?>
<a href="/admin/review/addon/uuid/<?php echo $item['uuid'];?>">放入元数据评审</a> <a href="/admin/review/addon/uuid/<?php echo $item['uuid'];?>">放入元数据评审</a>
<?php endif; ?> <?php endif; ?>
<a href="/admin/data/source/do/datasource/uuid/<?php echo $item['uuid'];?>">编辑数据来源</a>
</li> </li>
<li>数据贡献者:<?= $item['author']; ?></li> <li>数据贡献者:<?= $item['author']; ?></li>
<li><?= $item['description']; ?></li> <li><?= $item['description']; ?></li>

View File

@ -0,0 +1,67 @@
<?php
$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('<a href="/admin/data">数据管理</a>');
$this->breadcrumb('项目来源管理');
$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="ctrlplan">
<a href="/admin/data/source">项目来源管理</a>
<a href="/admin/data/source/do/add">添加项目来源</a>
</div>
<div class="search">
<form action="" method="get">
<input type="hidden" name="search" value='1' />
<input type="hidden" name="id" value='<?php echo $this->id;?>' />
<label>搜索关键字</label><input type="text" class="q" name="q" value="<?php echo $this->q; ?>" />
<input type="submit" class="btn" value="搜索" />
</form>
</div><!-- search DIV -->
<table class="stylized" width="700">
<thead>
<tr>
<td width='40%'>标题</td>
<td width='30%'>Code字符</td>
<td width='30%'>操作</td>
</tr>
</thead>
<?php if (count($this->paginator)): ?>
<tbody id="list">
<?php foreach ($this->paginator as $item): ?>
<tr>
<td><a href="/admin/data/source/do/fetch/id/<?php echo $item['id']?>"><?php echo $item['title']; ?></a></td>
<td><?php echo $item['code'];?></td>
<td>
<a href="/admin/data/source/do/edit/id/<?php echo $item['id']?>">查看编辑</a>|
<a href="/admin/data/source/do/fetch/id/<?php echo $item['id']?>">查看元数据</a>|
<a href="/admin/data/source/do/del/id/<?php echo $item['id']?>" onclick="return confirm('是否确定删除该来源')">删除</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>

View File

@ -0,0 +1,64 @@
<?php
$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('<a href="/admin/data">数据管理</a>');
$this->breadcrumb('项目来源管理');
$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="ctrlplan">
<a href="/admin/data/source/">项目来源管理</a>
<a href="/admin/data/source/do/add">添加项目来源</a>
</div>
<form method="post" action="/admin/data/source">
<p>
<label>标题:</label><br />
<input type="text" name="title" value="<?php echo $this->info['title'];?>" />
</p>
<p>
<label class="required">uuid:</label><br />
<input type="text" name="uuid" value="<?php echo $this->info['uuid'];?>" />
</p>
<p>
<label class="required">Code:</label><br />
<input type="text" name="code" value="<?php echo $this->info['code'];?>" />
</p>
<p>
<label>描述</label><br />
<textarea id="description" class="samll half" name="description"><?php echo $this->info['description'];?></textarea>
</p>
<p>
<label>has_pages</label><br />
<input type="radio" name="has_pages" value="true" <?php if($this->info['has_pages']) echo 'checked="checked"';?> />True <input type="radio" name="has_pages" value="false" <?php if(!$this->info['has_pages']) echo 'checked="checked"';?> />False
</p>
<p>
<label>has_agreement</label><br />
<input type="radio" name="has_agreement" value="true" <?php if($this->info['has_agreement']) echo 'checked="checked"';?> />True <input type="radio" name="has_agreement" value="false" <?php if(!$this->info['has_agreement']) echo 'checked="checked"';?> />False
</p>
<p>
<input type="hidden" name="id" value="<?php echo $this->info['id'];?>" />
<input type="hidden" name="do" value="<?php if($this->info['uuid']!='') echo 'edit';else echo 'add';?>" />
<input type="hidden" name="submit" value="1" />
<input type="submit" value="提交" />
</p>
</form>
</div>

View File

@ -0,0 +1,64 @@
<?php
$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('<a href="/admin/data">数据管理</a>');
$this->breadcrumb('项目来源管理');
$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="ctrlplan">
<a href="/admin/data/source">项目来源管理</a>
<a href="/admin/data/source/do/add">添加项目来源</a>
</div>
<div class="search">
<form action="" method="get">
<input type="hidden" name="search" value='1' />
<input type="hidden" name="id" value='<?php echo $this->id;?>' />
<label>搜索关键字</label><input type="text" class="q" name="q" value="<?php echo $this->q; ?>" />
<input type="submit" class="btn" value="搜索" />
</form>
</div><!-- search DIV -->
<table class="stylized" width="700">
<thead>
<tr>
<td width='85%'>标题</td>
<td width='15%'>操作</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>
<a href="/admin/data/source/do/datasource/uuid/<?php echo $item['uuid'];?>">编辑数据来源</a><br />
<a href="/admin/data/source/do/delsource/id/<?php echo $item['id']?>/uuid/<?php echo $item['uuid'];?>" onclick="return confirm('是否确定删除该来源')">清除数据来源</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>

View File

@ -0,0 +1,91 @@
<?php
$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('<a href="/admin/data">数据管理</a>');
$this->breadcrumb('项目来源管理');
$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; ?>
为元数据《<?php echo $this->info['title'];?>》选择项目来源
<div class="search">
<form action="" method="get">
<input type="hidden" name="search" value='1' />
<input type="hidden" name="id" value='<?php echo $this->id;?>' />
<label>搜索关键字</label><input type="text" class="q" name="q" value="<?php echo $this->q; ?>" />
<input type="submit" class="btn" value="搜索" />
</form>
</div><!-- search DIV -->
<form method="post">
<table class="stylized" width="700">
<thead>
<tr>
<td width='10%'>选择</td>
<td width='30%'>标题</td>
<td width='30%'>Code字符</td>
<td width='30%'>操作</td>
</tr>
</thead>
<?php if (count($this->paginator)): ?>
<tbody id="list">
<?php foreach ($this->paginator as $item): ?>
<tr>
<td><input type="radio" name="sourceid" value="<?php echo $item['id'];?>" <?php if($item['id']==$this->info['sourceid']) echo 'checked="checked"'; ?> /></td>
<td><a href="/data/<?php echo $item['uuid'];?>"><?php echo $item['title']; ?></a></td>
<td><?php echo $item['code'];?></td>
<td><a href="/admin/data/source/do/edit/id/<?php echo $item['id']?>">查看编辑</a></td>
</tr>
<?php endforeach; ?>
</tbody>
<?php endif; ?>
</table>
<input type="hidden" name="uuid" value="<?php echo $this->uuid;?>" />
<input type="hidden" name="do" value="datasource" />
<input type="hidden" name="submit" value="1" />
<?php
if(!empty($this->info['id']))
{
echo "此元数据已经选择了项目来源:".$this->info['stitle']."[".$this->info['code']."],操作将更改此元数据现有的项目来源<br />";
}
?>
<input type="submit" value="提交" />
</form>
<?php
if(!empty($this->info['id']))
{
?>
<form method="post" action="/admin/data/source/">
<input type="hidden" name="uuid" value="<?php echo $this->uuid;?>" />
<input type="hidden" name="do" value="delsource" />
<input type="hidden" name="id" value="<?php echo $this->info['id'];?>" />
<input type="hidden" name="submit" value="1" />
<br /><button type="submit" class="btn btn-red" onclick="return confirm('是否确定删除该来源')">清除数据来源</button>
</form>
<?php
}
?>
<div class="pagenavi"><?= $this->paginator; ?></div>
</div>
<script>$("#list tr").mouseover(function(){$(this).addClass("high")}).mouseout(function(){$(this).removeClass("high")})</script>

View File

@ -29,6 +29,7 @@
<p><a href="/admin/data/sync/source/westdc">开始同步从WESTDC同步到GEONETWORK</a> </p> <p><a href="/admin/data/sync/source/westdc">开始同步从WESTDC同步到GEONETWORK</a> </p>
<p><a href="/admin/data/sync/list/water">列出WESTDC中多出的WATER元数据</a></p> <p><a href="/admin/data/sync/list/water">列出WESTDC中多出的WATER元数据</a></p>
<p><a href="/admin/data/sync/delete/westdc">删除WESTDC中多出的元数据</a></p> <p><a href="/admin/data/sync/delete/westdc">删除WESTDC中多出的元数据</a></p>
<p><a href="/admin/data/sync/delete/geonetwork">删除GEONETWORK中多出的元数据</a></p>
<p><a href="/admin/data/sync/delete/water">删除WESTDC中多出的WATER元数据</a></p> <p><a href="/admin/data/sync/delete/water">删除WESTDC中多出的WATER元数据</a></p>
<p><a href="/admin/data/sync/thumb/geonetwork">同步GEONETWORK中的缩略图</a></p> <p><a href="/admin/data/sync/thumb/geonetwork">同步GEONETWORK中的缩略图</a></p>
<p><a href="/admin/data/sync/thumb/water">同步WATER中的缩略图</a></p> <p><a href="/admin/data/sync/thumb/water">同步WATER中的缩略图</a></p>

View File

@ -1,6 +1,8 @@
<div id="divHeader">
<div id="divLogo"> <div id="divLogo">
<a href="/"><img src="/images/westdc-banner.jpg" alt="Westdc Logo" /></a> <a href="/"><img src="/images/westdc-banner.jpg" alt="Westdc Logo" /></a>
</div> </div>
<div class="nav">
<div id="divNavi"> <div id="divNavi">
<ul> <ul>
<!-- CSS Tabs --> <!-- CSS Tabs -->
@ -13,6 +15,7 @@
<li><a href="/admin/stat"><span>统计数据</span></a></li> <li><a href="/admin/stat"><span>统计数据</span></a></li>
<li><a href="/admin/sys"><span>系统管理</span></a></li> <li><a href="/admin/sys"><span>系统管理</span></a></li>
</ul> </ul>
</div>
<div id="userNavi"> <div id="userNavi">
<?php <?php
$auth = Zend_Auth::getInstance(); $auth = Zend_Auth::getInstance();
@ -24,3 +27,4 @@
?> ?>
</div> </div>
</div> </div>
</div>

View File

@ -57,6 +57,7 @@
<a href="/admin/review/comments/ac/list/uuid/<?php echo $item['uuid'];?>">查看评审意见</a> <a href="/admin/review/comments/ac/list/uuid/<?php echo $item['uuid'];?>">查看评审意见</a>
<a href='/admin/review/accept/cancel/<?php echo $item['id'];?>' onclick="return confirm('是否确定取消评审')">取消评审</a> <a href='/admin/review/accept/cancel/<?php echo $item['id'];?>' onclick="return confirm('是否确定取消评审')">取消评审</a>
<a href="/admin/review/post/id/<?php echo $item['id'];?>" style="color:#6C0">发布</a> <a href="/admin/review/post/id/<?php echo $item['id'];?>" style="color:#6C0">发布</a>
<a href="/admin/review/delete/id/<?php echo $item['id'];?>" style="color:#F00" onclick="return confirm('是否确定删除?该操作不可逆')">删除</a>
</td> </td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>

View File

@ -23,14 +23,18 @@
<table> <table>
<thead> <thead>
<tr> <tr>
<td width="200">关键词</td> <td width="150">关键词</td>
<td width="100">数据服务次数</td> <td width="80">数据通过数</td>
<td width="80">数据拒绝数</td>
</tr> </tr>
</thead> </thead>
<?php <?php
foreach($this->type as $k=>$v) foreach($this->type as $k=>$v)
{ {
echo '<tr><td>'.$v['keyword'].'</td><td>'.$v['num'].'</td></tr>'; if ($v['status']==5)
echo '<tr><td>'.$v['keyword'].'</td><td>'.$v['num'].'</td>';
elseif ($v['status']==-1)
echo '<td>'.$v['num'].'</td></tr>';
} }
?> ?>
</table> </table>

View File

@ -14,10 +14,10 @@ geonetwork.params.dbname = wdscar_geonetwork
watergeonetwork.url=http://210.77.68.237:8080/geonetwork/ watergeonetwork.url=http://210.77.68.237:8080/geonetwork/
waterdb.adapter = PDO_PGSQL waterdb.adapter = PDO_PGSQL
waterdb.params.host = 210.77.68.252 waterdb.params.host = 210.77.68.237
waterdb.params.username = wlz waterdb.params.username = postgres
waterdb.params.password = glacier waterdb.params.password = "test@))("
waterdb.params.dbname = new_geonetwork waterdb.params.dbname = geonetwork252
heihedb.adapter = PDO_PGSQL heihedb.adapter = PDO_PGSQL
heihedb.params.host = 210.77.68.252 heihedb.params.host = 210.77.68.252
heihedb.params.username = wlz heihedb.params.username = wlz
@ -27,6 +27,7 @@ heihedb.params.dbname = heihe
seekspace.url=http://seekspace.resip.ac.cn/ seekspace.url=http://seekspace.resip.ac.cn/
seekspace.handleurl=http://seekspace.resip.ac.cn/handle seekspace.handleurl=http://seekspace.resip.ac.cn/handle
google.maps.api=ABQIAAAACD-MqkkoOm60o_dvwdcKVhQZ6FKmpkjmtV0YgdpDmHkvWF4pMRRbrl4iUSDP3HkLNg5iOMge8vdOvg google.maps.api=ABQIAAAACD-MqkkoOm60o_dvwdcKVhQZ6FKmpkjmtV0YgdpDmHkvWF4pMRRbrl4iUSDP3HkLNg5iOMge8vdOvg
bigthumb.path=../geonetwork/data/
paths.base = /var/www/test.westgis.ac.cn paths.base = /var/www/test.westgis.ac.cn
paths.data = /var/www/test.westgis.ac.cn/data paths.data = /var/www/test.westgis.ac.cn/data

View File

@ -12,30 +12,28 @@ class DataController extends Zend_Controller_Action
} }
function indexAction() function indexAction()
{ {
$md = new MetadataTable();
$db=$md->getAdapter();
//序列 //序列
$state=$db->query('select s.id,name,count(*) from series s,dataseries d where d.sid=s.id group by s.id,s.name'); $state=$this->db->query('select s.id,name,count(*) from series s,dataseries d where d.sid=s.id group by s.id,s.name');
$this->view->serie=$state->fetchAll(); $this->view->serie=$state->fetchAll();
//分类 //分类
$state=$db->query('select c.code,name,name_zh,count(*) from category c,categorycode cc where c.code=cc.code group by c.code,cc.name,cc.name_zh'); $state=$this->db->query('select c.code,name,name_zh,count(*) from category c,categorycode cc where c.code=cc.code group by c.code,cc.name,cc.name_zh');
$this->view->category=$state->fetchAll(); $this->view->category=$state->fetchAll();
//关键词 //关键词
$state=$db->query("select keyword,count(*) from keyword where keytype='place' group by keyword order by count desc limit 20"); $state=$this->db->query("select keyword,count(*) from keyword where keytype='place' group by keyword order by count desc limit 20");
$k1=$state->fetchAll(); $k1=$state->fetchAll();
//$state=$db->query("select keyword,count(*) from keyword where keytype='theme' group by keyword order by count desc limit 20"); //$state=$db->query("select keyword,count(*) from keyword where keytype='theme' group by keyword order by count desc limit 20");
$state=$db->query("select k.keyword,count(k.keyword) from keyword k left join metadata m on k.id=m.id where k.keytype='theme' and (m.uuid in (select uuid from dataorder group by uuid order by count(uuid) desc limit 20)) group by k.keyword order by count(k.keyword) desc limit 20"); $state=$this->db->query("select k.keyword,count(k.keyword) from keyword k left join normalmetadata m on k.id=m.id where k.keytype='theme' and (m.uuid in (select uuid from dataorder group by uuid order by count(uuid) desc limit 20)) group by k.keyword order by count(k.keyword) desc limit 20");
$k2=$state->fetchAll(); $k2=$state->fetchAll();
$state=$db->query("select keyword,count(*) from keyword where keytype='discipline' group by keyword order by count desc limit 20"); $state=$this->db->query("select keyword,count(*) from keyword where keytype='discipline' group by keyword order by count desc limit 20");
$k3=$state->fetchAll(); $k3=$state->fetchAll();
$state=$db->query("select keyword,count(*) from keyword where keytype='stratum' group by keyword order by count desc limit 20"); $state=$this->db->query("select keyword,count(*) from keyword where keytype='stratum' group by keyword order by count desc limit 20");
$k4=$state->fetchAll(); $k4=$state->fetchAll();
//$state=$db->query("select keyword,count(*) from keyword where keytype='temporal' group by keyword order by count desc limit 20"); //$state=$db->query("select keyword,count(*) from keyword where keytype='temporal' group by keyword order by count desc limit 20");
$state=$db->query("select k.keyword,count(k.keyword) from keyword k left join metadata m on k.id=m.id where k.keytype='temporal' and (m.uuid in (select uuid from dataorder group by uuid order by count(uuid) desc limit 20)) group by k.keyword order by count(k.keyword) desc limit 20"); $state=$this->db->query("select k.keyword,count(k.keyword) from keyword k left join normalmetadata m on k.id=m.id where k.keytype='temporal' and (m.uuid in (select uuid from dataorder group by uuid order by count(uuid) desc limit 20)) group by k.keyword order by count(k.keyword) desc limit 20");
$k5=$state->fetchAll(); $k5=$state->fetchAll();
$this->view->keywords=array('place'=>$k1,'theme'=>$k2,'discipline'=>$k3,'stratum'=>$k4,'temporal'=>$k5); $this->view->keywords=array('place'=>$k1,'theme'=>$k2,'discipline'=>$k3,'stratum'=>$k4,'temporal'=>$k5);
//最新10个入库数据 //最新10个入库数据
$state=$db->query('select id,uuid,title from metadata order by id desc limit 10'); $state=$this->db->query('select id,uuid,title from normalmetadata order by id desc limit 10');
$this->view->metadata = $state->fetchAll(); $this->view->metadata = $state->fetchAll();
//特色数据 //特色数据
@ -78,34 +76,30 @@ class DataController extends Zend_Controller_Action
} }
function onlinelistAction() function onlinelistAction()
{ {
$md=new MetadataTable();
$db=$md->getAdapter();
$page=(int)$this->_request->getParam('page'); $page=(int)$this->_request->getParam('page');
if (empty($page)) $page=1; if (empty($page)) $page=1;
$limit=30; $limit=30;
$offset=$limit*($page-1); $offset=$limit*($page-1);
$state=$db->query('select count(*) from metadata where datatype=0'); $state=$this->db->query('select count(*) from normalmetadata where datatype=0');
$row=$state->fetchAll(); $row=$state->fetchAll();
$sum=$row[0]['count']; $sum=$row[0]['count'];
$select=$db->select(); $select=$this->db->select();
$select->from('metadata','*')->where('datatype=0')->order('title')->limitPage($page,$limit); $select->from('normalmetadata','*')->where('datatype=0')->order('title')->limitPage($page,$limit);
$this->view->metadata = $db->fetchAll($select); $this->view->metadata = $this->db->fetchAll($select);
$this->view->page=new Pagination($sum,$page,$limit); $this->view->page=new Pagination($sum,$page,$limit);
} }
function offlinelistAction() function offlinelistAction()
{ {
$md=new MetadataTable();
$db=$md->getAdapter();
$page=(int)$this->_request->getParam('page'); $page=(int)$this->_request->getParam('page');
if (empty($page)) $page=1; if (empty($page)) $page=1;
$limit=30; $limit=30;
$offset=$limit*($page-1); $offset=$limit*($page-1);
$state=$db->query('select count(*) from metadata where datatype=1'); $state=$this->db->query('select count(*) from normalmetadata where datatype=1');
$row=$state->fetchAll(); $row=$state->fetchAll();
$sum=$row[0]['count']; $sum=$row[0]['count'];
$select=$db->select(); $select=$this->db->select();
$select->from('metadata','*')->where('datatype=1')->order('title')->limitPage($page,$limit); $select->from('normalmetadata','*')->where('datatype=1')->order('title')->limitPage($page,$limit);
$this->view->metadata = $db->fetchAll($select); $this->view->metadata = $this->db->fetchAll($select);
$this->view->page=new Pagination($sum,$page,$limit); $this->view->page=new Pagination($sum,$page,$limit);
} }
//展示最近20条离线神情记录情况 //展示最近20条离线神情记录情况
@ -179,48 +173,44 @@ class DataController extends Zend_Controller_Action
*/ */
function browseAction() function browseAction()
{ {
$md=new MetadataTable();
$db=$md->getAdapter();
$page=(int)$this->_request->getParam('page'); $page=(int)$this->_request->getParam('page');
if (empty($page)) $page=1; if (empty($page)) $page=1;
$limit=10; $limit=10;
$offset=$limit*($page-1); $offset=$limit*($page-1);
$state=$db->query('select count(*) from metadata'); $state=$this->db->query('select count(*) from metadata');
$row=$state->fetchAll(); $row=$state->fetchAll();
$sum=$row[0]['count']; $sum=$row[0]['count'];
$select=$db->select(); $select=$this->db->select();
$select->from('metadata','*')->order('id desc')->limitPage($page,$limit); $select->from('metadata','*')->order('id desc')->limitPage($page,$limit);
$this->view->metadata = $db->fetchAll($select); $this->view->metadata = $this->db->fetchAll($select);
$this->view->page=new Pagination($sum,$page,$limit); $this->view->page=new Pagination($sum,$page,$limit);
} }
function tagAction() function tagAction()
{ {
$id = (int)$this->_request->getParam('id'); $id = (int)$this->_request->getParam('id');
$key = $this->_request->getParam('key'); $key = $this->_request->getParam('key');
$md=new KeywordTable();
$db=$md->getAdapter();
$page=(int)$this->_request->getParam('page'); $page=(int)$this->_request->getParam('page');
if (empty($page)) $page=1; if (empty($page)) $page=1;
$limit=10; $limit=10;
$offset=$limit*($page-1); $offset=$limit*($page-1);
$state=$db->query('select keyword,count(*),keytype from keyword group by keyword,keytype order by keytype,keyword,count desc'); $state=$this->db->query('select keyword,count(*),keytype from keyword group by keyword,keytype order by keytype,keyword,count desc');
$this->view->keywords=$state->fetchAll(); $this->view->keywords=$state->fetchAll();
if ($id>0 or !empty($key)) { if ($id>0 or !empty($key)) {
if (empty($key)) { if (empty($key)) {
$where=$db->quoteInto('id = ?',$id); $where=$this->db->quoteInto('id = ?',$id);
$row=$md->fetchRow($where); $row=$md->fetchRow($where);
$key=$row->name; $key=$row->name;
} }
$this->view->codename=$key; $this->view->codename=$key;
$sql=$db->quoteInto('select count(m.id) from metadata m,keyword k where m.id=k.id and k.keyword=?',$key); $sql=$this->db->quoteInto('select count(m.id) from normalmetadata m,keyword k where m.id=k.id and k.keyword=?',$key);
$state=$db->query($sql); $state=$this->db->query($sql);
$row=$state->fetchAll(); $row=$state->fetchAll();
$sum=$row[0]['count']; $sum=$row[0]['count'];
$select=$db->select(); $select=$this->db->select();
$select->from('metadata','*')->join('keyword','metadata.id=keyword.id')->where('keyword.keyword=?',$key)->order('metadata.title')->limitPage($page,$limit); $select->from('normalmetadata','*')->join('keyword','normalmetadata.id=keyword.id')->where('keyword.keyword=?',$key)->order('normalmetadata.title')->limitPage($page,$limit);
//$sql=$db->quoteInto('select m.* from metadata m,keyword k where m.id=k.id and k.keyword=?',$key); //$sql=$db->quoteInto('select m.* from metadata m,keyword k where m.id=k.id and k.keyword=?',$key);
//$state=$db->query($sql); //$state=$db->query($sql);
$this->view->metadata=$db->fetchAll($select); $this->view->metadata=$this->db->fetchAll($select);
$this->view->page=new Pagination($sum,$page,$limit); $this->view->page=new Pagination($sum,$page,$limit);
} }
} }
@ -237,51 +227,50 @@ class DataController extends Zend_Controller_Action
$id=''; $id='';
} }
$keyword=$this->_request->getParam('keyword'); $keyword=$this->_request->getParam('keyword');
$md=new SeriesTable();
$db=$md->getAdapter();
if (empty($id)) { if (empty($id)) {
if (!empty($name)) if (!empty($name))
{ {
$where=$db->quoteInto('name = ?',$name); $where=$this->db->quoteInto('name = ?',$name);
$row=$md->fetchRow($where); $row=$this->db->fetchRow("select * from series where ".$where);
} }
} else { } else {
$where=$db->quoteInto('id = ?',$id); $where=$this->db->quoteInto('id = ?',$id);
$row=$md->fetchRow($where); $row=$this->db->fetchRow("select * from series where ".$where);
} }
if (!empty($id) or !empty($name)) if (!empty($id) or !empty($name))
{ {
if (!$row) $this->_redirect('/data'); if (!$row) $this->_redirect('/data');
$id=$row->id; $id=$row['id'];
} }
$page=(int)$this->_request->getParam('page'); $page=(int)$this->_request->getParam('page');
if (empty($page)) $page=1; if (empty($page)) $page=1;
$limit=10; $limit=10;
$offset=$limit*($page-1); $offset=$limit*($page-1);
$state=$db->query('select s.id,name,count(*) from series s,dataseries d where d.sid=s.id group by s.id,s.name'); $state=$this->db->query('select s.id,name,count(*) from series s,dataseries d where d.sid=s.id group by s.id,s.name');
$this->view->serie=$state->fetchAll(); $this->view->serie=$state->fetchAll();
if ($id>0) { if ($id>0) {
$where=$db->quoteInto('id = ?',$id); //$where=$this->db->quoteInto('id = ?',$id);
$row=$md->fetchRow($where); //$row=$this->db->fetchRow("select * from series where ".$where);
$this->view->codename=$row->name; $this->view->codename=$row['name'];
if (!empty($keyword)) if (!empty($keyword))
{ {
$sql='select count(m.id) as count from metadata m,dataseries d,keyword k where m.id=d.id and m.id=k.id and d.sid=? and k.keyword=?'; $sql='select count(m.id) as count from normalmetadata m,dataseries d,keyword k where m.id=d.id and m.id=k.id and d.sid=? and k.keyword=?';
$row=$db->fetchAll($sql,array($id,$keyword)); $row=$this->db->fetchAll($sql,array($id,$keyword));
$this->view->codename.="【关键词:".$keyword."";
}else{ }else{
$sql='select count(m.id) as count from metadata m,dataseries d where m.id=d.id and d.sid=?'; $sql='select count(m.id) as count from normalmetadata m,dataseries d where m.id=d.id and d.sid=?';
$row=$db->fetchAll($sql,array($id)); $row=$this->db->fetchAll($sql,array($id));
} }
$sum=$row[0]['count']; $sum=$row[0]['count'];
$select=$db->select(); $select=$this->db->select();
$select->from('metadata','*')->join('dataseries','metadata.id=dataseries.id')->where('dataseries.sid=?',$id)->order('metadata.title')->limitPage($page,$limit); $select->from('normalmetadata','*')->join('dataseries','normalmetadata.id=dataseries.id')->where('dataseries.sid=?',$id)->order('normalmetadata.title')->limitPage($page,$limit);
if (!empty($keyword)) $select->join('keyword','keyword.id=metadata.id')->where('keyword.keyword=?',$keyword); if (!empty($keyword)) $select->join('keyword','keyword.id=normalmetadata.id')->where('keyword.keyword=?',$keyword);
$this->view->metadata=$db->fetchAll($select); $this->view->metadata=$this->db->fetchAll($select);
$this->view->page=new Pagination($sum,$page,$limit); $this->view->page=new Pagination($sum,$page,$limit);
$this->view->showtools=($sum>$page)?true:false; //$this->view->showtools=($sum>$page)?true:false;
$this->view->form=new SearchForm(); //$this->view->form=new SearchForm();
$sql=$db->quoteInto("select keyword,count(*) as count from (select t.keyword,t.id from keyword t left join dataseries d on t.id=d.id where t.keytype='place' and d.sid=?) as f group by keyword order by count desc limit 30",$id); $sql=$this->db->quoteInto("select keyword,count(*) as count from (select t.keyword,t.id from keyword t left join dataseries d on t.id=d.id where t.keytype='place' and d.sid=?) as f group by keyword order by count desc limit 30",$id);
$state=$db->query($sql); $state=$this->db->query($sql);
$row=$state->fetchAll(); $row=$state->fetchAll();
$this->view->places=$row; $this->view->places=$row;
$this->view->seriesid=$id; $this->view->seriesid=$id;
@ -296,25 +285,19 @@ class DataController extends Zend_Controller_Action
{ {
$page = $this->_request->getParam('page'); $page = $this->_request->getParam('page');
$code = (int)$this->_request->getParam('code'); $code = (int)$this->_request->getParam('code');
$md=new CategoryCodeTable(); $state=$this->db->query('select c.code,name,name_zh,count(*) from category c,categorycode cc where c.code=cc.code group by c.code,cc.name,cc.name_zh');
$db=$md->getAdapter();
$state=$db->query('select c.code,name,name_zh,count(*) from category c,categorycode cc where c.code=cc.code group by c.code,cc.name,cc.name_zh');
$this->view->category=$state->fetchAll(); $this->view->category=$state->fetchAll();
if ($code>0 && $code<20) { if ($code>0 && $code<20) {
$where=$db->quoteInto('code = ?',$code); $where=$this->db->quoteInto('code = ?',$code);
$row=$md->fetchRow($where); $row=$this->db->fetchRow("select * from categorycode where ".$where);
$this->view->codename=(empty($row->name_zh)?$row->name:$row->name_zh); $this->view->codename=(empty($row['name_zh'])?$row['name']:$row['name_zh']);
$sql='select m.* from metadata m,category c where m.id=c.id and c.code=? order by m.title'; $sql='select count(m.id) from normalmetadata m left join category c on m.id=c.id where c.code=?';
$state=$db->query($sql,array($code)); $row=$this->db->fetchRow($sql,array($code));
$rows = $state->fetchAll(); $sum=$row['count'];
$select=$this->db->select();
$paginator = Zend_Paginator::factory($rows); $select->from('normalmetadata as m','*')->joinLeft('category as c','m.id=c.id')->where('c.code=?',$code)->order('m.title')->limitPage($page,$this->limit);
$paginator->setCurrentPageNumber($page);//($this->_getParam('page')); $this->view->metadata=$this->db->fetchAll($select);
$paginator->setItemCountPerPage($this->view->config->page->max); $this->view->page=new Pagination($sum,$page,$this->limit);
$paginator->setView($this->view);
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
$this->view->paginator=$paginator;
} else { } else {
//提供全部分类列表 //提供全部分类列表
} }
@ -326,14 +309,14 @@ class DataController extends Zend_Controller_Action
function timelineAction() function timelineAction()
{ {
$fn="time1.xml"; $fn="time1.xml";
$rows=$this->db->fetchAll("select ts_created from metadata order by ts_created desc limit 1"); $rows=$this->db->fetchAll("select ts_created from normalmetadata order by ts_created desc limit 1");
$last_update=strtotime($rows[0]['ts_created']); $last_update=strtotime($rows[0]['ts_created']);
if (!file_exists($fn) || (filemtime($fn)<$last_update)) if (!file_exists($fn) || (filemtime($fn)<$last_update))
{ {
$dateformat="M j Y"; $dateformat="M j Y";
$md = new MetadataTable(); $md = new MetadataTable();
$db=$md->getAdapter(); $db=$md->getAdapter();
$state=$db->query('select id,uuid,description,title,timebegin,timeend from metadata where timebegin is not null order by timebegin'); $state=$db->query('select id,uuid,description,title,timebegin,timeend from normalmetadata where timebegin is not null order by timebegin');
$rows=$state->fetchAll(); $rows=$state->fetchAll();
$timexml='<data>'; $timexml='<data>';
foreach($rows as $row) { foreach($rows as $row) {
@ -372,7 +355,7 @@ class DataController extends Zend_Controller_Action
$id = (int)$this->_request->getParam('id'); $id = (int)$this->_request->getParam('id');
$where=''; $where='';
if (!empty($id)) { $where=' where id='.$id; } if (!empty($id)) { $where=' where id='.$id; }
$sql='select id,uuid,west,south,north,east,title from metadata'.$where; $sql='select id,uuid,west,south,north,east,title from normalmetadata'.$where;
$state=$db->query($sql); $state=$db->query($sql);
$rows=$state->fetchAll(); $rows=$state->fetchAll();
$geomd=new GeoMetaData(); $geomd=new GeoMetaData();
@ -396,7 +379,7 @@ class DataController extends Zend_Controller_Action
*/ */
function timemapAction() function timemapAction()
{ {
$sql='select id,uuid,west,south,north,east,title,timebegin,timeend from metadata where timebegin is not null'; $sql='select id,uuid,west,south,north,east,title,timebegin,timeend from normalmetadata where timebegin is not null';
$this->view->rows=$this->db->fetchAll($sql); $this->view->rows=$this->db->fetchAll($sql);
} }
/* /*
@ -445,7 +428,7 @@ class DataController extends Zend_Controller_Action
//'generator' => 'Zend Framework Zend_Feed', //'generator' => 'Zend Framework Zend_Feed',
'entries' => array() 'entries' => array()
); );
$sql="select * from metadata order by ts_created desc"; $sql="select * from normalmetadata order by ts_created desc";
$rs=$this->db->fetchAll($sql); $rs=$this->db->fetchAll($sql);
$feedArray['published']=strtotime($rs[0]['ts_created']); $feedArray['published']=strtotime($rs[0]['ts_created']);
foreach($rs as $r) foreach($rs as $r)
@ -483,9 +466,9 @@ class DataController extends Zend_Controller_Action
$offset=$this->limit*($page-1); $offset=$this->limit*($page-1);
$search=new Search($key); $search=new Search($key);
$where=$search->sql_expr(array("title","description")); $where=$search->sql_expr(array("title","description"));
$row=$this->db->fetchAll("select count(*) from metadata where ".$where); $row=$this->db->fetchAll("select count(*) from normalmetadata where ".$where);
$sum=$row[0]['count']; $sum=$row[0]['count'];
$sql="select uuid,title,id,description from metadata where ".$where." order by title limit ? offset ?"; $sql="select uuid,title,id,description from normalmetadata where ".$where." order by title limit ? offset ?";
$this->view->metadata=$this->db->fetchAll($sql,array($this->limit,$offset)); $this->view->metadata=$this->db->fetchAll($sql,array($this->limit,$offset));
$this->view->page=new Pagination($sum,$page,$this->limit); $this->view->page=new Pagination($sum,$page,$this->limit);
$this->view->key=$key; $this->view->key=$key;
@ -519,15 +502,15 @@ class DataController extends Zend_Controller_Action
$start=$this->_request->getParam('start'); $start=$this->_request->getParam('start');
$end=$this->_request->getParam('end'); $end=$this->_request->getParam('end');
if (!empty($key)) { if (!empty($key)) {
$sql='select count(*) from metadata where east<? and west>? and north<? and south>? and (title ilike ? or description ilike ?)'; $sql='select count(*) from normalmetadata where east<? and west>? and north<? and south>? and (title ilike ? or description ilike ?)';
$row=$db->fetchAll($sql,array($e,$w,$n,$s,'%'.$key.'%','%'.$key.'%')); $row=$db->fetchAll($sql,array($e,$w,$n,$s,'%'.$key.'%','%'.$key.'%'));
} else { } else {
$sql='select count(*) from metadata where east<? and west>? and north<? and south>?'; $sql='select count(*) from normalmetadata where east<? and west>? and north<? and south>?';
$row=$db->fetchAll($sql,array($e,$w,$n,$s)); $row=$db->fetchAll($sql,array($e,$w,$n,$s));
} }
$sum=$row[0]['count']; $sum=$row[0]['count'];
$select=$db->select(); $select=$db->select();
$select->from('metadata','*')->where('east<?',$e)->where('west>?',$w)->where('north<?',$n)->where('south>?',$s); $select->from('normalmetadata','*')->where('east<?',$e)->where('west>?',$w)->where('north<?',$n)->where('south>?',$s);
if (!empty($key)) $select->where('(title ilike ? or description ilike ?)','%'.$key.'%'); if (!empty($key)) $select->where('(title ilike ? or description ilike ?)','%'.$key.'%');
$select->order('title')->limit($limit,$offset); $select->order('title')->limit($limit,$offset);
$this->view->metadata = $db->fetchAll($select); $this->view->metadata = $db->fetchAll($select);
@ -541,18 +524,19 @@ class DataController extends Zend_Controller_Action
*/ */
function viewAction() function viewAction()
{ {
$md=new MetadataTable();
$db=$md->getAdapter();
$id = (int)$this->_request->getParam('id'); $id = (int)$this->_request->getParam('id');
$sql="select m.*,s.status,g.id as gid,t.filename from normalmetadata m left join mdstatus s on m.uuid=s.uuid
left join thumbnail t on t.id=m.id left join geonetworkmetadata g on m.uuid=g.uuid where ";
if (empty($id)) { if (empty($id)) {
$uuid = $this->_request->getParam('uuid'); $uuid = $this->_request->getParam('uuid');
if (empty($uuid)) $this->_redirect('/data'); if (empty($uuid)) $this->_redirect('/data');
$where=$db->quoteInto('uuid = ?',$uuid); $where=$this->db->quoteInto('m.uuid = ?',$uuid);
$row=$md->fetchRow($where);
} else { } else {
$where=$db->quoteInto('id = ?',$id); $where=$this->db->quoteInto('m.id = ?',$id);
$row=$md->fetchRow($where);
} }
$sql.=$where;
$this->db->setFetchMode(Zend_Db::FETCH_OBJ);
$row=$this->db->fetchRow($sql);
if (!$row) $this->_redirect('/data'); if (!$row) $this->_redirect('/data');
$id=$row->id; $id=$row->id;
$uuid=$row->uuid; $uuid=$row->uuid;
@ -562,47 +546,49 @@ class DataController extends Zend_Controller_Action
$this->view->metadata->description=$wiki->parseTable($this->view->escape($row->description)); $this->view->metadata->description=$wiki->parseTable($this->view->escape($row->description));
//处理外部链接 //处理外部链接
$this->view->metadata->description=preg_replace('/\[\s*(http:\/\/.+?)\s+(.*?)\]/m','<a href="$1">$2</a>',$this->view->metadata->description); $this->view->metadata->description=preg_replace('/\[\s*(http:\/\/.+?)\s+(.*?)\]/m','<a href="$1">$2</a>',$this->view->metadata->description);
$this->view->thumburl='/gndata/'.sprintf('%05d',floor(($row->gid+0.1)/100)*100).'-'.sprintf('%05d',ceil(($row->gid+0.1)/100)*100-1)."/".$row->gid;
$this->view->thumburl.='/public/'.str_replace('_s.','.',$row->filename);
if (is_numeric($row->projection)) if (is_numeric($row->projection))
{ {
$sql="select proj4text from spatial_ref_sys where auth_srid=?"; $sql="select proj4text from spatial_ref_sys where auth_srid=?";
$rs=$db->fetchRow($sql,array((int)$row->projection)); $rs=$this->db->fetchRow($sql,array((int)$row->projection));
if ($rs) $this->view->projection=$rs['proj4text']; if ($rs) $this->view->projection=$rs->proj4text;
} }
$this->view->keys=$this->db->fetchAll("select * from keyword where id=? order by keytype,ts_created",array($id)); $this->view->keys=$this->db->fetchAll("select * from keyword where id=? order by keytype,ts_created",array($id));
$sql='select c.code,cc.name,cc.name_zh from category c,categorycode cc where c.code=cc.code and c.id= ?'; $sql='select c.code,cc.name,cc.name_zh from category c,categorycode cc where c.code=cc.code and c.id= ?';
$state=$db->query($sql,array($id)); $state=$this->db->query($sql,array($id));
$this->view->category=$state->fetchAll(); $this->view->category=$state->fetchAll();
$sql='select s.name,s.id from dataseries d, series s where d.sid=s.id and d.id= ?'; $sql='select s.name,s.id from dataseries d, series s where d.sid=s.id and d.id= ?';
$state=$db->query($sql,array($id)); $state=$this->db->query($sql,array($id));
$this->view->series=$state->fetchAll(); $this->view->series=$state->fetchAll();
$sql=$db->quoteInto("select count(*) as count from dataorder where uuid=?",$uuid); $sql=$this->db->quoteInto("select count(*) as count from dataorder where uuid=?",$uuid);
$row=$db->fetchRow($sql); $row=$this->db->fetchRow($sql);
$this->view->downloaded=$row['count']; $this->view->downloaded=$row->count;
//update the viewed times //update the viewed times
$sql="update mdstat set viewed=viewed+1 where uuid=?"; $sql="update mdstat set viewed=viewed+1 where uuid=?";
$db->query($sql,array($uuid)); $this->db->query($sql,array($uuid));
$sql=$db->quoteInto("select viewed from mdstat where uuid=?",$uuid); $sql=$this->db->quoteInto("select viewed from mdstat where uuid=?",$uuid);
$row=$db->fetchRow($sql); $row=$this->db->fetchRow($sql);
$this->view->viewed=$row['viewed']; $this->view->viewed=$row->viewed;
//数据文档 //数据文档
$sql="select linkage from onlineresource where uuid=? and description='数据说明文档'"; $sql="select linkage from onlineresource where uuid=? and description='数据说明文档'";
$sql=$db->quoteInto($sql,$uuid); $sql=$this->db->quoteInto($sql,$uuid);
$row=$db->fetchRow($sql); $row=$this->db->fetchRow($sql);
if ($row) $this->view->doc=$row['linkage']; if ($row) $this->view->doc=$row->linkage;
//相关资源 //相关资源
$sql="select * from onlineresource where uuid=? and description<>'数据说明文档' and (linkage not like '%ftp.westgis%') and name<>'元数据地址'"; $sql="select * from onlineresource where uuid=? and description<>'数据说明文档' and (linkage not like '%ftp.westgis%') and name<>'元数据地址'";
$sql=$db->quoteInto($sql,$uuid); $sql=$this->db->quoteInto($sql,$uuid);
$this->view->resources=$db->fetchAll($sql); $this->view->resources=$this->db->fetchAll($sql);
//建议参考文献 //建议参考文献
$sql="select r.* from reference r left join mdref m on m.refid=r.id where m.uuid=?"; $sql="select r.* from reference r left join mdref m on m.refid=r.id where m.uuid=?";
$sql=$db->quoteInto($sql,$uuid); $sql=$this->db->quoteInto($sql,$uuid);
$this->view->ref=$db->fetchAll($sql); $this->view->ref=$this->db->fetchAll($sql);
//相关用户 //相关用户
$sql="select p.email,p.individual,p.organisation,r.role from role r left join responsible p on r.resid=p.id where r.uuid=? order by r.role,r.id"; $sql="select p.email,p.individual,p.organisation,r.role from role r left join responsible p on r.resid=p.id where r.uuid=? order by r.role,r.id";
$this->view->authors=$db->fetchAll($sql,array($uuid)); $this->view->authors=$this->db->fetchAll($sql,array($uuid));
//数据限制信息 //数据限制信息
$sql="select u.* from uselimit u left join mdlimit m on u.id=m.lid where m.uuid=?"; $sql="select u.* from uselimit u left join mdlimit m on u.id=m.lid where m.uuid=?";
$this->view->uselimits=$db->fetchAll($sql,array($uuid)); $this->view->uselimits=$this->db->fetchAll($sql,array($uuid));
//相关元数据,根据同名关键词实现 //相关元数据,根据同名关键词实现
//$sql="select distinct(md.uuid),md.title from keyword kw left join metadata md on kw.id=md.id where kw.keyword in (select k.keyword from keyword k left join metadata m on k.id=m.id where m.id=? and k.keytype='theme') and kw.id<>? limit 10"; //$sql="select distinct(md.uuid),md.title from keyword kw left join metadata md on kw.id=md.id where kw.keyword in (select k.keyword from keyword k left join metadata m on k.id=m.id where m.id=? and k.keytype='theme') and kw.id<>? limit 10";
$sql="select distinct(md.uuid),md.title from keyword kw left join metadata md on kw.id=md.id where kw.keyword in (select k.keyword from keyword k left join metadata m on k.id=m.id where m.id=?) and kw.id<>? limit 10"; $sql="select distinct(md.uuid),md.title from keyword kw left join metadata md on kw.id=md.id where kw.keyword in (select k.keyword from keyword k left join metadata m on k.id=m.id where m.id=?) and kw.id<>? limit 10";
@ -611,9 +597,9 @@ class DataController extends Zend_Controller_Action
$sql="select * from knl_article where "; $sql="select * from knl_article where ";
foreach($this->view->keys as $k) foreach($this->view->keys as $k)
{ {
if ($k["keytype"]=='theme') if ($k->keytype=='theme')
{ {
$sql.=" title like '%".$k["keyword"]."%' or "; $sql.=" title like '%".$k->keyword."%' or ";
} }
} }
$sql.=" 1<>1 limit 10"; $sql.=" 1<>1 limit 10";
@ -650,6 +636,18 @@ class DataController extends Zend_Controller_Action
$content=$stripper->filter($formdata['content']); $content=$stripper->filter($formdata['content']);
$author=$stripper->filter($formdata['author']); $author=$stripper->filter($formdata['author']);
$this->db->query($sql,array($formdata['uid'],$formdata['uuid'],$author,$formdata['email'],$formdata['url'],$ip,$content,$agent,$type)); $this->db->query($sql,array($formdata['uid'],$formdata['uuid'],$author,$formdata['email'],$formdata['url'],$ip,$content,$agent,$type));
$patt = array();
$patt['user'] = $author;
$patt['uuid'] = $formdata['uuid'];
$patt['title']= $this->view->metadata->title;
$patt['content']= $content;
$mailtp=new EmailText($this->db,"data-comment-note",$patt);
$mail=new WestdcMailer($this->view->config->smtp);
$mail->setBodyText($mailtp->getBody());
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
$mail->addTo($this->view->config->service->email);
$mail->setSubject($mailtp->getSubject());
$mail->send();
$formdata['content']=''; $formdata['content']='';
} }
} elseif ($user) { } elseif ($user) {
@ -673,16 +671,24 @@ class DataController extends Zend_Controller_Action
if (empty($uuid)) die(); if (empty($uuid)) die();
$sql="select * from comments where uuid=? order by id desc"; $sql="select * from comments where uuid=? order by id desc";
$comments=$this->db->fetchAll($sql,array($uuid)); $comments=$this->db->fetchAll($sql,array($uuid));
if ($comments)
$paginator = Zend_Paginator::factory($comments);
$paginator->setCurrentPageNumber($this->_getParam('page'));
$paginator->setItemCountPerPage(5);
$paginator->setView($this->view);
Zend_View_Helper_PaginationControl::setDefaultViewPartial('data/pagination_ajax.phtml');
if ($paginator)
{ {
foreach($comments as $c) foreach($paginator as $c)
{ {
//$author=$this->view->escape($c['author']); //$author=$this->view->escape($c['author']);
$author=$c['author']; $author=$c['author'];
$author=($c['userid'])?"<strong>".$author."</strong>":$author; $author=($c['userid'])?"<strong>".$author."</strong>":$author;
$author=($c['url'])?'<a href="'.$c['url'].'">'.$author.'</a>':$author; $author=($c['url'])?'<a href="'.$c['url'].'">'.$author.'</a>':$author;
print "<div class='comment-content'><span>".$author." 发表于".date('Y-m-d H:i:s',strtotime($c['ts_created']))."</span><p>".($c['content'])."</p></div>"; print "<div class='comment-content'><span class='title'>".$author." 发表于".date('Y-m-d H:i:s',strtotime($c['ts_created']))."</span><p>".($c['content'])."</p></div>";
} }
echo '<div class="paginator">'.$paginator.'</div>';
}//else echo "<li>No comments.</li>"; }//else echo "<li>No comments.</li>";
} }
@ -1199,19 +1205,18 @@ class DataController extends Zend_Controller_Action
{ {
$id = (int)$this->_request->getParam('id'); $id = (int)$this->_request->getParam('id');
if ($id>0) { if ($id>0) {
$md=new ThumbnailTable(); $thumb=$this->db->fetchRow($this->db->quoteInto('select * from thumbnail where id=?',$id));
$thumb=$md->fetchRow('id='.$id);
$this->_helper->layout->disableLayout(); $this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender(); $this->_helper->viewRenderer->setNoRender();
if (empty($thumb->data)) { if (empty($thumb['data'])) {
header("Content-Type:image/png"); header("Content-Type:image/png");
header("Content-Length: " . filesize("images/nothumb.png")); header("Content-Length: " . filesize("images/nothumb.png"));
$file=fopen("images/nothumb.png",'r'); $file=fopen("images/nothumb.png",'r');
fpassthru($file); fpassthru($file);
exit; exit;
} else { } else {
header("Content-Type:image/".$thumb->filetype); header("Content-Type:image/".$thumb['filetype']);
print base64_decode($thumb->data); print base64_decode($thumb['data']);
} }
} }
} }
@ -1354,7 +1359,7 @@ class DataController extends Zend_Controller_Action
{ {
$this->_helper->layout->disableLayout(); $this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender(); $this->_helper->viewRenderer->setNoRender();
$sql="select title,datatype,filesize,id from metadata"; $sql="select title,datatype,filesize,id from normalmetadata";
$md=$this->db->fetchAll($sql); $md=$this->db->fetchAll($sql);
foreach($md as $m) foreach($md as $m)
{ {
@ -1398,11 +1403,12 @@ class DataController extends Zend_Controller_Action
if (is_numeric($row['projection'])) if (is_numeric($row['projection']))
{ {
$sql="select proj4text from spatial_ref_sys where auth_srid=?"; $sql="select proj4text from spatial_ref_sys where auth_srid=?";
$rs=$this->db->fetchRow($sql,array((int)$row['projection'])); $rs=$this->db->fetchRow($sql,array($row['projection']));
if ($rs) $projection=$rs['proj4text']; if ($rs) $projection=$rs['proj4text'];
} }
if (empty($prjection)) $projection=$row['projection']; if (empty($projection)) $projection=$row['projection'];
} } else
$projection='';
$dom = new DOMDocument(); $dom = new DOMDocument();
$dom->loadXML($row['data']); $dom->loadXML($row['data']);
@ -1428,7 +1434,7 @@ class DataController extends Zend_Controller_Action
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">'; <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">';
$content.='<title>'.$row['title'].'</title>'; $content.='<title>'.$row['title'].'</title>';
$content.='<style> $content.='<style>
body{MARGIN-RIGHT: auto;MARGIN-LEFT: auto;font-size:14px;line-height:22px;} body{MARGIN-RIGHT: auto;MARGIN-LEFT: auto;font-size:14px;line-height:22px;font-family:宋体,Arial;}
span{font-size:14px;} span{font-size:14px;}
div{clear: both;margin: 0 auto;width:100%;vertical-align:baseline;} div{clear: both;margin: 0 auto;width:100%;vertical-align:baseline;}
#uuid{text-align: right;} #uuid{text-align: right;}

View File

@ -36,11 +36,15 @@ class HeiheController extends DataController
$page=(int)$this->_request->getParam('page'); $page=(int)$this->_request->getParam('page');
if (empty($page)) $page=1; if (empty($page)) $page=1;
$offset=$this->limit*($page-1); $offset=$this->limit*($page-1);
$state=$this->db->query("select count(*) from metadata where source='e3ad32dc-f573-11e0-aa7b-b768cfd88d80'"); $state=$this->db->query("select count(*) from normalmetadata where source='e3ad32dc-f573-11e0-aa7b-b768cfd88d80'");
$row=$state->fetchAll(); $row=$state->fetchAll();
$sum=$row[0]['count']; $sum=$row[0]['count'];
$select=$this->db->select(); $select=$this->db->select();
$select->from('metadata','*')->where("source=?",'e3ad32dc-f573-11e0-aa7b-b768cfd88d80')->order('title desc')->limitPage($page,$this->limit); $select->from('normalmetadata as m','m.*')
->joinLeft('geonetworkmetadata as g','g.uuid=m.uuid','g.id as gid')
->joinLeft('thumbnail as t','t.id=m.id','t.filename')
->where("m.source=?",'e3ad32dc-f573-11e0-aa7b-b768cfd88d80')
->order('m.title desc')->limitPage($page,$this->limit);
$this->view->metadata = $this->db->fetchAll($select); $this->view->metadata = $this->db->fetchAll($select);
$this->view->page=new Pagination($sum,$page,$this->limit); $this->view->page=new Pagination($sum,$page,$this->limit);
} }
@ -50,9 +54,9 @@ class HeiheController extends DataController
$page=(int)$this->_request->getParam('page'); $page=(int)$this->_request->getParam('page');
if (empty($page)) $page=1; if (empty($page)) $page=1;
$offset=$this->limit*($page-1); $offset=$this->limit*($page-1);
$row=$this->db->fetchAll("select count(*) from reference where id in (select refid from mdref where uuid in (select uuid from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d'))"); $row=$this->db->fetchAll("select count(*) from reference where id in (select refid from mdref where uuid in (select uuid from metadata where source='e3ad32dc-f573-11e0-aa7b-b768cfd88d80'))");
$sum=$row[0]['count']; $sum=$row[0]['count'];
$sql="select * from reference where id in (select refid from mdref where uuid in (select uuid from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d')) order by reference limit ? offset ?"; $sql="select * from reference where id in (select refid from mdref where uuid in (select uuid from metadata where source='e3ad32dc-f573-11e0-aa7b-b768cfd88d80')) order by reference limit ? offset ?";
$this->view->refs=$this->db->fetchAll($sql,array($this->limit,$offset)); $this->view->refs=$this->db->fetchAll($sql,array($this->limit,$offset));
$this->view->page=new Pagination($sum,$page,$this->limit,"文献"); $this->view->page=new Pagination($sum,$page,$this->limit,"文献");
$this->view->offset=$offset+1; $this->view->offset=$offset+1;

View File

@ -31,7 +31,7 @@ class IndexController extends Zend_Controller_Action
$sql="select * from datafeature order by id desc"; $sql="select * from datafeature order by id desc";
$this->view->feature=$this->db->fetchRow($sql); $this->view->feature=$this->db->fetchRow($sql);
//特色数据集 //特色数据集
$sql="select * from datasetcd order by id desc"; $sql="select * from datasetcd order by random()";
$this->view->datasetcd=$this->db->fetchRow($sql); $this->view->datasetcd=$this->db->fetchRow($sql);
//下载最多数据(top 5) //下载最多数据(top 5)
$sql="select uuid,title,id from metadata where id in (select m.id from metadata m left join dataorder d on m.uuid=d.uuid group by m.id order by count(d.uuid) desc limit 5)"; $sql="select uuid,title,id from metadata where id in (select m.id from metadata m left join dataorder d on m.uuid=d.uuid group by m.id order by count(d.uuid) desc limit 5)";

View File

@ -1,6 +1,7 @@
<?php <?php
class ReviewController extends Zend_Controller_Action class ReviewController extends Zend_Controller_Action
{ {
private $limit=10;
function preDispatch() function preDispatch()
{ {
$this->view->config = Zend_Registry::get('config'); $this->view->config = Zend_Registry::get('config');
@ -28,249 +29,81 @@ class ReviewController extends Zend_Controller_Action
} }
function myreviewAction(){ function myreviewAction(){
$keyword = $this->_request->getParam('q');
$search = $this->_request->getParam('search');
try{
$auth = Zend_Auth::getInstance(); $auth = Zend_Auth::getInstance();
if($auth->hasIdentity()) if($auth->hasIdentity())
{ {
$user = $auth->getIdentity(); $user = $auth->getIdentity();
$uid = $user->id; $uid = $user->id;
} }else{
else
{
$this->_redirect('/account/login/?href=/review/myreview'); $this->_redirect('/account/login/?href=/review/myreview');
} }
$page=@(int)$this->_request->getParam('page');
$wheresql = array(); if (empty($page)) $page=1;
$wheresql[]=" r.userid='$uid' "; $offset=$this->limit*($page-1);
$row=$this->db->fetchAll("select count(s.*) from mdstatus s left join normalmetadata m on s.uuid=m.uuid where m.uuid in (select uuid from mdexpertreview er where er.id=$uid union select uuid from mdreview r where r.userid=$uid)");
if(!empty($keyword) && !empty($search)) $sum=$row[0]['count'];
$sql="select m.uuid,m.title,m.id,m.description,s.status,s.ts_accepted,s.ts_finished,g.id as gid,t.filename from mdstatus s left join normalmetadata m on s.uuid=m.uuid left join geonetworkmetadata g on g.uuid=m.uuid left join thumbnail t on t.id=m.id where m.uuid in (select uuid from mdexpertreview er where er.id=$uid union select uuid from mdreview r where r.userid=$uid) order by s.ts_created desc,m.title limit ? offset ?";
$this->view->metadata=$this->db->fetchAll($sql,array($this->limit,$offset));
$this->view->page=new Pagination($sum,$page,$this->limit);
foreach($this->view->metadata as $k=>$v)
{ {
if (preg_match("/[<|>|#|$|%|^|*|(|)|{|}|'|\"|;|:]/i",$keyword) || !is_numeric($search)) $this->view->metadata[$k]['statustext']=$this->rewritestatus($v['status']);
{
$this->messenger->addMessage('您的输入的搜索条件包含非法请求,请不要输入特殊符号');
$this->_redirect('/review/myreview');
}//非法请求过滤
$this->view->keyword = $keyword;
$wheresql[] = " md.title like '%$keyword%' ";
// e.g. (... or md.author like '%keyword%')
} }
$wheresql = join(' and ',$wheresql);
$sql = "select r.id,md.title,r.uuid from mdreview r
left join metadata md on md.uuid=r.uuid
where $wheresql";
$rs = $this->db->query($sql);
$rows = $rs->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;
}catch(Exception $e){
$this->messenger->addMessage('查询失败,请稍后重试 :(');
$this->_redirect('/review/myreview');
}
}//我参审的 }//我参审的
function draftAction(){ function draftAction(){
$page=@(int)$this->_request->getParam('page');
$keyword = $this->_request->getParam('q'); if (empty($page)) $page=1;
$search = $this->_request->getParam('search'); $offset=$this->limit*($page-1);
$row=$this->db->fetchAll("select count(s.*) from mdstatus s left join metadata m on s.uuid=m.uuid where s.status in (0)");
try{ $sum=$row[0]['count'];
$sql="select m.uuid,m.title,m.id,m.description,s.status,s.ts_created,g.id as gid,t.filename from mdstatus s left join metadata m on s.uuid=m.uuid left join geonetworkmetadata g on g.uuid=m.uuid left join thumbnail t on t.id=m.id where s.status in (0) order by s.ts_created desc,m.title limit ? offset ?";
$wheresql = array(); $this->view->metadata=$this->db->fetchAll($sql,array($this->limit,$offset));
$wheresql[]=" ms.status=0 "; $this->view->page=new Pagination($sum,$page,$this->limit);
if(!empty($keyword) && !empty($search))
{
if (preg_match("/[<|>|#|$|%|^|*|(|)|{|}|'|\"|;|:]/i",$keyword) || !is_numeric($search))
{
$this->messenger->addMessage('您的输入的搜索条件包含非法请求,请不要输入特殊符号');
$this->_redirect('/review/draft');
}//非法请求过滤
$this->view->keyword = $keyword;
$wheresql[] = " md.title like '%$keyword%' ";
}
$wheresql = join(' and ',$wheresql);
$sql = "select ms.uuid,ms.status,ms.ts_created,md.title,md.author from mdstatus ms
left join metadata md on md.uuid=ms.uuid
where $wheresql";
$rs = $this->db->query($sql);
$rows = $rs->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;
}catch(Exception $e){
$this->messenger->addMessage('查询失败,请稍后重试 :(');
$this->_redirect('/review/draft');
}
}//最新收稿 }//最新收稿
function acceptAction(){ function acceptAction(){
$page=@(int)$this->_request->getParam('page');
$keyword = $this->_request->getParam('q'); if (empty($page)) $page=1;
$search = $this->_request->getParam('search'); $offset=$this->limit*($page-1);
$row=$this->db->fetchAll("select count(s.*) from mdstatus s left join normalmetadata m on s.uuid=m.uuid where s.status in (1)");
try{ $sum=$row[0]['count'];
$sql="select m.uuid,m.title,m.id,m.description,s.status,s.ts_accepted,g.id as gid,t.filename from mdstatus s left join normalmetadata m on s.uuid=m.uuid left join geonetworkmetadata g on g.uuid=m.uuid left join thumbnail t on t.id=m.id where s.status in (1) order by s.ts_created desc,m.title limit ? offset ?";
$wheresql = array(); $this->view->metadata=$this->db->fetchAll($sql,array($this->limit,$offset));
$wheresql[]=" ms.status=1 "; $this->view->page=new Pagination($sum,$page,$this->limit);
if(!empty($keyword) && !empty($search))
{
if (preg_match("/[<|>|#|$|%|^|*|(|)|{|}|'|\"|;|:]/i",$keyword) || !is_numeric($search))
{
$this->messenger->addMessage('您的输入的搜索条件包含非法请求,请不要输入特殊符号');
$this->_redirect('/review/draft');
}//非法请求过滤
$this->view->keyword = $keyword;
$wheresql[] = " md.title like '%$keyword%' ";
}
$wheresql = join(' and ',$wheresql);
$sql = "select ms.uuid,ms.status,ms.ts_created,md.title,md.author from mdstatus ms
left join metadata md on md.uuid=ms.uuid
where $wheresql";
$rs = $this->db->query($sql);
$rows = $rs->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;
}catch(Exception $e){
$this->messenger->addMessage('查询失败,请稍后重试 :(');
$this->_redirect('/review/draft');
}
}//最新收稿 }//最新收稿
function inreviewAction(){ function inreviewAction(){
$page=@(int)$this->_request->getParam('page');
$keyword = $this->_request->getParam('q'); if (empty($page)) $page=1;
$search = $this->_request->getParam('search'); $offset=$this->limit*($page-1);
$row=$this->db->fetchAll("select count(s.*) from mdstatus s left join normalmetadata m on s.uuid=m.uuid where s.status in (2,3,4)");
try{ $sum=$row[0]['count'];
$sql="select m.uuid,m.title,m.id,m.description,s.status,s.ts_accepted,g.id as gid,t.filename from mdstatus s left join normalmetadata m on s.uuid=m.uuid left join geonetworkmetadata g on g.uuid=m.uuid left join thumbnail t on t.id=m.id where s.status in (2,3,4) order by s.ts_created desc,m.title limit ? offset ?";
$wheresql = array(); $this->view->metadata=$this->db->fetchAll($sql,array($this->limit,$offset));
$wheresql[]=" ms.status in (2,3,4) "; $this->view->page=new Pagination($sum,$page,$this->limit);
if(!empty($keyword) && !empty($search))
{
if (preg_match("/[<|>|#|$|%|^|*|(|)|{|}|'|\"|;|:]/i",$keyword) || !is_numeric($search))
{
$this->messenger->addMessage('您的输入的搜索条件包含非法请求,请不要输入特殊符号');
$this->_redirect('/review/inreview');
}//非法请求过滤
$this->view->keyword = $keyword;
$wheresql[] = " md.title like '%$keyword%' ";
}
$wheresql = join(' and ',$wheresql);
$sql = "select ms.uuid,ms.status,ms.ts_created,md.title,md.author from mdstatus ms
left join metadata md on md.uuid=ms.uuid
where $wheresql";
$rs = $this->db->query($sql);
$rows = $rs->fetchAll();
foreach($rows as $k=>$v)
{
$rows[$k]['status']=$this->rewiterstatus($v['status']);
}
$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;
}catch(Exception $e){
$this->messenger->addMessage('查询失败,请稍后重试 :(');
$this->_redirect('/review/inreview');
}
}//在审阶段的元数据 }//在审阶段的元数据
function reviewedAction(){ function reviewedAction(){
$page=@(int)$this->_request->getParam('page');
$keyword = $this->_request->getParam('q'); if (empty($page)) $page=1;
$search = $this->_request->getParam('search'); $offset=$this->limit*($page-1);
$row=$this->db->fetchAll("select count(s.*) from mdstatus s left join normalmetadata m on s.uuid=m.uuid where s.status in (5)");
try{ $sum=$row[0]['count'];
$sql="select m.uuid,m.title,m.id,m.description,s.status,s.ts_finished,g.id as gid,t.filename from mdstatus s left join normalmetadata m on s.uuid=m.uuid left join geonetworkmetadata g on g.uuid=m.uuid left join thumbnail t on t.id=m.id where s.status in (5) order by s.ts_created desc,m.title limit ? offset ?";
$wheresql = array(); $this->view->metadata=$this->db->fetchAll($sql,array($this->limit,$offset));
$wheresql[]=" ms.status=5 "; $this->view->page=new Pagination($sum,$page,$this->limit);
if(!empty($keyword) && !empty($search))
{
if (preg_match("/[<|>|#|$|%|^|*|(|)|{|}|'|\"|;|:]/i",$keyword) || !is_numeric($search))
{
$this->messenger->addMessage('您的输入的搜索条件包含非法请求,请不要输入特殊符号');
$this->_redirect('/review/reviewed');
}//非法请求过滤
$this->view->keyword = $keyword;
$wheresql[] = " md.title like '%$keyword%' ";
}
$wheresql = join(' and ',$wheresql);
$sql = "select ms.uuid,ms.status,ms.ts_created,ts_finished,md.title,md.author from mdstatus ms
left join metadata md on md.uuid=ms.uuid
where $wheresql";
$rs = $this->db->query($sql);
$rows = $rs->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;
}catch(Exception $e){
$this->messenger->addMessage('查询失败,请稍后重试 :(');
$this->_redirect('/review/reviewed');
}
}//已完成评审的元数据 }//已完成评审的元数据
function rewiterstatus($status){ function rewritestatus($status){
if($status==-1) if($status==-1)
{return "取消评审";} {return "取消评审";}
else if($status==0) else if($status==0)
{return "初始状态";} {return "投稿元数据";}
else if($status==1) else if($status==1)
{return "受元数据评审";} {return "接收元数据";}
else if($status==2) else if($status==2)
{return "专家评审中";} {return "专家评审中";}
else if($status==3) else if($status==3)
@ -320,12 +153,12 @@ class ReviewController extends Zend_Controller_Action
$redirectlink='/review/review/uuid/'.$uuid.'/'; $redirectlink='/review/review/uuid/'.$uuid.'/';
if($md['status']==5) if($md['status']>5)
{ {
$this->messenger->addMessage('该数据已经通过评审,不能再发表评审意见,如需提交问题,请联系数据管理员'); $this->messenger->addMessage('该数据已经通过评审,不能再发表评审意见,如需提交问题,请联系数据管理员');
$this->_redirect($redirectlink); $this->_redirect($redirectlink);
} }
if($md['status']==0) if($md['status']<1)
{ {
$this->messenger->addMessage('已被数据中心接收的数据才可以进行评审'); $this->messenger->addMessage('已被数据中心接收的数据才可以进行评审');
$this->_redirect($redirectlink); $this->_redirect($redirectlink);
@ -484,5 +317,26 @@ class ReviewController extends Zend_Controller_Action
}//allreviewAction() }//allreviewAction()
function searchAction()
{
$key=$this->_request->getParam('q');
if (!empty($key)) {
$search=new Search($key);
$where=$search->sql_expr(array("m.title","m.description"));
$page=@(int)$this->_request->getParam('page');
if (empty($page)) $page=1;
$offset=$this->limit*($page-1);
$row=$this->db->fetchAll("select count(s.*) from mdstatus s left join normalmetadata m on s.uuid=m.uuid where s.status>0 and ".$where);
$sum=$row[0]['count'];
$sql="select m.uuid,m.title,m.id,m.description,s.status,g.id as gid,t.filename from mdstatus s left join normalmetadata m on s.uuid=m.uuid left join geonetworkmetadata g on g.uuid=m.uuid left join thumbnail t on t.id=m.id where s.status>0 and ".$where." order by s.ts_created desc,m.title limit ? offset ?";
$this->view->metadata=$this->db->fetchAll($sql,array($this->limit,$offset));
$this->view->page=new Pagination($sum,$page,$this->limit);
$this->view->key=$key;
foreach($this->view->metadata as $k=>$v)
{
$this->view->metadata[$k]['statustext']=$this->rewritestatus($v['status']);
}
}
}
} }

View File

@ -4,8 +4,6 @@ class ServiceController extends Zend_Controller_Action
private $limit=10; private $limit=10;
function __call($id, $arguments) function __call($id, $arguments)
{ {
Zend_Debug::dump($arguments,'argu');
Zend_Debug::dump($id,'id');
$this->_helper->viewRenderer->setNoRender(); $this->_helper->viewRenderer->setNoRender();
$this->_helper->layout->disableLayout(); $this->_helper->layout->disableLayout();
} }
@ -35,15 +33,24 @@ class ServiceController extends Zend_Controller_Action
*/ */
function thumbAction() function thumbAction()
{ {
$id = (int)$this->_request->getParam('id');
if (empty($id)) {
$uuid = $this->_request->getParam('uuid');
if (empty($uuid)) $this->_redirect('/data');
$where=$this->db->quoteInto('uuid = ?',$uuid);
} else {
$where=$this->db->quoteInto('id = ?',$id);
}
$sql="select * from thumbnail where ".$where;
$thumb=$this->db->fetchRow($sql);
$this->_helper->layout->disableLayout(); $this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender(); $this->_helper->viewRenderer->setNoRender();
$uuid = $this->_request->getParam('uuid'); if (empty($thumb['data'])) {
$thumb=$this->db->fetchRow("select t.data,t.filetype from thumbnail t left join metadata m on t.id=m.id where m.uuid=?",array($uuid));
if (empty($thumb)) {
header("Content-Type:image/png"); header("Content-Type:image/png");
header("Content-Length: " . filesize("images/nothumb.png")); header("Content-Length: " . filesize("images/nothumb.png"));
$file=fopen("images/nothumb.png",'r'); $file=fopen("images/nothumb.png",'r');
fpassthru($file); fpassthru($file);
exit;
} else { } else {
header("Content-Type:image/".$thumb['filetype']); header("Content-Type:image/".$thumb['filetype']);
print base64_decode($thumb['data']); print base64_decode($thumb['data']);
@ -51,7 +58,39 @@ class ServiceController extends Zend_Controller_Action
} }
/* /*
* 高级搜索, no page, json output * 查看数据缩略大图
*/
function bigthumbAction()
{
$id = (int)$this->_request->getParam('id');
if (empty($id)) {
$uuid = $this->_request->getParam('uuid');
if (empty($uuid)) $this->_redirect('/data');
$where=$this->db->quoteInto('m.uuid = ?',$uuid);
} else {
$where=$this->db->quoteInto('m.id = ?',$id);
}
$sql="select g.id as gid,t.filename,t.filetype from geonetworkmetadata g left join metadata m on g.uuid=m.uuid left join thumbnail t on t.id=m.id where ".$where;
$thumb=$this->db->fetchRow($sql);
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender();
if (empty($thumb['filename'])) {
header("Content-Type:image/png");
header("Content-Length: " . filesize("images/nothumb.png"));
$file=fopen("images/nothumb.png",'r');
fpassthru($file);
exit;
} else {
$url=$this->view->config->bigthumb->path.sprintf('%05d',floor(($thumb['gid']+0.1)/100)*100).'-'.sprintf('%05d',ceil(($thumb['gid']+0.1)/100)*100-1)."/".$thumb['gid'];
$url.='/public/'.str_replace('_s.','.',$thumb['filename']);
header("Content-Type:image/".$thumb['filetype']);
$file=fopen($url,'r');
fpassthru($file);
exit;
}
}
/*
* 搜索, no page, json output
*/ */
function searchAction() function searchAction()
{ {
@ -86,26 +125,6 @@ class ServiceController extends Zend_Controller_Action
} }
} }
/*
* 数据浏览
*/
function browseAction()
{
$md=new MetadataTable();
$db=$md->getAdapter();
$page=(int)$this->_request->getParam('page');
if (empty($page)) $page=1;
$limit=10;
$offset=$limit*($page-1);
$state=$db->query('select count(*) from metadata');
$row=$state->fetchAll();
$sum=$row[0]['count'];
$select=$db->select();
$select->from('metadata','*')->order('title')->limitPage($page,$limit);
$this->view->metadata = $db->fetchAll($select);
$this->view->page=new Pagination($sum,$page,$limit);
}
/* /*
* 产生geojson数据 * 产生geojson数据
@ -136,14 +155,6 @@ class ServiceController extends Zend_Controller_Action
} }
$this->_helper->json($geomd); $this->_helper->json($geomd);
} }
/*
* 时空动态浏览
*/
function timemapAction()
{
$sql='select id,uuid,west,south,north,east,title,timebegin,timeend from metadata where timebegin is not null';
$this->view->rows=$this->db->fetchAll($sql);
}
function detailAction() function detailAction()
{ {
@ -243,187 +254,5 @@ class ServiceController extends Zend_Controller_Action
} }
} }
/**
* parse the wiki syntax used to render tables, code modified from mediawiki
*
* @private
*/
function parseTable ( $text ) {
$lines = explode ( "\n" , $text );
$td_history = array (); // Is currently a td tag open?
$last_tag_history = array (); // Save history of last lag activated (td, th or caption)
$tr_history = array (); // Is currently a tr tag open?
$tr_attributes = array (); // history of tr attributes
$has_opened_tr = array(); // Did this table open a <tr> element?
$indent_level = 0; // indent level of the table
foreach ( $lines as $key => $line )
{
$line = trim ( $line );
if( $line == '' ) { // empty line, go to next line
continue;
}
$first_character = $line{0};
$matches = array();
if ( preg_match( '/^(:*)\{\|(.*)$/' , $line , $matches ) ) {
// First check if we are starting a new table
$indent_level = strlen( $matches[1] );
$lines[$key] = str_repeat( '<dl><dd>' , $indent_level ) . "<table{$attributes}>";
array_push ( $td_history , false );
array_push ( $last_tag_history , '' );
array_push ( $tr_history , false );
array_push ( $tr_attributes , '' );
array_push ( $has_opened_tr , false );
} else if ( count ( $td_history ) == 0 ) {
// Don't do any of the following
continue;
} else if ( substr ( $line , 0 , 2 ) == '|}' ) {
// We are ending a table
$line = '</table>' . substr ( $line , 2 );
$last_tag = array_pop ( $last_tag_history );
if ( !array_pop ( $has_opened_tr ) ) {
$line = "<tr><td></td></tr>{$line}";
}
if ( array_pop ( $tr_history ) ) {
$line = "</tr>{$line}";
}
if ( array_pop ( $td_history ) ) {
$line = "</{$last_tag}>{$line}";
}
array_pop ( $tr_attributes );
$lines[$key] = $line . str_repeat( '</dd></dl>' , $indent_level );
} else if ( substr ( $line , 0 , 2 ) == '|-' ) {
// Now we have a table row
$line = preg_replace( '#^\|-+#', '', $line );
$line = '';
$last_tag = array_pop ( $last_tag_history );
array_pop ( $has_opened_tr );
array_push ( $has_opened_tr , true );
if ( array_pop ( $tr_history ) ) {
$line = '</tr>';
}
if ( array_pop ( $td_history ) ) {
$line = "</{$last_tag}>{$line}";
}
$lines[$key] = $line;
array_push ( $tr_history , false );
array_push ( $td_history , false );
array_push ( $last_tag_history , '' );
}
else if ( $first_character == '|' || $first_character == '!' || substr ( $line , 0 , 2 ) == '|+' ) {
// This might be cell elements, td, th or captions
if ( substr ( $line , 0 , 2 ) == '|+' ) {
$first_character = '+';
$line = substr ( $line , 1 );
}
$line = substr ( $line , 1 );
if ( $first_character == '!' ) {
$line = str_replace ( '!!' , '||' , $line );
}
// Split up multiple cells on the same line.
// FIXME : This can result in improper nesting of tags processed
// by earlier parser steps, but should avoid splitting up eg
// attribute values containing literal "||".
$cells = explode( '||' , $line );
$lines[$key] = '';
// Loop through each table cell
foreach ( $cells as $cell )
{
$previous = '';
if ( $first_character != '+' )
{
$tr_after = array_pop ( $tr_attributes );
if ( !array_pop ( $tr_history ) ) {
$previous = "<tr{$tr_after}>\n";
}
array_push ( $tr_history , true );
array_push ( $tr_attributes , '' );
array_pop ( $has_opened_tr );
array_push ( $has_opened_tr , true );
}
$last_tag = array_pop ( $last_tag_history );
if ( array_pop ( $td_history ) ) {
$previous = "</{$last_tag}>{$previous}";
}
if ( $first_character == '|' ) {
$last_tag = 'td';
} else if ( $first_character == '!' ) {
$last_tag = 'th';
} else if ( $first_character == '+' ) {
$last_tag = 'caption';
} else {
$last_tag = '';
}
array_push ( $last_tag_history , $last_tag );
// A cell could contain both parameters and data
$cell_data = explode ( '|' , $cell , 2 );
// Bug 553: Note that a '|' inside an invalid link should not
// be mistaken as delimiting cell parameters
if ( strpos( $cell_data[0], '[[' ) !== false ) {
$cell = "{$previous}<{$last_tag}>{$cell}";
} else if ( count ( $cell_data ) == 1 )
$cell = "{$previous}<{$last_tag}>{$cell_data[0]}";
else {
$cell = "{$previous}<{$last_tag}>{$cell_data[1]}";
}
$lines[$key] .= $cell;
array_push ( $td_history , true );
}
}
}
// Closing open td, tr && table
while ( count ( $td_history ) > 0 )
{
if ( array_pop ( $td_history ) ) {
$lines[] = '</td>' ;
}
if ( array_pop ( $tr_history ) ) {
$lines[] = '</tr>' ;
}
if ( !array_pop ( $has_opened_tr ) ) {
$lines[] = "<tr><td></td></tr>" ;
}
$lines[] = '</table>' ;
}
$output = implode ( "\n" , $lines ) ;
//@todo:移除<table></table>中所有的换行符
//可能存在问题
$output=preg_replace('/([a-zA-Z])>\n/m','$1>',$output);
$output=preg_replace('/\n<\//m','</',$output);
// special case: don't return empty table
if( $output == "<table>\n<tr><td></td></tr>\n</table>" ) {
$output = '';
}
return $output;
}
} }

View File

@ -11,40 +11,37 @@ $this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/data">'.$this->config->title->data.'</a>'); $this->breadcrumb('<a href="/data">'.$this->config->title->data.'</a>');
$this->breadcrumb('高级搜索'); $this->breadcrumb('高级搜索');
$this->breadcrumb()->setSeparator(' > '); $this->breadcrumb()->setSeparator(' > ');
$this->headScript()->appendFile('http://maps.google.cn/maps?file=api&v=2&key='.$this->config->google->maps->api);
?> ?>
<div id='tools'> <div id='tools'>
<?= $this->partial('data/tools.phtml'); ?> <?= $this->partial('data/tools.phtml'); ?>
</div> </div>
<?php if (!empty($this->metadata)) : ?> <?php if (!empty($this->metadata)) :
<?php echo $this->page->getNavigation(); echo $this->page->getNavigation();?>
foreach($this->metadata as $md) : ?>
<hr /> <hr />
<?php
foreach($this->metadata as $md) : ?>
<div class="mditem"> <div class="mditem">
<div class="thumb"><img src="/data/thumb/id/<?php echo $md['id'];?>" /></div> <div class="thumb"><img src="/service/thumb/id/<?php echo $md['id'];?>" /></div>
<h2><a href="/data/<?php echo $md['uuid'];?>"><?php echo $this->escape($md['title']);?></a> <h2><a href="/data/<?php echo $md['uuid'];?>"><?php echo $this->escape($md['title']);?></a>
</h2> </h2>
<span><?php echo mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?></span> <span><?php echo mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?></span>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
<hr />
<?php echo $this->page->getNavigation();?> <?php echo $this->page->getNavigation();?>
<?php else: ?> <?php else: ?>
<!--westdc.westgis.ac.cn-->
<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAACD-MqkkoOm60o_dvwdcKVhRBSKpgcP88GYi6r2Of16IkMX_4YhSBQsywCi4J2_fh4nBuWmK7gyRjLg"></script>
<!--test.westgis.ac.cn
<script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAACD-MqkkoOm60o_dvwdcKVhThiRESR0xRCe9JKd36EL3glTk0OxTsRzifkUWmTTrYWaE7dY1lYUlGxA'></script>
-->
<script src="/js/dragzoom.js" type="text/javascript"></script> <script src="/js/dragzoom.js" type="text/javascript"></script>
<div id="map"></div> <div id="map"></div>
<div id="spatial"> <div id="spatial">
<form id="search" enctype="application/x-www-form-urlencoded" action="/data/advancesearch" method="post"> <form id="search" enctype="application/x-www-form-urlencoded" action="/data/advancesearch" method="post">
<!--<fieldset><legend>时间范围</legend><ul> <fieldset><legend>时间范围</legend><ul>
<li><span>开始时间:</span> <li><span>开始时间:</span>
<input name="start" type="text" id="start" /> <input name="start" type="text" id="start" />
</li> </li>
<li><span>结束时间:</span> <li><span>结束时间:</span>
<input name="end" type="text" id="end" />&nbsp; <input name="end" type="text" id="end" />&nbsp;
</li></ul></fieldset>--> </li></ul></fieldset>
<fieldset><legend>空间范围</legend><ul> <fieldset><legend>空间范围</legend><ul>
<li><span>东:</span>&nbsp; <li><span>东:</span>&nbsp;
@ -98,7 +95,7 @@ foreach($this->metadata as $md) : ?>
</script> </script>
<div id="help"> <div id="help">
<fieldset><legend>搜索说明</legend><ul><li>关键词:您可以使用一个关键词,比如"沙漠",也可以使用多个关键词,中间用空格分开。</li> <fieldset><legend>搜索说明</legend><ul><li>关键词:您可以使用一个关键词,比如“沙漠”,也可以使用多个关键词,中间用空格分开。</li>
<li>空间范围这是以度为单位的十进制数字。比如东经125度30分可以输入为125.5。您也可以通过下面的在线地图工具直接在图上拉框选择一个范围,空间坐标会自动转换到文本框中。</li> <li>空间范围这是以度为单位的十进制数字。比如东经125度30分可以输入为125.5。您也可以通过下面的在线地图工具直接在图上拉框选择一个范围,空间坐标会自动转换到文本框中。</li>
<li>时间范围指数据的时间范围从开始时间到结束时间若结束时间不填则是一个时间点。时间格式为YYYY-MM-DD。</li> <li>时间范围指数据的时间范围从开始时间到结束时间若结束时间不填则是一个时间点。时间格式为YYYY-MM-DD。</li>
<li>还不清楚?您可以到<a href="http://forum.westgis.ac.cn/viewforum.php?f=30">论坛</a>提问。</li> <li>还不清楚?您可以到<a href="http://forum.westgis.ac.cn/viewforum.php?f=30">论坛</a>提问。</li>

View File

@ -13,16 +13,13 @@ $this->breadcrumb()->setSeparator(' > ');
<?= $this->partial('data/tools.phtml'); ?> <?= $this->partial('data/tools.phtml'); ?>
</div> </div>
<?php echo $this->page->getNavigation(); ?> <?php echo $this->page->getNavigation(); ?>
<?php foreach($this->metadata as $md) : ?>
<hr /> <hr />
<?php foreach($this->metadata as $md) : ?>
<div class="mditem"> <div class="mditem">
<div class="thumb"><img src="/data/thumb/id/<?php echo $md['id'];?>" /></div> <div class="thumb"><img src="/service/thumb/id/<?php echo $md['id'];?>" /></div>
<h2><a href="/data/<?php echo $md['uuid'];?>"><?php echo $this->escape($md['title']);?></a> <h2><a href="/data/<?php echo $md['uuid'];?>"><?php echo $this->escape($md['title']);?></a>
<a href="/data/xml/id/<?php echo $md['id'];?>" title="XML模式查看"><img src="/images/xml.gif" /></a>
<a href="/data/map/id/<?php echo $md['id']; ?>" title="查看数据空间范围"><img src="/images/map.gif" /></a>
</h2> </h2>
<div class="summary"><?php echo str_replace(array("\r\n", "\n", "\r"),'<br />',mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']));?></div> <div class="summary"><?php echo str_replace(array("\r\n", "\n", "\r"),'<br />',mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']));?></div>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
<hr />
<?php echo $this->page->getNavigation(); ?> <?php echo $this->page->getNavigation(); ?>

View File

@ -23,29 +23,20 @@ $this->breadcrumb()->setSeparator(' > ');
<?php endforeach; ?> <?php endforeach; ?>
</ul></fieldset> </ul></fieldset>
</div> </div>
<?php if (!empty($this->metadata)) : ?>
<div id='metacontent'> <div id='metacontent'>
<h1>当前浏览:<?php echo $this->codename; ?></h1>
<?php echo $this->page->getNavigation(); ?>
<hr />
<?php foreach($this->metadata as $md) : ?>
<div class="mditem">
<div class="thumb"><img src="/service/thumb/id/<?php echo $md['id'];?>" /></div>
<h2><a href="/data/<?php echo $md['uuid']; ?>"><?php echo $this->escape($md['title']);?></a>
<?php if (count($this->paginator)): ?>
<?php
$i=0;
foreach ($this->paginator as $item):
$i++;
if (mb_strlen($item['description'])>700)
{
$item['description'] = mb_substr($item['description'],0,400,'UTF-8').'...';
}
if($i%2==0) $style="style='background:#fafafa;'";
else $style="";
echo '<div class="mditem" '.$style.'>
<div class="thumb"><img src="/data/thumb/id/'.$item['id'].'" /></div>
<h2><a href="/data/'.$item['uuid'].'">'.$this->escape($item['title']).'</a>
</h2> </h2>
<p>'.$item['description'].'</p> <span><?php echo mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?></span>
</div>';
endforeach;
?>
<?php endif; ?>
<?= $this->paginator; ?>
</div> </div>
<?php endforeach; ?>
<?php echo $this->page->getNavigation(); ?>
</div>
<?php endif; ?>

View File

@ -1,15 +0,0 @@
<?php if ($this->md) :?>
<p>Are you sure that you want to delete this metadata:
<h2><?php echo $this->escape($this->md->title); ?></h2>
<?php echo $this->escape($this->md->description); ?>
</p>
<form action="<?php echo $this->url(array('action'=>'delete')); ?>" method="post">
<div>
<input type="hidden" name="id" value="<?php echo $this->md->id; ?>" />
<input type="submit" name="del" value="Yes" />
<input type="submit" name="del" value="No" />
</div>
</form>
<?php else: ?>
<p>Cannot find the metadata.</p>
<?php endif;?>

View File

@ -11,7 +11,7 @@
?> ?>
<div id="download"> <div id="download">
<h1><?php echo $this->md['title']; ?>(<?php echo $this->md['filesize']; ?>MB)</h1> <h1><?php echo $this->md['title']; ?>(<?php echo $this->md['filesize']; ?>MB)</h1>
<div id="thumb"><img src="/data/thumb/id/<?php echo $this->md['id'];?>" /></div> <div id="thumb"><img src="/service/thumb/id/<?php echo $this->md['id'];?>" /></div>
<div id="ftpurl"> <div id="ftpurl">
<fieldset><legend>FTP下载地址</legend> <fieldset><legend>FTP下载地址</legend>
<ul> <ul>

View File

@ -11,8 +11,8 @@
$this->breadcrumb()->setSeparator(' > '); $this->breadcrumb()->setSeparator(' > ');
$this->headScript()->appendFile('/js/OpenLayers.js'); $this->headScript()->appendFile('/js/OpenLayers.js');
$this->headLink()->appendStylesheet('/js/theme/default/style.css'); $this->headLink()->appendStylesheet('/js/theme/default/style.css');
$this->headScript()->appendFile('http://maps.google.cn/maps?file=api&v=2&key='.$this->config->google->maps->api);
?> ?>
<script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAACD-MqkkoOm60o_dvwdcKVhRBSKpgcP88GYi6r2Of16IkMX_4YhSBQsywCi4J2_fh4nBuWmK7gyRjLg'></script>
<div id='tools'> <div id='tools'>
<?= $this->partial('data/tools.phtml'); ?> <?= $this->partial('data/tools.phtml'); ?>
</div> </div>
@ -56,7 +56,7 @@
popup = new OpenLayers.Popup.FramedCloud("chicken", popup = new OpenLayers.Popup.FramedCloud("chicken",
feature.geometry.getBounds().getCenterLonLat(), feature.geometry.getBounds().getCenterLonLat(),
null, null,
"<div style='font-size:.8em'><a href=/data/"+feature.attributes['uuid']+">"+ feature.attributes['title'] +"</a> | <a href=/data/map/id/"+feature.attributes['id']+"><img src=/images/map.gif></a><hr /><img src=/data/thumb/id/" + feature.attributes['id']+"/></div>", "<div style='font-size:.8em'><a href=/data/"+feature.attributes['uuid']+">"+ feature.attributes['title'] +"</a> | <a href=/data/map/id/"+feature.attributes['id']+"><img src=/images/map.gif></a><hr /><img src=/service/thumb/id/" + feature.attributes['id']+"/></div>",
null, false, onPopupClose); null, false, onPopupClose);
feature.popup = popup; feature.popup = popup;
map.addPopup(popup); map.addPopup(popup);

View File

@ -14,11 +14,12 @@ $this->breadcrumb()->setSeparator(' > ');
<?= $this->partial('data/tools.phtml'); ?> <?= $this->partial('data/tools.phtml'); ?>
</div> </div>
<?php echo $this->page->getNavigation(); ?> <?php echo $this->page->getNavigation(); ?>
<?php foreach($this->metadata as $md) : ?>
<hr /> <hr />
<?php foreach($this->metadata as $md) : ?>
<div class="mditem"> <div class="mditem">
<a href="/data/<?php echo $md['uuid'];?>"><?php echo $this->escape($md['title']);?></a> <a href="/data/<?php echo $md['uuid'];?>"><?php echo $this->escape($md['title']);?></a>
<a href="/data/xml/id/<?php echo $md['id'];?>"><img src="/images/xml.gif" /></a> <a href="/data/xml/id/<?php echo $md['id'];?>"><img src="/images/xml.gif" /></a>
<a href="/data/doc/uuid/<?php echo $md['uuid'];?>"><img src="/images/doc-icon.png" /></a>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
<hr /> <hr />

View File

@ -14,11 +14,12 @@ $this->breadcrumb()->setSeparator(' > ');
<?= $this->partial('data/tools.phtml'); ?> <?= $this->partial('data/tools.phtml'); ?>
</div> </div>
<?php echo $this->page->getNavigation(); ?> <?php echo $this->page->getNavigation(); ?>
<?php foreach($this->metadata as $md) : ?>
<hr /> <hr />
<?php foreach($this->metadata as $md) : ?>
<div class="mditem"> <div class="mditem">
<a href="/data/<?php echo $md['uuid'];?>"><?php echo $this->escape($md['title']);?></a> <a href="/data/<?php echo $md['uuid'];?>"><?php echo $this->escape($md['title']);?></a>
<a href="/data/xml/id/<?php echo $md['id'];?>"><img src="/images/xml.gif" /></a> <a href="/data/xml/id/<?php echo $md['id'];?>"><img src="/images/xml.gif" /></a>
<a href="/data/doc/uuid/<?php echo $md['uuid'];?>"><img src="/images/doc-icon.png" /></a>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
<hr /> <hr />

View File

@ -0,0 +1,26 @@
<?php if ($this->pageCount): ?>
<div class="paginationControl">
<!-- Previous page link -->
<?php if (isset($this->previous)): ?>
<a href="javascript:void(0);" onclick="ajaxpage(<?php echo $this->previous;?>)">&lt; Previous</a>
<?php else: ?>
<span class="disabled">&lt; Previous</span>
<?php endif; ?>
<!-- Numbered page links -->
<?php foreach ($this->pagesInRange as $page): ?>
<?php if ($page != $this->current): ?>
<a href="javascript:void(0);" onclick="ajaxpage(<?php echo $page;?>)"><?= $page; ?></a>
<?php else: ?>
<span class="current"><?= $page; ?></span>
<?php endif; ?>
<?php endforeach; ?>
<!-- Next page link -->
<?php if (isset($this->next)): ?>
<a href="javascript:void(0);" onclick="ajaxpage(<?php echo $this->next;?>)">Next &gt;</a>
<?php else: ?>
<span class="disabled">Next &gt;</span>
<?php endif; ?>
</div>
<?php endif; ?>

View File

@ -12,15 +12,15 @@ $this->breadcrumb('快速搜索');
$this->breadcrumb()->setSeparator(' > '); $this->breadcrumb()->setSeparator(' > ');
?> ?>
<div id='tools'> <div id='tools'>
<?= $this->partial('data/tools.phtml'); ?> <?= $this->partial('data/tools.phtml',array('key'=>$this->key)); ?>
</div> </div>
<?php echo $this->form; ?>
<?php if (!empty($this->metadata)) : ?> <?php if (!empty($this->metadata)) : ?>
<?php echo $this->page->getNavigation(); <?php echo $this->page->getNavigation();
foreach($this->metadata as $md) : ?> foreach($this->metadata as $md) : ?>
<hr /> <hr />
<div class="mditem"> <div class="mditem">
<div class="thumb"><img src="/data/thumb/id/<?php echo $md['id'];?>" /></div> <div class="thumb"><img src="/service/thumb/id/<?php echo $md['id'];?>" /></div>
<h2><a href="/data/<?php echo $md['uuid'];?>"><?php echo $this->escape($md['title']);?></a> <h2><a href="/data/<?php echo $md['uuid'];?>"><?php echo $this->escape($md['title']);?></a>
</h2> </h2>
<span><?php echo mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?></span> <span><?php echo mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?></span>

View File

@ -34,12 +34,11 @@ $this->breadcrumb()->setSeparator(' > ');
<?php if (!empty($this->metadata)) : ?> <?php if (!empty($this->metadata)) : ?>
<div id='metacontent'> <div id='metacontent'>
<h1>当前浏览数据集序列:<?php echo $this->codename; ?></h1> <h1>当前浏览数据集序列:<?php echo $this->codename; ?></h1>
<?php if ($this->showtools) echo $this->form; ?>
<?php echo $this->page->getNavigation(); ?> <?php echo $this->page->getNavigation(); ?>
<?php foreach($this->metadata as $md) : ?>
<hr /> <hr />
<?php foreach($this->metadata as $md) : ?>
<div class="mditem"> <div class="mditem">
<div class="thumb"><img src="/data/thumb/id/<?php echo $md['id'];?>" /></div> <div class="thumb"><img src="/service/thumb/id/<?php echo $md['id'];?>" /></div>
<h2><a href="/data/<?php echo $md['uuid']; ?>"><?php echo $this->escape($md['title']);?></a> <h2><a href="/data/<?php echo $md['uuid']; ?>"><?php echo $this->escape($md['title']);?></a>
</h2> </h2>
<span><?php echo mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?></span> <span><?php echo mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?></span>

View File

@ -17,16 +17,17 @@ $this->breadcrumb()->setSeparator(' > ');
<div id='metacontent'> <div id='metacontent'>
<h1>当前浏览:<?php echo $this->codename; ?></h1> <h1>当前浏览:<?php echo $this->codename; ?></h1>
<?php echo $this->page->getNavigation(); ?> <?php echo $this->page->getNavigation(); ?>
<?php foreach($this->metadata as $md) : ?>
<hr /> <hr />
<div class="thumb"><img src="/data/thumb/id/<?php echo $md['id'];?>" /></div> <?php foreach($this->metadata as $md) : ?>
<div class="mditem"> <div class="mditem">
<div class="thumb"><img src="/service/thumb/id/<?php echo $md['id'];?>" /></div>
<h2><a href="/data/<?php echo $md['uuid']; ?>"><?php echo $this->escape($md['title']);?></a> <h2><a href="/data/<?php echo $md['uuid']; ?>"><?php echo $this->escape($md['title']);?></a>
</h2> </h2>
<span><?php echo mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?></span> <span><?php echo mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?></span>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
<?php echo $this->page->getNavigation(); ?>
</div> </div>
<?php else : ?> <?php else : ?>
<div id='leftnav'> <div id='leftnav'>

View File

@ -1,7 +0,0 @@
<?php
if (empty($this->thumb->data)) {
} else {
header("Content-Type:image/jpeg");
print base64_decode($this->thumb->data);
}
?>

View File

@ -8,7 +8,7 @@ $this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/data">'.$this->config->title->data.'</a>'); $this->breadcrumb('<a href="/data">'.$this->config->title->data.'</a>');
$this->breadcrumb('<a href="/data/timeline">时空导航</a>'); $this->breadcrumb('<a href="/data/timeline">时空导航</a>');
$this->breadcrumb()->setSeparator(' > '); $this->breadcrumb()->setSeparator(' > ');
$this->headScript()->appendFile('http://maps.google.com/maps?file=api&v=2&key=ABQIAAAACD-MqkkoOm60o_dvwdcKVhRBSKpgcP88GYi6r2Of16IkMX_4YhSBQsywCi4J2_fh4nBuWmK7gyRjLg'); $this->headScript()->appendFile('http://maps.google.cn/maps?file=api&v=2&key='.$this->config->google->maps->api);
$this->headScript()->appendFile('/js/timeline_var.js'); $this->headScript()->appendFile('/js/timeline_var.js');
$this->headScript()->appendFile('/js/timeline_js/timeline-api.js'); $this->headScript()->appendFile('/js/timeline_js/timeline-api.js');
$this->headScript()->appendFile('/js/timemap/timemap.js'); $this->headScript()->appendFile('/js/timemap/timemap.js');
@ -59,7 +59,7 @@ window.onload=function() {
"title" : "<?php echo $row['title']; ?>", "title" : "<?php echo $row['title']; ?>",
"options" : { "options" : {
// set the full HTML for the info window // set the full HTML for the info window
"infoHtml": "<a href=/data/<?php echo $row['uuid']; ?>><?php echo $row['title']; ?></a><hr /><img src=/data/thumb/id/<?php echo $row['id']; ?> />" "infoHtml": "<a href=/data/<?php echo $row['uuid']; ?>><?php echo $row['title']; ?></a><hr /><img src=/service/thumb/id/<?php echo $row['id']; ?> />"
} }
}, },
<?php endforeach; ?> <?php endforeach; ?>

View File

@ -1,44 +0,0 @@
<script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAACD-MqkkoOm60o_dvwdcKVhThiRESR0xRCe9JKd36EL3glTk0OxTsRzifkUWmTTrYWaE7dY1lYUlGxA'></script>
<script type="text/javascript">
var map;
map = new OpenLayers.Map('map');
map.addControl(new OpenLayers.Control.LayerSwitcher());
var gphy = new OpenLayers.Layer.Google(
"Google Physical",
{type: G_PHYSICAL_MAP}
);
var gmap = new OpenLayers.Layer.Google(
"Google Streets" // the default
);
var ghyb = new OpenLayers.Layer.Google(
"Google Hybrid",
{type: G_HYBRID_MAP}
);
var gsat = new OpenLayers.Layer.Google(
"Google Satellite",
{type: G_SATELLITE_MAP}
);
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'} );
map.addLayers([ol_wms,gphy, gmap, ghyb, gsat]);
map.setCenter(new OpenLayers.LonLat(102, 36), 4);
var ajax=new OpenLayers.Ajax.Request('/metadata/json/id/<?php echo $md->id; ?>',{method:'get',onSuccess:featureresult});
function featureresult(response){
var feature1= eval('(' + response.responseText + ')');
//alert(feature1.type);
var geojson_format = new OpenLayers.Format.GeoJSON();
var vector_layer = new OpenLayers.Layer.Vector('metadata');
map.addLayer(vector_layer);
vector_layer.addFeatures(geojson_format.read(feature1));
//map.zoomToExtent(vector_layer.getExtent());
var sf = new OpenLayers.Control.SelectFeature(vector_layer);
map.addControl(sf);
sf.activate();
}
</script>

View File

@ -1,11 +1,28 @@
<ul> <ul>
<li><a href="/data/tag">数据集关键词浏览</a></li> <li><a href="/data/tag">关键词浏览</a></li>
<li><a href="/data/series">数据集序列浏览</a></li> <li><a href="/data/series">序列浏览</a></li>
<li><a href="/data/category">数据集分类浏览</a></li> <li><a href="/data/category">分类浏览</a></li>
<li><a href="/data/timeline">时间轴浏览</a></li> <li><a href="/data/timeline">时间轴浏览</a></li>
<li><a href="/data/map">空间浏览</a></li> <li><a href="/data/map">空间浏览</a></li>
<li><a href="/data/timemap">时空浏览</a></li> <li><a href="/data/timemap">时空浏览</a></li>
<li><a href="/data/browse">浏览所有元数据</a></li> <li><a href="/data/browse">全部浏览</a></li>
<li><a href="/data/search">快速搜索</a></li>
<li><a href="/data/advancesearch">高级搜索</a></li> <li><a href="/data/advancesearch">高级搜索</a></li>
<form id="search" enctype="application/x-www-form-urlencoded" action="/data/search" method="post">
<li>
<input type="text" name="q" id="q" value="<?php echo (empty($this->key))?'回车搜索标题和摘要':$this->key; ?>" onfocus="myfocus(this);" onblur="myblur(this);">
<input type="hidden" name="submit" value="submit">
</form>
<script>
function myfocus(element) {
if (element.value == '回车搜索标题和摘要') {
element.value = '';
}
}
function myblur(element) {
if (element.value == '') {
element.value = '回车搜索标题和摘要';
}
}
</script>
</li>
</ul> </ul>

View File

@ -8,10 +8,11 @@
$this->breadcrumb('<a href="/data">'.$this->config->title->data.'</a>'); $this->breadcrumb('<a href="/data">'.$this->config->title->data.'</a>');
$this->breadcrumb('Details'); $this->breadcrumb('Details');
$this->breadcrumb()->setSeparator(' > '); $this->breadcrumb()->setSeparator(' > ');
$this->headScript()->appendFile('http://maps.google.com/maps?file=api&v=2&key='.$this->config->google->maps->api); $this->headScript()->appendFile('http://maps.google.cn/maps?file=api&v=2&key='.$this->config->google->maps->api);
$this->headScript()->appendFile('/js/prototype.js'); $this->headScript()->appendFile('/js/prototype.js');
$this->headScript()->appendFile('/js/OpenLayers.js'); $this->headScript()->appendFile('/js/OpenLayers.js');
$this->headScript()->appendFile('/js/window.js'); $this->headScript()->appendFile('/js/window.js');
$this->headScript()->appendFile('/js/pubfunc.js');
$this->headLink()->appendStylesheet('/js/theme/default/style.css'); $this->headLink()->appendStylesheet('/js/theme/default/style.css');
?> ?>
<?php $md=$this->metadata;if ($md):?> <?php $md=$this->metadata;if ($md):?>
@ -22,7 +23,7 @@ if ($md->title_en) echo '<br />'.$this->escape($md->title_en);?>
<div id="ItemSummary"> <div id="ItemSummary">
<div id="category"> <div id="category">
<ul><?php foreach($this->category as $cat): ?> <ul><?php foreach($this->category as $cat): ?>
<li><a href="/data/category/code/<?php echo $cat['code'];?>"><?php echo $this->escape($cat['name_zh']);?></a></li> <li><a href="/data/category/code/<?php echo $cat->code;?>"><?php echo $this->escape($cat->name_zh);?></a></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
</div> </div>
@ -30,15 +31,15 @@ if ($md->title_en) echo '<br />'.$this->escape($md->title_en);?>
$kt=''; $kt='';
$i=0; $i=0;
foreach($this->keys as $cg) : foreach($this->keys as $cg) :
if ($kt==$cg['keytype']) : if ($kt==$cg->keytype) :
$i+=1; $i+=1;
else : else :
if (!empty($kt)) echo '</ul></div>'; if (!empty($kt)) echo '</ul></div>';
$kt=$cg['keytype']; $kt=$cg->keytype;
$i=0; $i=0;
endif; endif;
if ($i==0) echo '<div id="'.$cg['keytype'].'"><ul>'; if ($i==0) echo '<div id="'.$cg->keytype.'"><ul>';
echo '<li><a href="/data/tag/key/'.urlencode($cg['keyword']).'">'.$cg['keyword'].'</a></li>'; echo '<li><a href="/data/tag/key/'.urlencode($cg->keyword).'">'.$cg->keyword.'</a></li>';
endforeach; endforeach;
echo '</ul></div>'; echo '</ul></div>';
?> ?>
@ -47,7 +48,7 @@ echo '</ul></div>';
<?php if ($this->series): ?> <?php if ($this->series): ?>
<div id="series"> <div id="series">
<ul><?php foreach($this->series as $serie): ?> <ul><?php foreach($this->series as $serie): ?>
<li><a href="/data/series/id/<?php echo $serie['id']; ?>"> <?php echo $this->escape($serie['name']);?></a></li> <li><a href="/data/series/id/<?php echo $serie->id; ?>"> <?php echo $this->escape($serie->name);?></a></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
</div> </div>
@ -94,10 +95,13 @@ else
<li id="datatype">Distributed method: <?php if ($md->datatype) print "Offline"; else print "Online";?> <a href="#" id="show-list" rel="<?php echo $md->uuid;?>">Files list</a></li> <li id="datatype">Distributed method: <?php if ($md->datatype) print "Offline"; else print "Online";?> <a href="#" id="show-list" rel="<?php echo $md->uuid;?>">Files list</a></li>
</ul> </ul>
<div id="linkurl"> <div id="linkurl">
<?php if (!$md->datatype) : ?> <?php if ($md->status>0 and $md->status<5) : ?>
<a href="/review/review/uuid/<?php echo $md->uuid; ?>"><img src="/images/review.png" title="此数据正在评审中,我们邀请您对此数据进行评审,以便其能尽快发布!" /></a>
<?php else : if (!$md->datatype) : ?>
<a href="javascript:$('todownload').show();todownload(1);"><img src="/images/download.png" title="Download" /></a> <a href="javascript:$('todownload').show();todownload(1);"><img src="/images/download.png" title="Download" /></a>
<?php endif; ?> <?php endif; ?>
<a href="/data/order/uuid/<?php echo $md->uuid; ?>"><img src="/images/order.png" title="Order this data"/></a> <a href="/data/order/uuid/<?php echo $md->uuid; ?>"><img src="/images/order.png" title="Order this data"/></a>
<?php endif; ?>
</div> </div>
</div> </div>
@ -113,24 +117,24 @@ $party_zh=array('resourceProvider'=>'Resource Provider','custodian'=>'Custodian'
$r=''; $r='';
$i=0; $i=0;
foreach($this->authors as $k=>$author) : foreach($this->authors as $k=>$author) :
if ($author['role']!=$r) if ($author->role!=$r)
{ {
$r=$author['role']; $r=$author->role;
$i=0; $i=0;
if ($k>0) echo '</li>'; if ($k>0) echo '</li>';
echo '<li>'.$party_zh[$author['role']].': '; echo '<li>'.$party_zh[$author->role].'';
} }
if ($i>0) echo ', '; if ($i>0) echo ', ';
$i+=1; $i+=1;
if (!empty($author['email']) && $r!='principalInvestigator') if (!empty($author->email) && $r!='principalInvestigator')
echo '<a href="mailto:'.$author['email'].'">'; echo '<a href="mailto:'.$author->email.'">';
echo '<strong title="'.$author['organisation'].'">'; echo '<strong title="'.$author->organisation.'">';
if (!empty($author['individual'])) if (!empty($author->individual))
echo $author['individual']; echo $author->individual;
else else
echo $author['organisation']; echo $author->organisation;
echo '</strong>'; echo '</strong>';
if (!empty($author['email'])) echo '</a>'; if (!empty($author->email)) echo '</a>';
if ($k+1==count($this->authors)) echo '</li>'; if ($k+1==count($this->authors)) echo '</li>';
endforeach; endforeach;
?> ?>
@ -143,7 +147,7 @@ endforeach;
</div> </div>
<div id="left"> <div id="left">
<div id="ImageViewer"><img src="/data/thumb/id/<?php echo $md->id;?>" /> </div> <div id="ImageViewer"><img src="/service/thumb/id/<?php echo $md->id;?>" onclick="fnCreate('<?php echo $this->thumburl; ?>')" /> </div>
<div id="abstract"> <div id="abstract">
<p> <p>
<?php echo str_replace(array("\r\n", "\n", "\r"),'</p><p>',$md->description);?> <?php echo str_replace(array("\r\n", "\n", "\r"),'</p><p>',$md->description);?>
@ -161,10 +165,10 @@ endforeach;
<h2>References</h2> <h2>References</h2>
<ol> <ol>
<?php foreach($this->ref as $ref) : <?php foreach($this->ref as $ref) :
if (empty($ref['link'])) if (empty($ref->link))
echo '<li>'.$ref['reference'].'</li>'; echo '<li>'.$ref->reference.'</li>';
else else
echo '<li>'.$ref['reference'].' <a href="'.$ref['link'].'">下载</a></li>'; echo '<li>'.$ref->reference.' <a href="'.$ref->link.'">下载</a></li>';
endforeach; endforeach;
?> ?>
</ol> </ol>
@ -173,7 +177,7 @@ endforeach;
<?php <?php
if ($this->uselimits) : if ($this->uselimits) :
foreach($this->uselimits as $uselimit) : foreach($this->uselimits as $uselimit) :
echo '<p>'.str_replace(array("\r\n", "\n", "\r"),'</p><p>',$this->escape($uselimit['uselimit'])).'</p>'; echo '<p>'.str_replace(array("\r\n", "\n", "\r"),'</p><p>',$this->escape($uselimit->uselimit)).'</p>';
endforeach; endforeach;
?> ?>
<?php else : ?> <?php else : ?>
@ -189,14 +193,14 @@ endforeach;
<?php if ($this->resources) : ?> <?php if ($this->resources) : ?>
<h2>Online resources</h2> <h2>Online resources</h2>
<ul><?php foreach($this->resources as $link) : ?> <ul><?php foreach($this->resources as $link) : ?>
<li><a href="<?php echo $link['linkage']; ?>" title="<?php echo $link['description']; ?>"> <li><a href="<?php echo $link->linkage; ?>" title="<?php echo $link->description; ?>">
<?php <?php
if (!empty($link['name'])) if (!empty($link->name))
echo $link['name']; echo $link->name;
elseif (!empty($link['description'])) elseif (!empty($link->description))
echo $link['description']; echo $link->description;
else else
echo $link['linkage']; echo $link->linkage;
?></a></li> ?></a></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
@ -209,7 +213,7 @@ endforeach;
<h2>Related data</h2> <h2>Related data</h2>
<ul> <ul>
<?php foreach ($this->related as $r) : ?> <?php foreach ($this->related as $r) : ?>
<li><a href="/data/<?= $r['uuid']; ?>"><?= $r['title']; ?></a></li> <li><a href="/data/<?= $r->uuid; ?>"><?= $r->title; ?></a></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
</div> </div>
@ -219,14 +223,14 @@ endforeach;
<h2>Related literature</h2> <h2>Related literature</h2>
<ul> <ul>
<?php foreach ($this->literature as $r) : <?php foreach ($this->literature as $r) :
$u=parse_url($r['url']); $u=parse_url($r->url);
if ($u['host']=='hdl.handle.net') if ($u['host']=='hdl.handle.net')
$url=$this->config->seekspace->handleurl.$u['path']; $url=$this->config->seekspace->handleurl.$u['path'];
else else
$url=$r['url']; $url=$r->url;
echo '<li>'; echo '<li>';
if ($url) echo '<a href="'.$url.'" target="_blank">'; if ($url) echo '<a href="'.$url.'" target="_blank">';
echo $r['title']; echo $r->title;
if ($url) echo '</a>'; if ($url) echo '</a>';
echo '</li>'; echo '</li>';
?> ?>
@ -239,17 +243,22 @@ echo '</li>';
<h2>Related documents</h2> <h2>Related documents</h2>
<ul> <ul>
<?php foreach ($this->documents as $r) : ?> <?php foreach ($this->documents as $r) : ?>
<li><a href="/data/<?= $r['uuid']; ?>"><?= $r['title']; ?></a></li> <li><a href="/data/<?= $r->uuid; ?>"><?= $r->title; ?></a></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
</div> </div>
<?php endif; ?> <?php endif; ?>
<hr /> <hr />
<div id="comments"> <div id="comments">
<?php if ($md->status>0 and $md->status<5) : ?>
<p class="strong">此数据还在评审过程中,我们真切地邀请您参加此数据的评审,以便我们能尽快发布此数据!<a href="/review/review/uuid/<?php echo $md->uuid; ?>"><img src="/images/review.png" title="此数据正在评审中,我们邀请您对此数据进行评审,以便其能尽快发布!" /></a></p>
<?php else : ?>
<h2>Comments</h2> <h2>Comments</h2>
<div id="allcomments"> <div id="allcomments">
<div id="loading"><img src="/images/loading.gif" />评论加载中</div>
</div> </div>
<?php echo $this->commentForm; ?> <?php echo $this->commentForm; ?>
<?php endif; ?>
</div> </div>
</div> </div>
@ -265,7 +274,7 @@ echo '</li>';
</div> </div>
<div id="todownload" style="display:none;"> <div id="todownload" style="display:none;">
<div class="closeox"><a href="javascript:void(0);" onclick="$('todownload').hide()">[close]</a></div> <div class="closeox"><a href="javascript:void(0);" onclick="$('todownload').hide()">[close]</a></div>
<div id="returninfo"> <div id="returninfo" style="">
</div> </div>
</div> </div>
@ -289,7 +298,8 @@ function todownload(ft)
function loading(){$('loading').style.display = 'block';} function loading(){$('loading').style.display = 'block';}
function done(){$('loading').style.display = 'none';} function done(){$('loading').style.display = 'none';}
function reportError(request){alert('Sorry. There was an error.');} function reportError(request){alert('Sorry. There was an error.');}
var request_pars = ''; //请求参数 function ajaxpage(page){
var request_pars = 'page='+page; //请求参数
var myAjax = new Ajax.Updater('allcomments', '/data/comment/uuid/<?= $md->uuid; ?>',{ var myAjax = new Ajax.Updater('allcomments', '/data/comment/uuid/<?= $md->uuid; ?>',{
method : 'get', // http 请求方法,get or post method : 'get', // http 请求方法,get or post
parameters : request_pars, // 请求参数 parameters : request_pars, // 请求参数
@ -297,7 +307,8 @@ function reportError(request){alert('Sorry. There was an error.');}
onLoading : loading, // 加载时 onLoading : loading, // 加载时
onComplete : done // 读取完毕 onComplete : done // 读取完毕
}); });
}
ajaxpage(0);
//google map //google map
var map = new GMap2(document.getElementById("watermap")); var map = new GMap2(document.getElementById("watermap"));
var plotbounds=new GLatLngBounds(new GLatLng(<?= $md->south; ?>,<?= $md->west; ?>),new GLatLng(<?= $md->north; ?>,<?= $md->east; ?>)); var plotbounds=new GLatLngBounds(new GLatLng(<?= $md->south; ?>,<?= $md->west; ?>),new GLatLng(<?= $md->north; ?>,<?= $md->east; ?>));

View File

@ -1,15 +1,20 @@
<div id="divHeader">
<div id="divLogo"> <div id="divLogo">
<a href="/"><img src="/images/westdc-banner.jpg" alt="Westdc Logo" /></a> <a href="/"><img src="/images/westdc-banner.jpg" alt="Westdc Logo" /></a>
</div> </div>
<div class="nav">
<div id="divNavi"> <div id="divNavi">
<ul> <ul>
<!-- CSS Tabs --> <!-- CSS Tabs -->
<li><a href="/"><span>Home</span></a></li> <li><a href="/"><span>首页</span></a></li>
<li><a href="/data"><span>Data</span></a></li> <!-- <li><a href="/news"><span>新闻动态</span></a></li> -->
<li><a href="/review"><span>Metadata Review</span></a></li> <li><a href="/data"><span>数据产品与服务</span></a></li>
<li><a href="/news"><span>News & Events</span></a></li> <li><a href="/review"><span>元数据评审</span></a></li>
<li><a href="/about"><span>About</span></a></li> <li><a href="/knowledge"><span>知识积累平台</span></a></li>
<li><a href="/community"><span>合作与交流</span></a></li>
<li><a href="/about"><span>关于本站</span></a></li>
</ul> </ul>
</div>
<div id="userNavi"> <div id="userNavi">
<?php <?php
$auth = Zend_Auth::getInstance(); $auth = Zend_Auth::getInstance();
@ -17,11 +22,12 @@
{ {
$user = $auth->getIdentity(); $user = $auth->getIdentity();
echo '<a href="/account/edit">'.$user->username.'</a> '; echo '<a href="/account/edit">'.$user->username.'</a> ';
if ($user->usertype=="administrator") echo '<a href="/admin">Admin</a> '; if ($user->usertype=="administrator") echo '<a href="/admin">后台管理</a> ';
echo '<a href="/data/order">My Order</a> <a href="/account/logout">Logout</a>'; echo '<a href="/data/order">数据篮</a> <a href="/account/logout">注销</a>';
} else { } else {
echo '<a href="/account/login">Login</a> <a href="/account/register">Register</a>'; echo '<a href="/account/login">登录</a> <a href="/account/register">注册</a>';
} }
?> ?>
</div> </div>
</div> </div>
</div>

View File

@ -0,0 +1,52 @@
<?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/">数字黑河</a>');
$this->breadcrumb('试验文档');
$this->breadcrumb()->setSeparator(' > ');
?>
<div id='sidebar'>
<div id='leftnavi'>
<?= $this->partial('heihe/navi.phtml'); ?>
</div>
</div>
<div id='right'>
<div>&nbsp;</div>
<div id="intro">
<h3>黑河数据清单:</h3>
<ol>
<li>数据清单详版2011</li>
<li>数据清单简版2011</li>
</ol>
<h3>数字黑河总结文献:</h3>
<ol>
<li>李新, 程国栋, 吴立宗. 数字黑河的思考与实践1为流域科学服务的数字流域. 地球科学进展, 2010, 25(3): 297-305.
</li>
<li>李新, 吴立宗, 马明国, 盖迎春, 冉有华, 王亮绪, 南卓铜. 数字黑河的思考与实践2数据集成. 地球科学进展, 2010, 25(3): 306-316. </li>
<li>Li X, Nan ZT, Cheng GD, Ding YJ, Wu LZ, Wang LX, Wang J, Ran YH, Li HX, Pan XD, Zhu ZM. Toward an improved data stewardship and service for environmental and ecological science data in west China. International Journal of Digital Earth, 2011, 4(4): 347-359. DOI: 10.1080/17538947.2011.558123. </li>
</ol>
</div>
<hr />
<h3>数据相关文献</h3>
<?php if ($this->refs) : ?>
<?php echo $this->page->getNavigation(); ?>
<div id="mdlist">
<ol start="<?php echo $this->offset; ?>">
<?php foreach($this->refs as $md) : ?>
<li><?php echo $md['reference'];
if ($md['link'])
{
echo ' <a href="'.$md['link'].'">下载</a>';
}
?>
</li>
<?php endforeach; ?>
</ol>
</div>
<?php endif; ?>
</div>

View File

@ -22,6 +22,7 @@
</li> </li>
</ul> </ul>
<ul> <ul>
<li><a href="/heihe/document">黑河文档</a></li>
<li><a href="/heihe/doc">word版元数据</a></li> <li><a href="/heihe/doc">word版元数据</a></li>
<li><a href="/heihe/browse">整体浏览</a></li> <li><a href="/heihe/browse">整体浏览</a></li>
<li><a href="/heihe/category">ISO19115分类</a></li> <li><a href="/heihe/category">ISO19115分类</a></li>
@ -30,6 +31,8 @@
<li><a href="/heihe/timeline">时间轴导航</a></li> <li><a href="/heihe/timeline">时间轴导航</a></li>
<li><a href="/heihe/timemap">时空联合导航</a></li> <li><a href="/heihe/timemap">时空联合导航</a></li>
<li>WebGIS地图浏览</li> <li>WebGIS地图浏览</li>
<li>黑河计划数据汇交</li>
<li>数据使用协议</li>
</ul> </ul>
<form id="search" enctype="application/x-www-form-urlencoded" action="/heihe/search" method="post"> <form id="search" enctype="application/x-www-form-urlencoded" action="/heihe/search" method="post">
<input type="text" name="q" id="q" value="<?php echo (empty($this->key))?'回车搜索标题和摘要':$this->key; ?>" onfocus="myfocus(this);" onblur="myblur(this);"> <input type="text" name="q" id="q" value="<?php echo (empty($this->key))?'回车搜索标题和摘要':$this->key; ?>" onfocus="myfocus(this);" onblur="myblur(this);">
@ -37,13 +40,13 @@
</form> </form>
<script> <script>
function myfocus(element) { function myfocus(element) {
if (element.value == element.defaultValue) { if (element.value == '回车搜索标题和摘要') {
element.value = ''; element.value = '';
} }
} }
function myblur(element) { function myblur(element) {
if (element.value == '') { if (element.value == '') {
element.value = element.defaultValue; element.value = '回车搜索标题和摘要';
} }
} }
</script> </script>

View File

@ -16,6 +16,7 @@ $this->breadcrumb()->setSeparator(' > ');
</div> </div>
</div> </div>
<div id='right'> <div id='right'>
<div class="clear">&nbsp;</div>
<?php if (!empty($this->metadata)) : ?> <?php if (!empty($this->metadata)) : ?>
<div id='mdlist'> <div id='mdlist'>
<h1>关键词:<?php echo $this->codename; ?><a href="/heihe/tag/">全部关键词</a></h1> <h1>关键词:<?php echo $this->codename; ?><a href="/heihe/tag/">全部关键词</a></h1>

View File

@ -4,6 +4,7 @@
$this->headTitle('全部浏览'); $this->headTitle('全部浏览');
$this->headTitle()->setSeparator(' - '); $this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/water.css'); $this->headLink()->appendStylesheet('/css/water.css');
$this->headScript()->appendFile('/js/pubfunc.js');
$this->breadcrumb('<a href="/">首页</a>'); $this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/data">'.$this->config->title->data.'</a>'); $this->breadcrumb('<a href="/data">'.$this->config->title->data.'</a>');
$this->breadcrumb('<a href="/heihe">数字黑河</a>'); $this->breadcrumb('<a href="/heihe">数字黑河</a>');
@ -19,10 +20,19 @@ $this->breadcrumb()->setSeparator(' > ');
<?php echo $this->page->getNavigation(); ?> <?php echo $this->page->getNavigation(); ?>
<hr /> <hr />
<div id="mdlist"> <div id="mdlist">
<?php foreach($this->metadata as $md) : ?> <?php foreach($this->metadata as $md) :
$thumburl='/gndata/'.sprintf('%05d',floor(($md['gid']+0.1)/100)*100).'-'.sprintf('%05d',ceil(($md['gid']+0.1)/100)*100-1)."/".$md['gid'];
$thumburl.='/public/'.str_replace('_s.','.',$md['filename']);
?>
<div class="thumb"> <div class="thumb">
<a href="/heihe/view/uuid/<?php echo $md['uuid'];?>">
<img src="/data/thumb/id/<?php echo $md['id'];?>" alt="<?php echo $this->escape($md['title']);?>" title="<?php echo mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?>"/></a> <div class="thumbtitle">
<a href="/heihe/view/uuid/<?php echo $md['uuid'];?>"><?php echo $this->escape($md['title']); ?> </a>
</div>
<img src="/service/thumb/id/<?php echo $md['id'];?>" alt="<?php echo $this->escape($md['title']);?>" title="<?php echo mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?>"
onclick="fnCreate('<?php echo $thumburl; ?>')" />
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>

View File

@ -48,7 +48,7 @@ window.onload=function() {
"title" : "<?php echo htmlspecialchars(mb_substr($row['title'],11,mb_strlen($row['title'],'UTF-8')-10,'UTF-8')); ?>", "title" : "<?php echo htmlspecialchars(mb_substr($row['title'],11,mb_strlen($row['title'],'UTF-8')-10,'UTF-8')); ?>",
"options" : { "options" : {
// set the full HTML for the info window // set the full HTML for the info window
"infoHtml": "<div class='info'><a href=/heihe/view/uuid/<?php echo $row['uuid']; ?>><?php echo htmlspecialchars($row['title']); ?></a><hr /><img src=/data/thumb/id/<?php echo $row['id']; ?> /></div>", "infoHtml": "<div class='info'><a href=/heihe/view/uuid/<?php echo $row['uuid']; ?>><?php echo htmlspecialchars($row['title']); ?></a><hr /><img src=/service/thumb/id/<?php echo $row['id']; ?> /></div>",
"theme":"orange" "theme":"orange"
} }
}, },

View File

@ -10,13 +10,11 @@
$this->breadcrumb('<a href="/heihe/">数字黑河</a>'); $this->breadcrumb('<a href="/heihe/">数字黑河</a>');
$this->breadcrumb('查看元数据'); $this->breadcrumb('查看元数据');
$this->breadcrumb()->setSeparator(' > '); $this->breadcrumb()->setSeparator(' > ');
//http://westdc.westgis.ac.cn $this->headScript()->appendFile('http://maps.google.cn/maps?file=api&v=2&key='.$this->config->google->maps->api);
//$this->headScript()->appendFile('http://maps.google.com/maps?file=api&v=2&key=ABQIAAAACD-MqkkoOm60o_dvwdcKVhRBSKpgcP88GYi6r2Of16IkMX_4YhSBQsywCi4J2_fh4nBuWmK7gyRjLg');
//$this->headScript()->appendFile('http://maps.google.com/maps?file=api&v=2&key=ABQIAAAACD-MqkkoOm60o_dvwdcKVhThiRESR0xRCe9JKd36EL3glTk0OxTsRzifkUWmTTrYWaE7dY1lYUlGxA');
$this->headScript()->appendFile('/js/prototype.js'); $this->headScript()->appendFile('/js/prototype.js');
$this->headScript()->appendFile('/js/OpenLayers.js'); $this->headScript()->appendFile('/js/OpenLayers.js');
$this->headScript()->appendFile('/js/window.js'); $this->headScript()->appendFile('/js/window.js');
$this->headScript()->appendFile('/js/pubfunc.js');
$this->headLink()->appendStylesheet('/js/theme/default/style.css'); $this->headLink()->appendStylesheet('/js/theme/default/style.css');
?> ?>
<div id='sidebar'> <div id='sidebar'>
@ -34,7 +32,7 @@ if ($md->title_en) echo '<br />'.$this->escape($md->title_en);?>
<div id="ItemSummary"> <div id="ItemSummary">
<div id="category"> <div id="category">
<ul><?php foreach($this->category as $cat): ?> <ul><?php foreach($this->category as $cat): ?>
<li><a href="/heihe/category/code/<?php echo $cat['code'];?>"><?php echo $this->escape($cat['name_zh']);?></a></li> <li><a href="/heihe/category/code/<?php echo $cat->code;?>"><?php echo $this->escape($cat->name_zh);?></a></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
</div> </div>
@ -42,15 +40,15 @@ if ($md->title_en) echo '<br />'.$this->escape($md->title_en);?>
$kt=''; $kt='';
$i=0; $i=0;
foreach($this->keys as $cg) : foreach($this->keys as $cg) :
if ($kt==$cg['keytype']) : if ($kt==$cg->keytype) :
$i+=1; $i+=1;
else : else :
if (!empty($kt)) echo '</ul></div>'; if (!empty($kt)) echo '</ul></div>';
$kt=$cg['keytype']; $kt=$cg->keytype;
$i=0; $i=0;
endif; endif;
if ($i==0) echo '<div id="'.$cg['keytype'].'"><ul>'; if ($i==0) echo '<div id="'.$cg->keytype.'"><ul>';
echo '<li><a href="/heihe/tag/key/'.urlencode($cg['keyword']).'">'.$cg['keyword'].'</a></li>'; echo '<li><a href="/heihe/tag/key/'.urlencode($cg->keyword).'">'.$cg->keyword.'</a></li>';
endforeach; endforeach;
echo '</ul></div>'; echo '</ul></div>';
?> ?>
@ -59,7 +57,7 @@ echo '</ul></div>';
<?php if ($this->series): ?> <?php if ($this->series): ?>
<div id="series"> <div id="series">
<ul><?php foreach($this->series as $serie): ?> <ul><?php foreach($this->series as $serie): ?>
<li><a href="/data/series/id/<?php echo $serie['id']; ?>"> <?php echo $this->escape($serie['name']);?></a></li> <li><a href="/data/series/id/<?php echo $serie->id; ?>"> <?php echo $this->escape($serie->name);?></a></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
</div> </div>
@ -105,10 +103,13 @@ else
<li id="datatype">数据共享方式:<?php if ($md->datatype) print "离线"; else print "在线(可直接下载)";?> <a href="#" id="show-list" rel="<?php echo $md->uuid;?>">文件列表</a></li> <li id="datatype">数据共享方式:<?php if ($md->datatype) print "离线"; else print "在线(可直接下载)";?> <a href="#" id="show-list" rel="<?php echo $md->uuid;?>">文件列表</a></li>
</ul> </ul>
<div id="linkurl"> <div id="linkurl">
<?php if (!$md->datatype) : ?> <?php if ($md->status>0 and $md->status<5) : ?>
<a href="/review/review/uuid/<?php echo $md->uuid; ?>"><img src="/images/review.png" title="此数据正在评审中,我们邀请您对此数据进行评审,以便其能尽快发布!" /></a>
<?php else : if (!$md->datatype) : ?>
<a href="/heihe/download/uuid/<?php echo $md->uuid; ?>"><img src="/images/download.png" title="直接下载" /></a> <a href="/heihe/download/uuid/<?php echo $md->uuid; ?>"><img src="/images/download.png" title="直接下载" /></a>
<?php endif; ?> <?php endif; ?>
<a href="/heihe/order/uuid/<?php echo $md->uuid; ?>"><img src="/images/order.png" title="免费!离线申请此数据(在线数据和离线数据都可申请)"/></a> <a href="/heihe/order/uuid/<?php echo $md->uuid; ?>"><img src="/images/order.png" title="免费!离线申请此数据(在线数据和离线数据都可申请)"/></a>
<?php endif; ?>
</div> </div>
</div> </div>
@ -124,39 +125,41 @@ $party_zh=array('resourceProvider'=>'资源提供者','custodian'=>'维护者','
$r=''; $r='';
$i=0; $i=0;
foreach($this->authors as $k=>$author) : foreach($this->authors as $k=>$author) :
if ($author['role']!=$r) if ($author->role!=$r)
{ {
$r=$author['role']; $r=$author->role;
$i=0; $i=0;
if ($k>0) echo '</li>'; if ($k>0) echo '</li>';
echo '<li>'.$party_zh[$author['role']].''; echo '<li>'.$party_zh[$author->role].'';
} }
if ($i>0) echo ''; if ($i>0) echo '';
$i+=1; $i+=1;
if (!empty($author['email']) && $r!='principalInvestigator') if (!empty($author->email) && $r!='principalInvestigator')
echo '<a href="mailto:'.$author['email'].'">'; echo '<a href="mailto:'.$author->email.'">';
echo '<strong title="'.$author['organisation'].'">'; echo '<strong title="'.$author->organisation.'">';
if (!empty($author['individual'])) if (!empty($author->individual))
echo $author['individual']; echo $author->individual;
else else
echo $author['organisation']; echo $author->organisation;
echo '</strong>'; echo '</strong>';
if (!empty($author['email'])) echo '</a>'; if (!empty($author->email)) echo '</a>';
if ($k+1==count($this->authors)) echo '</li>'; if ($k+1==count($this->authors)) echo '</li>';
endforeach; endforeach;
?> ?>
</ul> </ul>
<hr /> <hr />
<ul> <ul>
<li>元数据更新时间:<?php print date('Y-m-d',strtotime($md->ts_created)); ?> <a href="/heihe/xml/uuid/<?php echo $md->uuid;?>"><img src="/images/xml.gif" alt="查看XML源文件"></a></li> <li>元数据更新时间:<?php print date('Y-m-d',strtotime($md->ts_created)); ?>
<!--<li><a href="/data/detail/id/<?php echo $md->id;?>">详细元数据</a></li>--> <a href="/heihe/xml/uuid/<?php echo $md->uuid;?>"><img src="/images/xml.gif" alt="查看XML源文件"></a>
<a href="/data/doc/uuid/<?php echo $md->uuid; ?>"><img src="/images/doc-icon.png" alt="Word doc格式"></a>
</li>
</ul> </ul>
</div> </div>
</div> </div>
<div id="left"> <div id="left">
<div id="ImageViewer"><img src="/data/thumb/id/<?php echo $md->id;?>" /> </div> <div id="ImageViewer"><img src="/service/thumb/id/<?php echo $md->id;?>" onclick="fnCreate('<?php echo $this->thumburl; ?>')" /> </div>
<div id="abstract"> <div id="abstract">
<p> <p>
<?php echo str_replace(array("\r\n", "\n", "\r"),'</p><p>',$md->description);?> <?php echo str_replace(array("\r\n", "\n", "\r"),'</p><p>',$md->description);?>
@ -173,10 +176,10 @@ endforeach;
<h2>建议参考文献</h2> <h2>建议参考文献</h2>
<ol> <ol>
<?php foreach($this->ref as $ref) : <?php foreach($this->ref as $ref) :
if (empty($ref['link'])) if (empty($ref->link))
echo '<li>'.$ref['reference'].'</li>'; echo '<li>'.$ref->reference.'</li>';
else else
echo '<li>'.$ref['reference'].' <a href="'.$ref['link'].'">下载</a></li>'; echo '<li>'.$ref->reference.' <a href="'.$ref->link.'">下载</a></li>';
endforeach; endforeach;
?> ?>
</ol> </ol>
@ -185,7 +188,7 @@ endforeach;
<?php <?php
if ($this->uselimits) : if ($this->uselimits) :
foreach($this->uselimits as $uselimit) : foreach($this->uselimits as $uselimit) :
echo '<p>'.str_replace(array("\r\n", "\n", "\r"),'</p><p>',$this->escape($uselimit['uselimit'])).'</p>'; echo '<p>'.str_replace(array("\r\n", "\n", "\r"),'</p><p>',$this->escape($uselimit->uselimit)).'</p>';
endforeach; endforeach;
?> ?>
<?php else : ?> <?php else : ?>
@ -201,14 +204,14 @@ endforeach;
<?php if ($this->resources) : ?> <?php if ($this->resources) : ?>
<h2>其他在线资源</h2> <h2>其他在线资源</h2>
<ul><?php foreach($this->resources as $link) : ?> <ul><?php foreach($this->resources as $link) : ?>
<li><a href="<?php echo $link['linkage']; ?>" title="<?php echo $this->escape($link['description']); ?>"> <li><a href="<?php echo $link->linkage; ?>" title="<?php echo $this->escape($link->description); ?>">
<?php <?php
if (!empty($link['name'])) if (!empty($link->name))
echo $this->escape($link['name']); echo $this->escape($link->name);
elseif (!empty($link['description'])) elseif (!empty($link->description))
echo $this->escape($link['description']); echo $this->escape($link->description);
else else
echo $link['linkage']; echo $link->linkage;
?></a></li> ?></a></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
@ -217,6 +220,9 @@ endforeach;
</div> </div>
<div id="comments"> <div id="comments">
<hr /> <hr />
<?php if ($md->status>0 and $md->status<5) : ?>
<p class="strong">此数据还在评审过程中,我们真切地邀请您参加此数据的评审,以便我们能尽快发布此数据!<a href="/review/review/uuid/<?php echo $md->uuid; ?>"><img src="/images/review.png" title="此数据正在评审中,我们邀请您对此数据进行评审,以便其能尽快发布!" /></a></p>
<?php else : ?>
<h2>数据评论</h2> <h2>数据评论</h2>
<div id="allcomments"> <div id="allcomments">
</div> </div>
@ -245,6 +251,7 @@ function reportError(request)
}); });
</script> </script>
<?php echo $this->commentForm; ?> <?php echo $this->commentForm; ?>
<?php endif; ?>
</div> </div>
<div id="window-outter" style="display:none;"> <div id="window-outter" style="display:none;">

View File

@ -1,6 +1,8 @@
<div id="divHeader">
<div id="divLogo"> <div id="divLogo">
<a href="/"><img src="/images/heihe-logo1.png" alt="Heihe Logo" /></a> <a href="/"><img src="/images/heihe-logo.png" alt="Westdc Logo" /></a>
</div> </div>
<div class="nav">
<div id="divNavi"> <div id="divNavi">
<ul> <ul>
<!-- CSS Tabs --> <!-- CSS Tabs -->
@ -12,6 +14,7 @@
<li><a href="/community"><span>合作与交流</span></a></li> <li><a href="/community"><span>合作与交流</span></a></li>
<li><a href="/about"><span>关于本站</span></a></li> <li><a href="/about"><span>关于本站</span></a></li>
</ul> </ul>
</div>
<div id="userNavi"> <div id="userNavi">
<?php <?php
$auth = Zend_Auth::getInstance(); $auth = Zend_Auth::getInstance();
@ -27,3 +30,4 @@
?> ?>
</div> </div>
</div> </div>
</div>

View File

@ -1,10 +1,11 @@
<?php <?php
$this->headTitle($this->config->title->site); $this->headTitle($this->config->title->site);
$this->headTitle('Home'); $this->headTitle('首页');
$this->headTitle()->setSeparator(' - '); $this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/index.css'); $this->headLink()->appendStylesheet('/css/index.css');
$auth = Zend_Auth::getInstance(); $auth = Zend_Auth::getInstance();
?> ?>
<div id="index">
<div id="leftPanel"> <div id="leftPanel">
<div class="title">Top Downloaded</div> <div class="title">Top Downloaded</div>
<ul> <ul>
@ -95,3 +96,4 @@
</div> </div>
</div> </div>
</div> </div>
</div>

View File

@ -1,57 +1,47 @@
<?php <?php
$config = Zend_Registry::get('config'); $this->headTitle($this->config->title->site);
$this->headTitle($config->title->site); $this->headTitle($this->config->title->review);
$this->headTitle($config->title->mdreview); $this->headTitle('接收元数据');
$this->headTitle()->setSeparator(' - '); $this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/mdreview.css'); $this->headLink()->appendStylesheet('/css/mdreview.css');
$this->breadcrumb('<a href="/">首页</a>'); $this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/review">元数据评审</a>'); $this->breadcrumb('<a href="/review">'.$this->config->title->review.'</a>');
$this->breadcrumb('接收元数据');
$this->breadcrumb()->setSeparator(' > '); $this->breadcrumb()->setSeparator(' > ');
$this->headScript()->appendFile('/js/pubfunc.js');
?> ?>
<div id='rightPanel'> <div id='sidebar'>
<div id='leftnavi'>
<?= $this->partial('review/navi.phtml'); ?>
</div>
</div>
<?php if (!empty($this->metadata)) : ?>
<div id='mdlist'>
<?php echo $this->page->getNavigation(); ?>
<hr />
<?php foreach($this->metadata as $md) :
$thumburl='/gndata/'.sprintf('%05d',floor(($md['gid']+0.1)/100)*100).'-'.sprintf('%05d',ceil(($md['gid']+0.1)/100)*100-1)."/".$md['gid'];
$thumburl.='/public/'.str_replace('_s.','.',$md['filename']);
?>
<div class="thumbmd">
<div class="thumbtitle">
<a href="/data/<?php echo $md['uuid'];?>"><?php echo $this->escape($md['title']); ?> </a>【接收时间:<?php echo date('Y-m-d',strtotime($md['ts_accepted'])); ?>
<?php if ($md['status']!=5) : ?>
<a href="/review/review/uuid/<?php echo $md['uuid'];?>"><img src="/images/review.png" alt="查看评审页" title="进行数据评审"></a>
<?php endif; ?>
</div>
<?php if ($this->msg or $this->messages) :?> <img class="thumbimg" src="/service/thumb/id/<?php echo $md['id'];?>" alt="<?php echo $this->escape($md['title']);?>" title="<?php echo mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?>"
<div class="box box-info"> onclick="fnCreate('<?php echo $thumburl; ?>')" />
<?php if ($this->msg) : ?>
<?php echo $this->msg; ?> </div>
<?php endif; if ($this->messages): foreach($this->messages as $msg): ?> <?php endforeach; ?>
<?php echo $msg; ?> </div>
<?php endforeach;endif; ?> <hr class="clear"/>
<script language="javascript"> <?php echo $this->page->getNavigation();
setTimeout("document.getElementsByClassName('box-info').remove(0)",5000); else :
</script> ?>
<div>
<p>当前没有对应元数据。</p>
</div> </div>
<?php endif; ?> <?php endif; ?>
<h3>最新收稿的元数据:</h3>
<form action="/review/draft" method="POST">
<input class="q" type="text" id="q" name="q" value="<?php echo $this->keyword;?>" />
<input type="hidden" name="search" value="1" />
<input type="submit" class="btn" value="搜索" /></form>
<table class="stylized">
<thead>
<tr>
<th>元数据标题</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<?php
if (count($this->paginator)):
$autoindex=0;
foreach ($this->paginator as $item):
$autoindex++;?>
<tr class="<?php if($autoindex%2 == 0) echo 'even'; else echo 'odd'; ?>">
<td> <img src="/images/westdc_20w.gif" /> <a href="<?php echo $item['uuid'];?>"><?php echo $item['title'];?></a></td>
<td>
<a href="/review/review/uuid/<?php echo $item['uuid'];?>">评审</a> <a href="/data/<?php echo $item['uuid'];?>">查看</a>
</td>
</tr>
<?php endforeach; endif; ?>
</tbody>
</table>
<div class="pagenavi"><?= $this->paginator; ?></div>
</div>

View File

@ -1,25 +0,0 @@
<?php
$this->headTitle($this->config->title->site);
$this->headTitle($this->config->title->metadata);
$this->headTitle('全部浏览');
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/metadata.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/review">元数据评审</a>');
$this->breadcrumb('浏览');
$this->breadcrumb()->setSeparator(' > ');
?>
<?php echo $this->page->getNavigation(); ?>
<?php foreach($this->metadata as $md) : ?>
<hr />
<div class="mditem">
<div class="thumb"><img src="/metadata/thumb/id/<?php echo $md['id'];?>" /></div>
<h2><a href="/metadata/view/id/<?php echo $md['id'];?>"><?php echo $this->escape($md['title']);?></a>
<a href="/metadata/xml/id/<?php echo $md['id'];?>"><img src="/images/xml.gif" /></a>
<a href="/metadata/convert/format/iso19139/id/<?php echo $md['id'];?>"><img src="/images/iso19139.gif" /></a>
<a href="/metadata/convert/format/fgdc/id/<?php echo $md['id'];?>"><img src="/images/fgdc.gif" /></a>
<a href="/metadata/map/id/<?php echo $md['id']; ?>"><img src="/images/map.gif" /></a>
</h2>
<div class="summary"><?php echo str_replace(array("\r\n", "\n", "\r"),'<br />',mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']));?></div>
</div>
<?php endforeach; ?>

View File

@ -1,57 +1,44 @@
<?php <?php
$config = Zend_Registry::get('config'); $this->headTitle($this->config->title->site);
$this->headTitle($config->title->site); $this->headTitle($this->config->title->review);
$this->headTitle($config->title->mdreview); $this->headTitle('投稿元数据');
$this->headTitle()->setSeparator(' - '); $this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/mdreview.css'); $this->headLink()->appendStylesheet('/css/mdreview.css');
$this->breadcrumb('<a href="/">首页</a>'); $this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/review">元数据评审</a>'); $this->breadcrumb('<a href="/review">'.$this->config->title->review.'</a>');
$this->breadcrumb('投稿元数据');
$this->breadcrumb()->setSeparator(' > '); $this->breadcrumb()->setSeparator(' > ');
$this->headScript()->appendFile('/js/pubfunc.js');
?> ?>
<div id='rightPanel'> <div id='sidebar'>
<div id='leftnavi'>
<?= $this->partial('review/navi.phtml'); ?>
</div>
</div>
<?php if (!empty($this->metadata)) : ?>
<div id='mdlist'>
<?php echo $this->page->getNavigation(); ?>
<hr />
<?php foreach($this->metadata as $md) :
$thumburl='/gndata/'.sprintf('%05d',floor(($md['gid']+0.1)/100)*100).'-'.sprintf('%05d',ceil(($md['gid']+0.1)/100)*100-1)."/".$md['gid'];
$thumburl.='/public/'.str_replace('_s.','.',$md['filename']);
?>
<div class="thumbmd">
<div class="thumbtitle">
<?php echo $this->escape($md['title']); ?>【投稿时间:<?php echo date('Y-m-d',strtotime($md['ts_created'])); ?>
</div>
<?php if ($this->msg or $this->messages) :?> <img class="thumbimg" src="/service/thumb/id/<?php echo $md['id'];?>" alt="<?php echo $this->escape($md['title']);?>" title="<?php echo mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?>"
<div class="box box-info"> onclick="fnCreate('<?php echo $thumburl; ?>')" />
<?php if ($this->msg) : ?>
<?php echo $this->msg; ?> </div>
<?php endif; if ($this->messages): foreach($this->messages as $msg): ?> <?php endforeach; ?>
<?php echo $msg; ?> </div>
<?php endforeach;endif; ?> <hr class="clear"/>
<script language="javascript"> <?php echo $this->page->getNavigation();
setTimeout("document.getElementsByClassName('box-info').remove(0)",5000); else :
</script> ?>
<div>
<p>当前没有对应元数据。</p>
</div> </div>
<?php endif; ?> <?php endif; ?>
<h3>最新收稿的元数据:</h3>
<form action="/review/draft" method="POST">
<input class="q" type="text" id="q" name="q" value="<?php echo $this->keyword;?>" />
<input type="hidden" name="search" value="1" />
<input type="submit" class="btn" value="搜索" /></form>
<table class="stylized">
<thead>
<tr>
<th>元数据标题</th>
<th>收稿时间</th>
</tr>
</thead>
<tbody>
<?php
if (count($this->paginator)):
$autoindex=0;
foreach ($this->paginator as $item):
$autoindex++;?>
<tr class="<?php if($autoindex%2 == 0) echo 'even'; else echo 'odd'; ?>">
<td> <img src="/images/westdc_20w.gif" /> <a href="/data/<?php echo $item['uuid'];?>"><?php echo $item['title'];?></a></td>
<td>
<?php echo date("Y-m-d H:i",strtotime($item['ts_created']));?>
</td>
</tr>
<?php endforeach; endif; ?>
</tbody>
</table>
<div class="pagenavi"><?= $this->paginator; ?></div>
</div>

View File

@ -1,15 +1,31 @@
<?php <?php
$config = Zend_Registry::get('config'); $config = Zend_Registry::get('config');
$this->headTitle($config->title->site); $this->headTitle($config->title->site);
$this->headTitle($config->title->mdreview); $this->headTitle($config->title->review);
$this->headTitle()->setSeparator(' - '); $this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/mdreview.css'); $this->headLink()->appendStylesheet('/css/mdreview.css');
$this->breadcrumb('<a href="/">首页</a>'); $this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/review">元数据评审</a>'); $this->breadcrumb('元数据评审');
$this->breadcrumb()->setSeparator(' > '); $this->breadcrumb()->setSeparator(' > ');
?> ?>
<div id='rightPanel'> <div id='sidebar'>
<h3>目前系统中专家库为<?php echo $this->stat['experts']; ?>人,新投稿元数据<?php echo $this->stat['draft']; ?>条,已接收元数据<?php echo $this->stat['accept']; ?>条,有<?php echo $this->stat['inreview']; ?>条元数据正在评审中,已完成评审元数据<?php echo $this->stat['reviewed']; ?>条,有<?php echo $this->stat['openreviewuser']; ?>个用户参与了<?php echo $this->stat['openreview']; ?>次评审。 <a href="/review/myreview">我参审的元数据</a></h3> <div id='leftnavi'>
<?= $this->partial('review/navi.phtml'); ?>
</div>
<ul>
<li class="title">统计</li>
<li>专家:<?php echo $this->stat['experts']; ?></li>
<?php if ($this->stat['draft']) : ?>
<li>投稿:<?php echo $this->stat['draft']; ?></li>
<?php endif; ?>
<li>接收:<?php echo $this->stat['accept']; ?></li>
<li>评审:<?php echo $this->stat['inreview']; ?></li>
<li>完成:<?php echo $this->stat['reviewed']; ?></li>
<li>参与者:<?php echo $this->stat['openreviewuser']; ?></li>
<li>评审数:<?php echo $this->stat['openreview']; ?></li>
</ul>
</div>
<div id='indexbody'>
<?php if ($this->mdreceived) : ?> <?php if ($this->mdreceived) : ?>
<ul> <ul>
<div class="title"><a href="/review/draft">元数据:最新收稿</a></div> <div class="title"><a href="/review/draft">元数据:最新收稿</a></div>
@ -32,7 +48,7 @@ $this->breadcrumb()->setSeparator(' > ');
</ul> </ul>
<?php endif; if ($this->mdinreview) : ?> <?php endif; if ($this->mdinreview) : ?>
<ul> <ul>
<div class="title"><a href="/review/inreview">元数据:审中</a></div> <div class="title"><a href="/review/inreview">元数据:审中</a></div>
<?php foreach($this->mdinreview as $md) : ?> <?php foreach($this->mdinreview as $md) : ?>
<div class="mditem"> <div class="mditem">
<li> <img src="/images/westdc_20w.gif" /> <?php echo $this->escape($md['title']);?> [<a href="/review/review/uuid/<?php echo $md['uuid'];?>">评审</a> <a href="/data/<?php echo $md['uuid'];?>">查看</a>]</li> <li> <img src="/images/westdc_20w.gif" /> <?php echo $this->escape($md['title']);?> [<a href="/review/review/uuid/<?php echo $md['uuid'];?>">评审</a> <a href="/data/<?php echo $md['uuid'];?>">查看</a>]</li>

View File

@ -1,59 +1,47 @@
<?php <?php
$config = Zend_Registry::get('config'); $this->headTitle($this->config->title->site);
$this->headTitle($config->title->site); $this->headTitle($this->config->title->review);
$this->headTitle($config->title->mdreview); $this->headTitle('在审元数据');
$this->headTitle()->setSeparator(' - '); $this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/mdreview.css'); $this->headLink()->appendStylesheet('/css/mdreview.css');
$this->breadcrumb('<a href="/">首页</a>'); $this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/review">元数据评审</a>'); $this->breadcrumb('<a href="/review">'.$this->config->title->review.'</a>');
$this->breadcrumb('在审元数据');
$this->breadcrumb()->setSeparator(' > '); $this->breadcrumb()->setSeparator(' > ');
$this->headScript()->appendFile('/js/pubfunc.js');
?> ?>
<div id='rightPanel'> <div id='sidebar'>
<div id='leftnavi'>
<?= $this->partial('review/navi.phtml'); ?>
</div>
</div>
<?php if (!empty($this->metadata)) : ?>
<div id='mdlist'>
<?php echo $this->page->getNavigation(); ?>
<hr />
<?php foreach($this->metadata as $md) :
$thumburl='/gndata/'.sprintf('%05d',floor(($md['gid']+0.1)/100)*100).'-'.sprintf('%05d',ceil(($md['gid']+0.1)/100)*100-1)."/".$md['gid'];
$thumburl.='/public/'.str_replace('_s.','.',$md['filename']);
?>
<div class="thumbmd">
<div class="thumbtitle">
<a href="/data/<?php echo $md['uuid'];?>"><?php echo $this->escape($md['title']); ?> </a> 【接收时间:<?php echo date('Y-m-d',strtotime($md['ts_accepted'])); ?>
<?php if ($md['status']!=5) : ?>
<a href="/review/review/uuid/<?php echo $md['uuid'];?>"><img src="/images/review.png" alt="查看评审页" title="进行数据评审"></a>
<?php endif; ?>
</div>
<?php if ($this->msg or $this->messages) :?> <img class="thumbimg" src="/service/thumb/id/<?php echo $md['id'];?>" alt="<?php echo $this->escape($md['title']);?>" title="<?php echo mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?>"
<div class="box box-info"> onclick="fnCreate('<?php echo $thumburl; ?>')" />
<?php if ($this->msg) : ?>
<?php echo $this->msg; ?> </div>
<?php endif; if ($this->messages): foreach($this->messages as $msg): ?> <?php endforeach; ?>
<?php echo $msg; ?> </div>
<?php endforeach;endif; ?> <hr class="clear"/>
<script language="javascript"> <?php echo $this->page->getNavigation();
setTimeout("document.getElementsByClassName('box-info').remove(0)",5000); else :
</script> ?>
<div>
<p>当前没有对应元数据。</p>
</div> </div>
<?php endif; ?> <?php endif; ?>
<h3>目前在审的元数据:</h3>
<form action="/review/inreview" method="POST">
<input class="q" type="text" id="q" name="q" value="<?php echo $this->keyword;?>" />
<input type="hidden" name="search" value="1" />
<input type="submit" class="btn" value="搜索" /></form>
<table class="stylized">
<thead>
<tr>
<th>元数据标题</th>
<th>收稿时间</th>
<th>状态</th>
</tr>
</thead>
<tbody id="datas">
<?php
if (count($this->paginator)):
foreach ($this->paginator as $item):
?>
<tr>
<td> <img src="/images/westdc_20w.gif" /> <a href="/review/review/uuid/<?php echo $item['uuid'];?>"><?php echo $item['title'];?></a></td>
<td>
<?php echo date("Y-m-d",strtotime($item['ts_created']));?>
</td>
<td>
<?php echo $item['status'];?>
</td>
</tr>
<?php endforeach; endif; ?>
</tbody>
</table>
<div class="pagenavi"><?= $this->paginator; ?></div>
</div>

View File

@ -1,57 +1,50 @@
<?php <?php
$config = Zend_Registry::get('config'); $this->headTitle($this->config->title->site);
$this->headTitle($config->title->site); $this->headTitle($this->config->title->review);
$this->headTitle($config->title->mdreview); $this->headTitle('我参审的元数据');
$this->headTitle()->setSeparator(' - '); $this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/mdreview.css'); $this->headLink()->appendStylesheet('/css/mdreview.css');
$this->breadcrumb('<a href="/">首页</a>'); $this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/review">元数据评审</a>'); $this->breadcrumb('<a href="/review">'.$this->config->title->review.'</a>');
$this->breadcrumb('我参审的元数据');
$this->breadcrumb()->setSeparator(' > '); $this->breadcrumb()->setSeparator(' > ');
$this->headScript()->appendFile('/js/pubfunc.js');
?> ?>
<div id='rightPanel'> <div id='sidebar'>
<div id='leftnavi'>
<?= $this->partial('review/navi.phtml'); ?>
</div>
</div>
<?php if (!empty($this->metadata)) : ?>
<div id='mdlist'>
<?php echo $this->page->getNavigation(); ?>
<hr />
<?php foreach($this->metadata as $md) :
$thumburl='/gndata/'.sprintf('%05d',floor(($md['gid']+0.1)/100)*100).'-'.sprintf('%05d',ceil(($md['gid']+0.1)/100)*100-1)."/".$md['gid'];
$thumburl.='/public/'.str_replace('_s.','.',$md['filename']);
?>
<div class="thumbmd">
<div class="thumbtitle">
<a href="/data/<?php echo $md['uuid'];?>"><?php echo $this->escape($md['title']); ?> </a>【状态:<?php echo $md['statustext']; ?>
<?php if ($md['status']!=5) : ?>
<a href="/review/review/uuid/<?php echo $md['uuid'];?>"><img src="/images/review.png" alt="查看评审页" title="进行数据评审"></a>
<?php else : ?>
【接收时间:<?php echo date('Y-m-d',strtotime($md['ts_accepted'])); ?>
审结时间:<?php echo date('Y-m-d',strtotime($md['ts_finished'])); ?>
<?php endif; ?>
</div>
<?php if ($this->msg or $this->messages) :?> <img class="thumbimg" src="/service/thumb/id/<?php echo $md['id'];?>" alt="<?php echo $this->escape($md['title']);?>" title="<?php echo mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?>"
<div class="box box-info"> onclick="fnCreate('<?php echo $thumburl; ?>')" />
<?php if ($this->msg) : ?>
<?php echo $this->msg; ?> </div>
<?php endif; if ($this->messages): foreach($this->messages as $msg): ?> <?php endforeach; ?>
<?php echo $msg; ?> </div>
<?php endforeach;endif; ?> <hr class="clear"/>
<script language="javascript"> <?php echo $this->page->getNavigation();
setTimeout("document.getElementsByClassName('box-info').remove(0)",5000); else :
</script> ?>
<div>
<p>当前没有对应元数据。</p>
</div> </div>
<?php endif; ?> <?php endif; ?>
<h3>我参审的元数据:</h3>
<form action="/review/myreview" method="POST">
<input class="q" type="text" id="q" name="q" value="<?php echo $this->keyword;?>" />
<input type="hidden" name="search" value="1" />
<input type="submit" class="btn" value="搜索" /></form>
<table class="stylized">
<thead>
<tr>
<th>元数据标题</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<?php
if (count($this->paginator)):
$autoindex=0;
foreach ($this->paginator as $item):
$autoindex++;?>
<tr class="<?php if($autoindex%2 == 0) echo 'even'; else echo 'odd'; ?>">
<td> <img src="/images/westdc_20w.gif" /> <a href="<?php echo $item['uuid'];?>"><?php echo $item['title'];?></a></td>
<td>
<a href="/review/review/uuid/<?php echo $item['uuid'];?>">查看评审页</a>
</td>
</tr>
<?php endforeach; endif; ?>
</tbody>
</table>
<div class="pagenavi"><?= $this->paginator; ?></div>
</div>

View File

@ -0,0 +1,23 @@
<ul>
<li><a href="/review/myreview">我参审的元数据</a></li>
<li><a href="/review/draft">投稿元数据</a></li>
<li><a href="/review/accept">已接收元数据</a></li>
<li><a href="/review/inreview">评审中元数据</a></li>
<li><a href="/review/reviewed">已通过元数据</a></li>
</ul>
<form id="search" enctype="application/x-www-form-urlencoded" action="/review/search" method="post">
<input type="text" name="q" id="q" value="<?php echo (empty($this->key))?'回车搜索标题和摘要':$this->key; ?>" onfocus="myfocus(this);" onblur="myblur(this);">
<input type="hidden" name="submit" value="submit">
</form>
<script>
function myfocus(element) {
if (element.value == '回车搜索标题和摘要') {
element.value = '';
}
}
function myblur(element) {
if (element.value == '') {
element.value = '回车搜索标题和摘要';
}
}
</script>

View File

@ -22,7 +22,7 @@
<div id="left"> <div id="left">
<div id="abstract"> <div id="abstract">
<p> <p>
<img src="/data/thumb/id/<?php echo $md['id'];?>" class="thumb" /> <img src="/service/thumb/id/<?php echo $md['id'];?>" class="thumb" />
<?php echo str_replace(array("\r\n", "\n", "\r"),'</p><p>',$md['description']);?> <?php echo str_replace(array("\r\n", "\n", "\r"),'</p><p>',$md['description']);?>
</p> </p>
</div> </div>

View File

@ -1,58 +1,47 @@
<?php <?php
$this->headTitle($this->config->title->site); $this->headTitle($this->config->title->site);
$this->headTitle($this->config->title->review); $this->headTitle($this->config->title->review);
$this->headTitle('审结元数据');
$this->headTitle()->setSeparator(' - '); $this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/mdreview.css'); $this->headLink()->appendStylesheet('/css/mdreview.css');
$this->breadcrumb('<a href="/">首页</a>'); $this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/review">元数据评审</a>'); $this->breadcrumb('<a href="/review">'.$this->config->title->review.'</a>');
$this->breadcrumb('审结元数据');
$this->breadcrumb()->setSeparator(' > '); $this->breadcrumb()->setSeparator(' > ');
$this->headScript()->appendFile('/js/pubfunc.js');
?> ?>
<div id='rightPanel'> <div id='sidebar'>
<div id='leftnavi'>
<?= $this->partial('review/navi.phtml'); ?>
</div>
</div>
<?php if (!empty($this->metadata)) : ?>
<div id='mdlist'>
<?php echo $this->page->getNavigation(); ?>
<hr />
<?php foreach($this->metadata as $md) :
$thumburl='/gndata/'.sprintf('%05d',floor(($md['gid']+0.1)/100)*100).'-'.sprintf('%05d',ceil(($md['gid']+0.1)/100)*100-1)."/".$md['gid'];
$thumburl.='/public/'.str_replace('_s.','.',$md['filename']);
?>
<div class="thumbmd">
<div class="thumbtitle">
<a href="/data/<?php echo $md['uuid'];?>"><?php echo $this->escape($md['title']); ?> </a>【接收时间:<?php echo date('Y-m-d',strtotime($md['ts_finished'])); ?>
<?php if ($md['status']!=5) : ?>
<a href="/review/review/uuid/<?php echo $md['uuid'];?>"><img src="/images/review.png" alt="查看评审页" title="进行数据评审"></a>
<?php endif; ?>
</div>
<?php if ($this->msg or $this->messages) :?> <img class="thumbimg" src="/service/thumb/id/<?php echo $md['id'];?>" alt="<?php echo $this->escape($md['title']);?>" title="<?php echo mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?>"
<div class="box box-info"> onclick="fnCreate('<?php echo $thumburl; ?>')" />
<?php if ($this->msg) : ?>
<?php echo $this->msg; ?> </div>
<?php endif; if ($this->messages): foreach($this->messages as $msg): ?> <?php endforeach; ?>
<?php echo $msg; ?> </div>
<?php endforeach;endif; ?> <hr class="clear"/>
<script language="javascript"> <?php echo $this->page->getNavigation();
setTimeout("document.getElementsByClassName('box-info').remove(0)",5000); else :
</script> ?>
<div>
<p>当前没有对应元数据。</p>
</div> </div>
<?php endif; ?> <?php endif; ?>
<h3>已经通过审核的元数据:</h3>
<form action="/review/reviewed" method="POST">
<input class="q" type="text" id="q" name="q" value="<?php echo $this->keyword;?>" />
<input type="hidden" name="search" value="1" />
<input type="submit" class="btn" value="搜索" /></form>
<table class="stylized">
<thead>
<tr>
<th>元数据标题</th>
<th>评审结束时间</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<?php
if (count($this->paginator)):
$autoindex=0;
foreach ($this->paginator as $item):
$autoindex++;?>
<tr class="<?php if($autoindex%2 == 0) echo 'even'; else echo 'odd'; ?>">
<td> <img src="/images/westdc_20w.gif" /> <a href="/data/<?php echo $item['uuid'];?>"><?php echo $item['title'];?></a></td>
<td>
<?php echo date("Y-m-d",strtotime($item['ts_finished']));?>
</td>
<td><a href="/review/review/uuid/<?php echo $item['uuid'];?>">查看评审页</a></td>
</tr>
<?php endforeach; endif; ?>
</tbody>
</table>
<div class="pagenavi"><?= $this->paginator; ?></div>
</div>

View File

@ -0,0 +1,47 @@
<?php
$this->headTitle($this->config->title->site);
$this->headTitle($this->config->title->review);
$this->headTitle('快速搜索');
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/mdreview.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/review">'.$this->config->title->review.'</a>');
$this->breadcrumb('快速搜索');
$this->breadcrumb()->setSeparator(' > ');
$this->headScript()->appendFile('/js/pubfunc.js');
?>
<div id='sidebar'>
<div id='leftnavi'>
<?= $this->partial('review/navi.phtml',array('key'=>$this->key)); ?>
</div>
</div>
<?php if (!empty($this->metadata)) : ?>
<div id='mdlist'>
<?php echo $this->page->getNavigation(); ?>
<hr />
<?php foreach($this->metadata as $md) :
$thumburl='/gndata/'.sprintf('%05d',floor(($md['gid']+0.1)/100)*100).'-'.sprintf('%05d',ceil(($md['gid']+0.1)/100)*100-1)."/".$md['gid'];
$thumburl.='/public/'.str_replace('_s.','.',$md['filename']);
?>
<div class="thumbmd">
<div class="thumbtitle">
<a href="/data/<?php echo $md['uuid'];?>"><?php echo $this->escape($md['title']); ?> </a>【状态:<?php echo $md['statustext']; ?>
<?php if ($md['status']!=5) : ?>
<a href="/review/review/uuid/<?php echo $md['uuid'];?>"><img src="/images/review.png" alt="查看评审页" title="进行数据评审"></a>
<?php endif; ?>
</div>
<img class="thumbimg" src="/service/thumb/id/<?php echo $md['id'];?>" alt="<?php echo $this->escape($md['title']);?>" title="<?php echo mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?>"
onclick="fnCreate('<?php echo $thumburl; ?>')" />
</div>
<?php endforeach; ?>
</div>
<hr class="clear"/>
<?php echo $this->page->getNavigation();
else :
?>
<div>
<p>您的搜索结果为空,请尝试其他关键词进行查询。</p>
</div>
<?php endif; ?>

View File

@ -20,7 +20,7 @@ $this->breadcrumb()->setSeparator(' > ');
foreach($this->metadata as $md) : ?> foreach($this->metadata as $md) : ?>
<hr /> <hr />
<div class="mditem"> <div class="mditem">
<div class="thumb"><img src="/data/thumb/id/<?php echo $md['id'];?>" /></div> <div class="thumb"><img src="/service/thumb/id/<?php echo $md['id'];?>" /></div>
<h2><a href="/data/<?php echo $md['uuid'];?>"><?php echo $this->escape($md['title']);?></a> <h2><a href="/data/<?php echo $md['uuid'];?>"><?php echo $this->escape($md['title']);?></a>
</h2> </h2>
<span><?php echo mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?></span> <span><?php echo mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?></span>

View File

@ -16,7 +16,7 @@ $this->breadcrumb()->setSeparator(' > ');
<?php foreach($this->metadata as $md) : ?> <?php foreach($this->metadata as $md) : ?>
<hr /> <hr />
<div class="mditem"> <div class="mditem">
<div class="thumb"><img src="/data/thumb/id/<?php echo $md['id'];?>" /></div> <div class="thumb"><img src="/service/thumb/id/<?php echo $md['id'];?>" /></div>
<h2><a href="/data/<?php echo $md['uuid'];?>"><?php echo $this->escape($md['title']);?></a> <h2><a href="/data/<?php echo $md['uuid'];?>"><?php echo $this->escape($md['title']);?></a>
<a href="/data/xml/id/<?php echo $md['id'];?>" title="XML模式查看"><img src="/images/xml.gif" /></a> <a href="/data/xml/id/<?php echo $md['id'];?>" title="XML模式查看"><img src="/images/xml.gif" /></a>
<a href="/data/map/id/<?php echo $md['id']; ?>" title="查看数据空间范围"><img src="/images/map.gif" /></a> <a href="/data/map/id/<?php echo $md['id']; ?>" title="查看数据空间范围"><img src="/images/map.gif" /></a>

View File

@ -11,7 +11,7 @@
?> ?>
<div id="download"> <div id="download">
<h1><?php echo $this->md['title']; ?>(<?php echo $this->md['filesize']; ?>MB)</h1> <h1><?php echo $this->md['title']; ?>(<?php echo $this->md['filesize']; ?>MB)</h1>
<div id="thumb"><img src="/data/thumb/id/<?php echo $this->md['id'];?>" /></div> <div id="thumb"><img src="/service/thumb/id/<?php echo $this->md['id'];?>" /></div>
<div id="ftpurl"> <div id="ftpurl">
<fieldset><legend>FTP下载地址</legend> <fieldset><legend>FTP下载地址</legend>
<ul> <ul>

View File

@ -11,8 +11,8 @@
$this->breadcrumb()->setSeparator(' > '); $this->breadcrumb()->setSeparator(' > ');
$this->headScript()->appendFile('/js/OpenLayers.js'); $this->headScript()->appendFile('/js/OpenLayers.js');
$this->headLink()->appendStylesheet('/js/theme/default/style.css'); $this->headLink()->appendStylesheet('/js/theme/default/style.css');
$this->headScript()->appendFile('http://maps.google.cn/maps?file=api&v=2&key='.$this->config->google->maps->api);
?> ?>
<script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAACD-MqkkoOm60o_dvwdcKVhRBSKpgcP88GYi6r2Of16IkMX_4YhSBQsywCi4J2_fh4nBuWmK7gyRjLg'></script>
<div id='tools'> <div id='tools'>
<?= $this->partial('data/tools.phtml'); ?> <?= $this->partial('data/tools.phtml'); ?>
</div> </div>
@ -56,7 +56,7 @@
popup = new OpenLayers.Popup.FramedCloud("chicken", popup = new OpenLayers.Popup.FramedCloud("chicken",
feature.geometry.getBounds().getCenterLonLat(), feature.geometry.getBounds().getCenterLonLat(),
null, null,
"<div style='font-size:.8em'><a href=/data/"+feature.attributes['uuid']+">"+ feature.attributes['title'] +"</a> | <a href=/data/map/id/"+feature.attributes['id']+"><img src=/images/map.gif></a><hr /><img src=/data/thumb/id/" + feature.attributes['id']+"/></div>", "<div style='font-size:.8em'><a href=/data/"+feature.attributes['uuid']+">"+ feature.attributes['title'] +"</a> | <a href=/data/map/id/"+feature.attributes['id']+"><img src=/images/map.gif></a><hr /><img src=/service/thumb/id/" + feature.attributes['id']+"/></div>",
null, false, onPopupClose); null, false, onPopupClose);
feature.popup = popup; feature.popup = popup;
map.addPopup(popup); map.addPopup(popup);

View File

@ -38,7 +38,7 @@ $this->breadcrumb()->setSeparator(' > ');
foreach($this->metadata as $md) : ?> foreach($this->metadata as $md) : ?>
<div class="mditem"> <div class="mditem">
<hr /> <hr />
<div class="thumb"><img src="/data/thumb/id/<?php echo $md['id'];?>" /></div> <div class="thumb"><img src="/service/thumb/id/<?php echo $md['id'];?>" /></div>
<h2><a href="/water/<?php echo $md['uuid'];?>"><?php echo $this->escape($md['title']);?></a> <h2><a href="/water/<?php echo $md['uuid'];?>"><?php echo $this->escape($md['title']);?></a>
</h2> </h2>
<span><?php echo mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?></span> <span><?php echo mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?></span>

View File

@ -39,7 +39,7 @@ $this->breadcrumb()->setSeparator(' > ');
<?php foreach($this->metadata as $md) : ?> <?php foreach($this->metadata as $md) : ?>
<hr /> <hr />
<div class="mditem"> <div class="mditem">
<div class="thumb"><img src="/data/thumb/id/<?php echo $md['id'];?>" /></div> <div class="thumb"><img src="/service/thumb/id/<?php echo $md['id'];?>" /></div>
<h2><a href="/data/<?php echo $md['uuid']; ?>"><?php echo $this->escape($md['title']);?></a> <h2><a href="/data/<?php echo $md['uuid']; ?>"><?php echo $this->escape($md['title']);?></a>
</h2> </h2>
<span><?php echo mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?></span> <span><?php echo mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?></span>

View File

@ -17,7 +17,7 @@ $this->breadcrumb()->setSeparator(' > ');
<?php foreach($this->metadata as $md) : ?> <?php foreach($this->metadata as $md) : ?>
<div class="mditem"> <div class="mditem">
<hr /> <hr />
<div class="thumb"><img src="/data/thumb/id/<?php echo $md['id'];?>" /></div> <div class="thumb"><img src="/service/thumb/id/<?php echo $md['id'];?>" /></div>
<h2><a href="/water/<?php echo $md['uuid']; ?>"><?php echo $this->escape($md['title']);?></a> <h2><a href="/water/<?php echo $md['uuid']; ?>"><?php echo $this->escape($md['title']);?></a>
</h2> </h2>

View File

@ -1,7 +0,0 @@
<?php
if (empty($this->thumb->data)) {
} else {
header("Content-Type:image/jpeg");
print base64_decode($this->thumb->data);
}
?>

View File

@ -9,8 +9,7 @@ $this->breadcrumb('<a href="/data">'.$this->config->title->data.'</a>');
$this->breadcrumb('<a href="/water/">黑河综合遥感联合试验</a>'); $this->breadcrumb('<a href="/water/">黑河综合遥感联合试验</a>');
$this->breadcrumb('时空联合导航'); $this->breadcrumb('时空联合导航');
$this->breadcrumb()->setSeparator(' > '); $this->breadcrumb()->setSeparator(' > ');
$this->headScript()->appendFile('http://maps.google.com/maps?file=api&v=2&key=ABQIAAAACD-MqkkoOm60o_dvwdcKVhRBSKpgcP88GYi6r2Of16IkMX_4YhSBQsywCi4J2_fh4nBuWmK7gyRjLg'); $this->headScript()->appendFile('http://maps.google.cn/maps?file=api&v=2&key='.$this->config->google->maps->api);
//$this->headScript()->appendFile('http://maps.google.com/maps?file=api&v=2&key=ABQIAAAACD-MqkkoOm60o_dvwdcKVhThiRESR0xRCe9JKd36EL3glTk0OxTsRzifkUWmTTrYWaE7dY1lYUlGxA');
$this->headScript()->appendFile('/js/timeline_var.js'); $this->headScript()->appendFile('/js/timeline_var.js');
$this->headScript()->appendFile('/js/timeline_js/timeline-api.js'); $this->headScript()->appendFile('/js/timeline_js/timeline-api.js');
$this->headScript()->appendFile('/js/timemap/timemap.js'); $this->headScript()->appendFile('/js/timemap/timemap.js');
@ -48,7 +47,7 @@ window.onload=function() {
"title" : "<?php echo htmlspecialchars(mb_substr($row['title'],11,mb_strlen($row['title'],'UTF-8')-10,'UTF-8')); ?>", "title" : "<?php echo htmlspecialchars(mb_substr($row['title'],11,mb_strlen($row['title'],'UTF-8')-10,'UTF-8')); ?>",
"options" : { "options" : {
// set the full HTML for the info window // set the full HTML for the info window
"infoHtml": "<div class='info'><a href=/water/<?php echo $row['uuid']; ?>><?php echo htmlspecialchars(mb_substr($row['title'],11,mb_strlen($row['title'],'UTF-8')-10,'UTF-8')); ?></a><hr /><img src=/data/thumb/id/<?php echo $row['id']; ?> /></div>", "infoHtml": "<div class='info'><a href=/water/<?php echo $row['uuid']; ?>><?php echo htmlspecialchars(mb_substr($row['title'],11,mb_strlen($row['title'],'UTF-8')-10,'UTF-8')); ?></a><hr /><img src=/service/thumb/id/<?php echo $row['id']; ?> /></div>",
"theme":"orange" "theme":"orange"
} }
}, },

View File

@ -9,11 +9,12 @@
$this->breadcrumb('<a href="/water/">黑河综合遥感联合试验</a>'); $this->breadcrumb('<a href="/water/">黑河综合遥感联合试验</a>');
$this->breadcrumb('查看试验元数据'); $this->breadcrumb('查看试验元数据');
$this->breadcrumb()->setSeparator(' > '); $this->breadcrumb()->setSeparator(' > ');
$this->headScript()->appendFile('http://maps.google.com/maps?file=api&v=2&key='.$this->config->google->maps->api); $this->headScript()->appendFile('http://maps.google.cn/maps?file=api&v=2&key='.$this->config->google->maps->api);
$this->headScript()->appendFile('/js/prototype.js'); $this->headScript()->appendFile('/js/prototype.js');
$this->headScript()->appendFile('/js/OpenLayers.js'); $this->headScript()->appendFile('/js/OpenLayers.js');
$this->headScript()->appendFile('/js/window.js'); $this->headScript()->appendFile('/js/window.js');
$this->headScript()->appendFile('/js/pubfunc.js');
$this->headLink()->appendStylesheet('/js/theme/default/style.css'); $this->headLink()->appendStylesheet('/js/theme/default/style.css');
?> ?>
<?php $md=$this->metadata;if ($md):?> <?php $md=$this->metadata;if ($md):?>
@ -21,10 +22,11 @@
if ($md->title_en) echo '<br />'.$this->escape($md->title_en);?> if ($md->title_en) echo '<br />'.$this->escape($md->title_en);?>
</h1> </h1>
<div id="right"> <div id="right">
<div id="ItemSummary"> <div id="ItemSummary">
<div id="category"> <div id="category">
<ul><?php foreach($this->category as $cat): ?> <ul><?php foreach($this->category as $cat): ?>
<li><a href="/water/category/code/<?php echo $cat['code'];?>"><?php echo $this->escape($cat['name_zh']);?></a></li> <li><a href="/heihe/category/code/<?php echo $cat->code;?>"><?php echo $this->escape($cat->name_zh);?></a></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
</div> </div>
@ -32,15 +34,15 @@ if ($md->title_en) echo '<br />'.$this->escape($md->title_en);?>
$kt=''; $kt='';
$i=0; $i=0;
foreach($this->keys as $cg) : foreach($this->keys as $cg) :
if ($kt==$cg['keytype']) : if ($kt==$cg->keytype) :
$i+=1; $i+=1;
else : else :
if (!empty($kt)) echo '</ul></div>'; if (!empty($kt)) echo '</ul></div>';
$kt=$cg['keytype']; $kt=$cg->keytype;
$i=0; $i=0;
endif; endif;
if ($i==0) echo '<div id="'.$cg['keytype'].'"><ul>'; if ($i==0) echo '<div id="'.$cg->keytype.'"><ul>';
echo '<li><a href="/water/tag/key/'.urlencode($cg['keyword']).'">'.$cg['keyword'].'</a></li>'; echo '<li><a href="/heihe/tag/key/'.urlencode($cg->keyword).'">'.$cg->keyword.'</a></li>';
endforeach; endforeach;
echo '</ul></div>'; echo '</ul></div>';
?> ?>
@ -49,7 +51,7 @@ echo '</ul></div>';
<?php if ($this->series): ?> <?php if ($this->series): ?>
<div id="series"> <div id="series">
<ul><?php foreach($this->series as $serie): ?> <ul><?php foreach($this->series as $serie): ?>
<li><a href="/data/series/id/<?php echo $serie['id']; ?>"> <?php echo $this->escape($serie['name']);?></a></li> <li><a href="/data/series/id/<?php echo $serie->id; ?>"> <?php echo $this->escape($serie->name);?></a></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
</div> </div>
@ -95,10 +97,13 @@ else
<li id="datatype">数据共享方式:<?php if ($md->datatype) print "离线"; else print "在线(可直接下载)";?> <a href="#" id="show-list" rel="<?php echo $md->uuid;?>">文件列表</a></li> <li id="datatype">数据共享方式:<?php if ($md->datatype) print "离线"; else print "在线(可直接下载)";?> <a href="#" id="show-list" rel="<?php echo $md->uuid;?>">文件列表</a></li>
</ul> </ul>
<div id="linkurl"> <div id="linkurl">
<?php if (!$md->datatype) : ?> <?php if ($md->status>0 and $md->status<5) : ?>
<a href="/water/download/uuid/<?php echo $md->uuid; ?>"><img src="/images/download.png" title="直接下载" /></a> <a href="/review/review/uuid/<?php echo $md->uuid; ?>"><img src="/images/review.png" title="此数据正在评审中,我们邀请您对此数据进行评审,以便其能尽快发布!" /></a>
<?php else : if (!$md->datatype) : ?>
<a href="/heihe/download/uuid/<?php echo $md->uuid; ?>"><img src="/images/download.png" title="直接下载" /></a>
<?php endif; ?>
<a href="/heihe/order/uuid/<?php echo $md->uuid; ?>"><img src="/images/order.png" title="免费!离线申请此数据(在线数据和离线数据都可申请)"/></a>
<?php endif; ?> <?php endif; ?>
<a href="/water/order/uuid/<?php echo $md->uuid; ?>"><img src="/images/order.png" title="免费!离线申请此数据(在线数据和离线数据都可申请)"/></a>
</div> </div>
</div> </div>
@ -114,47 +119,49 @@ $party_zh=array('resourceProvider'=>'资源提供者','custodian'=>'维护者','
$r=''; $r='';
$i=0; $i=0;
foreach($this->authors as $k=>$author) : foreach($this->authors as $k=>$author) :
if ($author['role']!=$r) if ($author->role!=$r)
{ {
$r=$author['role']; $r=$author->role;
$i=0; $i=0;
if ($k>0) echo '</li>'; if ($k>0) echo '</li>';
echo '<li>'.$party_zh[$author['role']].''; echo '<li>'.$party_zh[$author->role].'';
} }
if ($i>0) echo ''; if ($i>0) echo '';
$i+=1; $i+=1;
if (!empty($author['email']) && $r!='principalInvestigator') if (!empty($author->email) && $r!='principalInvestigator')
echo '<a href="mailto:'.$author['email'].'">'; echo '<a href="mailto:'.$author->email.'">';
echo '<strong title="'.$author['organisation'].'">'; echo '<strong title="'.$author->organisation.'">';
if (!empty($author['individual'])) if (!empty($author->individual))
echo $author['individual']; echo $author->individual;
else else
echo $author['organisation']; echo $author->organisation;
echo '</strong>'; echo '</strong>';
if (!empty($author['email'])) echo '</a>'; if (!empty($author->email)) echo '</a>';
if ($k+1==count($this->authors)) echo '</li>'; if ($k+1==count($this->authors)) echo '</li>';
endforeach; endforeach;
?> ?>
</ul> </ul>
<hr /> <hr />
<ul> <ul>
<li>元数据更新时间:<?php print date('Y-m-d',strtotime($md->ts_created)); ?> <a href="/water/xml/uuid/<?php echo $md->uuid;?>"><img src="/images/xml.gif" alt="查看XML源文件"></a></li> <li>元数据更新时间:<?php print date('Y-m-d',strtotime($md->ts_created)); ?>
<!--<li><a href="/data/detail/id/<?php echo $md->id;?>">详细元数据</a></li>--> <a href="/heihe/xml/uuid/<?php echo $md->uuid;?>"><img src="/images/xml.gif" alt="查看XML源文件"></a>
<a href="/data/doc/uuid/<?php echo $md->uuid; ?>"><img src="/images/doc-icon.png" alt="Word doc格式"></a>
</li>
</ul> </ul>
</div> </div>
</div> </div>
<div id="left"> <div id="left">
<div id="ImageViewer"><img src="/data/thumb/id/<?php echo $md->id;?>" /> </div>
<div id="ImageViewer"><img src="/service/thumb/id/<?php echo $md->id;?>" onclick="fnCreate('<?php echo $this->thumburl; ?>')" /> </div>
<div id="abstract"> <div id="abstract">
<p> <p>
<?php echo str_replace(array("\r\n", "\n", "\r"),'</p><p>',$md->description);?> <?php echo str_replace(array("\r\n", "\n", "\r"),'</p><p>',$md->description);?>
</p> </p>
</div> </div>
<hr />
<div id="cite"> <div id="cite">
<hr />
<?php if ($md->citation) : ?> <?php if ($md->citation) : ?>
<h2>本数据引用方式</h2> <h2>本数据引用方式</h2>
<p><?php echo $this->escape($md->citation);?></p> <p><?php echo $this->escape($md->citation);?></p>
@ -163,10 +170,10 @@ endforeach;
<h2>建议参考文献</h2> <h2>建议参考文献</h2>
<ol> <ol>
<?php foreach($this->ref as $ref) : <?php foreach($this->ref as $ref) :
if (empty($ref['link'])) if (empty($ref->link))
echo '<li>'.$ref['reference'].'</li>'; echo '<li>'.$ref->reference.'</li>';
else else
echo '<li>'.$ref['reference'].' <a href="'.$ref['link'].'">下载</a></li>'; echo '<li>'.$ref->reference.' <a href="'.$ref->link.'">下载</a></li>';
endforeach; endforeach;
?> ?>
</ol> </ol>
@ -175,7 +182,7 @@ endforeach;
<?php <?php
if ($this->uselimits) : if ($this->uselimits) :
foreach($this->uselimits as $uselimit) : foreach($this->uselimits as $uselimit) :
echo '<p>'.str_replace(array("\r\n", "\n", "\r"),'</p><p>',$this->escape($uselimit['uselimit'])).'</p>'; echo '<p>'.str_replace(array("\r\n", "\n", "\r"),'</p><p>',$this->escape($uselimit->uselimit)).'</p>';
endforeach; endforeach;
?> ?>
<?php else : ?> <?php else : ?>
@ -191,14 +198,14 @@ endforeach;
<?php if ($this->resources) : ?> <?php if ($this->resources) : ?>
<h2>其他在线资源</h2> <h2>其他在线资源</h2>
<ul><?php foreach($this->resources as $link) : ?> <ul><?php foreach($this->resources as $link) : ?>
<li><a href="<?php echo $link['linkage']; ?>" title="<?php echo $link['description']; ?>"> <li><a href="<?php echo $link->linkage; ?>" title="<?php echo $this->escape($link->description); ?>">
<?php <?php
if (!empty($link['name'])) if (!empty($link->name))
echo $link['name']; echo $this->escape($link->name);
elseif (!empty($link['description'])) elseif (!empty($link->description))
echo $link['description']; echo $this->escape($link->description);
else else
echo $link['linkage']; echo $link->linkage;
?></a></li> ?></a></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
@ -207,6 +214,9 @@ endforeach;
</div> </div>
<hr /> <hr />
<div id="comments"> <div id="comments">
<?php if ($md->status>0 and $md->status<5) : ?>
<p class="strong">此数据还在评审过程中,我们真切地邀请您参加此数据的评审,以便我们能尽快发布此数据!<a href="/review/review/uuid/<?php echo $md->uuid; ?>"><img src="/images/review.png" title="此数据正在评审中,我们邀请您对此数据进行评审,以便其能尽快发布!" /></a></p>
<?php else : ?>
<h2>数据评论</h2> <h2>数据评论</h2>
<div id="allcomments"> <div id="allcomments">
</div> </div>
@ -235,6 +245,7 @@ function reportError(request)
}); });
</script> </script>
<?php echo $this->commentForm; ?> <?php echo $this->commentForm; ?>
<?php endif; ?>
</div> </div>
</div> </div>

View File

@ -1,13 +1,12 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head> <head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<link rel="stylesheet" type="text/css" media="screen" <link rel="stylesheet" type="text/css" media="screen"
href="/css/default.css" /> href="/css/default.css" />
<script src='/js/navi.js' type="text/javascript"></script> <script src='/js/navi.js' type="text/javascript"></script>
<link rel="alternate" type="application/rss+xml" title="WestDC RSS Feed" href="/data/feed" /> <link rel="alternate" type="application/rss+xml" title="WDSCAR RSS Feed" href="/data/feed" />
<link rel="pingback" href="http://westdc.westgis.ac.cn/data/pingback" /> <link rel="pingback" href="http://wdscar.westgis.ac.cn/data/pingback" />
<?= $this->headTitle() ?> <?= $this->headTitle() ?>
<?= $this->headScript() ?> <?= $this->headScript() ?>
<?= $this->headLink() ?> <?= $this->headLink() ?>
@ -31,7 +30,7 @@ var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 8);
piwikTracker.trackPageView(); piwikTracker.trackPageView();
piwikTracker.enableLinkTracking(); piwikTracker.enableLinkTracking();
} catch( err ) {} } catch( err ) {}
</script><noscript><p><img src="http://piwik.westgis.ac.cn/piwik.php?idsite=8" style="border:0" alt="" /></p></noscript> </script><noscript><p><img src="http://piwik.westgis.ac.cn/piwik.php?idsite=5" style="border:0" alt="" /></p></noscript>
<!-- End Piwik Tracking Code --> <!-- End Piwik Tracking Code -->
</body> </body>
</html> </html>

View File

@ -19,9 +19,10 @@ class EmailText{
$sql = "select * from emailtext where id='".$this->tmpid."'"; $sql = "select * from emailtext where id='".$this->tmpid."'";
else else
$sql = "select * from emailtext where template='".$this->tmpid."'"; $sql = "select * from emailtext where template='".$this->tmpid."'";
$t=$this->db->getFetchMode();
$this->db->setFetchMode(Zend_Db::FETCH_ASSOC);
$rs = $this->db->query($sql); $rs = $this->db->query($sql);
$this->db->setFetchMode($t);
$this->tmpinfo = $rs->fetch(); $this->tmpinfo = $rs->fetch();
} }