diff --git a/application/admin/controllers/DataController.php b/application/admin/controllers/DataController.php
index b4b61914..f1cba491 100755
--- a/application/admin/controllers/DataController.php
+++ b/application/admin/controllers/DataController.php
@@ -35,7 +35,7 @@ class Admin_DataController extends Zend_Controller_Action
//$uuid=$this->_request->getParam('uuid');
if ($source=="geonetwork" && empty($uuid) ) {
//从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);
foreach($rs as $gmd) {
$this->import($gmd->data);
@@ -45,12 +45,12 @@ class Admin_DataController extends Zend_Controller_Action
} elseif ($source=="watergn" && empty($uuid) ) {
//首先删除所有的黑河试验数据
//$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);
$sql="delete from responsible where id not in (select distinct(resid) from role)";
$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);
foreach($rs as $gmd) {
$this->import($gmd->data);
@@ -74,9 +74,10 @@ class Admin_DataController extends Zend_Controller_Action
$this->view->msg='成功同步WESTDC元数据到GEONETWORK!';
} 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)) {
$this->import($rs->data);
+ $this->db->exec($this->db->quoteInto("update metadata set source=? where uuid='$uuid'",$rs->source));
$this->view->msg='成功同步元数据:'.$uuid;
} else $this->view->msg='不存在此元数据:'.$uuid;
} elseif (!empty($uuid) && isset($_POST['gnsubmit'])) {
@@ -93,17 +94,18 @@ class Admin_DataController extends Zend_Controller_Action
} else $this->view->msg='不存在此元数据:'.$uuid;
} 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)) {
- $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;
} else $this->view->msg='不存在此元数据:'.$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)) {
$this->import($rs->data);
+ $this->db->query("update metadata set source=? where uuid=?",array($rs->source,$uuid));
$this->view->msg='成功同步元数据:'.$uuid;
} else $this->view->msg='不存在此元数据:'.$uuid;
} 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')";
$this->db->query($sql);
$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') {
$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);
@@ -783,23 +795,280 @@ class Admin_DataController extends Zend_Controller_Action
function sourceAction()
{
-
- $add=(int)$this->_getParam('add');
- $edit=(int)$this->_getParam('edit');
- $delete=(int)$this->_getParam('delete');
- $search=$this->_getParam('search');
- $keyword=$this->_getParam('keyword');
+ $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');
- if ($add) {
+ if ($do == 'add') {
+
+ $redirect = "/admin/data/source/";
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');
}// 添加项目来源
+ 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
diff --git a/application/admin/controllers/DownController.php b/application/admin/controllers/DownController.php
index 7a90588a..f6bcb70d 100644
--- a/application/admin/controllers/DownController.php
+++ b/application/admin/controllers/DownController.php
@@ -45,12 +45,11 @@ class Admin_DownController extends Zend_Controller_Action
$row=$this->db->fetchRow($sql,array($start));
//发送用户邮件进行信息提示和说明
$mail = new WestdcMailer($this->view->config->smtp);
- $body=file_get_contents($this->view->config->offline->email->start_template);
- $body=str_replace("[username]",$row['username'],$body);
- $body=str_replace("[datalist]",str_replace(";","\n",$row['datalist']),$body);
- $mail->setBodyText($body);
+ $datalist=str_replace(";","\n",$row['datalist']);
+ $mailtp=new EmailText($this->db,'offline-start',array('user'=>$row['username'],'datalist'=>$datalist));
+ $mail->setBodyText($mailtp->getBody());
+ $mail->setSubject($mailtp->getSubject());
$mail->addTo($row['email']);
- $mail->setSubject('西部数据中心已收到您的纸质离线申请');
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
$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";
$rows=$this->db->fetchAll($sql);
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')
->setHeader('Content-Disposition','attachment; filename="offlineapp.csv"')
diff --git a/application/admin/controllers/ReviewController.php b/application/admin/controllers/ReviewController.php
index d4433950..bda898e1 100644
--- a/application/admin/controllers/ReviewController.php
+++ b/application/admin/controllers/ReviewController.php
@@ -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()
{
diff --git a/application/admin/controllers/StatController.php b/application/admin/controllers/StatController.php
index 3b3744b3..3d303143 100644
--- a/application/admin/controllers/StatController.php
+++ b/application/admin/controllers/StatController.php
@@ -119,11 +119,11 @@ class Admin_StatController extends Zend_Controller_Action
function waterAction()
{
- $sql="select count(k.keyword) as num,k.keyword from dataorder d join metadata m on d.uuid=m.uuid
- left join keyword k on m.id=k.id
- where (d.status=5 or d.status=-1) and m.source!=''
- 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";
+ $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
+ 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='中游干旱区水文试验区')
+ group by k.keyword,d.status order by k.keyword desc,d.status desc";
$re =$this->db->query($sql);
$type =$re->fetchAll();//按分类
@@ -141,13 +141,13 @@ class Admin_StatController extends Zend_Controller_Action
$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
- from
- (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
- 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)
+ $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
+ (select distinct(o.id),o.ts_created
+ from offlineapp o where o.datalist like '%黑河综合遥感联合试验%') as o
+ 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)";
$re=$this->db->query($sql);
diff --git a/application/admin/views/scripts/data/md.phtml b/application/admin/views/scripts/data/md.phtml
index 5e64f5cd..739e2321 100644
--- a/application/admin/views/scripts/data/md.phtml
+++ b/application/admin/views/scripts/data/md.phtml
@@ -44,10 +44,11 @@
,查看:= $item['viewed']; ?>次。 操作:
编辑
删除
- 同步 附件管理
-
- 放入元数据评审
-
+ 同步 附件管理
+
+ 放入元数据评审
+
+ 编辑数据来源
]
数据贡献者:= $item['author']; ?>
= $item['description']; ?>
diff --git a/application/admin/views/scripts/data/source.phtml b/application/admin/views/scripts/data/source.phtml
new file mode 100644
index 00000000..94f411f1
--- /dev/null
+++ b/application/admin/views/scripts/data/source.phtml
@@ -0,0 +1,67 @@
+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('首页 ');
+ $this->breadcrumb('后台首页 ');
+ $this->breadcrumb('数据管理 ');
+ $this->breadcrumb('项目来源管理');
+ $this->breadcrumb()->setSeparator(' > ');
+?>
+
+= $this->partial('data/left.phtml'); ?>
+
+
+msg or $this->messages) :?>
+
+msg) : ?>
+
msg; ?>
+messages): foreach($this->messages as $msg): ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 标题
+ Code字符
+ 操作
+
+
+ paginator)): ?>
+
+ paginator as $item): ?>
+
+
+
+
+ 查看编辑 |
+ 查看元数据 |
+ 删除
+
+
+
+
+
+
+
= $this->paginator; ?>
+
+
\ No newline at end of file
diff --git a/application/admin/views/scripts/data/sourceadd.phtml b/application/admin/views/scripts/data/sourceadd.phtml
new file mode 100644
index 00000000..49bac0b1
--- /dev/null
+++ b/application/admin/views/scripts/data/sourceadd.phtml
@@ -0,0 +1,64 @@
+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('首页 ');
+ $this->breadcrumb('后台首页 ');
+ $this->breadcrumb('数据管理 ');
+ $this->breadcrumb('项目来源管理');
+ $this->breadcrumb()->setSeparator(' > ');
+?>
+
+= $this->partial('data/left.phtml'); ?>
+
+
+
+msg or $this->messages) :?>
+
+msg) : ?>
+
msg; ?>
+messages): foreach($this->messages as $msg): ?>
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/application/admin/views/scripts/data/sourcefetchone.phtml b/application/admin/views/scripts/data/sourcefetchone.phtml
new file mode 100644
index 00000000..a8c98981
--- /dev/null
+++ b/application/admin/views/scripts/data/sourcefetchone.phtml
@@ -0,0 +1,64 @@
+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('首页 ');
+ $this->breadcrumb('后台首页 ');
+ $this->breadcrumb('数据管理 ');
+ $this->breadcrumb('项目来源管理');
+ $this->breadcrumb()->setSeparator(' > ');
+?>
+
+= $this->partial('data/left.phtml'); ?>
+
+
+msg or $this->messages) :?>
+
+msg) : ?>
+
msg; ?>
+messages): foreach($this->messages as $msg): ?>
+
+
+
+
+
+
+
+
+
+
+
+ 搜索关键字
+
+
+
+
+
+
+
+ 标题
+ 操作
+
+
+ paginator)): ?>
+
+ paginator as $item): ?>
+
+
+
+ 编辑数据来源
+ 清除数据来源
+
+
+
+
+
+
+
= $this->paginator; ?>
+
+
\ No newline at end of file
diff --git a/application/admin/views/scripts/data/sourceselect.phtml b/application/admin/views/scripts/data/sourceselect.phtml
new file mode 100644
index 00000000..eab90f68
--- /dev/null
+++ b/application/admin/views/scripts/data/sourceselect.phtml
@@ -0,0 +1,91 @@
+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('首页 ');
+ $this->breadcrumb('后台首页 ');
+ $this->breadcrumb('数据管理 ');
+ $this->breadcrumb('项目来源管理');
+ $this->breadcrumb()->setSeparator(' > ');
+?>
+
+= $this->partial('data/left.phtml'); ?>
+
+
+
+msg or $this->messages) :?>
+
+msg) : ?>
+
msg; ?>
+messages): foreach($this->messages as $msg): ?>
+
+
+
+
+
+为元数据《info['title'];?>》选择项目来源
+
+
+
+
+
+ 搜索关键字
+
+
+
+
+
+
+
+
+
+
+info['id']))
+ {
+ echo "此元数据已经选择了项目来源:".$this->info['stitle']."[".$this->info['code']."],操作将更改此元数据现有的项目来源 ";
+ }
+?>
+
+
+info['id']))
+ {
+ ?>
+
+
+
+
+
+ 清除数据来源
+
+
+
+
= $this->paginator; ?>
+
+
\ No newline at end of file
diff --git a/application/admin/views/scripts/data/sync.phtml b/application/admin/views/scripts/data/sync.phtml
index aac98b46..dd3d5833 100644
--- a/application/admin/views/scripts/data/sync.phtml
+++ b/application/admin/views/scripts/data/sync.phtml
@@ -29,6 +29,7 @@
开始同步:从WESTDC同步到GEONETWORK
列出WESTDC中多出的WATER元数据
删除WESTDC中多出的元数据
+删除GEONETWORK中多出的元数据
删除WESTDC中多出的WATER元数据
同步GEONETWORK中的缩略图
同步WATER中的缩略图
diff --git a/application/admin/views/scripts/header.phtml b/application/admin/views/scripts/header.phtml
index 34f3eda0..61b57a4e 100755
--- a/application/admin/views/scripts/header.phtml
+++ b/application/admin/views/scripts/header.phtml
@@ -1,8 +1,10 @@
-
-
-
-
-
+
diff --git a/application/admin/views/scripts/review/myreview.phtml b/application/admin/views/scripts/review/myreview.phtml
index 317ea79e..e5e76fef 100644
--- a/application/admin/views/scripts/review/myreview.phtml
+++ b/application/admin/views/scripts/review/myreview.phtml
@@ -52,11 +52,12 @@
?>
邀请专家
- 更改管理员
- 查看详细
- 查看评审意见
- ' onclick="return confirm('是否确定取消评审')">取消评审
- 发布
+ 更改管理员
+ 查看详细
+ 查看评审意见
+ ' onclick="return confirm('是否确定取消评审')">取消评审
+ 发布
+ 删除
diff --git a/application/admin/views/scripts/stat/water.phtml b/application/admin/views/scripts/stat/water.phtml
index ca3df483..be5cfd81 100644
--- a/application/admin/views/scripts/stat/water.phtml
+++ b/application/admin/views/scripts/stat/water.phtml
@@ -23,14 +23,18 @@
- 关键词
- 数据服务次数
+ 关键词
+ 数据通过数
+ 数据拒绝数
type as $k=>$v)
- {
- echo ''.$v['keyword'].' '.$v['num'].' ';
+ {
+ if ($v['status']==5)
+ echo ''.$v['keyword'].' '.$v['num'].' ';
+ elseif ($v['status']==-1)
+ echo ''.$v['num'].' ';
}
?>
diff --git a/application/config.ini b/application/config.ini
index 3fffd23e..b03c0b1b 100755
--- a/application/config.ini
+++ b/application/config.ini
@@ -14,10 +14,10 @@ geonetwork.params.dbname = wdscar_geonetwork
watergeonetwork.url=http://210.77.68.237:8080/geonetwork/
waterdb.adapter = PDO_PGSQL
-waterdb.params.host = 210.77.68.252
-waterdb.params.username = wlz
-waterdb.params.password = glacier
-waterdb.params.dbname = new_geonetwork
+waterdb.params.host = 210.77.68.237
+waterdb.params.username = postgres
+waterdb.params.password = "test@))("
+waterdb.params.dbname = geonetwork252
heihedb.adapter = PDO_PGSQL
heihedb.params.host = 210.77.68.252
heihedb.params.username = wlz
@@ -27,6 +27,7 @@ heihedb.params.dbname = heihe
seekspace.url=http://seekspace.resip.ac.cn/
seekspace.handleurl=http://seekspace.resip.ac.cn/handle
google.maps.api=ABQIAAAACD-MqkkoOm60o_dvwdcKVhQZ6FKmpkjmtV0YgdpDmHkvWF4pMRRbrl4iUSDP3HkLNg5iOMge8vdOvg
+bigthumb.path=../geonetwork/data/
paths.base = /var/www/test.westgis.ac.cn
paths.data = /var/www/test.westgis.ac.cn/data
diff --git a/application/default/controllers/DataController.php b/application/default/controllers/DataController.php
index 245850ae..3bb6a7f8 100755
--- a/application/default/controllers/DataController.php
+++ b/application/default/controllers/DataController.php
@@ -12,30 +12,28 @@ class DataController extends Zend_Controller_Action
}
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();
//分类
- $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();
//关键词
- $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();
//$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();
- $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();
- $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();
//$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();
$this->view->keywords=array('place'=>$k1,'theme'=>$k2,'discipline'=>$k3,'stratum'=>$k4,'temporal'=>$k5);
//最新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();
//特色数据
@@ -78,34 +76,30 @@ class DataController extends Zend_Controller_Action
}
function onlinelistAction()
{
- $md=new MetadataTable();
- $db=$md->getAdapter();
$page=(int)$this->_request->getParam('page');
if (empty($page)) $page=1;
$limit=30;
$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();
$sum=$row[0]['count'];
- $select=$db->select();
- $select->from('metadata','*')->where('datatype=0')->order('title')->limitPage($page,$limit);
- $this->view->metadata = $db->fetchAll($select);
+ $select=$this->db->select();
+ $select->from('normalmetadata','*')->where('datatype=0')->order('title')->limitPage($page,$limit);
+ $this->view->metadata = $this->db->fetchAll($select);
$this->view->page=new Pagination($sum,$page,$limit);
}
function offlinelistAction()
{
- $md=new MetadataTable();
- $db=$md->getAdapter();
$page=(int)$this->_request->getParam('page');
if (empty($page)) $page=1;
$limit=30;
$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();
$sum=$row[0]['count'];
- $select=$db->select();
- $select->from('metadata','*')->where('datatype=1')->order('title')->limitPage($page,$limit);
- $this->view->metadata = $db->fetchAll($select);
+ $select=$this->db->select();
+ $select->from('normalmetadata','*')->where('datatype=1')->order('title')->limitPage($page,$limit);
+ $this->view->metadata = $this->db->fetchAll($select);
$this->view->page=new Pagination($sum,$page,$limit);
}
//展示最近20条离线神情记录情况
@@ -179,48 +173,44 @@ class DataController 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');
+ $state=$this->db->query('select count(*) from metadata');
$row=$state->fetchAll();
$sum=$row[0]['count'];
- $select=$db->select();
+ $select=$this->db->select();
$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);
}
function tagAction()
{
$id = (int)$this->_request->getParam('id');
$key = $this->_request->getParam('key');
- $md=new KeywordTable();
- $db=$md->getAdapter();
$page=(int)$this->_request->getParam('page');
if (empty($page)) $page=1;
$limit=10;
$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();
if ($id>0 or !empty($key)) {
if (empty($key)) {
- $where=$db->quoteInto('id = ?',$id);
+ $where=$this->db->quoteInto('id = ?',$id);
$row=$md->fetchRow($where);
$key=$row->name;
}
$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);
- $state=$db->query($sql);
+ $sql=$this->db->quoteInto('select count(m.id) from normalmetadata m,keyword k where m.id=k.id and k.keyword=?',$key);
+ $state=$this->db->query($sql);
$row=$state->fetchAll();
$sum=$row[0]['count'];
- $select=$db->select();
- $select->from('metadata','*')->join('keyword','metadata.id=keyword.id')->where('keyword.keyword=?',$key)->order('metadata.title')->limitPage($page,$limit);
+ $select=$this->db->select();
+ $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);
//$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);
}
}
@@ -237,51 +227,50 @@ class DataController extends Zend_Controller_Action
$id='';
}
$keyword=$this->_request->getParam('keyword');
- $md=new SeriesTable();
- $db=$md->getAdapter();
if (empty($id)) {
if (!empty($name))
{
- $where=$db->quoteInto('name = ?',$name);
- $row=$md->fetchRow($where);
+ $where=$this->db->quoteInto('name = ?',$name);
+ $row=$this->db->fetchRow("select * from series where ".$where);
}
} else {
- $where=$db->quoteInto('id = ?',$id);
- $row=$md->fetchRow($where);
+ $where=$this->db->quoteInto('id = ?',$id);
+ $row=$this->db->fetchRow("select * from series where ".$where);
}
if (!empty($id) or !empty($name))
{
if (!$row) $this->_redirect('/data');
- $id=$row->id;
+ $id=$row['id'];
}
$page=(int)$this->_request->getParam('page');
if (empty($page)) $page=1;
$limit=10;
$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();
if ($id>0) {
- $where=$db->quoteInto('id = ?',$id);
- $row=$md->fetchRow($where);
- $this->view->codename=$row->name;
+ //$where=$this->db->quoteInto('id = ?',$id);
+ //$row=$this->db->fetchRow("select * from series where ".$where);
+ $this->view->codename=$row['name'];
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=?';
- $row=$db->fetchAll($sql,array($id,$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=$this->db->fetchAll($sql,array($id,$keyword));
+ $this->view->codename.="【关键词:".$keyword."】";
}else{
- $sql='select count(m.id) as count from metadata m,dataseries d where m.id=d.id and d.sid=?';
- $row=$db->fetchAll($sql,array($id));
+ $sql='select count(m.id) as count from normalmetadata m,dataseries d where m.id=d.id and d.sid=?';
+ $row=$this->db->fetchAll($sql,array($id));
}
$sum=$row[0]['count'];
- $select=$db->select();
- $select->from('metadata','*')->join('dataseries','metadata.id=dataseries.id')->where('dataseries.sid=?',$id)->order('metadata.title')->limitPage($page,$limit);
- if (!empty($keyword)) $select->join('keyword','keyword.id=metadata.id')->where('keyword.keyword=?',$keyword);
- $this->view->metadata=$db->fetchAll($select);
+ $select=$this->db->select();
+ $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=normalmetadata.id')->where('keyword.keyword=?',$keyword);
+ $this->view->metadata=$this->db->fetchAll($select);
$this->view->page=new Pagination($sum,$page,$limit);
- $this->view->showtools=($sum>$page)?true:false;
- $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);
- $state=$db->query($sql);
+ //$this->view->showtools=($sum>$page)?true:false;
+ //$this->view->form=new SearchForm();
+ $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=$this->db->query($sql);
$row=$state->fetchAll();
$this->view->places=$row;
$this->view->seriesid=$id;
@@ -296,25 +285,19 @@ class DataController extends Zend_Controller_Action
{
$page = $this->_request->getParam('page');
$code = (int)$this->_request->getParam('code');
- $md=new CategoryCodeTable();
- $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');
+ $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();
if ($code>0 && $code<20) {
- $where=$db->quoteInto('code = ?',$code);
- $row=$md->fetchRow($where);
- $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';
- $state=$db->query($sql,array($code));
- $rows = $state->fetchAll();
-
- $paginator = Zend_Paginator::factory($rows);
- $paginator->setCurrentPageNumber($page);//($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;
-
+ $where=$this->db->quoteInto('code = ?',$code);
+ $row=$this->db->fetchRow("select * from categorycode where ".$where);
+ $this->view->codename=(empty($row['name_zh'])?$row['name']:$row['name_zh']);
+ $sql='select count(m.id) from normalmetadata m left join category c on m.id=c.id where c.code=?';
+ $row=$this->db->fetchRow($sql,array($code));
+ $sum=$row['count'];
+ $select=$this->db->select();
+ $select->from('normalmetadata as m','*')->joinLeft('category as c','m.id=c.id')->where('c.code=?',$code)->order('m.title')->limitPage($page,$this->limit);
+ $this->view->metadata=$this->db->fetchAll($select);
+ $this->view->page=new Pagination($sum,$page,$this->limit);
} else {
//提供全部分类列表
}
@@ -326,14 +309,14 @@ class DataController extends Zend_Controller_Action
function timelineAction()
{
$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']);
if (!file_exists($fn) || (filemtime($fn)<$last_update))
{
$dateformat="M j Y";
$md = new MetadataTable();
$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();
$timexml='';
foreach($rows as $row) {
@@ -372,7 +355,7 @@ class DataController extends Zend_Controller_Action
$id = (int)$this->_request->getParam('id');
$where='';
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);
$rows=$state->fetchAll();
$geomd=new GeoMetaData();
@@ -396,7 +379,7 @@ class DataController extends Zend_Controller_Action
*/
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);
}
/*
@@ -445,7 +428,7 @@ class DataController extends Zend_Controller_Action
//'generator' => 'Zend Framework Zend_Feed',
'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);
$feedArray['published']=strtotime($rs[0]['ts_created']);
foreach($rs as $r)
@@ -483,9 +466,9 @@ class DataController extends Zend_Controller_Action
$offset=$this->limit*($page-1);
$search=new Search($key);
$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'];
- $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->page=new Pagination($sum,$page,$this->limit);
$this->view->key=$key;
@@ -519,15 +502,15 @@ class DataController extends Zend_Controller_Action
$start=$this->_request->getParam('start');
$end=$this->_request->getParam('end');
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.'%'));
} 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));
}
$sum=$row[0]['count'];
$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.'%');
$select->order('title')->limit($limit,$offset);
$this->view->metadata = $db->fetchAll($select);
@@ -541,68 +524,71 @@ class DataController extends Zend_Controller_Action
*/
function viewAction()
{
- $md=new MetadataTable();
- $db=$md->getAdapter();
$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)) {
$uuid = $this->_request->getParam('uuid');
if (empty($uuid)) $this->_redirect('/data');
- $where=$db->quoteInto('uuid = ?',$uuid);
- $row=$md->fetchRow($where);
+ $where=$this->db->quoteInto('m.uuid = ?',$uuid);
} else {
- $where=$db->quoteInto('id = ?',$id);
- $row=$md->fetchRow($where);
+ $where=$this->db->quoteInto('m.id = ?',$id);
}
+ $sql.=$where;
+ $this->db->setFetchMode(Zend_Db::FETCH_OBJ);
+ $row=$this->db->fetchRow($sql);
if (!$row) $this->_redirect('/data');
$id=$row->id;
$uuid=$row->uuid;
$this->view->metadata=$row;
- //提前对表格进行预处理
+ //提前对表格进行预处理
$wiki=new WikiFormat();
$this->view->metadata->description=$wiki->parseTable($this->view->escape($row->description));
//处理外部链接
- $this->view->metadata->description=preg_replace('/\[\s*(http:\/\/.+?)\s+(.*?)\]/m','$2 ',$this->view->metadata->description);
+ $this->view->metadata->description=preg_replace('/\[\s*(http:\/\/.+?)\s+(.*?)\]/m','$2 ',$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))
{
$sql="select proj4text from spatial_ref_sys where auth_srid=?";
- $rs=$db->fetchRow($sql,array((int)$row->projection));
- if ($rs) $this->view->projection=$rs['proj4text'];
+ $rs=$this->db->fetchRow($sql,array((int)$row->projection));
+ 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));
$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();
$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();
- $sql=$db->quoteInto("select count(*) as count from dataorder where uuid=?",$uuid);
- $row=$db->fetchRow($sql);
- $this->view->downloaded=$row['count'];
+ $sql=$this->db->quoteInto("select count(*) as count from dataorder where uuid=?",$uuid);
+ $row=$this->db->fetchRow($sql);
+ $this->view->downloaded=$row->count;
//update the viewed times
$sql="update mdstat set viewed=viewed+1 where uuid=?";
- $db->query($sql,array($uuid));
- $sql=$db->quoteInto("select viewed from mdstat where uuid=?",$uuid);
- $row=$db->fetchRow($sql);
- $this->view->viewed=$row['viewed'];
+ $this->db->query($sql,array($uuid));
+ $sql=$this->db->quoteInto("select viewed from mdstat where uuid=?",$uuid);
+ $row=$this->db->fetchRow($sql);
+ $this->view->viewed=$row->viewed;
//数据文档
$sql="select linkage from onlineresource where uuid=? and description='数据说明文档'";
- $sql=$db->quoteInto($sql,$uuid);
- $row=$db->fetchRow($sql);
- if ($row) $this->view->doc=$row['linkage'];
+ $sql=$this->db->quoteInto($sql,$uuid);
+ $row=$this->db->fetchRow($sql);
+ if ($row) $this->view->doc=$row->linkage;
//相关资源
$sql="select * from onlineresource where uuid=? and description<>'数据说明文档' and (linkage not like '%ftp.westgis%') and name<>'元数据地址'";
- $sql=$db->quoteInto($sql,$uuid);
- $this->view->resources=$db->fetchAll($sql);
+ $sql=$this->db->quoteInto($sql,$uuid);
+ $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=$db->quoteInto($sql,$uuid);
- $this->view->ref=$db->fetchAll($sql);
+ $sql=$this->db->quoteInto($sql,$uuid);
+ $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";
- $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=?";
- $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 kw.id<>? limit 10";
@@ -611,9 +597,9 @@ class DataController extends Zend_Controller_Action
$sql="select * from knl_article where ";
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";
@@ -650,6 +636,18 @@ class DataController extends Zend_Controller_Action
$content=$stripper->filter($formdata['content']);
$author=$stripper->filter($formdata['author']);
$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']='';
}
} elseif ($user) {
@@ -673,16 +671,24 @@ class DataController extends Zend_Controller_Action
if (empty($uuid)) die();
$sql="select * from comments where uuid=? order by id desc";
$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=$c['author'];
$author=($c['userid'])?"".$author." ":$author;
$author=($c['url'])?''.$author.' ':$author;
- print "";
+ print "";
}
+ echo ''.$paginator.'
';
}//else echo "No comments. ";
}
@@ -1199,19 +1205,18 @@ class DataController extends Zend_Controller_Action
{
$id = (int)$this->_request->getParam('id');
if ($id>0) {
- $md=new ThumbnailTable();
- $thumb=$md->fetchRow('id='.$id);
+ $thumb=$this->db->fetchRow($this->db->quoteInto('select * from thumbnail where id=?',$id));
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender();
- if (empty($thumb->data)) {
+ if (empty($thumb['data'])) {
header("Content-Type:image/png");
header("Content-Length: " . filesize("images/nothumb.png"));
$file=fopen("images/nothumb.png",'r');
fpassthru($file);
exit;
} else {
- header("Content-Type:image/".$thumb->filetype);
- print base64_decode($thumb->data);
+ header("Content-Type:image/".$thumb['filetype']);
+ print base64_decode($thumb['data']);
}
}
}
@@ -1354,7 +1359,7 @@ class DataController extends Zend_Controller_Action
{
$this->_helper->layout->disableLayout();
$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);
foreach($md as $m)
{
@@ -1380,33 +1385,34 @@ class DataController extends Zend_Controller_Action
{
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender();
- $uuid=$this->_request->getParam('uuid');
+ $uuid=$this->_request->getParam('uuid');
$review=$this->_request->getParam('review');
if (!empty($uuid))
{
$sql="select x.data,m.title,m.description,g.id,m.projection from xml x left join metadata m on m.id=x.id left join geonetworkmetadata g on g.uuid=m.uuid where m.uuid=".$this->db->quote($uuid);
- $row=$this->db->fetchRow($sql);
+ $row=$this->db->fetchRow($sql);
$sql="select r.* from reference r left join mdref m on m.refid=r.id where m.uuid=?";
$sql=$this->db->quoteInto($sql,$uuid);
- $ref=$this->db->fetchAll($sql);
- $reference='';
- foreach($ref as $refer)
- {
- $reference.=''.$refer['reference'].' ';
- }
+ $ref=$this->db->fetchAll($sql);
+ $reference='';
+ foreach($ref as $refer)
+ {
+ $reference.=''.$refer['reference'].' ';
+ }
$reference.=' ';
if (is_numeric($row['projection']))
{
$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 (empty($prjection)) $projection=$row['projection'];
- }
+ }
+ if (empty($projection)) $projection=$row['projection'];
+ } else
+ $projection='';
$dom = new DOMDocument();
$dom->loadXML($row['data']);
- //提前对表格进行预处理
+ //提前对表格进行预处理
$wiki=new WikiFormat();
$abs=$wiki->parseTable($this->view->escape($row["description"]));
//处理外部链接
@@ -1418,8 +1424,8 @@ class DataController extends Zend_Controller_Action
$xslt = new XSLTProcessor();
$xslt->registerPHPFunctions();
$xslt->setParameter('', 'thumburl', $thumburl);
- $xslt->setParameter('', 'abstract', $abs);
- $xslt->setParameter('','projection',$projection);
+ $xslt->setParameter('', 'abstract', $abs);
+ $xslt->setParameter('','projection',$projection);
$xslt->setParameter('','reference',$reference);
$XSL = new DOMDocument();
$XSL->load( '../data/doc.xsl', LIBXML_NOCDATA);
@@ -1428,7 +1434,7 @@ class DataController extends Zend_Controller_Action
';
$content.=''.$row['title'].' ';
$content.='
';
- $content.=$xslt->transformToXML($dom);
+ $content.=$xslt->transformToXML($dom);
if ($review==1) $content.=file_get_contents('../data/review-table.htm',true);
$content.="";
$this->getResponse()->setHeader('Content-Type', 'application/vnd.ms-doc')
diff --git a/application/default/controllers/HeiheController.php b/application/default/controllers/HeiheController.php
index 31bcc780..b2a6ce3c 100644
--- a/application/default/controllers/HeiheController.php
+++ b/application/default/controllers/HeiheController.php
@@ -36,11 +36,15 @@ class HeiheController extends DataController
$page=(int)$this->_request->getParam('page');
if (empty($page)) $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();
$sum=$row[0]['count'];
$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->page=new Pagination($sum,$page,$this->limit);
}
@@ -50,9 +54,9 @@ class HeiheController extends DataController
$page=(int)$this->_request->getParam('page');
if (empty($page)) $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'];
- $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->page=new Pagination($sum,$page,$this->limit,"文献");
$this->view->offset=$offset+1;
diff --git a/application/default/controllers/IndexController.php b/application/default/controllers/IndexController.php
index 1bec4e03..f6304505 100755
--- a/application/default/controllers/IndexController.php
+++ b/application/default/controllers/IndexController.php
@@ -31,7 +31,7 @@ class IndexController extends Zend_Controller_Action
$sql="select * from datafeature order by id desc";
$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);
//下载最多数据(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)";
diff --git a/application/default/controllers/ReviewController.php b/application/default/controllers/ReviewController.php
index 3b7c760d..67557b69 100644
--- a/application/default/controllers/ReviewController.php
+++ b/application/default/controllers/ReviewController.php
@@ -1,6 +1,7 @@
view->config = Zend_Registry::get('config');
@@ -28,249 +29,81 @@ class ReviewController extends Zend_Controller_Action
}
function myreviewAction(){
-
- $keyword = $this->_request->getParam('q');
- $search = $this->_request->getParam('search');
-
- try{
- $auth = Zend_Auth::getInstance();
- if($auth->hasIdentity())
- {
- $user = $auth->getIdentity();
- $uid = $user->id;
- }
- else
- {
- $this->_redirect('/account/login/?href=/review/myreview');
- }
-
- $wheresql = array();
- $wheresql[]=" r.userid='$uid' ";
-
- if(!empty($keyword) && !empty($search))
- {
- if (preg_match("/[<|>|#|$|%|^|*|(|)|{|}|'|\"|;|:]/i",$keyword) || !is_numeric($search))
- {
- $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');
- }
-
+ $auth = Zend_Auth::getInstance();
+ if($auth->hasIdentity())
+ {
+ $user = $auth->getIdentity();
+ $uid = $user->id;
+ }else{
+ $this->_redirect('/account/login/?href=/review/myreview');
+ }
+ $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 m.uuid in (select uuid from mdexpertreview er where er.id=$uid union select uuid from mdreview r where r.userid=$uid)");
+ $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)
+ {
+ $this->view->metadata[$k]['statustext']=$this->rewritestatus($v['status']);
+ }
}//我参审的
function draftAction(){
-
- $keyword = $this->_request->getParam('q');
- $search = $this->_request->getParam('search');
-
- try{
-
- $wheresql = array();
- $wheresql[]=" ms.status=0 ";
-
- 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');
- }
-
+ $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 metadata m on s.uuid=m.uuid where s.status in (0)");
+ $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 ?";
+ $this->view->metadata=$this->db->fetchAll($sql,array($this->limit,$offset));
+ $this->view->page=new Pagination($sum,$page,$this->limit);
}//最新收稿
function acceptAction(){
-
- $keyword = $this->_request->getParam('q');
- $search = $this->_request->getParam('search');
-
- try{
-
- $wheresql = array();
- $wheresql[]=" ms.status=1 ";
-
- 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');
- }
-
+ $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 in (1)");
+ $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 ?";
+ $this->view->metadata=$this->db->fetchAll($sql,array($this->limit,$offset));
+ $this->view->page=new Pagination($sum,$page,$this->limit);
}//最新收稿
function inreviewAction(){
-
- $keyword = $this->_request->getParam('q');
- $search = $this->_request->getParam('search');
-
- try{
-
- $wheresql = array();
- $wheresql[]=" ms.status in (2,3,4) ";
-
- 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');
- }
-
+ $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 in (2,3,4)");
+ $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 ?";
+ $this->view->metadata=$this->db->fetchAll($sql,array($this->limit,$offset));
+ $this->view->page=new Pagination($sum,$page,$this->limit);
}//在审阶段的元数据
function reviewedAction(){
-
- $keyword = $this->_request->getParam('q');
- $search = $this->_request->getParam('search');
-
- try{
-
- $wheresql = array();
- $wheresql[]=" ms.status=5 ";
-
- 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');
- }
-
+ $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 in (5)");
+ $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 ?";
+ $this->view->metadata=$this->db->fetchAll($sql,array($this->limit,$offset));
+ $this->view->page=new Pagination($sum,$page,$this->limit);
}//已完成评审的元数据
- function rewiterstatus($status){
+ function rewritestatus($status){
if($status==-1)
{return "取消评审";}
else if($status==0)
- {return "初始状态";}
+ {return "投稿元数据";}
else if($status==1)
- {return "接受元数据评审";}
+ {return "接收元数据";}
else if($status==2)
{return "专家评审中";}
else if($status==3)
@@ -320,12 +153,12 @@ class ReviewController extends Zend_Controller_Action
$redirectlink='/review/review/uuid/'.$uuid.'/';
- if($md['status']==5)
+ if($md['status']>5)
{
$this->messenger->addMessage('该数据已经通过评审,不能再发表评审意见,如需提交问题,请联系数据管理员');
$this->_redirect($redirectlink);
}
- if($md['status']==0)
+ if($md['status']<1)
{
$this->messenger->addMessage('已被数据中心接收的数据才可以进行评审');
$this->_redirect($redirectlink);
@@ -482,7 +315,28 @@ class ReviewController extends Zend_Controller_Action
echo $stringbuffer.''.$paginator.'
';
- }//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']);
+ }
+ }
+ }
}
diff --git a/application/default/controllers/ServiceController.php b/application/default/controllers/ServiceController.php
index 63ec9b6b..b8bc6752 100644
--- a/application/default/controllers/ServiceController.php
+++ b/application/default/controllers/ServiceController.php
@@ -4,8 +4,6 @@ class ServiceController extends Zend_Controller_Action
private $limit=10;
function __call($id, $arguments)
{
- Zend_Debug::dump($arguments,'argu');
- Zend_Debug::dump($id,'id');
$this->_helper->viewRenderer->setNoRender();
$this->_helper->layout->disableLayout();
}
@@ -35,23 +33,64 @@ class ServiceController extends Zend_Controller_Action
*/
function thumbAction()
{
- $this->_helper->layout->disableLayout();
- $this->_helper->viewRenderer->setNoRender();
- $uuid = $this->_request->getParam('uuid');
- $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-Length: " . filesize("images/nothumb.png"));
- $file=fopen("images/nothumb.png",'r');
- fpassthru($file);
- } else {
- header("Content-Type:image/".$thumb['filetype']);
- print base64_decode($thumb['data']);
- }
- }
+ $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->viewRenderer->setNoRender();
+ if (empty($thumb['data'])) {
+ header("Content-Type:image/png");
+ header("Content-Length: " . filesize("images/nothumb.png"));
+ $file=fopen("images/nothumb.png",'r');
+ fpassthru($file);
+ exit;
+ } else {
+ header("Content-Type:image/".$thumb['filetype']);
+ print base64_decode($thumb['data']);
+ }
+ }
/*
- * 高级搜索, 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()
{
@@ -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数据
@@ -136,14 +155,6 @@ class ServiceController extends Zend_Controller_Action
}
$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()
{
@@ -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 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( '' , $indent_level ) . "";
- 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 = '
' . substr ( $line , 2 );
- $last_tag = array_pop ( $last_tag_history );
-
- if ( !array_pop ( $has_opened_tr ) ) {
- $line = " {$line}";
- }
-
- if ( array_pop ( $tr_history ) ) {
- $line = " {$line}";
- }
-
- if ( array_pop ( $td_history ) ) {
- $line = "{$last_tag}>{$line}";
- }
- array_pop ( $tr_attributes );
- $lines[$key] = $line . str_repeat( '' , $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 = '';
- }
-
- 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 = "\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[] = '' ;
- }
- if ( array_pop ( $tr_history ) ) {
- $lines[] = ' ' ;
- }
- if ( !array_pop ( $has_opened_tr ) ) {
- $lines[] = " " ;
- }
-
- $lines[] = '' ;
- }
-
- $output = implode ( "\n" , $lines ) ;
-
- //@todo:移除中所有的换行符
- //可能存在问题
- $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 == "" ) {
- $output = '';
- }
-
- return $output;
- }
-
}
diff --git a/application/default/views/scripts/data/advancesearch.phtml b/application/default/views/scripts/data/advancesearch.phtml
index 77996de8..9107662b 100644
--- a/application/default/views/scripts/data/advancesearch.phtml
+++ b/application/default/views/scripts/data/advancesearch.phtml
@@ -11,40 +11,37 @@ $this->breadcrumb('首页 ');
$this->breadcrumb(''.$this->config->title->data.' ');
$this->breadcrumb('高级搜索');
$this->breadcrumb()->setSeparator(' > ');
+$this->headScript()->appendFile('http://maps.google.cn/maps?file=api&v=2&key='.$this->config->google->maps->api);
?>
= $this->partial('data/tools.phtml'); ?>
-metadata)) : ?>
-page->getNavigation();
-foreach($this->metadata as $md) : ?>
+metadata)) :
+ echo $this->page->getNavigation();?>
+
+metadata as $md) : ?>
-
+
400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?>
-
page->getNavigation();?>
-
-
-
-
+
空间范围
东:
@@ -98,7 +95,7 @@ foreach($this->metadata as $md) : ?>
-
搜索说明 关键词:您可以使用一个关键词,比如"沙漠",也可以使用多个关键词,中间用空格分开。
+ 搜索说明 关键词:您可以使用一个关键词,比如“沙漠”,也可以使用多个关键词,中间用空格分开。
空间范围:这是以度为单位的十进制数字。比如,东经125度30分,可以输入为125.5。您也可以通过下面的在线地图工具直接在图上拉框选择一个范围,空间坐标会自动转换到文本框中。
时间范围:指数据的时间范围,从开始时间到结束时间,若结束时间不填,则是一个时间点。时间格式为YYYY-MM-DD。
还不清楚?您可以到论坛 提问。
diff --git a/application/default/views/scripts/data/browse.phtml b/application/default/views/scripts/data/browse.phtml
index dd25901b..7892ffdf 100755
--- a/application/default/views/scripts/data/browse.phtml
+++ b/application/default/views/scripts/data/browse.phtml
@@ -13,16 +13,13 @@ $this->breadcrumb()->setSeparator(' > ');
= $this->partial('data/tools.phtml'); ?>
page->getNavigation(); ?>
-metadata as $md) : ?>
+metadata as $md) : ?>
-
+
',mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']));?>
-
page->getNavigation(); ?>
\ No newline at end of file
diff --git a/application/default/views/scripts/data/category.phtml b/application/default/views/scripts/data/category.phtml
index b36f458e..fe96d9a9 100755
--- a/application/default/views/scripts/data/category.phtml
+++ b/application/default/views/scripts/data/category.phtml
@@ -23,29 +23,20 @@ $this->breadcrumb()->setSeparator(' > ');
-
-
-paginator)): ?>
-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 '
-
-
-
'.$item['description'].'
-
';
-endforeach;
-?>
+metadata)) : ?>
+
+
当前浏览:codename; ?>
+page->getNavigation(); ?>
+
+metadata as $md) : ?>
+
+
+
+
400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?>
+
+
+page->getNavigation(); ?>
+
-
-= $this->paginator; ?>
-
-
\ No newline at end of file
diff --git a/application/default/views/scripts/data/delete.phtml b/application/default/views/scripts/data/delete.phtml
deleted file mode 100755
index 324ed331..00000000
--- a/application/default/views/scripts/data/delete.phtml
+++ /dev/null
@@ -1,15 +0,0 @@
-md) :?>
-Are you sure that you want to delete this metadata:
-
escape($this->md->title); ?>
- escape($this->md->description); ?>
-
-
-
-
-
-
-
-
-
-Cannot find the metadata.
-
diff --git a/application/default/views/scripts/data/download.phtml b/application/default/views/scripts/data/download.phtml
index d392a707..9cc18f21 100644
--- a/application/default/views/scripts/data/download.phtml
+++ b/application/default/views/scripts/data/download.phtml
@@ -11,7 +11,7 @@
?>
md['title']; ?>(md['filesize']; ?>MB)
-
+
page->getNavigation(); ?>
-metadata as $md) : ?>
+metadata as $md) : ?>
diff --git a/application/default/views/scripts/data/onlinelist.phtml b/application/default/views/scripts/data/onlinelist.phtml
index 129305fc..f798990b 100755
--- a/application/default/views/scripts/data/onlinelist.phtml
+++ b/application/default/views/scripts/data/onlinelist.phtml
@@ -14,11 +14,12 @@ $this->breadcrumb()->setSeparator(' > ');
= $this->partial('data/tools.phtml'); ?>
page->getNavigation(); ?>
-metadata as $md) : ?>
+metadata as $md) : ?>
diff --git a/application/default/views/scripts/data/pagination_ajax.phtml b/application/default/views/scripts/data/pagination_ajax.phtml
new file mode 100644
index 00000000..7798ce21
--- /dev/null
+++ b/application/default/views/scripts/data/pagination_ajax.phtml
@@ -0,0 +1,26 @@
+pageCount): ?>
+
+
\ No newline at end of file
diff --git a/application/default/views/scripts/data/search.phtml b/application/default/views/scripts/data/search.phtml
index ca1e9266..280e8779 100755
--- a/application/default/views/scripts/data/search.phtml
+++ b/application/default/views/scripts/data/search.phtml
@@ -12,15 +12,15 @@ $this->breadcrumb('快速搜索');
$this->breadcrumb()->setSeparator(' > ');
?>
-= $this->partial('data/tools.phtml'); ?>
+= $this->partial('data/tools.phtml',array('key'=>$this->key)); ?>
-form; ?>
+
metadata)) : ?>
page->getNavigation();
foreach($this->metadata as $md) : ?>
-
+
400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?>
diff --git a/application/default/views/scripts/data/series.phtml b/application/default/views/scripts/data/series.phtml
index 8a91f765..15406fa5 100755
--- a/application/default/views/scripts/data/series.phtml
+++ b/application/default/views/scripts/data/series.phtml
@@ -34,12 +34,11 @@ $this->breadcrumb()->setSeparator(' > ');
metadata)) : ?>
当前浏览数据集序列:codename; ?>
-showtools) echo $this->form; ?>
page->getNavigation(); ?>
-metadata as $md) : ?>
+metadata as $md) : ?>
-
+
400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?>
diff --git a/application/default/views/scripts/data/tag.phtml b/application/default/views/scripts/data/tag.phtml
index 8e9fb477..dfd42c86 100755
--- a/application/default/views/scripts/data/tag.phtml
+++ b/application/default/views/scripts/data/tag.phtml
@@ -17,16 +17,17 @@ $this->breadcrumb()->setSeparator(' > ');
当前浏览:codename; ?>
page->getNavigation(); ?>
-metadata as $md) : ?>
-
+metadata as $md) : ?>
+
400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?>
+page->getNavigation(); ?>
diff --git a/application/default/views/scripts/data/thumb.phtml b/application/default/views/scripts/data/thumb.phtml
deleted file mode 100755
index bd126a1f..00000000
--- a/application/default/views/scripts/data/thumb.phtml
+++ /dev/null
@@ -1,7 +0,0 @@
-thumb->data)) {
- } else {
- header("Content-Type:image/jpeg");
- print base64_decode($this->thumb->data);
- }
-?>
\ No newline at end of file
diff --git a/application/default/views/scripts/data/timemap.phtml b/application/default/views/scripts/data/timemap.phtml
index a7000e2e..c55291a7 100644
--- a/application/default/views/scripts/data/timemap.phtml
+++ b/application/default/views/scripts/data/timemap.phtml
@@ -8,7 +8,7 @@ $this->breadcrumb('
首页 ');
$this->breadcrumb('
'.$this->config->title->data.' ');
$this->breadcrumb('
时空导航 ');
$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_js/timeline-api.js');
$this->headScript()->appendFile('/js/timemap/timemap.js');
@@ -59,7 +59,7 @@ window.onload=function() {
"title" : "",
"options" : {
// set the full HTML for the info window
- "infoHtml": "
> />"
+ "infoHtml": "
> />"
}
},
diff --git a/application/default/views/scripts/data/tmp.js b/application/default/views/scripts/data/tmp.js
deleted file mode 100755
index 6509e348..00000000
--- a/application/default/views/scripts/data/tmp.js
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
diff --git a/application/default/views/scripts/data/tools.phtml b/application/default/views/scripts/data/tools.phtml
index fb7dd85d..31c56fe4 100755
--- a/application/default/views/scripts/data/tools.phtml
+++ b/application/default/views/scripts/data/tools.phtml
@@ -1,11 +1,28 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/application/default/views/scripts/data/view.phtml b/application/default/views/scripts/data/view.phtml
index 60d99f58..731cebfc 100755
--- a/application/default/views/scripts/data/view.phtml
+++ b/application/default/views/scripts/data/view.phtml
@@ -8,10 +8,11 @@
$this->breadcrumb('
'.$this->config->title->data.' ');
$this->breadcrumb('Details');
$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/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');
?>
metadata;if ($md):?>
@@ -22,7 +23,7 @@ if ($md->title_en) echo '
'.$this->escape($md->title_en);?>
@@ -30,15 +31,15 @@ if ($md->title_en) echo '
'.$this->escape($md->title_en);?>
$kt='';
$i=0;
foreach($this->keys as $cg) :
- if ($kt==$cg['keytype']) :
+ if ($kt==$cg->keytype) :
$i+=1;
else :
if (!empty($kt)) echo '
';
- $kt=$cg['keytype'];
+ $kt=$cg->keytype;
$i=0;
endif;
- if ($i==0) echo '
';
series): ?>
@@ -94,10 +95,13 @@ else
Distributed method: datatype) print "Offline"; else print "Online";?> Files list
-datatype) : ?>
+status>0 and $md->status<5) : ?>
+
+datatype) : ?>
+
@@ -113,24 +117,24 @@ $party_zh=array('resourceProvider'=>'Resource Provider','custodian'=>'Custodian'
$r='';
$i=0;
foreach($this->authors as $k=>$author) :
-if ($author['role']!=$r)
+if ($author->role!=$r)
{
- $r=$author['role'];
+ $r=$author->role;
$i=0;
if ($k>0) echo '';
- echo '
'.$party_zh[$author['role']].': ';
+ echo ' '.$party_zh[$author->role].':';
}
if ($i>0) echo ', ';
$i+=1;
- if (!empty($author['email']) && $r!='principalInvestigator')
- echo '';
- echo '';
- if (!empty($author['individual']))
- echo $author['individual'];
+ if (!empty($author->email) && $r!='principalInvestigator')
+ echo '';
+ echo '';
+ if (!empty($author->individual))
+ echo $author->individual;
else
- echo $author['organisation'];
+ echo $author->organisation;
echo ' ';
- if (!empty($author['email'])) echo ' ';
+ if (!empty($author->email)) echo ' ';
if ($k+1==count($this->authors)) echo ' ';
endforeach;
?>
@@ -143,7 +147,7 @@ endforeach;
-
+
',$md->description);?>
@@ -161,10 +165,10 @@ endforeach;
References
ref as $ref) :
- if (empty($ref['link']))
- echo ''.$ref['reference'].' ';
+ if (empty($ref->link))
+ echo ''.$ref->reference.' ';
else
- echo ''.$ref['reference'].' 下载 ';
+ echo ''.$ref->reference.' 下载 ';
endforeach;
?>
@@ -173,7 +177,7 @@ endforeach;
uselimits) :
foreach($this->uselimits as $uselimit) :
-echo '
'.str_replace(array("\r\n", "\n", "\r"),'
',$this->escape($uselimit['uselimit'])).'
';
+echo '
'.str_replace(array("\r\n", "\n", "\r"),'
',$this->escape($uselimit->uselimit)).'
';
endforeach;
?>
@@ -189,14 +193,14 @@ endforeach;
resources) : ?>
Online resources
@@ -209,7 +213,7 @@ endforeach;
Related data
@@ -219,14 +223,14 @@ endforeach;
Related literature
literature as $r) :
-$u=parse_url($r['url']);
+$u=parse_url($r->url);
if ($u['host']=='hdl.handle.net')
$url=$this->config->seekspace->handleurl.$u['path'];
else
- $url=$r['url'];
+ $url=$r->url;
echo '';
if ($url) echo '';
-echo $r['title'];
+echo $r->title;
if ($url) echo ' ';
echo ' ';
?>
@@ -239,17 +243,22 @@ echo '';
Related documents
@@ -265,7 +274,7 @@ echo '';
-
@@ -289,7 +298,8 @@ function todownload(ft)
function loading(){$('loading').style.display = 'block';}
function done(){$('loading').style.display = 'none';}
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; ?>',{
method : 'get', // http 请求方法,get or post
parameters : request_pars, // 请求参数
@@ -297,7 +307,8 @@ function reportError(request){alert('Sorry. There was an error.');}
onLoading : loading, // 加载时
onComplete : done // 读取完毕
});
-
+}
+ajaxpage(0);
//google map
var map = new GMap2(document.getElementById("watermap"));
var plotbounds=new GLatLngBounds(new GLatLng(= $md->south; ?>,= $md->west; ?>),new GLatLng(= $md->north; ?>,= $md->east; ?>));
diff --git a/application/default/views/scripts/header.phtml b/application/default/views/scripts/header.phtml
index 979114d3..030bb30b 100755
--- a/application/default/views/scripts/header.phtml
+++ b/application/default/views/scripts/header.phtml
@@ -1,27 +1,33 @@
-
-
-
-
+
diff --git a/application/default/views/scripts/heihe/document.phtml b/application/default/views/scripts/heihe/document.phtml
new file mode 100644
index 00000000..08702931
--- /dev/null
+++ b/application/default/views/scripts/heihe/document.phtml
@@ -0,0 +1,52 @@
+headTitle($this->config->title->site);
+$this->headTitle($this->config->title->data);
+$this->headTitle()->setSeparator(' - ');
+$this->headLink()->appendStylesheet('/css/water.css');
+$this->breadcrumb('
首页 ');
+$this->breadcrumb('
'.$this->config->title->data.' ');
+$this->breadcrumb('
数字黑河 ');
+$this->breadcrumb('试验文档');
+$this->breadcrumb()->setSeparator(' > ');
+?>
+
+
+
+
+
+
黑河数据清单:
+
+数据清单详版2011
+数据清单简版2011
+
+
数字黑河总结文献:
+
+李新, 程国栋, 吴立宗. 数字黑河的思考与实践1:为流域科学服务的数字流域. 地球科学进展, 2010, 25(3): 297-305.
+
+李新, 吴立宗, 马明国, 盖迎春, 冉有华, 王亮绪, 南卓铜. 数字黑河的思考与实践2:数据集成. 地球科学进展, 2010, 25(3): 306-316.
+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.
+
+
+
+
数据相关文献
+refs) : ?>
+page->getNavigation(); ?>
+
+
+ refs as $md) : ?>
+ 下载';
+}
+ ?>
+
+
+
+
+
+
\ No newline at end of file
diff --git a/application/default/views/scripts/heihe/navi.phtml b/application/default/views/scripts/heihe/navi.phtml
index a4fb4f09..24373201 100644
--- a/application/default/views/scripts/heihe/navi.phtml
+++ b/application/default/views/scripts/heihe/navi.phtml
@@ -22,6 +22,7 @@
@@ -37,13 +40,13 @@
\ No newline at end of file
diff --git a/application/default/views/scripts/heihe/tag.phtml b/application/default/views/scripts/heihe/tag.phtml
index b3a6f531..8889beb3 100755
--- a/application/default/views/scripts/heihe/tag.phtml
+++ b/application/default/views/scripts/heihe/tag.phtml
@@ -16,6 +16,7 @@ $this->breadcrumb()->setSeparator(' > ');
+
metadata)) : ?>
关键词:codename; ?> 【全部关键词 】
diff --git a/application/default/views/scripts/heihe/thumb.phtml b/application/default/views/scripts/heihe/thumb.phtml
index 69d134eb..6f8f4cf3 100644
--- a/application/default/views/scripts/heihe/thumb.phtml
+++ b/application/default/views/scripts/heihe/thumb.phtml
@@ -4,6 +4,7 @@
$this->headTitle('全部浏览');
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/water.css');
+$this->headScript()->appendFile('/js/pubfunc.js');
$this->breadcrumb('
首页 ');
$this->breadcrumb('
'.$this->config->title->data.' ');
$this->breadcrumb('
数字黑河 ');
@@ -19,10 +20,19 @@ $this->breadcrumb()->setSeparator(' > ');
page->getNavigation(); ?>
-metadata as $md) : ?>
+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']);
+?>
-
-
+
+
+
+
+
diff --git a/application/default/views/scripts/heihe/timemap.phtml b/application/default/views/scripts/heihe/timemap.phtml
index fad998c9..02d71e6f 100644
--- a/application/default/views/scripts/heihe/timemap.phtml
+++ b/application/default/views/scripts/heihe/timemap.phtml
@@ -48,7 +48,7 @@ window.onload=function() {
"title" : "",
"options" : {
// set the full HTML for the info window
- "infoHtml": "
",
+ "infoHtml": "
",
"theme":"orange"
}
},
diff --git a/application/default/views/scripts/heihe/view.phtml b/application/default/views/scripts/heihe/view.phtml
index eb34395b..75e40c82 100755
--- a/application/default/views/scripts/heihe/view.phtml
+++ b/application/default/views/scripts/heihe/view.phtml
@@ -10,13 +10,11 @@
$this->breadcrumb('
数字黑河 ');
$this->breadcrumb('查看元数据');
$this->breadcrumb()->setSeparator(' > ');
- //http://westdc.westgis.ac.cn
- //$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('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/OpenLayers.js');
$this->headScript()->appendFile('/js/window.js');
+ $this->headScript()->appendFile('/js/pubfunc.js');
$this->headLink()->appendStylesheet('/js/theme/default/style.css');
?>
@@ -124,39 +125,41 @@ $party_zh=array('resourceProvider'=>'资源提供者','custodian'=>'维护者','
$r='';
$i=0;
foreach($this->authors as $k=>$author) :
-if ($author['role']!=$r)
+if ($author->role!=$r)
{
- $r=$author['role'];
+ $r=$author->role;
$i=0;
if ($k>0) echo '';
- echo '
'.$party_zh[$author['role']].':';
+ echo ' '.$party_zh[$author->role].':';
}
if ($i>0) echo ',';
$i+=1;
- if (!empty($author['email']) && $r!='principalInvestigator')
- echo '';
- echo '';
- if (!empty($author['individual']))
- echo $author['individual'];
+ if (!empty($author->email) && $r!='principalInvestigator')
+ echo '';
+ echo '';
+ if (!empty($author->individual))
+ echo $author->individual;
else
- echo $author['organisation'];
+ echo $author->organisation;
echo ' ';
- if (!empty($author['email'])) echo ' ';
+ if (!empty($author->email)) echo ' ';
if ($k+1==count($this->authors)) echo ' ';
endforeach;
?>
- 元数据更新时间:ts_created)); ?>
-
+ 元数据更新时间:ts_created)); ?>
+
+
+
-
+
',$md->description);?>
@@ -173,10 +176,10 @@ endforeach;
建议参考文献
ref as $ref) :
- if (empty($ref['link']))
- echo ''.$ref['reference'].' ';
+ if (empty($ref->link))
+ echo ''.$ref->reference.' ';
else
- echo ''.$ref['reference'].' 下载 ';
+ echo ''.$ref->reference.' 下载 ';
endforeach;
?>
@@ -185,7 +188,7 @@ endforeach;
uselimits) :
foreach($this->uselimits as $uselimit) :
-echo '
'.str_replace(array("\r\n", "\n", "\r"),'
',$this->escape($uselimit['uselimit'])).'
';
+echo '
'.str_replace(array("\r\n", "\n", "\r"),'
',$this->escape($uselimit->uselimit)).'
';
endforeach;
?>
@@ -201,14 +204,14 @@ endforeach;
resources) : ?>
其他在线资源
@@ -217,6 +220,9 @@ endforeach;
diff --git a/application/default/views/scripts/heihe_header.phtml b/application/default/views/scripts/heihe_header.phtml
index 0334c74d..7a53a7b6 100644
--- a/application/default/views/scripts/heihe_header.phtml
+++ b/application/default/views/scripts/heihe_header.phtml
@@ -1,29 +1,33 @@
-
-
-
-
-
-
-hasIdentity())
- {
- $user = $auth->getIdentity();
- echo '
'.$user->username.' ';
- if ($user->usertype=="administrator") echo '
后台管理 ';
- echo '
数据篮 注销 ';
- } else {
- echo '
登录 注册 ';
- }
-?>
-
-
+
diff --git a/application/default/views/scripts/index/index.phtml b/application/default/views/scripts/index/index.phtml
index 278785de..f85fc366 100755
--- a/application/default/views/scripts/index/index.phtml
+++ b/application/default/views/scripts/index/index.phtml
@@ -1,97 +1,99 @@
-headTitle($this->config->title->site);
- $this->headTitle('Home');
- $this->headTitle()->setSeparator(' - ');
- $this->headLink()->appendStylesheet('/css/index.css');
- $auth = Zend_Auth::getInstance();
-?>
-
-
Top Downloaded
-
-
-
快速链接
-
-
-
友情链接
-
-
-
统 计
-
统计数据显示,目前本站:
-
- • 元数据
- metanum; ?> 条
- • 在线数据 onlinesize/1000,2,'.',''); ?> GB
- • 总数据 onlinesize+$this->offlinesize)/1000,2,'.',''); ?> GB
- • 总注册用户 usernum; ?> 人
-
-
-
-
-
-
-
-
= $this->feature['title']; ?>
-
= $this->feature['description']; ?>
-
详细
-
-
-
-
-
-
= $this->datasetcd['title']; ?>
-
简介: = $this->datasetcd['descript']; ?>
-
-
-
-
-
-
-
+headTitle($this->config->title->site);
+ $this->headTitle('首页');
+ $this->headTitle()->setSeparator(' - ');
+ $this->headLink()->appendStylesheet('/css/index.css');
+ $auth = Zend_Auth::getInstance();
+?>
+
+
+
Top Downloaded
+
+
+
快速链接
+
+
+
友情链接
+
+
+
统 计
+
统计数据显示,目前本站:
+
+ • 元数据
+ metanum; ?> 条
+ • 在线数据 onlinesize/1000,2,'.',''); ?> GB
+ • 总数据 onlinesize+$this->offlinesize)/1000,2,'.',''); ?> GB
+ • 总注册用户 usernum; ?> 人
+
+
+
+
+
+
+
+
= $this->feature['title']; ?>
+
= $this->feature['description']; ?>
+
详细
+
+
+
+
+
+
= $this->datasetcd['title']; ?>
+
简介: = $this->datasetcd['descript']; ?>
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/application/default/views/scripts/review/accept.phtml b/application/default/views/scripts/review/accept.phtml
index 4793fa76..6b4a0af4 100644
--- a/application/default/views/scripts/review/accept.phtml
+++ b/application/default/views/scripts/review/accept.phtml
@@ -1,57 +1,47 @@
headTitle($config->title->site);
-$this->headTitle($config->title->mdreview);
-$this->headTitle()->setSeparator(' - ');
-$this->headLink()->appendStylesheet('/css/mdreview.css');
-$this->breadcrumb('
首页 ');
-$this->breadcrumb('
元数据评审 ');
-$this->breadcrumb()->setSeparator(' > ');
+$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('
首页 ');
+$this->breadcrumb('
'.$this->config->title->review.' ');
+$this->breadcrumb('接收元数据');
+$this->breadcrumb()->setSeparator(' > ');
+$this->headScript()->appendFile('/js/pubfunc.js');
?>
-
-
-msg or $this->messages) :?>
-
-msg) : ?>
- msg; ?>
-messages): foreach($this->messages as $msg): ?>
-
-
-
-
-
-
-
最新收稿的元数据:
-
-
-
-
-
-
-
-
-
- 元数据标题
- 操作
-
-
-
- paginator)):
- $autoindex=0;
- foreach ($this->paginator as $item):
- $autoindex++;?>
-
-
-
- 评审 查看
-
-
-
-
-
-
= $this->paginator; ?>
-
-
\ No newline at end of file
+
+metadata)) : ?>
+
+page->getNavigation(); ?>
+
+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']);
+?>
+
+
+
+
+
+
+
+
+
+page->getNavigation();
+else :
+?>
+
+
\ No newline at end of file
diff --git a/application/default/views/scripts/review/browse.phtml b/application/default/views/scripts/review/browse.phtml
deleted file mode 100755
index cce63ea7..00000000
--- a/application/default/views/scripts/review/browse.phtml
+++ /dev/null
@@ -1,25 +0,0 @@
-headTitle($this->config->title->site);
-$this->headTitle($this->config->title->metadata);
-$this->headTitle('全部浏览');
-$this->headTitle()->setSeparator(' - ');
-$this->headLink()->appendStylesheet('/css/metadata.css');
-$this->breadcrumb('
首页 ');
-$this->breadcrumb('
元数据评审 ');
-$this->breadcrumb('浏览');
-$this->breadcrumb()->setSeparator(' > ');
-?>
-page->getNavigation(); ?>
-metadata as $md) : ?>
-
-
-
-
-
',mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']));?>
-
-
diff --git a/application/default/views/scripts/review/draft.phtml b/application/default/views/scripts/review/draft.phtml
index 2a5cd28b..79f2b40d 100644
--- a/application/default/views/scripts/review/draft.phtml
+++ b/application/default/views/scripts/review/draft.phtml
@@ -1,57 +1,44 @@
headTitle($config->title->site);
-$this->headTitle($config->title->mdreview);
-$this->headTitle()->setSeparator(' - ');
-$this->headLink()->appendStylesheet('/css/mdreview.css');
-$this->breadcrumb('
首页 ');
-$this->breadcrumb('
元数据评审 ');
-$this->breadcrumb()->setSeparator(' > ');
+$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('
首页 ');
+$this->breadcrumb('
'.$this->config->title->review.' ');
+$this->breadcrumb('投稿元数据');
+$this->breadcrumb()->setSeparator(' > ');
+$this->headScript()->appendFile('/js/pubfunc.js');
?>
-
-
-msg or $this->messages) :?>
-
-msg) : ?>
- msg; ?>
-messages): foreach($this->messages as $msg): ?>
-
-
-
-
-
-
-
最新收稿的元数据:
-
-
-
-
-
-
-
-
-
- 元数据标题
- 收稿时间
-
-
-
- paginator)):
- $autoindex=0;
- foreach ($this->paginator as $item):
- $autoindex++;?>
-
-
-
-
-
-
-
-
-
-
= $this->paginator; ?>
-
-
\ No newline at end of file
+
+metadata)) : ?>
+
+page->getNavigation(); ?>
+
+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']);
+?>
+
+
+ escape($md['title']); ?>【投稿时间:】
+
+
+
+
+
+
+
+
+page->getNavigation();
+else :
+?>
+
+
\ No newline at end of file
diff --git a/application/default/views/scripts/review/index.phtml b/application/default/views/scripts/review/index.phtml
index 406a79ae..bd0e219e 100755
--- a/application/default/views/scripts/review/index.phtml
+++ b/application/default/views/scripts/review/index.phtml
@@ -1,54 +1,70 @@
-headTitle($config->title->site);
-$this->headTitle($config->title->mdreview);
-$this->headTitle()->setSeparator(' - ');
-$this->headLink()->appendStylesheet('/css/mdreview.css');
-$this->breadcrumb('
首页 ');
-$this->breadcrumb('
元数据评审 ');
-$this->breadcrumb()->setSeparator(' > ');
+headTitle($config->title->site);
+$this->headTitle($config->title->review);
+$this->headTitle()->setSeparator(' - ');
+$this->headLink()->appendStylesheet('/css/mdreview.css');
+$this->breadcrumb('
首页 ');
+$this->breadcrumb('元数据评审');
+$this->breadcrumb()->setSeparator(' > ');
?>
-
-
目前系统中专家库为stat['experts']; ?>人,新投稿元数据stat['draft']; ?>条,已接收元数据stat['accept']; ?>条,有stat['inreview']; ?>条元数据正在评审中,已完成评审元数据stat['reviewed']; ?>条,有stat['openreviewuser']; ?>个用户参与了stat['openreview']; ?>次评审。 我参审的元数据
-mdreceived) : ?>
-
-
-mdreceived as $md) : ?>
-
-
escape($md['title']);?>(收稿时间:)
+
+
+mdreceived) : ?>
+
+
+mdreceived as $md) : ?>
+
+
escape($md['title']);?>(收稿时间:)
+
+
+更多>>
+
+mdaccepted) : ?>
+
+
+mdaccepted as $md) : ?>
+
+
escape($md['title']);?> [评审 查看 ]
+
+
+更多>>
+
+mdinreview) : ?>
+
+
+mdinreview as $md) : ?>
+
+
escape($md['title']);?> [评审 查看 ]
+
+
+更多>>
+
+mdreviewed) : ?>
+
+
+mdreviewed as $md) : ?>
+
+
+更多>>
+
+
\ No newline at end of file
diff --git a/application/default/views/scripts/review/inreview.phtml b/application/default/views/scripts/review/inreview.phtml
index dea9472f..1e04e283 100644
--- a/application/default/views/scripts/review/inreview.phtml
+++ b/application/default/views/scripts/review/inreview.phtml
@@ -1,59 +1,47 @@
headTitle($config->title->site);
-$this->headTitle($config->title->mdreview);
-$this->headTitle()->setSeparator(' - ');
-$this->headLink()->appendStylesheet('/css/mdreview.css');
-$this->breadcrumb('
首页 ');
-$this->breadcrumb('
元数据评审 ');
-$this->breadcrumb()->setSeparator(' > ');
+$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('
首页 ');
+$this->breadcrumb('
'.$this->config->title->review.' ');
+$this->breadcrumb('在审元数据');
+$this->breadcrumb()->setSeparator(' > ');
+$this->headScript()->appendFile('/js/pubfunc.js');
?>
-
-
-msg or $this->messages) :?>
-
-msg) : ?>
- msg; ?>
-messages): foreach($this->messages as $msg): ?>
-
-
-
-
-
-
-
目前在审的元数据:
-
-
-
-
-
-
-
-
-
- 元数据标题
- 收稿时间
- 状态
-
-
-
- paginator)):
- foreach ($this->paginator as $item):
- ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
= $this->paginator; ?>
-
\ No newline at end of file
+
+metadata)) : ?>
+
+page->getNavigation(); ?>
+
+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']);
+?>
+
+
+
+
+
+
+
+
+
+page->getNavigation();
+else :
+?>
+
+
\ No newline at end of file
diff --git a/application/default/views/scripts/review/myreview.phtml b/application/default/views/scripts/review/myreview.phtml
index 8538e432..15dbb70d 100644
--- a/application/default/views/scripts/review/myreview.phtml
+++ b/application/default/views/scripts/review/myreview.phtml
@@ -1,57 +1,50 @@
-headTitle($config->title->site);
-$this->headTitle($config->title->mdreview);
-$this->headTitle()->setSeparator(' - ');
-$this->headLink()->appendStylesheet('/css/mdreview.css');
-$this->breadcrumb('
首页 ');
-$this->breadcrumb('
元数据评审 ');
-$this->breadcrumb()->setSeparator(' > ');
-?>
-
-
-msg or $this->messages) :?>
-
-msg) : ?>
- msg; ?>
-messages): foreach($this->messages as $msg): ?>
-
-
-
-
-
-
-
我参审的元数据:
-
-
-
-
-
-
-
-
-
- 元数据标题
- 操作
-
-
-
- paginator)):
- $autoindex=0;
- foreach ($this->paginator as $item):
- $autoindex++;?>
-
-
-
- 查看评审页
-
-
-
-
-
-
= $this->paginator; ?>
-
-
\ No newline at end of file
+headTitle($this->config->title->site);
+$this->headTitle($this->config->title->review);
+$this->headTitle('我参审的元数据');
+$this->headTitle()->setSeparator(' - ');
+$this->headLink()->appendStylesheet('/css/mdreview.css');
+$this->breadcrumb('
首页 ');
+$this->breadcrumb('
'.$this->config->title->review.' ');
+$this->breadcrumb('我参审的元数据');
+$this->breadcrumb()->setSeparator(' > ');
+$this->headScript()->appendFile('/js/pubfunc.js');
+?>
+
+metadata)) : ?>
+
+page->getNavigation(); ?>
+
+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']);
+?>
+
+
+
+
+
+
+
+
+
+page->getNavigation();
+else :
+?>
+
+
\ No newline at end of file
diff --git a/application/default/views/scripts/review/navi.phtml b/application/default/views/scripts/review/navi.phtml
new file mode 100644
index 00000000..083b64ec
--- /dev/null
+++ b/application/default/views/scripts/review/navi.phtml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/application/default/views/scripts/review/review.phtml b/application/default/views/scripts/review/review.phtml
index 0704de5e..0d248692 100755
--- a/application/default/views/scripts/review/review.phtml
+++ b/application/default/views/scripts/review/review.phtml
@@ -22,7 +22,7 @@
-
+
',$md['description']);?>
diff --git a/application/default/views/scripts/review/reviewed.phtml b/application/default/views/scripts/review/reviewed.phtml
index 9386e2b1..afcd2e39 100644
--- a/application/default/views/scripts/review/reviewed.phtml
+++ b/application/default/views/scripts/review/reviewed.phtml
@@ -1,58 +1,47 @@
headTitle($this->config->title->site);
-$this->headTitle($this->config->title->review);
-$this->headTitle()->setSeparator(' - ');
-$this->headLink()->appendStylesheet('/css/mdreview.css');
-$this->breadcrumb('
首页 ');
-$this->breadcrumb('
元数据评审 ');
-$this->breadcrumb()->setSeparator(' > ');
+$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('
首页 ');
+$this->breadcrumb('
'.$this->config->title->review.' ');
+$this->breadcrumb('审结元数据');
+$this->breadcrumb()->setSeparator(' > ');
+$this->headScript()->appendFile('/js/pubfunc.js');
?>
-
-
-msg or $this->messages) :?>
-
-msg) : ?>
- msg; ?>
-messages): foreach($this->messages as $msg): ?>
-
-
-
-
-
-
-
已经通过审核的元数据:
-
-
-
-
-
-
-
-
-
- 元数据标题
- 评审结束时间
- 操作
-
-
-
- paginator)):
- $autoindex=0;
- foreach ($this->paginator as $item):
- $autoindex++;?>
-
-
-
-
-
- 查看评审页
-
-
-
-
-
= $this->paginator; ?>
-
-
\ No newline at end of file
+
+metadata)) : ?>
+
+page->getNavigation(); ?>
+
+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']);
+?>
+
+
+
+
+
+
+
+
+
+page->getNavigation();
+else :
+?>
+
+
\ No newline at end of file
diff --git a/application/default/views/scripts/review/search.phtml b/application/default/views/scripts/review/search.phtml
new file mode 100644
index 00000000..6ea19a9a
--- /dev/null
+++ b/application/default/views/scripts/review/search.phtml
@@ -0,0 +1,47 @@
+headTitle($this->config->title->site);
+$this->headTitle($this->config->title->review);
+$this->headTitle('快速搜索');
+$this->headTitle()->setSeparator(' - ');
+$this->headLink()->appendStylesheet('/css/mdreview.css');
+$this->breadcrumb('
首页 ');
+$this->breadcrumb('
'.$this->config->title->review.' ');
+$this->breadcrumb('快速搜索');
+$this->breadcrumb()->setSeparator(' > ');
+$this->headScript()->appendFile('/js/pubfunc.js');
+?>
+
+metadata)) : ?>
+
+page->getNavigation(); ?>
+
+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']);
+?>
+
+
+
+
+
+
+
+
+
+page->getNavigation();
+else :
+?>
+
+
您的搜索结果为空,请尝试其他关键词进行查询。
+
+
\ No newline at end of file
diff --git a/application/default/views/scripts/water/advancesearch.phtml b/application/default/views/scripts/water/advancesearch.phtml
index 77996de8..4b0e7549 100644
--- a/application/default/views/scripts/water/advancesearch.phtml
+++ b/application/default/views/scripts/water/advancesearch.phtml
@@ -20,7 +20,7 @@ $this->breadcrumb()->setSeparator(' > ');
foreach($this->metadata as $md) : ?>
-
+
400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?>
diff --git a/application/default/views/scripts/water/browse.phtml b/application/default/views/scripts/water/browse.phtml
index dd25901b..921d9f97 100755
--- a/application/default/views/scripts/water/browse.phtml
+++ b/application/default/views/scripts/water/browse.phtml
@@ -16,7 +16,7 @@ $this->breadcrumb()->setSeparator(' > ');
metadata as $md) : ?>
-
+
escape($md['title']);?>
diff --git a/application/default/views/scripts/water/download.phtml b/application/default/views/scripts/water/download.phtml
index d392a707..9cc18f21 100644
--- a/application/default/views/scripts/water/download.phtml
+++ b/application/default/views/scripts/water/download.phtml
@@ -11,7 +11,7 @@
?>
md['title']; ?>(md['filesize']; ?>MB)
-
+
FTP下载地址
diff --git a/application/default/views/scripts/water/map.phtml b/application/default/views/scripts/water/map.phtml
index 3eaadef7..aac5e400 100755
--- a/application/default/views/scripts/water/map.phtml
+++ b/application/default/views/scripts/water/map.phtml
@@ -11,8 +11,8 @@
$this->breadcrumb()->setSeparator(' > ');
$this->headScript()->appendFile('/js/OpenLayers.js');
$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);
?>
-
= $this->partial('data/tools.phtml'); ?>
@@ -56,7 +56,7 @@
popup = new OpenLayers.Popup.FramedCloud("chicken",
feature.geometry.getBounds().getCenterLonLat(),
null,
- "",
+ "",
null, false, onPopupClose);
feature.popup = popup;
map.addPopup(popup);
diff --git a/application/default/views/scripts/water/search.phtml b/application/default/views/scripts/water/search.phtml
index 44f43b2a..8e856321 100755
--- a/application/default/views/scripts/water/search.phtml
+++ b/application/default/views/scripts/water/search.phtml
@@ -38,7 +38,7 @@ $this->breadcrumb()->setSeparator(' > ');
foreach($this->metadata as $md) : ?>
-
+
400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?>
diff --git a/application/default/views/scripts/water/series.phtml b/application/default/views/scripts/water/series.phtml
index 8a91f765..ce7f092c 100755
--- a/application/default/views/scripts/water/series.phtml
+++ b/application/default/views/scripts/water/series.phtml
@@ -39,7 +39,7 @@ $this->breadcrumb()->setSeparator(' > ');
metadata as $md) : ?>
-
+
400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?>
diff --git a/application/default/views/scripts/water/tag.phtml b/application/default/views/scripts/water/tag.phtml
index 434c670f..4d1d3e55 100755
--- a/application/default/views/scripts/water/tag.phtml
+++ b/application/default/views/scripts/water/tag.phtml
@@ -17,7 +17,7 @@ $this->breadcrumb()->setSeparator(' > ');
metadata as $md) : ?>
-
+
diff --git a/application/default/views/scripts/water/thumb.phtml b/application/default/views/scripts/water/thumb.phtml
deleted file mode 100755
index bd126a1f..00000000
--- a/application/default/views/scripts/water/thumb.phtml
+++ /dev/null
@@ -1,7 +0,0 @@
-thumb->data)) {
- } else {
- header("Content-Type:image/jpeg");
- print base64_decode($this->thumb->data);
- }
-?>
\ No newline at end of file
diff --git a/application/default/views/scripts/water/timemap.phtml b/application/default/views/scripts/water/timemap.phtml
index f32cd921..fc26b603 100644
--- a/application/default/views/scripts/water/timemap.phtml
+++ b/application/default/views/scripts/water/timemap.phtml
@@ -9,8 +9,7 @@ $this->breadcrumb('
'.$this->config->title->data.' ');
$this->breadcrumb('
黑河综合遥感联合试验 ');
$this->breadcrumb('时空联合导航');
$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.com/maps?file=api&v=2&key=ABQIAAAACD-MqkkoOm60o_dvwdcKVhThiRESR0xRCe9JKd36EL3glTk0OxTsRzifkUWmTTrYWaE7dY1lYUlGxA');
+$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_js/timeline-api.js');
$this->headScript()->appendFile('/js/timemap/timemap.js');
@@ -48,7 +47,7 @@ window.onload=function() {
"title" : "",
"options" : {
// set the full HTML for the info window
- "infoHtml": "
",
+ "infoHtml": "
",
"theme":"orange"
}
},
diff --git a/application/default/views/scripts/water/view.phtml b/application/default/views/scripts/water/view.phtml
index 2cebe185..41df86d0 100755
--- a/application/default/views/scripts/water/view.phtml
+++ b/application/default/views/scripts/water/view.phtml
@@ -9,11 +9,12 @@
$this->breadcrumb('
黑河综合遥感联合试验 ');
$this->breadcrumb('查看试验元数据');
$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/OpenLayers.js');
$this->headScript()->appendFile('/js/window.js');
+ $this->headScript()->appendFile('/js/pubfunc.js');
$this->headLink()->appendStylesheet('/js/theme/default/style.css');
?>
metadata;if ($md):?>
@@ -21,10 +22,11 @@
if ($md->title_en) echo '
'.$this->escape($md->title_en);?>
+
@@ -32,15 +34,15 @@ if ($md->title_en) echo '
'.$this->escape($md->title_en);?>
$kt='';
$i=0;
foreach($this->keys as $cg) :
- if ($kt==$cg['keytype']) :
+ if ($kt==$cg->keytype) :
$i+=1;
else :
if (!empty($kt)) echo '
';
- $kt=$cg['keytype'];
+ $kt=$cg->keytype;
$i=0;
endif;
- if ($i==0) echo '
';
series): ?>
@@ -95,10 +97,13 @@ else
数据共享方式:datatype) print "离线"; else print "在线(可直接下载)";?> 文件列表
-datatype) : ?>
-
+status>0 and $md->status<5) : ?>
+
+datatype) : ?>
+
+
+
-
@@ -114,47 +119,49 @@ $party_zh=array('resourceProvider'=>'资源提供者','custodian'=>'维护者','
$r='';
$i=0;
foreach($this->authors as $k=>$author) :
-if ($author['role']!=$r)
+if ($author->role!=$r)
{
- $r=$author['role'];
+ $r=$author->role;
$i=0;
if ($k>0) echo '';
- echo '
'.$party_zh[$author['role']].':';
+ echo ' '.$party_zh[$author->role].':';
}
if ($i>0) echo ',';
$i+=1;
- if (!empty($author['email']) && $r!='principalInvestigator')
- echo '';
- echo '';
- if (!empty($author['individual']))
- echo $author['individual'];
+ if (!empty($author->email) && $r!='principalInvestigator')
+ echo '';
+ echo '';
+ if (!empty($author->individual))
+ echo $author->individual;
else
- echo $author['organisation'];
+ echo $author->organisation;
echo ' ';
- if (!empty($author['email'])) echo ' ';
+ if (!empty($author->email)) echo ' ';
if ($k+1==count($this->authors)) echo ' ';
endforeach;
?>
- 元数据更新时间:ts_created)); ?>
-
+ 元数据更新时间:ts_created)); ?>
+
+
+
-
+
+
-
-
+
citation) : ?>
本数据引用方式
escape($md->citation);?>
@@ -163,10 +170,10 @@ endforeach;
建议参考文献
ref as $ref) :
- if (empty($ref['link']))
- echo ''.$ref['reference'].' ';
+ if (empty($ref->link))
+ echo ''.$ref->reference.' ';
else
- echo ''.$ref['reference'].' 下载 ';
+ echo ''.$ref->reference.' 下载 ';
endforeach;
?>
@@ -175,7 +182,7 @@ endforeach;
uselimits) :
foreach($this->uselimits as $uselimit) :
-echo '
'.str_replace(array("\r\n", "\n", "\r"),'
',$this->escape($uselimit['uselimit'])).'
';
+echo '
'.str_replace(array("\r\n", "\n", "\r"),'
',$this->escape($uselimit->uselimit)).'
';
endforeach;
?>
@@ -191,14 +198,14 @@ endforeach;
resources) : ?>
其他在线资源
@@ -207,6 +214,9 @@ endforeach;
diff --git a/application/layouts/layout.phtml b/application/layouts/layout.phtml
index e19d18d7..fe2e507a 100755
--- a/application/layouts/layout.phtml
+++ b/application/layouts/layout.phtml
@@ -1,37 +1,36 @@
-
-
-
-
-
-
-
-
- = $this->headTitle() ?>
- = $this->headScript() ?>
- = $this->headLink() ?>
- = $this->headStyle() ?>
-
-
- = $this->render('header.phtml') ?>
-
-
= $this->breadcrumb() ?>
-
= $this->layout()->content ?>
-
- = $this->render('footer.phtml') ?>
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ = $this->headTitle() ?>
+ = $this->headScript() ?>
+ = $this->headLink() ?>
+ = $this->headStyle() ?>
+
+
+ = $this->render('header.phtml') ?>
+
+
= $this->breadcrumb() ?>
+
= $this->layout()->content ?>
+
+ = $this->render('footer.phtml') ?>
+
+
+
+
+
+
diff --git a/application/models/EmailText.php b/application/models/EmailText.php
index 56f6f4c0..6bfe94c8 100644
--- a/application/models/EmailText.php
+++ b/application/models/EmailText.php
@@ -18,10 +18,11 @@ class EmailText{
if(is_numeric($this->tmpid))
$sql = "select * from emailtext where id='".$this->tmpid."'";
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);
-
+ $this->db->setFetchMode($t);
$this->tmpinfo = $rs->fetch();
}
".($c['content'])."