add simple odt option

This commit is contained in:
wlx 2013-06-11 09:23:21 +00:00
parent 223b46b6c9
commit 70a968e556
1 changed files with 16 additions and 7 deletions

View File

@ -459,7 +459,8 @@ class ServiceController extends Zend_Controller_Action
$this->_helper->layout->disableLayout(); $this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender(); $this->_helper->viewRenderer->setNoRender();
$uuid=$this->_request->getParam('uuid'); $uuid=$this->_request->getParam('uuid');
$review=$this->_request->getParam('review'); $review=$this->_request->getParam('review');
$ac=$this->_request->getParam('ac');
//error_reporting(1); //error_reporting(1);
if (!empty($uuid)) if (!empty($uuid))
{ {
@ -571,11 +572,14 @@ class ServiceController extends Zend_Controller_Action
require_once('odtphp/library/odf.php'); require_once('odtphp/library/odf.php');
$config["PATH_TO_TMP"]="/tmp/zip"; $config["PATH_TO_TMP"]="/tmp/zip";
$config["ZIP_PROXY"]="ZipArchive"; $config["ZIP_PROXY"]="ZipArchive";
$odf=new Odf("../data/metadata-template.odt",$config); 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',$row['title'],true,'utf-8');
@$odf->setVars('title_en',$row['title_en'],true,'utf-8'); @$odf->setVars('title_en',$row['title_en'],true,'utf-8');
$odf->setVars('uuid',$row['uuid'],true,'utf-8'); @$odf->setVars('uuid',$row['uuid'],true,'utf-8');
$odf->setVars('datetime',date('Y-m-d')); $odf->setVars('datetime',date('Y-m-d'));
$odf->setVars('abstract',$row['description'],true,'utf-8'); $odf->setVars('abstract',$row['description'],true,'utf-8');
@$odf->setVars('theme_keyword',$row['keyword']['theme'],true,'utf-8'); @$odf->setVars('theme_keyword',$row['keyword']['theme'],true,'utf-8');
@ -601,9 +605,14 @@ class ServiceController extends Zend_Controller_Action
@$odf->setVars('north',$row['north'],true,'utf-8'); @$odf->setVars('north',$row['north'],true,'utf-8');
@$odf->setVars('south',$row['south'],true,'utf-8'); @$odf->setVars('south',$row['south'],true,'utf-8');
@$odf->setVars('west',$row['west'],true,'utf-8'); @$odf->setVars('west',$row['west'],true,'utf-8');
@$odf->setVars('east',$row['east'],true,'utf-8'); @$odf->setVars('east',$row['east'],true,'utf-8');
$odf->setImage('bigthumb', 'http://westdc.westgis.ac.cn/service/bigthumb/uuid/'.$row['uuid']); if (!$ac=='simple')
$odf->setImage('thumb', 'http://westdc.westgis.ac.cn/service/thumb/uuid/'.$row['uuid']); {
@$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->exportAsAttachedFile($row['title'].'.odt'); $odf->exportAsAttachedFile($row['title'].'.odt');
} }