Module Print
This commit is contained in:
parent
cc5abea478
commit
d900029708
@ -1,14 +1,6 @@
|
||||
<?php
|
||||
class PrintController extends Zend_Controller_Action
|
||||
class Print_FileController extends Zend_Controller_Action
|
||||
{
|
||||
protected $theme;
|
||||
|
||||
public function init()
|
||||
{
|
||||
// --- Theme
|
||||
$this->theme = Zend_Registry::get('theme');
|
||||
}
|
||||
|
||||
/**
|
||||
* Renvoie les paramètres pour l'impression
|
||||
*/
|
||||
@ -73,10 +65,10 @@ class PrintController extends Zend_Controller_Action
|
||||
case 'evaluation':
|
||||
$params['siret'] = $elements[2];
|
||||
$params['id'] = $elements[3];
|
||||
switch($action){
|
||||
case 'scoreshisto':
|
||||
$params['type'] = $elements[4];
|
||||
break;
|
||||
switch($action){
|
||||
case 'scoreshisto':
|
||||
$params['type'] = $elements[4];
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'giant':
|
||||
@ -93,9 +85,9 @@ class PrintController extends Zend_Controller_Action
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'worldcheck':
|
||||
case 'worldcheck':
|
||||
$params['matchIdentifier'] = $elements[2];
|
||||
$params['nameType'] = $elements[3];
|
||||
$params['nameType'] = $elements[3];
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
@ -108,8 +100,6 @@ class PrintController extends Zend_Controller_Action
|
||||
);
|
||||
}
|
||||
|
||||
public function indexAction(){}
|
||||
|
||||
/**
|
||||
* Imprime la page en PDF
|
||||
* Par défaut, le contenu html a déjà été enregistré..
|
||||
@ -136,10 +126,10 @@ class PrintController extends Zend_Controller_Action
|
||||
echo 'Fichier introuvable';
|
||||
exit;
|
||||
}
|
||||
|
||||
$pdf = new Scores_Wkhtml_Pdf();
|
||||
$pdf->setOptions('footer-right', 'Page [page] sur [toPage]');
|
||||
$pdf->setOptions('header-right', date('d/m/Y H:i:s'));
|
||||
|
||||
$pdf = new Scores_Wkhtml_Pdf();
|
||||
$pdf->setOptions('footer-right', 'Page [page] sur [toPage]');
|
||||
$pdf->setOptions('header-right', date('d/m/Y H:i:s'));
|
||||
$output_file = $pdf->exec($file);
|
||||
|
||||
//Envoi au navigateur
|
||||
@ -185,34 +175,6 @@ class PrintController extends Zend_Controller_Action
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Imprime la page en activant le javascript d'impression
|
||||
* Il faut récupérer le controller et l'action du nom du fichier, ainsi que
|
||||
* les paramètres
|
||||
* Par exemple :
|
||||
* identite-fiche-siret-id.html
|
||||
*/
|
||||
public function ecranAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$fichier = $request->getParam('fichier', '');
|
||||
|
||||
if (substr($fichier,-5)!='.html') {
|
||||
echo 'Fichier incorrect';
|
||||
exit;
|
||||
}
|
||||
|
||||
$fichier = str_replace('.html', '', $fichier);
|
||||
$elements = $this->pageParams($fichier);
|
||||
if ($elements===false){
|
||||
exit;
|
||||
}
|
||||
$this->view->assign('controller', $elements['controller']);
|
||||
$this->view->assign('action', $elements['action']);
|
||||
Zend_Registry::get('firebug')->info($elements['params']);
|
||||
$this->view->assign('params', $elements['params']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Envoi le fichier XML de l'objet sérialiser sur la sortie standard
|
||||
*/
|
32
application/modules/print/controllers/ScreenController.php
Normal file
32
application/modules/print/controllers/ScreenController.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
class Print_ScreenController extends Zend_Controller_Action
|
||||
{
|
||||
/**
|
||||
* Imprime la page en activant le javascript d'impression
|
||||
* Il faut récupérer le controller et l'action du nom du fichier, ainsi que
|
||||
* les paramètres
|
||||
* Par exemple :
|
||||
* identite-fiche-siret-id.html
|
||||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$fichier = $request->getParam('fichier', '');
|
||||
|
||||
if (substr($fichier,-5)!='.html') {
|
||||
echo 'Fichier incorrect';
|
||||
exit;
|
||||
}
|
||||
|
||||
$fichier = str_replace('.html', '', $fichier);
|
||||
$elements = $this->pageParams($fichier);
|
||||
if ($elements===false){
|
||||
exit;
|
||||
}
|
||||
$this->view->assign('module', $elements['module']);
|
||||
$this->view->assign('controller', $elements['controller']);
|
||||
$this->view->assign('action', $elements['action']);
|
||||
Zend_Registry::get('firebug')->info($elements['params']);
|
||||
$this->view->assign('params', $elements['params']);
|
||||
}
|
||||
}
|
@ -6,4 +6,4 @@ window.onload = function() {
|
||||
<style>
|
||||
#content {float:none;clear:both;width:auto;padding:0;margin:0;padding-top:20px;}
|
||||
</style>
|
||||
<?=$this->action($this->action, $this->controller, null, $this->params)?>
|
||||
<?=$this->action($this->action, $this->controller, $this->module, $this->params)?>
|
Loading…
Reference in New Issue
Block a user