merge heihedata branch r3775, r3776 to trunk

This commit is contained in:
wlx 2013-07-02 07:10:59 +00:00
parent 90f11cd4f4
commit 15b7e274f0
4 changed files with 42 additions and 11 deletions

View File

@ -1540,7 +1540,17 @@ class DataController extends Zend_Controller_Action
//生成PDF离线申请文件 //生成PDF离线申请文件
//用户信息可以从SESSION中读取离线申请信息 //用户信息可以从SESSION中读取离线申请信息
//$sql="select * from users where id=?"; //$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)); $rows=$this->db->fetchAll($sql,array($userid));
if ($rows) { if ($rows) {
$this->view->data2=$rows; $this->view->data2=$rows;

View File

@ -49,15 +49,36 @@ class ApplicantPDF extends FPDI
$this->SetFont('ugb','',12); $this->SetFont('ugb','',12);
$this->Write(5,($i+1).'. '.$md['title']); $this->Write(5,($i+1).'. '.$md['title']);
$this->ln(); $this->ln();
if ($md['citation']) if ($md['reference'])
{ {
$this->Write(5,'【建议引用方式】'.$md['citation']); $this->Write(5,'【引用方式】'.$md['reference']);
$this->ln(); $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->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();
} }
$this->ln(); $this->ln();
@ -70,21 +91,21 @@ class ApplicantPDF extends FPDI
$this->addPage(); $this->addPage();
$this->useTemplate($tplidx); $this->useTemplate($tplidx);
$this->SetFont('ugb','B',14); $this->SetFont('ugb','B',14);
$this->setXY(46,43); $this->setXY(46,51);
$this->Write(10,$this->data['realname']); $this->Write(10,$this->data['realname']);
$this->SetFont('ugb','',12); $this->SetFont('ugb','',12);
$this->setXY(122,194); $this->setXY(122,194);
$this->Write(10,$this->data['realname']); $this->Write(10,$this->data['realname']);
$this->setXY(122,201); $this->setXY(122,201);
$this->Write($this->fontsize,$this->data['address']); $this->Write($this->fontsize,$this->data['address']);
$this->setXY(122,209); $this->setXY(122,208);
$this->Write($this->fontsize,$this->data['phone']); $this->Write($this->fontsize,$this->data['phone']);
$this->setXY(122,216); $this->setXY(122,215);
$this->Write($this->fontsize,$this->data['email']); $this->Write($this->fontsize,$this->data['email']);
$t=date("Y-m-d"); $t=date("Y-m-d");
$this->setXY(32,246); $this->setXY(32,242);
$this->Write($this->fontsize,$t); $this->Write($this->fontsize,$t);
$this->setXY(122,246); $this->setXY(122,242);
$this->Write($this->fontsize,$t); $this->Write($this->fontsize,$t);
} }
} }

Binary file not shown.

Binary file not shown.