#545, 初步实现黑河数据的协议分离

This commit is contained in:
wlx 2013-07-17 08:04:33 +00:00
parent 0cfab6f6aa
commit 985120fe69
7 changed files with 70 additions and 19 deletions

View File

@ -5,7 +5,7 @@ db.params.username = gis
db.params.password = gispassword db.params.password = gispassword
db.params.dbname = metadata db.params.dbname = metadata
geonetwork.url=http://www.heihedata.org/geonetwork/ geonetwork.url=http://test.heihedata.org/geonetwork/
geonetwork.adapter = PDO_PGSQL geonetwork.adapter = PDO_PGSQL
geonetwork.params.host = localhost geonetwork.params.host = localhost
geonetwork.params.username = gis geonetwork.params.username = gis
@ -53,7 +53,8 @@ ftp.user=newwestdc
ftp.password=westdcforsmall ftp.password=westdcforsmall
download.max=5 //最多同时申请下载个数 download.max=5 //最多同时申请下载个数
page.max=10 //每页显示条目数 page.max=10 //每页显示条目数
offline.template=../data/offline.pdf offline.template=../data/offline.pdf
offline.heihetemplate=../data/heihe.pdf
offline.security=../data/security.pdf offline.security=../data/security.pdf
offline.water_template=../data/water_offline.pdf offline.water_template=../data/water_offline.pdf
offline.font=../data/simhei.ttf offline.font=../data/simhei.ttf

View File

@ -2805,7 +2805,7 @@ class AuthorController extends Zend_Controller_Action
$this->jsonexit($data); $this->jsonexit($data);
return true; return true;
} }
$author = new Author($this->db); $author = new Author($this->db);
if(!$author->checkAuthor($uuid)) if(!$author->checkAuthor($uuid))
{ {
@ -2828,7 +2828,7 @@ class AuthorController extends Zend_Controller_Action
$sth = $this->db->prepare($sql); $sth = $this->db->prepare($sql);
$sth->execute(array(trim($ref))); $sth->execute(array(trim($ref)));
$row = $sth->fetch(); $row = $sth->fetch();
} }
$sql="insert into mdref (uuid,refid,reftype) values(?,?,?)"; $sql="insert into mdref (uuid,refid,reftype) values(?,?,?)";
$sth = $this->db->prepare($sql); $sth = $this->db->prepare($sql);
$ex=$sth->execute(array($uuid,$row['id'],$reftype)); $ex=$sth->execute(array($uuid,$row['id'],$reftype));

View File

@ -1579,11 +1579,19 @@ where d.status=2 and d.userid=? order by d.ts_created desc
$this->_helper->layout->disableLayout(); $this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender(); $this->_helper->viewRenderer->setNoRender();
//生成PDF //生成PDF
$sql="select m.title||'('||m.filesize::text||'MB)' as title from dataorder d right join heihemetadata m on d.uuid=m.uuid where d.status=2 and d.userid=?";
$list=$this->db->fetchAll($sql,array($userid));
foreach($list as $i=>$row) @$formData['heihelist'].=($i+1).". ".$row['title'].";";
$sql="select m.title||'('||m.filesize::text||'MB)' as title from dataorder d right join normalmetadata m on d.uuid=m.uuid where d.uuid not in (select uuid from heihemetadata) and d.status=2 and d.userid=?";
$list=$this->db->fetchAll($sql,array($userid));
foreach($list as $i=>$row) @$formData['westdclist'].=($i+1).". ".$row['title'].";";
$pdf = new ApplicantPDF(); $pdf = new ApplicantPDF();
$pdf->template=$this->view->config->offline->template; $pdf->template=$this->view->config->offline->template;
$pdf->heihetemplate=$this->view->config->offline->heihetemplate;
$formData['project'].='['.$formData['project_title'].' | '.$formData['project_type'].' | '.$formData['project_id'].']'; $formData['project'].='['.$formData['project_title'].' | '.$formData['project_type'].' | '.$formData['project_id'].']';
$pdf->data = $formData; $pdf->data = $formData;
$pdf->drawWestdc(); if (isset($formData['westdclist'])) $pdf->drawWestdc();
if (isset($formData['heihelist'])) $pdf->drawHeihe();
$pdf->addRef($rows); $pdf->addRef($rows);
$pdf->addSecurity($this->view->config->offline->security); $pdf->addSecurity($this->view->config->offline->security);
header("Content-Disposition: inline; filename=westdc-data-apply.pdf"); header("Content-Disposition: inline; filename=westdc-data-apply.pdf");
@ -1595,11 +1603,19 @@ where d.status=2 and d.userid=? order by d.ts_created desc
} elseif ($formData['submit']) { } elseif ($formData['submit']) {
//提交 //提交
//生成PDF //生成PDF
$sql="select m.title||'('||m.filesize::text||'MB)' as title from dataorder d right join heihemetadata m on d.uuid=m.uuid where d.status=2 and d.userid=?";
$list=$this->db->fetchAll($sql,array($userid));
foreach($list as $i=>$row) @$formData['heihelist'].=($i+1).". ".$row['title'].";";
$sql="select m.title||'('||m.filesize::text||'MB)' as title from dataorder d right join normalmetadata m on d.uuid=m.uuid where d.uuid not in (select uuid from heihemetadata) and d.status=2 and d.userid=?";
$list=$this->db->fetchAll($sql,array($userid));
foreach($list as $i=>$row) @$formData['westdclist'].=($i+1).". ".$row['title'].";";
$pdf = new ApplicantPDF(); $pdf = new ApplicantPDF();
$pdf->template=$this->view->config->offline->template; $pdf->template=$this->view->config->offline->template;
$pdf->heihetemplate=$this->view->config->offline->heihetemplate;
$pdf->data = $formData; $pdf->data = $formData;
$pdf->data['project'].='['.$formData['project_title'].' | '.$formData['project_type'].' | '.$formData['project_id'].']'; $pdf->data['project'].='['.$formData['project_title'].' | '.$formData['project_type'].' | '.$formData['project_id'].']';
$pdf->drawWestdc(); if (isset($formData['westdclist'])) $pdf->drawWestdc();
if (isset($formData['heihelist'])) $pdf->drawHeihe();
$pdf->addRef($rows); $pdf->addRef($rows);
$pdf->addSecurity($this->view->config->offline->security); $pdf->addSecurity($this->view->config->offline->security);
$fn=$formData['realname'].date('YmdHis').".pdf"; $fn=$formData['realname'].date('YmdHis').".pdf";
@ -1638,7 +1654,7 @@ where d.status=2 and d.userid=? order by d.ts_created desc
$this->_helper->viewRenderer('order'); $this->_helper->viewRenderer('order');
//跳转到/data/order并提示帮助信息告知用户已经发送EMAIL //跳转到/data/order并提示帮助信息告知用户已经发送EMAIL
$this->view->msg=view::Msg('alert-success',"提示信息:您的离线申请已经提交,系统已经发送一封邮件给您,请打印出申请表、签字后拍照或扫描并email给数据中心服务组可以采用邮寄方式),具体信息请参考邮件说明。",0); $this->view->msg=view::Msg('alert-success',"提示信息:您的离线申请已经提交,系统已经发送一封邮件给您,请打印出申请表、签字后扫描为pdf并email给数据中心服务组仍可以采用邮寄方式具体信息请参考邮件说明。",0);
if (empty($ac)) $ac='offline3'; if (empty($ac)) $ac='offline3';
//$this->_redirect('/data/order'); //$this->_redirect('/data/order');
} }

View File

@ -72,7 +72,7 @@ if ($this->tabID=='order-offline1') {
echo ' <a class="btn" href="/data/order/cancel/'.$order['id'].'">取消</a>'; echo ' <a class="btn" href="/data/order/cancel/'.$order['id'].'">取消</a>';
break; break;
case 3: case 3:
echo "请打印签字然后扫描或拍照申请表并email或邮寄"; echo "请打印签字扫描为pdf并email或邮寄";
break; break;
default: default:
break; break;
@ -80,7 +80,7 @@ if ($this->tabID=='order-offline1') {
} elseif ($this->tabID=='order-offline3') { } elseif ($this->tabID=='order-offline3') {
switch($order['status']) { switch($order['status']) {
case 3: case 3:
echo "请打印签字然后扫描或拍照申请表并email或邮寄"; echo "请打印签字扫描为pdf并email或邮寄";
break; break;
case 4: case 4:
echo "已收到申请,请等待审批。日期:";echo date('Y-m-d',strtotime($order['ts_received'])); echo "已收到申请,请等待审批。日期:";echo date('Y-m-d',strtotime($order['ts_received']));

View File

@ -5,36 +5,70 @@ require_once('fpdi/fpdi.php');
class ApplicantPDF extends FPDI class ApplicantPDF extends FPDI
{ {
public $template;//模板文件的路径 public $template;//模板文件的路径
public $heihetemplate;//模板文件的路径
public $data;//包含具体的数据,数组 public $data;//包含具体的数据,数组
public $fontsize=10; public $fontsize=10;
function __construct()
{
parent::__construct();
$this->AddUniGBhwFont('ugb','AdobeSongStd-Light-Acro');
}
function drawWestdc() function drawWestdc()
{ {
$pagecount = $this->setSourceFile($this->template); $pagecount = $this->setSourceFile($this->template);
$tplidx = $this->importPage(1); $tplidx = $this->importPage(1);
$this->addPage(); $this->addPage();
$this->useTemplate($tplidx); $this->useTemplate($tplidx);
$this->AddUniGBhwFont('ugb','AdobeSongStd-Light-Acro');
$this->SetFont('ugb','',$this->fontsize); $this->SetFont('ugb','',$this->fontsize);
$this->setXY(71,44); $this->setXY(74,43);
$this->Write($this->fontsize,$this->data['realname']); $this->Write($this->fontsize,$this->data['realname']);
$this->SetXY(34,55); $this->SetXY(34,55);
$this->MultiCell (166, 4, str_replace(";","\n",$this->data['datalist'])); $this->MultiCell (166, 4, str_replace(";","\n",$this->data['westdclist']));
$this->setXY(30,100); $this->setXY(30,100);
$this->MultiCell(166,4,trim($this->data['project'])); $this->MultiCell(166,4,trim($this->data['project']));
//$this->setXY(34,239); //$this->setXY(34,239);
//$this->Write($this->fontsize,$this->data['realname']); //$this->Write($this->fontsize,$this->data['realname']);
$this->setXY(32,225); $this->setXY(32,223);
$this->Write($this->fontsize,$this->data['unit']); $this->Write($this->fontsize,$this->data['unit']);
$this->setXY(112,225); $this->setXY(112,223);
$this->Write($this->fontsize,$this->data['email']); $this->Write($this->fontsize,$this->data['email']);
$this->setXY(174,225); $this->setXY(174,223);
$this->Write($this->fontsize,$this->data['postcode']); $this->Write($this->fontsize,$this->data['postcode']);
$this->setXY(32,231); $this->setXY(32,230);
$this->Write($this->fontsize,$this->data['address']); $this->Write($this->fontsize,$this->data['address']);
$this->setXY(112,231); $this->setXY(112,230);
$this->Write($this->fontsize,$this->data['phone']); $this->Write($this->fontsize,$this->data['phone']);
$t=date("Y-m-d"); $t=date("Y-m-d");
$this->setXY(174,231); $this->setXY(174,230);
$this->Write($this->fontsize,$t);
}
function drawHeihe()
{
$pagecount = $this->setSourceFile($this->heihetemplate);
$tplidx = $this->importPage(1);
$this->addPage();
$this->useTemplate($tplidx);
$this->SetFont('ugb','',$this->fontsize);
$this->setXY(88,43);
$this->Write($this->fontsize,$this->data['realname']);
$this->SetXY(34,55);
$this->MultiCell (166, 4, str_replace(";","\n",$this->data['heihelist']));
$this->setXY(30,100);
$this->MultiCell(166,4,trim($this->data['project']));
//$this->setXY(34,239);
//$this->Write($this->fontsize,$this->data['realname']);
$this->setXY(32,223);
$this->Write($this->fontsize,$this->data['unit']);
$this->setXY(112,223);
$this->Write($this->fontsize,$this->data['email']);
$this->setXY(174,223);
$this->Write($this->fontsize,$this->data['postcode']);
$this->setXY(32,230);
$this->Write($this->fontsize,$this->data['address']);
$this->setXY(112,230);
$this->Write($this->fontsize,$this->data['phone']);
$t=date("Y-m-d");
$this->setXY(174,230);
$this->Write($this->fontsize,$t); $this->Write($this->fontsize,$t);
} }
function addRef($mds) function addRef($mds)

BIN
data/heihe.pdf Normal file

Binary file not shown.

Binary file not shown.