diff --git a/application/admin/controllers/DataController.php b/application/admin/controllers/DataController.php
index 76572946..9d2655a3 100755
--- a/application/admin/controllers/DataController.php
+++ b/application/admin/controllers/DataController.php
@@ -2443,9 +2443,9 @@ class Admin_DataController extends Zend_Controller_Action
));
$mail->setBodyText($mailtp->getBody());
$mail->setSubject($mailtp->getSubject());
- $filecontent=file_get_contents("http://" . $_SERVER['HTTP_HOST'].'/data/doc/review/1/uuid/'.$uuid);
+ $filecontent=file_get_contents("http://" . $_SERVER['HTTP_HOST'].'/service/doc/uuid/'.$row['uuid']);
$mail->createAttachment($filecontent,'application/octet-stream',Zend_Mime::DISPOSITION_ATTACHMENT, Zend_Mime::ENCODING_BASE64, $row['title'].'.doc');
- $filecontent=file_get_contents("http://" . $_SERVER['HTTP_HOST'].'/service/pdf/uuid/'.$uuid);
+ $filecontent=file_get_contents("http://" . $_SERVER['HTTP_HOST'].'/service/pdf/uuid/'.$row['uuid']);
$mail->createAttachment($filecontent,'application/octet-stream',Zend_Mime::DISPOSITION_ATTACHMENT, Zend_Mime::ENCODING_BASE64, $row['title'].'.pdf');
if($this->debug==0)
{
diff --git a/application/admin/controllers/ReviewController.php b/application/admin/controllers/ReviewController.php
index f84c89ce..1d0b83e7 100644
--- a/application/admin/controllers/ReviewController.php
+++ b/application/admin/controllers/ReviewController.php
@@ -388,7 +388,7 @@ class Admin_ReviewController extends Zend_Controller_Action
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
$mail->addTo($expinfo['email']);
$mail->setSubject($mailtp->getSubject());
- $filecontent=file_get_contents("http://" . $_SERVER['HTTP_HOST'].'/data/doc/review/1/uuid/'.$uuid);
+ $filecontent=file_get_contents("http://" . $_SERVER['HTTP_HOST'].'/service/doc/uuid/'.$uuid);
$mail->createAttachment($filecontent,'application/octet-stream',Zend_Mime::DISPOSITION_ATTACHMENT, Zend_Mime::ENCODING_BASE64, $md['title'].'.doc');
$filecontent=file_get_contents("http://" . $_SERVER['HTTP_HOST'].'/service/pdf/uuid/'.$uuid);
$mail->createAttachment($filecontent,'application/octet-stream',Zend_Mime::DISPOSITION_ATTACHMENT, Zend_Mime::ENCODING_BASE64, $md['title'].'.pdf');
@@ -428,7 +428,7 @@ class Admin_ReviewController extends Zend_Controller_Action
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
$mail->addTo($row['email']);
$mail->setSubject($mailtp->getSubject());
- $filecontent=file_get_contents("http://" . $_SERVER['HTTP_HOST'].'/service/doc/review/1/uuid/'.$uuid);
+ $filecontent=file_get_contents("http://" . $_SERVER['HTTP_HOST'].'/service/doc/uuid/'.$uuid);
$mail->createAttachment($filecontent,'application/octet-stream',Zend_Mime::DISPOSITION_ATTACHMENT, Zend_Mime::ENCODING_BASE64, $row['title'].'.doc');
$filecontent=file_get_contents("http://" . $_SERVER['HTTP_HOST'].'/service/pdf/uuid/'.$uuid);
$mail->createAttachment($filecontent,'application/octet-stream',Zend_Mime::DISPOSITION_ATTACHMENT, Zend_Mime::ENCODING_BASE64, $row['title'].'.pdf');
@@ -638,61 +638,35 @@ class Admin_ReviewController extends Zend_Controller_Action
*/
function postAction(){
+ include_once('helper/view.php');
+ include_once('data/Review.php');
+
$id = $this->_request->getParam('id');
$emails = $this->_request->getParam('emails');
-
- include_once('helper/view.php');
- $auth = Zend_Auth::getInstance();
- if($auth->hasIdentity())
+
+ $review = new Review($this->db);
+ $reviewListener = new reviewListener();
+ @$review->events()->attachAggregate($reviewListener);
+
+ if(is_numeric($id))
{
- $user = $auth->getIdentity();
- $userid = $user->id;
-
- $sql = "select id from mdstatus where id='$id' and userid='$userid'";
- $rs = $this->db->query($sql);
- $row = $rs->fetch();
-
- if(!empty($row['id']))
+ $id = (int)$id;
+ if($review->checkAdmin($id) !== true)
{
-
- if($this->changestatus($id,5))
- {
- //发布正式版本
- $sql = "UPDATE mdversion SET changelog=?,userid=? WHERE id in (select id from mdversion where uuid in (select uuid from mdstatus where id=?) order by ts_created desc limit 1)";
- $this->db->query($sql,array('发布第一个正式版本 version 1.0',$userid,$id));
- //删除所有的中间版本
- $sql="delete from mdversion where changelog is null and uuid in (select uuid from mdstatus where id=?)";
- $this->db->query($sql,array($id));
- //email message
- $mail=new WestdcMailer($this->view->config->smtp);
- $sql="select m.uuid,m.title from metadata m left join mdstatus s on m.uuid=s.uuid where s.id='$id'";
- $rs=$this->db->query($sql);
- $res=$rs->fetch();
- $mailtp=new EmailText($this->db,'metadata-publish',array('uuid'=>$res['uuid'],'title'=>$res['title']));
- $mail->setBodyText($mailtp->getBody());
- $mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
- $mail->addTo($emails);
- $mail->setSubject($mailtp->getSubject());
- $mail->send();
-
- view::Post($this,array("content"=>'操作成功:该元数据成功发布','url'=>"/admin/review/myreview"));
- return true;
- }else{
- view::Post($this,array("content"=>'操作失败','url'=>"/admin/review/myreview"));
- return true;
- }
-
- }else{
view::Post($this,array("content"=>'您没有权限操作其他管理员管理的元数据评审','url'=>"/admin/review/myreview"));
return true;
}
-
- }else
- {
- view::Post($this,array("content"=>'权限读取失败','url'=>"/admin/review/myreview"));
- return true;
}
+ $s = $review->post($id,$emails);
+ if($s)
+ {
+ view::Post($this,"发布成功",-1);
+ return true;
+ }else{
+ view::Post($this,"发布失败",-1);
+ return true;
+ }
}//发布元数据
/*
@@ -740,9 +714,9 @@ class Admin_ReviewController extends Zend_Controller_Action
if($update>0 || is_array($update))
{
$ids = '';
- if(is_array($update))
- {
- $ids = implode(',',$update);
+ if(is_array($update))
+ {
+ $ids = implode(',',$update);
} else $ids=$update;
if($this->changestatus($ids,1))
@@ -764,14 +738,14 @@ class Admin_ReviewController extends Zend_Controller_Action
$sql="select distinct u.email,m.title,m.uuid from mdstatus s left join metadata m on s.uuid=m.uuid
left join mdauthor a on s.uuid=a.uuid left join users u on a.userid=u.id where s.id=? order by u.email";
$rs=$this->db->query($sql,array($ids));
- $rows=$rs->fetchAll($rs);
+ $rows=$rs->fetchAll();
if ($rows)
{
//有数据作者
- $mail=array();
+ $email=array();
foreach ($rows as $row)
{
- $mail[]=$row['email'];
+ $email[]=$row['email'];
}
$title=$rows[0]['title'];
$uuid=$rows[0]['uuid'];
@@ -779,12 +753,12 @@ class Admin_ReviewController extends Zend_Controller_Action
$mail=new WestdcMailer($this->view->config->smtp);
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
$mailtp=new EmailText($this->db,"review-new-accept",array(
- 'uuid' => $iso->uuid,
- 'title'=> $iso->resTitle
+ 'uuid' => $uuid,
+ 'title'=> $title
));
$mail->setBodyText($mailtp->getBody());
$mail->setSubject($mailtp->getSubject());
- $mail->addTo($mail);
+ $mail->addTo($email);
$mail->addCC($this->view->config->service->email);
$mail->send();
}
diff --git a/application/admin/controllers/SysController.php b/application/admin/controllers/SysController.php
index a28c0a0b..34457854 100644
--- a/application/admin/controllers/SysController.php
+++ b/application/admin/controllers/SysController.php
@@ -7,7 +7,7 @@ class Admin_SysController extends Zend_Controller_Action
$this->view->config = Zend_Registry::get('config');
$this->messenger=$this->_helper->getHelper('FlashMessenger');
$this->view->messages = $this->messenger->getMessages();
- $this->_helper->layout->setLayout('administry');//新UI
+ $this->_helper->layout->setLayout('administry');//新UI
$this->view->theme = new Theme();
}
@@ -333,24 +333,102 @@ class Admin_SysController extends Zend_Controller_Action
}
}//end
- }//getmessageAction() 获取站内消息
-
- //ftp测试
- function ftptestAction()
- {
- }
-
- function recoveryAction()
- {
- $pages=20;
- $ac=$this->_request->getParam('ac');
- if ($ac=='' || $ac=='online')
- {
- $sql = "SELECT m.title,m.uuid,ds.host,ds.path,
- (select floor(sum(filesize)/1024/1024*100)/100 from datafile where dsid=ds.id) as filesize,
- (select count(id) from datafile where dsid=ds.id) as filecount from metadata m
+ }//getmessageAction() 获取站内消息
+
+ //ftp测试
+ function ftptestAction()
+ {
+ }
+
+ //区域管理
+ function regionsAction()
+ {
+ include_once("data/Regions.php");
+ include_once("helper/view.php");
+
+ $region = new Region($this->db);
+
+ $ac = $this->_getParam('ac');
+ $id = $this->_getParam("id");
+
+ $RegionListener = new RegionListener();
+ @$region->events()->attachAggregate($RegionListener);
+
+ if(empty($ac) || $ac == "index")
+ {
+ $filter = array();
+
+ $q = $this->_getParam('keyword');
+ if(!empty($q))
+ {
+ $filter['q'] = $q;
+ $this->view->keyword = $q;
+ }
+
+ $data = $region->fetchRegion('all',$filter);
+ view::addPaginator($data,$this,NULL,15);
+ }
+
+ if($ac == "add" || $ac == "edit")
+ {
+ $this->_helper->viewRenderer('regions-add');
+ $submit = $this->_getParam('submit');
+ if(!empty($submit))
+ {
+ $this->view->data = $data = $this->_getParam("data");
+ $s = $region->addRegion($data,$id);
+ if($s === true)
+ {
+ $msg = "添加成功";
+ if(!empty($id))
+ $msg = "编辑成功";
+
+ view::Post($this,$msg,"/admin/sys/regions");
+ return true;
+ }else{
+ if(is_string($s))
+ {
+ $this->view->error = view::Error($s);
+ return true;
+ }else{
+ $this->view->error = view::Error("操作失败请重试");
+ return true;
+ }
+ }
+ }else{
+ if(!empty($id))
+ {
+ $this->view->data = $region->get($id);
+ }
+ }
+ }//添加
+
+ if($ac == "del")
+ {
+ $langid = $this->_getParam('langid');
+ if(!empty($id) && !empty($langid))
+ {
+ $region->del($id,$langid);
+ }else{
+ $region->del($id);
+ }
+ view::Post($this,"删除成功",-1);
+ }//删除
+
+ }//区域管理
+
+ function recoveryAction()
+ {
+ $pages=20;
+ $ac=$this->_request->getParam('ac');
+ if ($ac=='' || $ac=='online')
+ {
+ $sql = "SELECT m.title,m.uuid,ds.host,ds.path,
+ floor(t.filesize/1024/1024*100)/100 as filesize,
+ t.filecount from metadata m
LEFT JOIN mdstatus s ON m.uuid=s.uuid
LEFT JOIN dataset ds ON m.uuid=ds.uuid
+ left join (select dsid,count(id) as filecount,sum(filesize) as filesize from datafile group by dsid) as t on ds.id=t.dsid
where s.status>4 and m.datatype=0 and ds.host='ftp1.westgis.ac.cn'
ORDER BY m.id DESC";
$sth = $this->db->prepare($sql);
@@ -362,16 +440,18 @@ class Admin_SysController extends Zend_Controller_Action
$paginator->setItemCountPerPage($pages);
$paginator->setView($this->view);
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
- $this->view->paginator=$paginator;
- } else if ($ac=='heihe')
- {
- $sql = "SELECT m.title,m.uuid,ds.host,ds.path,
- (select floor(sum(filesize)/1024/1024*100)/100 from datafile where dsid=ds.id) as filesize,
- (select count(id) from datafile where dsid=ds.id) as filecount from metadata m
+ $this->view->paginator=$paginator;
+ $ac='online';
+ } else if ($ac=='heihe')
+ {
+ $sql = "SELECT m.title,m.uuid,ds.host,ds.path,
+ floor(t.filesize/1024/1024*100)/100 as filesize,
+ t.filecount from metadata m
LEFT JOIN mdstatus s ON m.uuid=s.uuid
LEFT JOIN dataset ds ON m.uuid=ds.uuid
- left join datasource on datasource.uuid=m.uuid
- left join source on datasource.sourceid=source.id
+ left join (select dsid,count(id) as filecount,sum(filesize) as filesize from datafile group by dsid) as t on ds.id=t.dsid
+ left join datasource on datasource.uuid=m.uuid
+ left join source on datasource.sourceid=source.id
where s.status>4 and m.datatype=1 and ds.host='ftp1.westgis.ac.cn' and source.code='heihe'
ORDER BY m.id DESC";
$sth = $this->db->prepare($sql);
@@ -383,19 +463,18 @@ class Admin_SysController extends Zend_Controller_Action
$paginator->setItemCountPerPage($pages);
$paginator->setView($this->view);
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
- $this->view->paginator=$paginator;
- } else if ($ac=='water')
- {
+ $this->view->paginator=$paginator;
+ } else if ($ac=='water')
+ {
$sql = "SELECT m.title,m.uuid,ds.host,ds.path,
- floor(sum(datafile.filesize)/1024/1024*100)/100 as filesize,
- count(datafile.id) as filecount from metadata m
- LEFT JOIN mdstatus s ON m.uuid=s.uuid
+ floor(t.filesize/1024/1024*100)/100 as filesize,
+ t.filecount from metadata m
+ LEFT JOIN mdstatus s ON m.uuid=s.uuid
LEFT JOIN dataset ds ON m.uuid=ds.uuid
- left join datafile on ds.id=datafile.dsid
+ left join (select dsid,count(id) as filecount,sum(filesize) as filesize from datafile group by dsid) as t on ds.id=t.dsid
left join datasource on datasource.uuid=m.uuid
left join source on datasource.sourceid=source.id
- where s.status>4 and m.datatype=1 and ds.host='ftp1.westgis.ac.cn' and source.code='water'
- group by m.title,m.uuid,ds.host,ds.path
+ where s.status>4 and m.datatype=1 and ds.host='ftp1.westgis.ac.cn' and source.code='water'
ORDER BY m.title DESC";
$sth = $this->db->prepare($sql);
$sth->execute();
@@ -406,19 +485,18 @@ class Admin_SysController extends Zend_Controller_Action
$paginator->setItemCountPerPage($pages);
$paginator->setView($this->view);
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
- $this->view->paginator=$paginator;
- } else if ($ac=='heihe1')
- {
- $sql = "SELECT m.title,m.uuid,ds.host,ds.path,
- floor(sum(datafile.filesize)/1024/1024*100)/100 as filesize,
- count(datafile.id) as filecount from metadata m
+ $this->view->paginator=$paginator;
+ } else if ($ac=='heihe1')
+ {
+ $sql = "SELECT m.title,m.uuid,ds.host,ds.path,
+ floor(t.filesize/1024/1024*100)/100 as filesize,
+ t.filecount from metadata m
LEFT JOIN mdstatus s ON m.uuid=s.uuid
- LEFT JOIN dataset ds ON m.uuid=ds.uuid
- left join datasource on datasource.uuid=m.uuid
- left join datafile on ds.id=datafile.dsid
- left join source on datasource.sourceid=source.id
- where s.status in (2,3,4) and ds.host='ftp1.westgis.ac.cn' and source.code='heihe'
- group by m.title,m.uuid,ds.host,ds.path
+ LEFT JOIN dataset ds ON m.uuid=ds.uuid
+ left join datasource on datasource.uuid=m.uuid
+ left join (select dsid,count(id) as filecount,sum(filesize) as filesize from datafile group by dsid) as t on ds.id=t.dsid
+ left join source on datasource.sourceid=source.id
+ where s.status in (2,3,4) and ds.host='ftp1.westgis.ac.cn' and source.code='heihe'
ORDER BY m.title DESC";
$sth = $this->db->prepare($sql);
$sth->execute();
@@ -429,16 +507,17 @@ class Admin_SysController extends Zend_Controller_Action
$paginator->setItemCountPerPage($pages);
$paginator->setView($this->view);
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
- $this->view->paginator=$paginator;
- } else if ($ac=='hiwater')
- {
- $sql = "SELECT m.title,m.uuid,ds.host,ds.path,
- (select floor(sum(filesize)/1024/1024*100)/100 from datafile where dsid=ds.id) as filesize,
- (select count(id) from datafile where dsid=ds.id) as filecount from metadata m
+ $this->view->paginator=$paginator;
+ } else if ($ac=='hiwater')
+ {
+ $sql = "SELECT m.title,m.uuid,ds.host,ds.path,
+ floor(t.filesize/1024/1024*100)/100 as filesize,
+ t.filecount from metadata m
LEFT JOIN mdstatus s ON m.uuid=s.uuid
- LEFT JOIN dataset ds ON m.uuid=ds.uuid
- left join datasource on datasource.uuid=m.uuid
- left join source on datasource.sourceid=source.id
+ LEFT JOIN dataset ds ON m.uuid=ds.uuid
+ left join (select dsid,count(id) as filecount,sum(filesize) as filesize from datafile group by dsid) as t on ds.id=t.dsid
+ left join datasource on datasource.uuid=m.uuid
+ left join source on datasource.sourceid=source.id
where ds.host='ftp1.westgis.ac.cn' and source.code='hiwater'
ORDER BY m.title DESC";
$sth = $this->db->prepare($sql);
@@ -450,14 +529,15 @@ class Admin_SysController extends Zend_Controller_Action
$paginator->setItemCountPerPage($pages);
$paginator->setView($this->view);
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
- $this->view->paginator=$paginator;
- }else if ($ac=='westee')
- {
- $sql = "SELECT m.title,m.uuid,ds.host,ds.path,
- (select floor(sum(filesize)/1024/1024*100)/100 from datafile where dsid=ds.id) as filesize,
- (select count(id) from datafile where dsid=ds.id) as filecount from metadata m
+ $this->view->paginator=$paginator;
+ }else if ($ac=='westee')
+ {
+ $sql = "SELECT m.title,m.uuid,ds.host,ds.path,
+ floor(t.filesize/1024/1024*100)/100 as filesize,
+ t.filecount from metadata m
LEFT JOIN mdstatus s ON m.uuid=s.uuid
LEFT JOIN dataset ds ON m.uuid=ds.uuid
+ left join (select dsid,count(id) as filecount,sum(filesize) as filesize from datafile group by dsid) as t on ds.id=t.dsid
where ds.host='ftp1.westgis.ac.cn' and m.uuid in (select uuid from westeemd)
ORDER BY m.title DESC";
$sth = $this->db->prepare($sql);
@@ -469,29 +549,99 @@ class Admin_SysController extends Zend_Controller_Action
$paginator->setItemCountPerPage($pages);
$paginator->setView($this->view);
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
- $this->view->paginator=$paginator;
- }else if ($ac=='other')
- {
- $sql = "SELECT m.title,m.uuid,ds.host,ds.path,
- (select floor(sum(filesize)/1024/1024*100)/100 from datafile where dsid=ds.id) as filesize,
- (select count(id) from datafile where dsid=ds.id) as filecount from metadata m
+ $this->view->paginator=$paginator;
+ }else if ($ac=='other')
+ {
+ $sql = "SELECT m.title,m.uuid,ds.host,ds.path,
+ floor(t.filesize/1024/1024*100)/100 as filesize,
+ t.filecount from metadata m
LEFT JOIN mdstatus s ON m.uuid=s.uuid
LEFT JOIN dataset ds ON m.uuid=ds.uuid
+ left join (select dsid,count(id) as filecount,sum(filesize) as filesize from datafile group by dsid) as t on ds.id=t.dsid
where ds.host='ftp1.westgis.ac.cn' and m.uuid not in (select uuid from datasource) and m.uuid not in (select uuid from westeemd)
ORDER BY m.title DESC";
$sth = $this->db->prepare($sql);
$sth->execute();
$rows = $sth->fetchAll();
+ $paginator = Zend_Paginator::factory($rows);
+ $paginator->setCurrentPageNumber($this->_getParam('page'));
+ $paginator->setItemCountPerPage($pages);
+ $paginator->setView($this->view);
+ Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
+ $this->view->paginator=$paginator;
+ }
+ $this->view->activeID="btn-".$ac;
+ }
+
+ function problemAction()
+ {
+ $pages=20;
+ $ac=$this->_request->getParam('ac');
+ if ($ac=='' || $ac=='ref')
+ {
+ $sql = "SELECT m.title,m.uuid,m.citation,g.id as gid from metadata m
+ LEFT JOIN mdstatus s ON m.uuid=s.uuid
+ left join geonetworkmetadata g on g.uuid=m.uuid
+ where s.status>4 and m.citation like '%??%'
+ ORDER BY m.id DESC";
+ $sth = $this->db->prepare($sql);
+ $sth->execute();
+ $rows = $sth->fetchAll();
+
$paginator = Zend_Paginator::factory($rows);
$paginator->setCurrentPageNumber($this->_getParam('page'));
$paginator->setItemCountPerPage($pages);
$paginator->setView($this->view);
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
$this->view->paginator=$paginator;
- }
- $this->view->activeID="btn-".$ac;
- }
-
+ $this->_helper->viewRenderer('problem-ref');
+ $ac='ref';
+ } else if ($ac=='file')
+ {
+ $sql = "SELECT m.title,m.uuid,m.filesize,ds.host,ds.path from metadata m
+ LEFT JOIN mdstatus s ON m.uuid=s.uuid
+ LEFT JOIN dataset ds ON m.uuid=ds.uuid
+ where s.status>4 and ds.id not in (select distinct dsid from datafile)
+ group by m.title,m.uuid,ds.host,ds.path,m.filesize
+ ORDER BY m.title DESC;";
+ $sth = $this->db->prepare($sql);
+ $sth->execute();
+ $rows = $sth->fetchAll();
+
+ $paginator = Zend_Paginator::factory($rows);
+ $paginator->setCurrentPageNumber($this->_getParam('page'));
+ $paginator->setItemCountPerPage($pages);
+ $paginator->setView($this->view);
+ Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
+ $this->view->paginator=$paginator;
+ } else if ($ac=='tiny')
+ {
+ $sql = "SELECT m.title,m.uuid,ds.host,ds.path,
+ floor(sum(datafile.filesize)/1024/1024*100)/100 as filesize,
+ count(datafile.id) as filecount
+ from metadata m
+ LEFT JOIN mdstatus s ON m.uuid=s.uuid
+ LEFT JOIN dataset ds ON m.uuid=ds.uuid
+ left join datasource on datasource.uuid=m.uuid
+ left join datafile on ds.id=datafile.dsid
+ left join source on datasource.sourceid=source.id
+ where s.status>4 and ds.id in (select t.dsid from (select dsid,count(id) as filecount,sum(filesize) as filesize from datafile group by dsid) as t
+where t.filesize<1024*5)
+ group by m.title,m.uuid,ds.host,ds.path
+ ORDER BY m.title DESC;";
+ $sth = $this->db->prepare($sql);
+ $sth->execute();
+ $rows = $sth->fetchAll();
+
+ $paginator = Zend_Paginator::factory($rows);
+ $paginator->setCurrentPageNumber($this->_getParam('page'));
+ $paginator->setItemCountPerPage($pages);
+ $paginator->setView($this->view);
+ Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
+ $this->view->paginator=$paginator;
+ }
+ $this->view->activeID="btn-".$ac;
+ }
}
diff --git a/application/admin/views/scripts/news/newsadd.phtml b/application/admin/views/scripts/news/newsadd.phtml
index 28ceb49e..6a1c01b0 100644
--- a/application/admin/views/scripts/news/newsadd.phtml
+++ b/application/admin/views/scripts/news/newsadd.phtml
@@ -62,10 +62,10 @@ $(document).ready(function(){
});
-
+
= $this->partial('news/left.phtml'); ?>
-
+
新闻发布
-
+
+
\ No newline at end of file
diff --git a/application/admin/views/scripts/sys/problem.phtml b/application/admin/views/scripts/sys/problem.phtml
new file mode 100644
index 00000000..9e3a3edf
--- /dev/null
+++ b/application/admin/views/scripts/sys/problem.phtml
@@ -0,0 +1,50 @@
+headTitle($this->config->title->site);
+ $this->headTitle('后台管理');
+ $this->headTitle()->setSeparator(' - ');
+ $this->headLink()->appendStylesheet('/css/admin.css');
+ $this->theme->AppendPlus($this,'colorbox');
+?>
+
\ No newline at end of file
diff --git a/application/default/controllers/AuthorController.php b/application/default/controllers/AuthorController.php
index 39e23cb1..ec1cf681 100644
--- a/application/default/controllers/AuthorController.php
+++ b/application/default/controllers/AuthorController.php
@@ -709,22 +709,24 @@ class AuthorController extends Zend_Controller_Action
*/
function applyAction()
{
- $ac = $this->_request->getParam('ac');
+ $ac = $this->_request->getParam('ac');
+ include_once('helper/view.php');
+ $this->view->id=view::User('id');
if($ac == "mydata")
{
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender();
- include_once('helper/view.php');
$email = view::User('email');
- $realname=view::User('realname');
+ $realname=view::User('realname');
+
$sql = "SELECT distinct m.uuid,m.title,m.description,a.status,a.userid FROM normalmetadata m
LEFT JOIN mdauthor a ON m.uuid=a.uuid
LEFT JOIN role r ON r.uuid=m.uuid
LEFT JOIN responsible re ON r.resid = re.id
- WHERE re.email LIKE '%$email%' or re.realname='$realname'";
+ WHERE r.role in ('originator','resourceProvider','pointOfContact','owner') and (re.email LIKE '%$email%' or re.individual='$realname')";
$rs = $this->db->query($sql);
$this->jsonexit($rs->fetchAll());
@@ -2094,9 +2096,9 @@ class AuthorController extends Zend_Controller_Action
));
$mail->setBodyText($mailtp->getBody());
$mail->setSubject($mailtp->getSubject());
- $filecontent=file_get_contents("http://" . $_SERVER['HTTP_HOST'].'/data/doc/review/1/uuid/'.$uuid);
+ $filecontent=file_get_contents("http://" . $_SERVER['HTTP_HOST'].'/service/doc/uuid/'.$row['uuid']);
$mail->createAttachment($filecontent,'application/octet-stream',Zend_Mime::DISPOSITION_ATTACHMENT, Zend_Mime::ENCODING_BASE64, $row['title'].'.doc');
- $filecontent=file_get_contents("http://" . $_SERVER['HTTP_HOST'].'/service/pdf/uuid/'.$uuid);
+ $filecontent=file_get_contents("http://" . $_SERVER['HTTP_HOST'].'/service/pdf/uuid/'.$row['uuid']);
$mail->createAttachment($filecontent,'application/octet-stream',Zend_Mime::DISPOSITION_ATTACHMENT, Zend_Mime::ENCODING_BASE64, $row['title'].'.pdf');
if($this->debug==0)
{
diff --git a/application/default/controllers/HeiheController.php b/application/default/controllers/HeiheController.php
index 6b13b8a3..78288c5e 100644
--- a/application/default/controllers/HeiheController.php
+++ b/application/default/controllers/HeiheController.php
@@ -8,12 +8,15 @@ class HeiheController extends DataController
parent::preDispatch();
$this->debug = 1;
$this->view->pageID = "heihe-".$this->_request->getActionName();
+ $this->view->nav[] = array('link'=>"/heihe",'title'=>'黑河计划数据管理中心');
}
function indexAction()
{
$sql="select m.uuid,m.title,m.id,m.description from normalmetadata m left join thumbnail t on m.id=t.id where m.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and length(t.data)>2 order by random() limit 3";
$this->view->meatdata=$this->db->fetchAll($sql);
+ $archive = new Archive($this->db);
+ $this->view->info = $archive->getOneArchive('黑河流域数据简介','about');
}
/*
@@ -65,121 +68,136 @@ class HeiheController extends DataController
function baseAction()
{
- $page=(int)$this->_request->getParam('page');
- if (empty($page)) $page=1;
- $offset=$this->limit*($page-1);
- $state=$this->db->query("select count(*) from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and id in (select id from keyword where keytype='theme' and (keyword='冰川' or keyword='沙漠' or keyword='地貌' or keyword='植被' or keyword='草场' or keyword='沙漠化' or keyword='基础地理' or keyword='遥感影像' or keyword='水文地质' or keyword='社会经济' or keyword='人口' or keyword='SWAT' or keyword='NPP' or keyword='WRF' or keyword='辐射' or keyword='NEP'))");
- $row=$state->fetchAll();
- $sum=$row[0]['count'];
- $sql="select uuid,title from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and id in (select id from keyword where keytype='theme' and (keyword='冰川' or keyword='沙漠' or keyword='地貌' or keyword='植被' or keyword='草场' or keyword='沙漠化' or keyword='基础地理' or keyword='遥感影像' or keyword='水文地质' or keyword='社会经济' or keyword='人口' or keyword='SWAT' or keyword='NPP' or keyword='WRF' or keyword='辐射' or keyword='NEP')) order by timebegin,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->offset=$offset+1;
+ $this->getmd(array('冰川','沙漠','地貌','植被','草场','沙漠化','基础地理','遥感影像','水文地质','社会经济','人口','SWAT','NPP','WRF','辐射','NEP'));
+ $archive = new Archive($this->db);
+ $this->view->info = $archive->getOneArchive('黑河计划-基础数据','about');
+ $this->view->nav[] = array('link'=>"/heihe/base",'title'=>'基础数据');
+ $this->_helper->viewRenderer('base');
}
function geobaseAction()
{
$this->getmd('基础地理');
+ $archive = new Archive($this->db);
+ $this->view->info = $archive->getOneArchive('黑河计划-基础地理数据','about');
+ $this->view->nav[] = array('link'=>"/heihe/geobase",'title'=>'基础地理数据');
+ $this->_helper->viewRenderer('base');
}
function coreAction()
{
- $page=(int)$this->_request->getParam('page');
- if (empty($page)) $page=1;
- $offset=$this->limit*($page-1);
- $state=$this->db->query("select count(*) from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and id in (select id from keyword where keytype='theme' and (keyword='DEM' or keyword='土地利用' or keyword='土壤' or keyword='气象' or keyword='水文观测' or keyword='灌溉' or keyword='试验'))");
- $row=$state->fetchAll();
- $sum=$row[0]['count'];
- $sql="select uuid,title from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and id in (select id from keyword where keytype='theme' and (keyword='DEM' or keyword='土地利用' or keyword='土壤' or keyword='气象' or keyword='水文观测' or keyword='灌溉' or keyword='试验')) order by timebegin,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->offset=$offset+1;
+ $this->getmd(array('DEM','土地利用','土壤','气象','水文观测','灌溉','试验'));
+ $archive = new Archive($this->db);
+ $this->view->info = $archive->getOneArchive('黑河计划-核心数据','about');
+ $this->view->nav[] = array('link'=>"/heihe/core",'title'=>'核心数据');
+ $this->_helper->viewRenderer('base');
}
function demAction()
{
$this->getmd('DEM');
+ $archive = new Archive($this->db);
+ $this->view->info = $archive->getOneArchive('黑河计划-DEM','about');
+ $this->view->nav[] = array('link'=>"/heihe/dem",'title'=>'DEM');
+ $this->_helper->viewRenderer('base');
}
function rsAction()
{
$this->getmd('遥感影像');
+ $archive = new Archive($this->db);
+ $this->view->info = $archive->getOneArchive('黑河计划-遥感影像','about');
+ $this->view->nav[] = array('link'=>"/heihe/rs",'title'=>'遥感影像');
+ $this->_helper->viewRenderer('base');
}
function waterAction()
{
$this->getmd('水文地质');
+ $archive = new Archive($this->db);
+ $this->view->info = $archive->getOneArchive('黑河计划-水文水资源数据','about');
+ $this->view->nav[] = array('link'=>"/heihe/water",'title'=>'水文水资源数据');
+ $this->_helper->viewRenderer('base');
}
function modelAction()
{
- $page=(int)$this->_request->getParam('page');
- if (empty($page)) $page=1;
- $offset=$this->limit*($page-1);
- $state=$this->db->query("select count(*) from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and id in (select id from keyword where keytype='theme' and (keyword='WRF' or keyword='NPP' or keyword='SWAT' or keyword='NEP' or keyword='辐射'))");
- $row=$state->fetchAll();
- $sum=$row[0]['count'];
- $sql="select uuid,title from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and id in (select id from keyword where keytype='theme' and (keyword='WRF' or keyword='NPP' or keyword='SWAT' or keyword='NEP' or keyword='辐射')) order by timebegin,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->offset=$offset+1;
+ $this->getmd(array('WRF','NPP','SWAT','NEP','辐射'));
+ $archive = new Archive($this->db);
+ $this->view->info = $archive->getOneArchive('黑河计划-模型数据','about');
+ $this->view->nav[] = array('link'=>"/heihe/model",'title'=>'模型数据');
+ $this->_helper->viewRenderer('base');
}
function economicAction()
{
- $page=(int)$this->_request->getParam('page');
- if (empty($page)) $page=1;
- $offset=$this->limit*($page-1);
- $state=$this->db->query("select count(*) from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and id in (select id from keyword where keytype='theme' and (keyword='人口' or keyword='社会经济'))");
- $row=$state->fetchAll();
- $sum=$row[0]['count'];
- $sql="select uuid,title from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and id in (select id from keyword where keytype='theme' and (keyword='人口' or keyword='社会经济')) order by timebegin,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->offset=$offset+1;
+ $this->getmd(array('人口','社会经济'));
+ $archive = new Archive($this->db);
+ $this->view->info = $archive->getOneArchive('黑河计划-社会经济数据','about');
+ $this->view->nav[] = array('link'=>"/heihe/economic",'title'=>'社会经济数据');
+ $this->_helper->viewRenderer('base');
}
function landsurfaceAction()
{
- $page=(int)$this->_request->getParam('page');
- if (empty($page)) $page=1;
- $offset=$this->limit*($page-1);
- $state=$this->db->query("select count(*) from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and id in (select id from keyword where keytype='theme' and (keyword='冰川' or keyword='沙漠' or keyword='地貌' or keyword='植被' or keyword='草场' or keyword='沙漠化'))");
- $row=$state->fetchAll();
- $sum=$row[0]['count'];
- $sql="select uuid,title from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and id in (select id from keyword where keytype='theme' and (keyword='冰川' or keyword='沙漠' or keyword='地貌' or keyword='植被' or keyword='草场' or keyword='沙漠化')) order by timebegin,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->offset=$offset+1;
+ $this->getmd(array('冰川','沙漠','地貌','植被','草场','沙漠化'));
+ $archive = new Archive($this->db);
+ $this->view->info = $archive->getOneArchive('黑河计划-陆地表层数据','about');
+ $this->view->nav[] = array('link'=>"/heihe/landsurface",'title'=>'陆地表层数据');
+ $this->_helper->viewRenderer('base');
}
function landuseAction()
{
- $this->getmd('土地利用','theme');
+ $this->getmd('土地利用');
+ $archive = new Archive($this->db);
+ $this->view->info = $archive->getOneArchive('黑河计划-土地利用数据','about');
+ $this->view->nav[] = array('link'=>"/heihe/landuse",'title'=>'土地利用数据');
+ $this->_helper->viewRenderer('base');
}
function soilAction()
{
- $this->getmd('土壤','theme');
+ $this->getmd('土壤');
+ $archive = new Archive($this->db);
+ $this->view->info = $archive->getOneArchive('黑河计划-土壤数据','about');
+ $this->view->nav[] = array('link'=>"/heihe/soil",'title'=>'土壤数据');
+ $this->_helper->viewRenderer('base');
}
function meteoAction()
{
- $this->getmd('气象','theme');
+ $this->getmd('气象');
+ $archive = new Archive($this->db);
+ $this->view->info = $archive->getOneArchive('黑河计划-气象观测数据','about');
+ $this->view->nav[] = array('link'=>"/heihe/meteo",'title'=>'气象观测数据');
+ $this->_helper->viewRenderer('base');
}
function hydroAction()
{
- $this->getmd('水文观测','theme');
+ $this->getmd('水文观测');
+ $archive = new Archive($this->db);
+ $this->view->info = $archive->getOneArchive('黑河计划-水文观测数据','about');
+ $this->view->nav[] = array('link'=>"/heihe/hydro",'title'=>'水文观测数据');
+ $this->_helper->viewRenderer('base');
}
function irragationAction()
{
- $this->getmd('灌溉','theme');
+ $this->getmd('灌溉');
+ $archive = new Archive($this->db);
+ $this->view->info = $archive->getOneArchive('黑河计划-灌溉数据','about');
+ $this->view->nav[] = array('link'=>"/heihe/irragation",'title'=>'灌溉数据');
+ $this->_helper->viewRenderer('base');
}
function obsAction()
{
- $this->getmd('试验','theme');
+ $this->getmd('试验');
+ $archive = new Archive($this->db);
+ $this->view->info = $archive->getOneArchive('黑河计划-观测试验数据','about');
+ $this->view->nav[] = array('link'=>"/heihe/obs",'title'=>'观测试验数据');
+ $this->_helper->viewRenderer('base');
}
function listAction()
@@ -188,34 +206,30 @@ class HeiheController extends DataController
$this->view->metadata=$this->db->fetchAll($sql);
}
- function tagAction()
- {
- $key = $this->_request->getParam('key');
- $page=(int)$this->_request->getParam('page');
- if (empty($page)) $page=1;
- $offset=$this->limit*($page-1);
- if (!empty($key)) {
- $this->view->codename=$key;
- $sql=$this->db->quoteInto('select count(id) from keyword where keyword=?',$key);
- $state=$this->db->query($sql);
- $row=$state->fetchAll();
- $sum=$row[0]['count'];
- $sql="select uuid,title,id,description from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and id in (select id from keyword where keyword='".$key."') order by timebegin,title limit ? offset ?";
- $this->view->metadata=$this->db->fetchAll($sql,array($this->limit,$offset));
- $this->view->page=new Pagination($sum,$page,$this->limit);
- } else {
- $state=$this->db->query("select keyword.keyword,count(*) from keyword left join normalmetadata m on keyword.id=m.id where keyword.keytype='place' and m.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') group by keyword.keyword order by count desc");
- $k1=$state->fetchAll();
- $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 d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') group by k.keyword order by k.keyword");
- $k2=$state->fetchAll();
- $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='discipline' and m.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') group by k.keyword order by k.keyword");
- $k3=$state->fetchAll();
- $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='stratum' and m.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') group by k.keyword order by k.keyword");
- $k4=$state->fetchAll();
- $state=$this->db->query("select keyword.keyword,count(*) from keyword left join normalmetadata m on keyword.id=m.id where keyword.keytype='temporal' and m.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') group by keyword.keyword order by keyword.keyword");
- $k5=$state->fetchAll();
- $this->view->keywords=array('place'=>$k1,'theme'=>$k2,'discipline'=>$k3,'stratum'=>$k4,'temporal'=>$k5);
- }
+ function tagAction()
+ {
+ $key = $this->_request->getParam('key');
+ $keytype = $this->_request->getParam('keytype');
+ $page=(int)$this->_request->getParam('page');
+ if (empty($page)) $page=1;
+ $offset=$this->limit*($page-1);
+ if (!empty($key)) {
+ $this->view->codename=$key;
+ $sql=$this->db->quoteInto("select count(k.id) from keyword k left join normalmetadata m on k.id=m.id where m.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and k.keyword=?",$key);
+ $state=$this->db->query($sql);
+ $row=$state->fetchAll();
+ $sum=$row[0]['count'];
+ $sql="select uuid,title,id,description from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and id in (select id from keyword where keyword='".$key."') order by timebegin,title limit ? offset ?";
+ $this->view->metadata=$this->db->fetchAll($sql,array($this->limit,$offset));
+ $this->view->page=new Pagination($sum,$page,$this->limit);
+ } else {
+ $sql="select k.keyword,count(*),k.keytype from keyword k left join normalmetadata m on k.id=m.id where length(k.keyword)>0 and m.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') ";
+ if (!empty($keytype) && ($keytype=='place' || $keytype=='theme' || $keytype=='discipline'||$keytype=='temporal')) $sql.=" and k.keytype='".$keytype."'";
+ $sql.=' group by k.keyword,k.keytype order by k.keytype,k.keyword,count desc';
+ $state=$this->db->query($sql);
+ $this->view->keytype=$keytype;
+ $this->view->keywords=$state->fetchAll();
+ }
}
function searchAction()
@@ -296,19 +310,63 @@ class HeiheController extends DataController
}
}
- private function getmd($keyword,$type='theme')
- {
- $page=(int)$this->_request->getParam('page');
- if (empty($page)) $page=1;
- $offset=$this->limit*($page-1);
- $state=$this->db->query("select count(m.*) from normalmetadata m left join datasource d on m.uuid=d.uuid left join source s on d.sourceid=s.id where s.code='heihe' and m.id in (select id from keyword where keytype='".$type."' and keyword='".$keyword."')");
- $row=$state->fetchAll();
- $sum=$row[0]['count'];
- //@todo: add order with title
- $sql="select uuid,title from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and id in (select id from keyword where keytype='".$type."' and keyword='".$keyword."') order by timebegin,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->offset=$offset+1;
+ private function getmd($keyword,$type='theme')
+ {
+ $page=(int)$this->_request->getParam('page');
+ if (empty($page)) $page=1;
+ $offset=$this->limit*($page-1);
+ if (!is_array($keyword))
+ {
+ $keyword=array($keyword);
+ }
+ $key="(";
+ foreach($keyword as $k)
+ {
+ $key.="'".$k."',";
+ }
+ $key=substr($key,0,-1);
+ $key.=")";
+ $keyword=$key;
+
+ $state=$this->db->query("select count(m.*) from normalmetadata m left join datasource d on m.uuid=d.uuid left join source s on d.sourceid=s.id where s.code='heihe' and m.id in (select id from keyword where keytype='".$type."' and keyword in ".$keyword.")");
+ $row=$state->fetchAll();
+ $sum=$row[0]['count'];
+ //@todo: add order with title
+ $sql="select uuid,title from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and id in (select id from keyword where keytype='".$type."' and keyword in ".$keyword.") order by timebegin,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->offset=$offset+1;
+ }
+
+ //获取多项条件并列关系的数据并必须满足limited条件
+ //$keyword:字符串或字符串数组
+ //$limited:限制字符串
+ private function getmdlimited($keyword,$limited)
+ {
+ $page=(int)$this->_request->getParam('page');
+ if (empty($page)) $page=1;
+ $offset=$this->limit*($page-1);
+ if (!is_array($keyword))
+ {
+ $keyword=array($keyword);
+ }
+ $key="(";
+ foreach($keyword as $k)
+ {
+ $key.="'".$k."',";
+ }
+ $key=substr($key,0,-1);
+ $key.=")";
+ $keyword=$key;
+
+ $state=$this->db->query("select count(m.*) from normalmetadata m left join datasource d on m.uuid=d.uuid left join source s on d.sourceid=s.id where s.code='heihe' and m.id in (select id from keyword where keyword='".$limited."') and m.id in (select id from keyword where keyword in ".$keyword.")");
+ $row=$state->fetchAll();
+ $sum=$row[0]['count'];
+ //@todo: add order with title
+ $sql="select uuid,title from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and id in (select id from keyword where keyword='".$limited."') and id in (select id from keyword where keyword in ".$keyword.") order by timebegin,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->offset=$offset+1;
}
/*
@@ -334,13 +392,7 @@ class HeiheController extends DataController
$this->view->isadmin=false;
if ($user->usertype=='administrator') $this->view->isadmin=true;
}
-
- if(empty($ac) || $ac == "index")
- {
- $this->_helper->viewRenderer('submit-index');
- return true;
- }
-
+
//新建元数据
if($ac == "newdata")
{
@@ -409,10 +461,10 @@ class HeiheController extends DataController
}//newdata
//未提交数据
- if($ac == "unsubmit")
+ if($ac == "unsubmit" || $ac=="")
{
$do = $this->_getParam('do');
-
+
//未提交的数据列表
if(empty($do) || $do=="index")
{
@@ -737,6 +789,7 @@ class HeiheController extends DataController
if(empty($ac) || $ac == "index" || $ac == 'my')
{
$this->_helper->viewRenderer('project-index');
+ $this->view->tabID='projects-index';
//Search Link
$this->view->searchLink = "/heihe/projects/ac/index/";
@@ -752,15 +805,20 @@ class HeiheController extends DataController
$this->view->error = "输入的搜索条件有误,只允许输入汉字、数字、字母";
return true;
}
- $wheresql[] = " (title LIKE '%$q%' OR
- code LIKE '%$q%' OR
- name LIKE '%$q%')";
+ $wheresql[] = " (p.title LIKE '%$q%' OR
+ p.code LIKE '%$q%' OR
+ p.name LIKE '%$q%')";
$this->view->searchKeyword = $q;
}
if($ac == "my")
{
- $wheresql[] = " email='$user_email' ";
+ //防止通过其它方式访问,先判断是否是登录用户,如果不是,抛出消息后强制用户退出
+ $auth = Zend_Auth::getInstance();
+ if(!$auth->hasIdentity())
+ $this->_redirect('/account/login?href=/heihe/projects/ac/my');
+ $wheresql[] = " p.email='$user_email' ";
+ $this->view->tabID='projects-my';
}
if(count($wheresql)>0)
@@ -775,8 +833,8 @@ class HeiheController extends DataController
$wheresql = " WHERE ".$wheresql;
}
- $sql = "SELECT * FROM heiheproject $wheresql
- ORDER BY id DESC";
+ $sql = "SELECT p.*,f.id as fid FROM heiheproject p left join fund f on p.code=f.fund_id $wheresql
+ ORDER BY p.id asc";
$sth = $this->db->query($sql);
$rows = $sth->fetchAll();
@@ -792,8 +850,8 @@ class HeiheController extends DataController
if($ac == "submitting")
{
$this->_helper->viewRenderer('project-index');
-
- $sql = "SELECT * FROM heiheproject WHERE status=1";
+ $this->view->tabID='projects-submitting';
+ $sql = "SELECT p.*,f.id as fid FROM heiheproject p left join fund f on p.code=f.fund_id WHERE p.status=1";
$sth = $this->db->query($sql);
$rows = $sth->fetchAll();
@@ -808,8 +866,8 @@ class HeiheController extends DataController
if($ac == "unsubmit")
{
$this->_helper->viewRenderer('project-index');
-
- $sql = "SELECT * FROM heiheproject WHERE status=0";
+ $this->view->tabID='projects-unsubmit';
+ $sql = "SELECT p.*,f.id as fid FROM heiheproject p left join fund f on p.code=f.fund_id WHERE p.status=0";
$sth = $this->db->query($sql);
$rows = $sth->fetchAll();
@@ -824,8 +882,8 @@ class HeiheController extends DataController
if($ac == "submit")
{
$this->_helper->viewRenderer('project-index');
-
- $sql = "SELECT * FROM heiheproject WHERE status>0";
+ $this->view->tabID='projects-submit';
+ $sql = "SELECT p.*,f.id as fid FROM heiheproject p left join fund f on p.code=f.fund_id WHERE p.status>0";
$sth = $this->db->query($sql);
$rows = $sth->fetchAll();
@@ -1018,5 +1076,166 @@ class HeiheController extends DataController
$sth=$this->wdb->prepare($sql);
$sth->execute(array($author,$uuid));
}
+ //基于数据作者的浏览(包括认证后的数据作者以及未认证的数据作者)
+ function authorAction()
+ {
+ $ac = $this->_request->getParam('ac');
+ $id = (int)$this->_request->getParam('id');
+ if ($ac=='verified') {
+ //已经认证过的数据作者
+ $this->view->tabID='author-verified';
+ $this->view->ac='verified';
+ if ($id) {
+ //列出作者的数据
+ $sql="select username,realname from users where id=?";
+ $this->view->author=$this->db->fetchRow($sql,array($id));
+ $sql="select m.* from normalmetadata m left join mdauthor a on a.uuid=m.uuid where m.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and a.userid=?";
+ $sth = $this->db->prepare($sql);
+ $sth->execute(array($id));
+ $rows = $sth->fetchAll();
+ $paginator = Zend_Paginator::factory($rows);
+ $paginator->setCurrentPageNumber($this->_getParam('page'));
+ $paginator->setItemCountPerPage(10);
+ $paginator->setView($this->view);
+ Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
+ $this->view->paginator=$paginator;
+ } else {
+ //已经认证过的数据作者
+ $sql="select u.username,u.realname,u.id,count(u.id) as count from mdauthor a left join users u on a.userid=u.id where a.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and a.status=1 and a.uuid in (select uuid from normalmetadata) group by u.id,u.username,u.realname";
+ $sth = $this->db->prepare($sql);
+ $sth->execute();
+ $rows = $sth->fetchAll();
+ $paginator = Zend_Paginator::factory($rows);
+ $paginator->setCurrentPageNumber($this->_getParam('page'));
+ $paginator->setItemCountPerPage(50);
+ $paginator->setView($this->view);
+ Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
+ $this->view->paginator=$paginator;
+ }
+ } else if ($ac=='unverified' || empty($ac)) {
+ //未认证的数据作者
+ $this->view->tabID='author-unverified';
+ $this->view->ac='unverified';
+ if ($id) {
+ //列出数据
+ $sql="select individual as username from responsible where id=?";
+ $this->view->author=$this->db->fetchRow($sql,array($id));
+ $sql="select distinct m.* from normalmetadata m left join role r on m.uuid=r.uuid left join responsible s on r.resid=s.id where r.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and r.role in ('pointOfContact','resourceProvider','owner') and s.id=?";
+ $sth = $this->db->prepare($sql);
+ $sth->execute(array($id));
+ $rows = $sth->fetchAll();
+ $paginator = Zend_Paginator::factory($rows);
+ $paginator->setCurrentPageNumber($this->_getParam('page'));
+ $paginator->setItemCountPerPage(10);
+ $paginator->setView($this->view);
+ Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
+ $this->view->paginator=$paginator;
+ } else {
+ //列出所有作者
+ $sql="select distinct responsible.individual as username,responsible.id from responsible left join role on role.resid=responsible.id where role.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and role.role in ('pointOfContact','resourceProvider','owner')";
+ $sth = $this->db->prepare($sql);
+ $sth->execute();
+ $rows = $sth->fetchAll();
+ $paginator = Zend_Paginator::factory($rows);
+ $paginator->setCurrentPageNumber($this->_getParam('page'));
+ $paginator->setItemCountPerPage(50);
+ $paginator->setView($this->view);
+ Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
+ $this->view->paginator=$paginator;
+ }
+ }
+ }
+ function fundAction()
+ {
+ $id = (int)$this->_request->getParam('id');
+ if (!empty($id)) {
+ $sql="select * from fund where id=?";
+ $this->view->fund=$this->db->fetchRow($sql,array($id));
+ if ($this->view->fund) {
+ $sql="select distinct m.* from normalmetadata m left join mdfund mf on m.uuid=mf.uuid where m.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and mf.fid=?";
+ $sth = $this->db->prepare($sql);
+ $sth->execute(array($id));
+ $rows = $sth->fetchAll();
+ $paginator = Zend_Paginator::factory($rows);
+ $paginator->setCurrentPageNumber($this->_getParam('page'));
+ $paginator->setItemCountPerPage(10);
+ $paginator->setView($this->view);
+ Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
+ $this->view->paginator=$paginator;
+ }
+ } else {
+ //提供全部分类列表
+ $sql="select f.id,f.title,f.fund_id,f.fund_type,f.ts_created,count(m.id) as datacount,sum(md.filesize) as filesize from fund f left join mdfund m on f.id=m.fid left join metadata md on m.uuid=md.uuid left join heiheproject hp on f.fund_id=hp.code where hp.id is not null and m.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') group by f.id,f.title,f.fund_id,f.fund_type,f.ts_created order by f.ts_created desc";
+ $sth = $this->db->prepare($sql);
+ $sth->execute();
+ $rows = $sth->fetchAll();
+ $paginator = Zend_Paginator::factory($rows);
+ $paginator->setCurrentPageNumber($this->_getParam('page'));
+ $paginator->setItemCountPerPage(10);
+ $paginator->setView($this->view);
+ Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
+ $this->view->paginator=$paginator;
+ $this->_helper->viewRenderer('fund-list');
+ }
+ }
+
+ function orgAction()
+ {
+ $page = $this->_request->getParam('page');
+ $name = $this->_request->getParam('name');
+ $state=$this->db->query("select distinct responsible.organisation from responsible left join role on role.resid=responsible.id where role.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and role.role in ('pointOfContact','resourceProvider','owner')");
+ $this->view->organisation=$state->fetchAll();
+ if (!empty($name)) {
+ $this->view->codename=$name;
+ $sql="select distinct m.* from normalmetadata m left join role r on m.uuid=r.uuid left join responsible s on r.resid=s.id where m.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and r.role in ('pointOfContact','resourceProvider','owner') and s.organisation=?";
+ $sth = $this->db->prepare($sql);
+ $sth->execute(array($name));
+ $rows = $sth->fetchAll();
+ $paginator = Zend_Paginator::factory($rows);
+ $paginator->setCurrentPageNumber($this->_getParam('page'));
+ $paginator->setItemCountPerPage(10);
+ $paginator->setView($this->view);
+ Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
+ $this->view->paginator=$paginator;
+ } else {
+ //提供全部分类列表
+ }
+ }
+
+ //实现基于DOI信息的浏览
+ function doiAction()
+ {
+ $ac = $this->_request->getParam('ac');
+ if ($ac=='unready') {
+ //列出没有DOI的数据
+ $sql="select m.* from normalmetadata m where length(m.doi)<3 and m.uuid not in (select uuid from datadoi) and m.uuid in (select ds.uuid from datasource ds left join source s on ds.sourceid=s.id where s.code='heihe') order by m.ts_created desc";
+ $this->view->tabID='doi-unready';
+ } else if ($ac=='prepare') {
+ //列出有DOI但还未进行提交申请的数据
+ $sql="select m.* from normalmetadata m where length(m.doi)>3 and m.uuid not in (select uuid from datadoi) and m.uuid in (select ds.uuid from datasource ds left join source s on ds.sourceid=s.id where s.code='heihe') order by m.ts_created desc";
+ $this->view->tabID='doi-prepare';
+ } else if ($ac=='unsubmit') {
+ //列出有DOI并计划提交申请的数据
+ $sql="select m.*,d.doi as datadoi,date(d.ts_created) as ts_created from normalmetadata m left join datadoi d on m.uuid=d.uuid where length(m.doi)>3 and d.ts_created is not null and d.ts_submitted is null and m.uuid in (select ds.uuid from datasource ds left join source s on ds.sourceid=s.id where s.code='heihe') order by d.ts_created desc";
+ $this->view->tabID='doi-unsubmit';
+ } else if ($ac=='submit') {
+ //列出有DOI并计划提交申请的数据
+ $sql="select m.*,d.doi as datadoi,date(d.ts_submitted) as ts_submitted from normalmetadata m left join datadoi d on m.uuid=d.uuid where length(m.doi)>3 and d.ts_submitted is not null and d.ts_published is null and m.uuid in (select ds.uuid from datasource ds left join source s on ds.sourceid=s.id where s.code='heihe') order by d.ts_submitted desc,d.ts_created desc";
+ $this->view->tabID='doi-submit';
+ } else if ($ac=='publish' || empty($ac)) {
+ //默认:列出最新发布的DOI数据
+ $sql="select m.*,d.doi as datadoi,date(d.ts_submitted) as ts_submitted,date(d.ts_published) as ts_published from normalmetadata m left join datadoi d on m.uuid=d.uuid where length(m.doi)>3 and d.ts_published is not null and m.uuid in (select ds.uuid from datasource ds left join source s on ds.sourceid=s.id where s.code='heihe') order by d.ts_published desc,d.ts_submitted desc,d.ts_created desc";
+ $this->view->tabID='doi-publish';
+ }
+ $sth = $this->db->prepare($sql);
+ $sth->execute();
+ $rows = $sth->fetchAll();
+ $paginator = Zend_Paginator::factory($rows);
+ $paginator->setCurrentPageNumber($this->_getParam('page'));
+ $paginator->setItemCountPerPage(10);
+ $paginator->setView($this->view);
+ Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
+ $this->view->paginator=$paginator;
+ }
}
\ No newline at end of file
diff --git a/application/default/controllers/HiwaterController.php b/application/default/controllers/HiwaterController.php
index 71f65910..75adb558 100644
--- a/application/default/controllers/HiwaterController.php
+++ b/application/default/controllers/HiwaterController.php
@@ -241,7 +241,7 @@ class HiwaterController extends DataController
}
function bnulaiAction()
{
- $this->getmd(array('','LAI'));
+ $this->getmdlimited('LAI','生态水文无线传感器网络');
$this->_helper->viewRenderer('base');
}
diff --git a/application/default/controllers/SearchController.php b/application/default/controllers/SearchController.php
index 76aca128..353d57c9 100644
--- a/application/default/controllers/SearchController.php
+++ b/application/default/controllers/SearchController.php
@@ -7,6 +7,7 @@ class SearchController extends Zend_Controller_Action
$this->view->config = Zend_Registry::get('config');
$this->messenger=$this->_helper->getHelper('FlashMessenger');
$this->view->messages = $this->messenger->getMessages();
+ $this->view->theme = new Theme();
$this->view->nav = array(
array('link'=>'/','title'=>''),
array('link'=>'/data','title'=>$this->view->config->title->data),
@@ -38,5 +39,15 @@ class SearchController extends Zend_Controller_Action
$this->_helper->viewRenderer->setNoRender();
header("Content-Type: application/json; charset=utf-8");
echo $search->suggest($q);
- }
+ }
+ function advanceAction()
+ {
+ $this->view->east=$this->getParam('east');
+ $this->view->west=$this->getParam('west');
+ $this->view->south=$this->getParam('south');
+ $this->view->north=$this->getParam('north');
+ $this->view->begin=$this->getParam('begin');
+ $this->view->end=$this->getParam('end');
+ $this->view->q=$this->getParam('q');
+ }
}
diff --git a/application/default/controllers/ServiceController.php b/application/default/controllers/ServiceController.php
index 40d420df..bac191d9 100644
--- a/application/default/controllers/ServiceController.php
+++ b/application/default/controllers/ServiceController.php
@@ -373,10 +373,8 @@ class ServiceController extends Zend_Controller_Action
error_reporting(1);
if (!empty($uuid))
{
- $sql="select x.data,m.title,m.citation,m.suppinfo,m.doi,m.filesize,m.fileformat,m.south,m.east,m.west,m.north,m.timebegin,m.timeend,m.title_en,m.uuid,m.description,g.id,m.projection,t.filetype,
- cc.name as category, cc.name_zh as category_zh
+ $sql="select g.data,m.title,m.citation,m.suppinfo,m.doi,m.filesize,m.fileformat,m.south,m.east,m.west,m.north,date(m.timebegin) as timebegin,date(m.timeend) as timeend,m.title_en,m.uuid,m.description,g.id,m.projection,t.filetype
from metadata m left join xml x on m.id=x.id left join thumbnail t on x.id=t.id
- left join category c on c.id=m.id left join categorycode cc on c.code=cc.code
left join geonetworkmetadata g on g.uuid=m.uuid where m.uuid=".$this->db->quote($uuid);
$row=$this->db->fetchRow($sql);
$sql="select r.* from reference r left join mdref m on m.refid=r.id where m.uuid=?";
@@ -387,7 +385,14 @@ class ServiceController extends Zend_Controller_Action
{
$reference.=($k+1).'. '.str_replace(array("\r\n", "\n", "\r"),'',$refer['reference'])."\r\n";
}
- $row['reference']=$reference;
+ $row['reference']=$reference;
+ $sql="select cc.name as category, cc.name_zh from metadata m left join category c on m.id=c.id left join categorycode cc on c.code=cc.code where m.uuid=".$this->db->quote($uuid);
+ $cat=$this->db->fetchAll($sql);
+ $row['category_zh']='';
+ foreach($cat as $category)
+ {
+ $row['category_zh'].=$category['name_zh'].' ';
+ }
$sql="select u.uselimit from mdlimit ml left join metadata m on ml.uuid=m.uuid left join uselimit u on ml.lid=u.id where m.uuid=?";
$sql=$this->db->quoteInto($sql,$uuid);
$limits=$this->db->fetchAll($sql);
@@ -454,14 +459,13 @@ class ServiceController extends Zend_Controller_Action
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender();
$uuid=$this->_request->getParam('uuid');
- $review=$this->_request->getParam('review');
+ $review=$this->_request->getParam('review');
+ $ac=$this->_request->getParam('ac');
//error_reporting(1);
if (!empty($uuid))
{
- $sql="select x.data,m.title,m.citation,m.suppinfo,m.doi,m.filesize,m.fileformat,m.south,m.east,m.west,m.north,m.timebegin,m.timeend,m.title_en,m.uuid,m.description,g.id,m.projection,t.filetype,
- cc.name as category, cc.name_zh as category_zh
- from xml x left join metadata m on m.id=x.id left join thumbnail t on x.id=t.id
- left join category c on c.id=m.id left join categorycode cc on c.code=cc.code
+ $sql="select g.data,m.title,m.citation,m.suppinfo,m.doi,m.filesize,m.fileformat,m.ts_created,m.south,m.east,m.west,m.north,date(m.timebegin) as timebegin,date(m.timeend) as timeend,m.title_en,m.uuid,m.description,g.id,m.projection,t.filetype
+ from metadata m left join thumbnail t on m.id=t.id
left join geonetworkmetadata g on g.uuid=m.uuid where m.uuid=".$this->db->quote($uuid);
$row=$this->db->fetchRow($sql);
$sql="select r.* from reference r left join mdref m on m.refid=r.id where m.uuid=?";
@@ -472,7 +476,14 @@ class ServiceController extends Zend_Controller_Action
{
$reference.=($k+1).'. '.str_replace(array("\r\n", "\n", "\r"),'',$refer['reference'])."\r\n";
}
- $row['reference']=$reference;
+ $row['reference']=$reference;
+ $sql="select cc.name as category, cc.name_zh from metadata m left join category c on m.id=c.id left join categorycode cc on c.code=cc.code where m.uuid=".$this->db->quote($uuid);
+ $cat=$this->db->fetchAll($sql);
+ $row['category_zh']='';
+ foreach($cat as $category)
+ {
+ $row['category_zh'].=$category['name_zh'].' ';
+ }
$sql="select u.uselimit from mdlimit ml left join metadata m on ml.uuid=m.uuid left join uselimit u on ml.lid=u.id where m.uuid=?";
$sql=$this->db->quoteInto($sql,$uuid);
$limits=$this->db->fetchAll($sql);
@@ -491,8 +502,10 @@ class ServiceController extends Zend_Controller_Action
{
$resource.=($k+1).". ".$r['name'].' '.$r['linkage']."\n";
}
- $row['resources']=$resource;
- $sql="select r.role,s.* from role r left join responsible s on r.resid=s.id left join metadata m on m.uuid=r.uuid where m.uuid=? order by r.role,r.id";
+ $row['resources']=$resource;
+ $sql="select r.role,s.* from role r left join responsible s on r.resid=s.id left join metadata m on m.uuid=r.uuid where m.uuid=? order by r.role,r.id";
+ if ($ac=='simple')
+ $sql="select r.role,s.* from role r left join responsible s on r.resid=s.id left join metadata m on m.uuid=r.uuid where r.role in ('resourceProvider','owner','pointOfContact') and m.uuid=? order by r.role,r.id";
$sql=$this->db->quoteInto($sql,$uuid);
$contact=$this->db->fetchAll($sql);
$contacts="";
@@ -561,22 +574,25 @@ class ServiceController extends Zend_Controller_Action
require_once('odtphp/library/odf.php');
$config["PATH_TO_TMP"]="/tmp/zip";
- $config["ZIP_PROXY"]="ZipArchive";
- $odf=new Odf("../data/metadata-template.odt",$config);
+ $config["ZIP_PROXY"]="ZipArchive";
+ if ($ac=='simple')
+ $odf=new Odf("../data/metadata-template-simple.odt",$config);
+ else
+ $odf=new Odf("../data/metadata-template.odt",$config);
$odf->setVars('title',$row['title'],true,'utf-8');
@$odf->setVars('title_en',$row['title_en'],true,'utf-8');
- $odf->setVars('uuid',$row['uuid'],true,'utf-8');
- $odf->setVars('datetime',date('Y-m-d'));
+ @$odf->setVars('uuid',$row['uuid'],true,'utf-8');
+ $odf->setVars('datetime',date('Y-m-d',strtotime($row['ts_created'])));
$odf->setVars('abstract',$row['description'],true,'utf-8');
@$odf->setVars('theme_keyword',$row['keyword']['theme'],true,'utf-8');
@$odf->setVars('place_keyword',$row['keyword']['place'],true,'utf-8');
@$odf->setVars('temporal_keyword',empty($row['keyword']['temporal'])?'':$row['keyword']['temporal'],true,'utf-8');
@$odf->setVars('discipline_keyword',$row['keyword']['discipline'],true,'utf-8');
- @$odf->setVars('stratum_keyword',$row['keyword']['stratum'],true,'utf-8');
+
@$odf->setVars('category',$row['category'].' '.$row['category_zh'],true,'utf-8');
- @$odf->setVars('rfdenom',$row['rfdenom'],true,'utf-8');
- @$odf->setVars('resolution',$row['resolution'],true,'utf-8');
- @$odf->setVars('projection',$row['projection'],true,'utf-8');
+
+
+
@$odf->setVars('filesize',$row['filesize'],true,'utf-8');
@$odf->setVars('fileformat',$row['fileformat'],true,'utf-8');
@$odf->setVars('timebegin',$row['timebegin'],true,'utf-8');
@@ -584,16 +600,27 @@ class ServiceController extends Zend_Controller_Action
@$odf->setVars('citation',$row['citation'],true,'utf-8');
@$odf->setVars('reference',$row['reference'],true,'utf-8');
@$odf->setVars('doi',$row['doi'],true,'utf-8');
- @$odf->setVars('suppinfo',$row['suppinfo'],true,'utf-8');
- @$odf->setVars('uselimits',$row['uselimits'],true,'utf-8');
- @$odf->setVars('resources',$row['resources'],true,'utf-8');
- @$odf->setVars('contacts',$row['contacts'],true,'utf-8');
+
@$odf->setVars('north',$row['north'],true,'utf-8');
@$odf->setVars('south',$row['south'],true,'utf-8');
@$odf->setVars('west',$row['west'],true,'utf-8');
- @$odf->setVars('east',$row['east'],true,'utf-8');
- $odf->setImage('bigthumb', 'http://westdc.westgis.ac.cn/service/bigthumb/uuid/'.$row['uuid']);
- $odf->setImage('thumb', 'http://westdc.westgis.ac.cn/service/thumb/uuid/'.$row['uuid']);
+ @$odf->setVars('east',$row['east'],true,'utf-8');
+ if (!$ac=='simple')
+ {
+ @$odf->setImage('bigthumb', 'http://westdc.westgis.ac.cn/service/bigthumb/uuid/'.$row['uuid']);
+ @$odf->setImage('thumb', 'http://westdc.westgis.ac.cn/service/thumb/uuid/'.$row['uuid']);
+ @$odf->setVars('projection',$row['projection'],true,'utf-8');
+ @$odf->setVars('resolution',$row['resolution'],true,'utf-8');
+ @$odf->setVars('rfdenom',$row['rfdenom'],true,'utf-8');
+ @$odf->setVars('stratum_keyword',$row['keyword']['stratum'],true,'utf-8');
+ @$odf->setVars('uselimits',$row['uselimits'],true,'utf-8');
+ @$odf->setVars('resources',$row['resources'],true,'utf-8');
+ @$odf->setVars('suppinfo',$row['suppinfo'],true,'utf-8');
+ @$odf->setVars('contacts',$row['contacts'],true,'utf-8');
+ } else {
+ @$odf->setImage('qrcode', 'http://westdc.westgis.ac.cn/service/qrcode/uuid/'.$row['uuid']);
+ }
+
$odf->exportAsAttachedFile($row['title'].'.odt');
}
@@ -1190,7 +1217,7 @@ class ServiceController extends Zend_Controller_Action
$pageSize = 10;//每页容量
$sql = "select md.title,md.uuid from mdref mr
- left join metadata md on md.uuid=mr.uuid
+ right join normalmetadata md on md.uuid=mr.uuid
where mr.refid=$id";
$pagnation="";
if(isset($page))
@@ -1502,6 +1529,20 @@ class ServiceController extends Zend_Controller_Action
$this->getResponse()->setHeader('Content-Type', 'application/json')->appendBody(json_encode($data,JSON_NUMERIC_CHECK));
return true;
+ }
+
+ function qrcodeAction()
+ {
+ $this->_helper->layout->disableLayout();
+ $this->_helper->viewRenderer->setNoRender();
+ $uuid = $this->getRequest()->getParam('uuid');
+ $code_params = array('text' => 'http://westdc.westgis.ac.cn/data/'.$uuid,
+ 'backgroundColor' => '#FFFFFF',
+ 'foreColor' => '#000000',
+ 'padding' => 4, //array(10,5,10,5),
+ 'moduleSize' => 2);
+ $renderer_params = array('imageType' => 'png');
+ Zend_Matrixcode::render('qrcode', $code_params, 'image', $renderer_params);
}
}
diff --git a/application/default/views/scripts/author/apply.phtml b/application/default/views/scripts/author/apply.phtml
index 09711c18..736c8500 100644
--- a/application/default/views/scripts/author/apply.phtml
+++ b/application/default/views/scripts/author/apply.phtml
@@ -77,8 +77,8 @@ function datareceive(data){
var result = new Array();
for(i=0;i';
+ if(data[i].status==1 && data[i].userid==id; ?>) var ct='您是此元数据的作者';
+ else if (data[i].status==0 && data[i].userid==id; ?>) var ct='您已经申请成为该元数据作者,请前往 我的数据 查看';
else var ct='申请成为此数据的作者';
result.push('