diff --git a/application/admin/controllers/DataController.php b/application/admin/controllers/DataController.php index 9d2655a3..78e428e5 100755 --- a/application/admin/controllers/DataController.php +++ b/application/admin/controllers/DataController.php @@ -3626,7 +3626,8 @@ class Admin_DataController extends Zend_Controller_Action { $ac = $this->_getParam('ac'); $submit = $this->_getParam('submit'); - $uuid = $this->_getParam('uuid'); + $uuid = $this->_getParam('uuid'); + $q=$this->_getParam('q'); include_once("data/Doi.php"); $doi = new Doi($this->db); @@ -3636,7 +3637,7 @@ class Admin_DataController extends Zend_Controller_Action { if(empty($uuid)) { - $rows = $doi->fetch(); + $rows = $doi->fetch(0,$q); view::addPaginator($rows,$this->view,$this->_request); }else{ $this->_redirect('/admin/data/doi/ac/edit/?uuid='.$uuid); diff --git a/application/default/controllers/AuthorController.php b/application/default/controllers/AuthorController.php index ec1cf681..71a63662 100644 --- a/application/default/controllers/AuthorController.php +++ b/application/default/controllers/AuthorController.php @@ -6,6 +6,7 @@ @license http:// @link http:// */ +include_once("data/Author.php"); class AuthorController extends Zend_Controller_Action { private $limit=10; @@ -709,8 +710,8 @@ class AuthorController extends Zend_Controller_Action */ function applyAction() { - $ac = $this->_request->getParam('ac'); - include_once('helper/view.php'); + $ac = $this->_request->getParam('ac'); + include_once('helper/view.php'); $this->view->id=view::User('id'); if($ac == "mydata") @@ -719,7 +720,7 @@ class AuthorController extends Zend_Controller_Action $this->_helper->viewRenderer->setNoRender(); $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 @@ -2565,7 +2566,7 @@ class AuthorController extends Zend_Controller_Action function literatureAction() { $ac = $this->_request->getParam('ac'); - $uuid = $this->_request->getParam('uuid'); + $this->view->uuid = $uuid = $this->_request->getParam('uuid'); $id = $this->_request->getParam('id'); $auth = Zend_Auth::getInstance(); @@ -2596,9 +2597,14 @@ class AuthorController extends Zend_Controller_Action $this->_helper->viewRenderer->setNoRender(); $id = $this->_getParam('id'); + $refid = $this->_getParam('refid'); $content = $this->_getParam('content'); + $link = $this->_getParam('link'); + $reftype = $this->_getParam('reftype'); + $uuid = $this->_getParam('uuid'); - if(empty($id)) + + if(empty($id) || empty($uuid)) { $this->jsonexit(array('error'=>'参数错误')); return true; @@ -2610,7 +2616,13 @@ class AuthorController extends Zend_Controller_Action return true; } - $s = $author->Literature->edit($id,$content); + if(empty($reftype)) + { + $this->jsonexit(array('error'=>'请选择文献类型')); + return true; + } + + $s = $author->Literature->edit($id,$refid,$uuid,$content,$link,$reftype); if($s !== true) { $this->jsonexit(array('error'=>'出现错误')); @@ -2713,7 +2725,7 @@ class AuthorController extends Zend_Controller_Action //按文献浏览 else if($ac=="byliter") { - $keywords = $this->_request->getParam('q'); + $keywords = $this->_request->getParam('q'); if(!empty($keywords)) $this->view->q = $keywords; $sql = "SELECT count(md.uuid) as c,r.reference,r.id FROM reference r @@ -2744,6 +2756,17 @@ class AuthorController extends Zend_Controller_Action $this->_helper->viewRenderer('literature-byliter'); } + //单条文献的信息 + else if ($ac == "get") + { + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + $id = $this->_getParam('id'); + $data = $author->Literature->getOne($id); + $this->jsonexit($data); + return true; + } + //按数据浏览 else if($ac=="bydata") { @@ -2763,41 +2786,40 @@ class AuthorController extends Zend_Controller_Action //添加文献信息 else if($ac == "add") { - $submit = $this->_request->getParam('submit'); - if(!empty($submit)) - { - $this->_helper->layout->disableLayout(); - $this->_helper->viewRenderer->setNoRender(); - - $data = ""; - try{ - $uuid = $this->_request->getParam('uuid'); - $ref=$this->_request->getParam('ref'); - $reftype=$this->_request->getParam('reftype'); - $url = $this->_request->getParam('url'); - if(empty($uuid) || empty($ref) || !is_numeric($reftype)) - { + $submit = $this->_request->getParam('submit'); + if(!empty($submit)) + { + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + + $data = ""; + try{ + $uuid = $this->_request->getParam('uuid'); + $ref=$this->_request->getParam('ref'); + $reftype=$this->_request->getParam('reftype'); + $url = $this->_request->getParam('url'); + + if(empty($uuid) || empty($ref) || !is_numeric($reftype)) + { $data = array("error"=>"参数错误"); $this->jsonexit($data); return true; - } + } - $sql="select * from mdauthor where userid=? and uuid=? and status=1"; - $sth = $this->db->prepare($sql); - $sth->execute(array($u_id,$uuid)); - $row = $sth->fetch(); - if (empty($row)) - { + $author = new Author($this->db); + if(!$author->checkAuthor($uuid)) + { $data = array("error"=>$this->alertbox('warning','您不是该数据作者,无法添加对应文献信息。')); $this->jsonexit($data); return true; - } + } $sql="select id from reference where reference=?"; $sth = $this->db->prepare($sql); $sth->execute(array($ref)); - $row = $sth->fetch(); - if (!$row) + $row = $sth->fetch(); + + if(empty($row['id'])) { $sql="insert into reference (reference,link) values(?,?)"; $sth = $this->db->prepare($sql); @@ -2811,7 +2833,7 @@ class AuthorController extends Zend_Controller_Action $sth = $this->db->prepare($sql); $ex=$sth->execute(array($uuid,$row['id'],$reftype)); - if($ex) + if($ex) { $data = array("commited"=>1,"error"=>$this->alertbox('ok','成功添加文献!')); $this->jsonexit($data); @@ -2821,8 +2843,9 @@ class AuthorController extends Zend_Controller_Action $this->jsonexit($data); return true; } - }catch(Exception $e) { - $msg = "提交失败,请确认权限后重试"; + + }catch(Exception $e) { + $msg = "提交失败,您提交的数据可能已经存在"; if($this->debug>0) {$msg .= $e->getMessage();} $data = array("error"=>$this->alertbox('error',$msg)); diff --git a/application/default/controllers/DataController.php b/application/default/controllers/DataController.php index 8dfc3e66..989e35ee 100755 --- a/application/default/controllers/DataController.php +++ b/application/default/controllers/DataController.php @@ -1540,7 +1540,17 @@ class DataController extends Zend_Controller_Action //生成PDF离线申请文件 //用户信息可以从SESSION中读取?离线申请信息 //$sql="select * from users where id=?"; - $sql="select m.title||'('||m.filesize::text||'MB)' as title,m.citation,m.suppinfo from dataorder d left join metadata m on d.uuid=m.uuid where d.status=2 and d.userid=? order by d.ts_created desc"; + $sql="select m.title||'('||m.filesize::text||'MB)' as title,m.ts_published,date_part('year',doi.ts_published) as publish_year,m.citation,m.suppinfo, +array_to_string(ARRAY( +select r.reference from mdref mr left join reference r on mr.refid=r.id +where mr.reftype=3 and mr.uuid=d.uuid order by mr.place),'\n'::text) as reference, +array_to_string(array( +select fund.fund_type||':'||fund.title||'(编号:'||fund.fund_id||')' +from fund left join mdfund on fund.id=mdfund.fid where mdfund.uuid=d.uuid),'\n'::text) as fund, +doi.doi as datadoi,doi.authors,doi.publisher,doi.title as doititle,doi.author_en,doi.publisher_en,doi.title_en +from dataorder d left join metadata m on d.uuid=m.uuid left join datadoi doi on doi.uuid=d.uuid +where d.status=2 and d.userid=? order by d.ts_created desc +"; $rows=$this->db->fetchAll($sql,array($userid)); if ($rows) { $this->view->data2=$rows; diff --git a/application/default/controllers/HiwaterController.php b/application/default/controllers/HiwaterController.php index 55cb1263..81e8d3ad 100644 --- a/application/default/controllers/HiwaterController.php +++ b/application/default/controllers/HiwaterController.php @@ -190,16 +190,23 @@ class HiwaterController extends DataController { $this->getmd(array('','自动气象站')); $this->_helper->viewRenderer('base'); + $archive = new Archive($this->db); + $this->view->info = $archive->getOneArchive('HiWATER-通量观测矩阵','about'); } function ecAction() { $this->getmd(array('','涡动相关仪')); $this->_helper->viewRenderer('base'); + $archive = new Archive($this->db); + $this->view->info = $archive->getOneArchive('HiWATER-通量观测矩阵','about'); } function lasAction() { $this->getmd(array('','大孔径闪烁仪')); - $this->_helper->viewRenderer('base'); + $this->_helper->viewRenderer('base'); + $archive = new Archive($this->db); + $this->view->info = $archive->getOneArchive('HiWATER-通量观测矩阵','about'); + } function precAction() { @@ -288,7 +295,9 @@ class HiwaterController extends DataController function msoAction() { $this->getmd(array('自动气象站','涡动相关仪','大孔径闪烁仪','稳定同位素观测系统','热扩散液流计(TDP)','宇宙射线土壤水分')); - $this->_helper->viewRenderer('base'); + $this->_helper->viewRenderer('base'); + $archive = new Archive($this->db); + $this->view->info = $archive->getOneArchive('HiWATER-通量观测矩阵','about'); } function isotopeAction() @@ -494,7 +503,7 @@ class HiwaterController extends DataController $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='hiwater') and id in (select id from keyword where keytype='".$type."' and keyword in ".$keyword.") order by timebegin,title limit ? offset ?"; + $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='hiwater') and id in (select id from keyword where keytype='".$type."' and keyword in ".$keyword.") 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->offset=$offset+1; @@ -525,7 +534,7 @@ class HiwaterController extends DataController $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='hiwater') 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 ?"; + $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='hiwater') and id in (select id from keyword where keyword='".$limited."') and id in (select id from keyword where keyword in ".$keyword.") 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->offset=$offset+1; diff --git a/application/default/controllers/ReviewController.php b/application/default/controllers/ReviewController.php index bc337291..dc6d2d7c 100644 --- a/application/default/controllers/ReviewController.php +++ b/application/default/controllers/ReviewController.php @@ -123,15 +123,72 @@ class ReviewController extends Zend_Controller_Action * mdstatus 中 status 字段值为 2,3,4 的元数据为正在进行评审的元数据 */ function inreviewAction(){ - $this->view->pageID = "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 right 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 right 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); + + include_once("helper/view.php"); + $ac = $this->_getParam('ac'); + + if(empty($ac)) + { + $this->view->pageID = "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 right 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 right 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); + } + + if($ac == "require") + { + $this->_helper->viewRenderer('inreview-require'); + $this->view->pageID = "review-inreview-require"; + $uid = view::User('id'); + + if(empty($uid)) + { + view::Post($this,"请先登录","/account/login/?href=".urlencode("/review/inreview/ac/require")); + } + + $sql = "select m.uuid,m.title,m.id,m.description,s.status,s.ts_accepted,g.id as gid,t.filename,r.ts_created,r.id as rid,e.id as eid + from mdstatus s + right 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 + left join mdreview r ON m.uuid=r.uuid + left join mdexpertreview e ON e.uuid=m.uuid + WHERE s.status in (2,3,4) AND r.id IS NULL + GROUP BY m.uuid,m.title,m.id,m.description,s.status,s.ts_accepted,g.id,t.filename,s.ts_created,r.ts_created,r.id,e.id + order by e.id DESC,s.ts_created desc,m.title"; + $rs = $this->db->query($sql); + view::addPaginator($rs->fetchAll(),$this,NULL,$this->limit); + } + + if($ac == "reviewed") + { + $this->_helper->viewRenderer('inreview-reviewed'); + $this->view->pageID = "review-inreview-reviewed"; + $uid = view::User('id'); + + if(empty($uid)) + { + view::Post($this,"请先登录","/account/login/?href=".urlencode("/review/inreview/ac/reviewed")); + } + + $sql = "select m.uuid,m.title,m.id,m.description,s.status,s.ts_accepted,g.id as gid,t.filename,r.ts_created + from mdstatus s + right 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 + left join mdreview r ON m.uuid=r.uuid + WHERE s.status in (2,3,4) AND r.userid=$uid + GROUP BY m.uuid,m.title,m.id,m.description,s.status,s.ts_accepted,g.id,t.filename,s.ts_created,r.ts_created + order by s.ts_created desc,m.title"; + $rs = $this->db->query($sql); + view::addPaginator($rs->fetchAll(),$this,NULL,$this->limit); + } + }//在审阶段的元数据 diff --git a/application/default/views/scripts/author/accept.phtml b/application/default/views/scripts/author/accept.phtml index bfca1b85..5b4caed3 100644 --- a/application/default/views/scripts/author/accept.phtml +++ b/application/default/views/scripts/author/accept.phtml @@ -1,75 +1,79 @@ -headTitle($this->config->title->site); -$this->headTitle($this->config->title->author); -$this->headTitle()->setSeparator(' - '); -$this->headLink()->appendStylesheet('/css/author.css'); -$this->breadcrumb('首页'); -$this->breadcrumb('数据作者'); -$this->breadcrumb('我的数据'); -$this->breadcrumb()->setSeparator(' > '); -?> -
请输入元数据标题关键字进行搜索
-400?$this->escape(mb_substr($item['description'],0,400,'UTF-8').'...'):$this->escape($item['description']); ?>
-- 您已经申请该数据(如果长时间没有收到回应请联系数据中心)'; - } - ?> - -
-请输入元数据标题关键字进行搜索
+400?$this->escape(mb_substr($item['description'],0,400,'UTF-8').'...'):$this->escape($item['description']); ?>
++ 您已经申请该数据(如果长时间没有收到回应请联系数据中心)'; + } + ?> + +
+
【 查看详细
- | 编辑
+ | 编辑
| 排序
| 删除
| 添加文献
diff --git a/application/default/views/scripts/data/view.phtml b/application/default/views/scripts/data/view.phtml
index 6f0422ff..dd071fe8 100755
--- a/application/default/views/scripts/data/view.phtml
+++ b/application/default/views/scripts/data/view.phtml
@@ -79,8 +79,8 @@ if ($md->title_en) echo '
'.$this->escape($md->title_en);?>
?>
为尊重知识产权、保障数据作者的权益、扩展数据中心的服务、评估数据的应用潜力,请数据使用者在使用数据所产生的研究成果中(包括公开发表的论文、论著、数据产品和未公开发表的研究报告、数据产品等成果),明确注明数据来源和数据作者。对于转载(二次或多次发布)的数据,作者还须注明原始数据来源。
-中文发表的成果参考以下规范注明: 数据来源于国家自然科学基金委员会"中国西部环境与生态科学数据中心"(http://westdc.westgis.ac.cn)
-英文发表的成果依据以下规范注明: The data set is provided by Environmental and Ecological Science Data Center for West China,National Natural Science Foundation of China (http://westdc.westgis.ac.cn)
+中文发表的成果参考以下规范注明: 数据来源于黑河计划数据管理中心、寒区旱区科学数据中心(http://westdc.westgis.ac.cn)
+英文发表的成果依据以下规范注明: The data set is provided by Cold and Arid Regions Sciences Data Center at Lanzhou (http://westdc.westgis.ac.cn)
data_archives){ ?> diff --git a/application/default/views/scripts/heihe/view.phtml b/application/default/views/scripts/heihe/view.phtml index 9d7b1abc..20f54780 100755 --- a/application/default/views/scripts/heihe/view.phtml +++ b/application/default/views/scripts/heihe/view.phtml @@ -102,8 +102,8 @@ if ($md->title_en) echo '为尊重知识产权、保障数据作者的权益、扩展数据中心的服务、评估数据的应用潜力,请数据使用者在使用数据所产生的研究成果中(包括公开发表的论文、论著、数据产品和未公开发表的研究报告、数据产品等成果),明确注明数据来源和数据作者。对于转载(二次或多次发布)的数据,作者还须注明原始数据来源。
-中文发表的成果参考以下规范注明: 数据来源于国家自然科学基金委员会"中国西部环境与生态科学数据中心"(http://westdc.westgis.ac.cn)
-英文发表的成果依据以下规范注明: The data set is provided by Environmental and Ecological Science Data Center for West China,National Natural Science Foundation of China (http://westdc.westgis.ac.cn)
+中文发表的成果参考以下规范注明: 数据来源于黑河计划数据管理中心、寒区旱区科学数据中心(http://westdc.westgis.ac.cn)
+英文发表的成果依据以下规范注明: The data set is provided by Cold and Arid Regions Sciences Data Center at Lanzhou (http://westdc.westgis.ac.cn)
data_archives){ ?> diff --git a/application/default/views/scripts/hiwater/navi.phtml b/application/default/views/scripts/hiwater/navi.phtml index 88e2e45b..09f3fd82 100644 --- a/application/default/views/scripts/hiwater/navi.phtml +++ b/application/default/views/scripts/hiwater/navi.phtml @@ -105,7 +105,7 @@为尊重知识产权、保障数据作者的权益、扩展数据中心的服务、评估数据的应用潜力,请数据使用者在使用数据所产生的研究成果中(包括公开发表的论文、论著、数据产品和未公开发表的研究报告、数据产品等成果),明确注明数据来源和数据作者。对于转载(二次或多次发布)的数据,作者还须注明原始数据来源。
-中文发表的成果参考以下规范注明: 数据来源于国家自然科学基金委员会"中国西部环境与生态科学数据中心"(http://westdc.westgis.ac.cn)
-英文发表的成果依据以下规范注明: The data set is provided by Environmental and Ecological Science Data Center for West China,National Natural Science Foundation of China (http://westdc.westgis.ac.cn)
+中文发表的成果参考以下规范注明: 数据来源于黑河计划数据管理中心、寒区旱区科学数据中心(http://westdc.westgis.ac.cn)
+英文发表的成果依据以下规范注明: The data set is provided by Cold and Arid Regions Sciences Data Center at Lanzhou (http://westdc.westgis.ac.cn)
data_archives){ ?> diff --git a/application/default/views/scripts/index/index.phtml b/application/default/views/scripts/index/index.phtml index c35251aa..7e4fc08e 100755 --- a/application/default/views/scripts/index/index.phtml +++ b/application/default/views/scripts/index/index.phtml @@ -90,9 +90,9 @@名称 | +接收时间 | +操作 | +
---|---|---|
= $item['title'] ?>= empty($item['eid']) ? "":"[受邀评审]"?> | += date("Y-m-d",strtotime($item['ts_accepted'])) ?> | ++ 评审 + | +
名称 | +接收时间 | +评审时间 | +操作 | +
---|---|---|---|
= $item['title'] ?> | += date("Y-m-d",strtotime($item['ts_accepted'])) ?> | += date("Y-m-d",strtotime($item['ts_created'])) ?> | ++ 查看 + | +
为尊重知识产权、保障数据作者的权益、扩展数据中心的服务、评估数据的应用潜力,请数据使用者在使用数据所产生的研究成果中(包括公开发表的论文、论著、数据产品和未公开发表的研究报告、数据产品等成果),明确注明数据来源和数据作者。对于转载(二次或多次发布)的数据,作者还须注明原始数据来源。
-中文发表的成果参考以下规范注明: 数据来源于国家自然科学基金委员会"中国西部环境与生态科学数据中心"(http://westdc.westgis.ac.cn)
-英文发表的成果依据以下规范注明: The data set is provided by Environmental and Ecological Science Data Center for West China,National Natural Science Foundation of China (http://westdc.westgis.ac.cn)
+中文发表的成果参考以下规范注明: 数据来源于黑河计划数据管理中心、寒区旱区科学数据中心(http://westdc.westgis.ac.cn)
+英文发表的成果依据以下规范注明: The data set is provided by Cold and Arid Regions Sciences Data Center at Lanzhou (http://westdc.westgis.ac.cn)
data_archives){ ?> diff --git a/application/models/ApplicantPDF.php b/application/models/ApplicantPDF.php index 1951caa7..2ed0e0e4 100644 --- a/application/models/ApplicantPDF.php +++ b/application/models/ApplicantPDF.php @@ -49,15 +49,36 @@ class ApplicantPDF extends FPDI $this->SetFont('ugb','',12); $this->Write(5,($i+1).'. '.$md['title']); $this->ln(); - if ($md['citation']) - { - $this->Write(5,'【建议引用方式】'.$md['citation']); + if ($md['reference']) + { + $this->Write(5,'【引用方式】'.$md['reference']); $this->ln(); + if (!empty($md['publish_year'])) + { + $this->Write(5,'【数据的引用】'.substr($md['authors'],1,-1).'. '.$md['doititle'].'. '.$md['publisher'].', ' + .(empty($md['ts_published'])?$md['publish_year']:date('Y',strtotime($md['ts_published']))). + '. doi:'.$md['datadoi'].' ['.str_replace('"','',substr($md['author_en'],1,-1)).'. '.$md['title_en'] + .'. '.$md['publisher_en'].', '.(empty($md['ts_published'])?$md['publish_year']:date('Y',strtotime($md['ts_published']))).'. doi:'.$md['datadoi'].']'); + $this->ln(); + } + } elseif ($md['citation']) + { + $this->Write(5,'【引用方式】'.$md['citation']); + $this->ln(); + if (!empty($md['publish_year']) && !strpos($md['citation'],$md['datadoi'])) + { + $this->Write(5,'【数据的引用】'.substr($md['authors'],1,-1).'. '.$md['doititle'].'. '.$md['publisher'].', ' + .(empty($md['ts_published'])?$md['publish_year']:date('Y',strtotime($md['ts_published']))). + '. doi:'.$md['datadoi'].' ['.str_replace('"','',substr($md['author_en'],1,-1)).'. '.$md['title_en'] + .'. '.$md['publisher_en'].', '.(empty($md['ts_published'])?$md['publish_year']:date('Y',strtotime($md['ts_published']))).'. doi:'.$md['datadoi'].']'); + $this->ln(); + } } - if ($md['suppinfo']) + if ($md['suppinfo'] || $md['fund']) { $this->SetFont('ugb','I',10); - $this->Write(5,'【项目支持信息】'.$md['suppinfo']); + $p=(!empty($md['fund']))?$md['fund']:$md['suppinfo']; + $this->Write(5,'【项目信息】'.$p); $this->ln(); } $this->ln(); @@ -70,21 +91,21 @@ class ApplicantPDF extends FPDI $this->addPage(); $this->useTemplate($tplidx); $this->SetFont('ugb','B',14); - $this->setXY(46,43); + $this->setXY(46,51); $this->Write(10,$this->data['realname']); $this->SetFont('ugb','',12); $this->setXY(122,194); $this->Write(10,$this->data['realname']); $this->setXY(122,201); $this->Write($this->fontsize,$this->data['address']); - $this->setXY(122,209); + $this->setXY(122,208); $this->Write($this->fontsize,$this->data['phone']); - $this->setXY(122,216); + $this->setXY(122,215); $this->Write($this->fontsize,$this->data['email']); $t=date("Y-m-d"); - $this->setXY(32,246); + $this->setXY(32,242); $this->Write($this->fontsize,$t); - $this->setXY(122,246); + $this->setXY(122,242); $this->Write($this->fontsize,$t); } } diff --git a/application/models/RegisterForm.php b/application/models/RegisterForm.php index fc25a383..09195618 100755 --- a/application/models/RegisterForm.php +++ b/application/models/RegisterForm.php @@ -48,7 +48,7 @@ class RegisterForm extends Zend_Form $address=new Zend_Form_Element_Text('address'); $address->setLabel('联系地址')->setRequired(false); $project=new Zend_Form_Element_Textarea('project'); - $project->setLabel('隶属西部项目')->setRequired(false)->setAttrib('rows',4); + $project->setLabel('科研项目')->setRequired(false)->setAttrib('rows',4); $id = new Zend_Form_Element_Hidden('id'); diff --git a/application/models/data/Author.php b/application/models/data/Author.php index 6a133754..ec8c818b 100644 --- a/application/models/data/Author.php +++ b/application/models/data/Author.php @@ -72,7 +72,15 @@ class Literature extends Author public function __construct($db) { $this->db = $db; - } + } + + function getOne($id,$uuid = ""){ + $sql = "select m.uuid,r.reference,r.link,m.reftype,r.id as refid from reference r left join mdref m on r.id=m.refid where m.id=?"; + $sth = $this->db->prepare($sql); + $sth->execute(array($id)); + $row = $sth->fetch(); + return $row; + } function byuuid($uuid){ include_once("helper/view.php"); @@ -90,16 +98,33 @@ class Literature extends Author return $rows; } - function edit($id,$content){ + function edit($mdrefid,$refid,$uuid,$content,$link,$reftype){ include_once("helper/dbh.php"); $dbh = new dbh($this->db); $data = array( - 'reference' => $content + 'reference' => $content, + 'link'=>$link ); - $s = $dbh->update("reference",$data," id=$id ",false); - return $s; + $s = $dbh->update("reference",$data," id=$refid ",false); + + if($s) + { + $data = array( + 'reftype'=>$reftype + ); + $d = $dbh->update("mdref",$data," id=$mdrefid ",false); + if($d) + { + return true; + }else{ + return false; + } + }else{ + return false; + } + } function order($id,$order){ diff --git a/application/models/data/Doi.php b/application/models/data/Doi.php index 2b47d4c0..31e6eeae 100644 --- a/application/models/data/Doi.php +++ b/application/models/data/Doi.php @@ -12,16 +12,25 @@ class Doi extends Zend_Controller_Plugin_Abstract $this->db = $db; } - function fetch($uid=0) + function fetch($uid=0,$keyword='') { + $wheresql=' 1=1 '; + if(!empty($keyword)) + { + if(preg_match("/\'/",$keyword)) + { + $keyword = preg_replace("/\'/","''",$keyword); + } + $wheresql.=" and d.title like '%$keyword%'"; + } if(empty($uid)) { - $sql = "SELECT * FROM ".$this->tbl_doi." ORDER BY ts_published desc,ts_submitted desc,ts_created DESC"; + $sql = "SELECT * FROM ".$this->tbl_doi." d where ".$wheresql."ORDER BY d.ts_published desc,d.ts_submitted desc,d.ts_created DESC"; }else{ - $sql = "SELECT doi.* FROM ".$this->tbl_doi." doi - LEFT JOIN mdauthor a ON doi.uuid=a.uuid - WHERE a.userid=".$uid." AND a.status>0 - ORDER BY ts_published desc,ts_submitted desc,ts_created DESC + $sql = "SELECT d.* FROM ".$this->tbl_doi." d + LEFT JOIN mdauthor a ON d.uuid=a.uuid + WHERE a.userid=".$uid." AND a.status>0 and ".$wheresql." + ORDER BY d.ts_published desc,d.ts_submitted desc,d.ts_created DESC "; } $rs = $this->db->query($sql); diff --git a/data/offline.pdf b/data/offline.pdf index f1380197..d86dadb6 100644 Binary files a/data/offline.pdf and b/data/offline.pdf differ diff --git a/data/security.pdf b/data/security.pdf index ee2eca30..c7627ceb 100644 Binary files a/data/security.pdf and b/data/security.pdf differ diff --git a/htdocs/js/lib/custom/models/author-literature.js b/htdocs/js/lib/custom/models/author-literature.js index 48792777..0a87a980 100644 --- a/htdocs/js/lib/custom/models/author-literature.js +++ b/htdocs/js/lib/custom/models/author-literature.js @@ -14,6 +14,7 @@ $(document).ready(function(e) { var settings = $.extend( { id:'', content : '', + uuid:'' }, options); var methods = { @@ -21,11 +22,11 @@ $(document).ready(function(e) { { methods.creatWindow(id); }, - creatWindow : function(id){ + creatWindow : function(id,html){ $.colorbox({ initialHeight: '0', initialWidth: '0', - html: methods.dialog, + html: html, opacity: '0.3', onComplete: function(){ $('.confirm_yes').click(function(e){ @@ -44,7 +45,7 @@ $(document).ready(function(e) { $.ajax({ 'type':"POST", 'url':'/author/literature/', - 'data':'ac=edit&id='+id+'&content='+$('#content_input_area').val(), + 'data':'ac=edit&'+$('#edit-mdref').serialize(), 'success':function(data){ if (typeof(data)=='object') { @@ -65,9 +66,34 @@ $(document).ready(function(e) { } }); }, - dialog : function(content){ + loadinfo : function(id){ + $.ajax({ + 'type':"POST", + 'url':'/author/literature/', + 'data':'ac=get&id='+id, + 'success':function(data){ + html = methods.dialog(data); + methods.creatWindow(id,html); + }, + 'timeout': 30000, + 'error': function(){ + alert('出现错误,请刷新后重试'); + } + }); + }, + dialog : function(data){ HTML = '