diff --git a/application/default/controllers/ServiceController.php b/application/default/controllers/ServiceController.php index ad4a7289..42770a91 100644 --- a/application/default/controllers/ServiceController.php +++ b/application/default/controllers/ServiceController.php @@ -617,7 +617,8 @@ class ServiceController extends Zend_Controller_Action @$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://test.heihedata.org/service/qrcode/uuid/'.$row['uuid']); } $odf->exportAsAttachedFile($row['title'].'.odt'); @@ -1528,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); } }