Mise à jour complete avec enregistrement html pour les pdf
This commit is contained in:
parent
041db0ff82
commit
8e88313ee0
@ -8,9 +8,10 @@ appnamespace = "Application"
|
||||
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
|
||||
resources.frontController.params.displayExceptions = 0
|
||||
autoloaderNamespaces[] = "Application_"
|
||||
resources.frontController.plugins.Menu = "Application_Controller_Plugin_Menu"
|
||||
resources.frontController.plugins.Auth = "Application_Controller_Plugin_Auth"
|
||||
resources.frontController.plugins.Auth = "Application_Controller_Plugin_Cgu"
|
||||
resources.frontController.plugins.Menu = "Application_Controller_Plugin_Menu"
|
||||
resources.frontController.plugins.Pdf = "Application_Controller_Plugin_Pdf"
|
||||
resources.frontController.plugins.Cgu = "Application_Controller_Plugin_Cgu"
|
||||
resources.layout.layout = "main"
|
||||
resources.layout.layoutPath = APPLICATION_PATH "/views/default"
|
||||
resources.view.basePath = APPLICATION_PATH "/views/default"
|
||||
|
@ -124,8 +124,17 @@ class IdentiteController extends Zend_Controller_Action
|
||||
);
|
||||
$dBlock[$item] = $display;
|
||||
}
|
||||
|
||||
require_once 'Scores/Logo.php';
|
||||
$logo = new Logo($infos->Siren, $infos->Isin);
|
||||
$logoImg = array(
|
||||
'label' => 'Logo',
|
||||
'texte' => $logo->affiche(),
|
||||
);
|
||||
|
||||
Zend_Registry::get('firebug')->info($infos);
|
||||
$this->view->assign('dBlock', $dBlock);
|
||||
$this->view->assign('logo', $logoImg);
|
||||
$this->view->assign('dateDerMaj', $dateDerMaj);
|
||||
$this->view->assign('datemajTexte', $datemajTexte);
|
||||
$this->view->assign('raisonSociale', $session->getRaisonSociale());
|
||||
|
62
application/controllers/PrintController.php
Normal file
62
application/controllers/PrintController.php
Normal file
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
class PrintController extends Zend_Controller_Action
|
||||
{
|
||||
public function init(){}
|
||||
|
||||
public function indexAction(){}
|
||||
|
||||
public function pdfAction()
|
||||
{
|
||||
/*
|
||||
* Recup controller / action / paramètres
|
||||
* identite-fiche-siret-id.pdf
|
||||
*/
|
||||
$request = $this->getRequest();
|
||||
$fichier = $request->getParam('fichier');
|
||||
|
||||
if (substr($fichier,-4)!='.pdf') {
|
||||
echo 'Fichier incorrect';
|
||||
exit;
|
||||
}
|
||||
$fichier = str_replace('.pdf', '', $fichier);
|
||||
$elements = explode('-', $fichier);
|
||||
$controller = $elements[0];
|
||||
$action = $elements[1];
|
||||
|
||||
switch($controller){
|
||||
case 'identite':
|
||||
switch($action){
|
||||
case 'fiche':
|
||||
$params['siret'] = $elements[2];
|
||||
$params['id'] = $elements[3];
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
$params['print'] = 'pdf';
|
||||
|
||||
// Désactivation affichage
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
$content = $this->view->action($action, $controller, null, $params);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function ecranAction()
|
||||
{
|
||||
//Affichage + script javascript window.print
|
||||
|
||||
/*
|
||||
* Recup controller / action / paramètres
|
||||
* identite-fiche-siret-id
|
||||
*/
|
||||
$request = $this->getRequest();
|
||||
$params = $request->getParams();
|
||||
|
||||
print_r($params);
|
||||
exit;
|
||||
$this->_forward($action, $controller, null, $params);
|
||||
|
||||
}
|
||||
}
|
@ -1,14 +1,25 @@
|
||||
<?php if ($this->navigation()->menu()->hasPages()) { ?>
|
||||
<div id="menu">
|
||||
<div id="logo">
|
||||
<img src="/themes/default/images/logos/logo_sd.gif" width="200" height="65" />
|
||||
</div>
|
||||
<?php
|
||||
/*
|
||||
$this->navigation()->menu()->setPartial('scripts/menu.phtml');
|
||||
echo $this->navigation()->menu()->render();
|
||||
*/
|
||||
echo $this->navigation()->menu();
|
||||
?>
|
||||
<div class="icones">
|
||||
<?php if ($this->print) {?>
|
||||
<a target="_blank" title="Impression" href="/editer/ecran/<?=$this->print.'.html'?>">
|
||||
<img alt="Impression" src="/themes/default/images/interfaces/printer.png">
|
||||
</a>
|
||||
<?php }?>
|
||||
|
||||
<?php if ($this->pdf) {?>
|
||||
<a target="_blank" title="Impression" href="/editer/pdf/<?=$this->pdf.'.pdf'?>">
|
||||
<img alt="Impression" src="/themes/default/images/interfaces/pdf.png">
|
||||
</a>
|
||||
<?php }?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('#menu ul.navigation').accordion({
|
||||
@ -18,3 +29,4 @@ $('#menu ul.navigation').accordion({
|
||||
active: <?php echo $this->menuScript(); ?>
|
||||
});
|
||||
</script>
|
||||
<?php }?>
|
@ -0,0 +1 @@
|
||||
<?php
|
@ -15,9 +15,7 @@ echo $this->partial('identite/fiche-item.phtml', $this->dBlock['SiretSiege']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['TvaNumero']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['Isin']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['Capitalisation']);
|
||||
?>
|
||||
//Logo
|
||||
<?php
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->logo);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['NumRC']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['AutreId']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['Actif']);
|
||||
|
@ -10,12 +10,25 @@ class Application_Controller_Plugin_Menu extends Zend_Controller_Plugin_Abstract
|
||||
$siret = $request->getParam('siret', null);
|
||||
$id = $request->getParam('id', null);
|
||||
$layout = Zend_Layout::getMVCInstance();
|
||||
if ($layout->isEnabled()) {
|
||||
if ($layout->isEnabled() && $request->getControllerName()!='print') {
|
||||
require_once 'Scores/Menu.php';
|
||||
$computeMenu = new Menu($siret, $id);
|
||||
$menu = $computeMenu->getMenu();
|
||||
$view = $layout->getView();
|
||||
$view->navigation($menu);
|
||||
|
||||
//Gestion affichage Lien PDF
|
||||
require_once 'Scores/PagePrint.php';
|
||||
$page = new PagePrint($request->getControllerName(), $request->getActionName());
|
||||
|
||||
if ($page->exportable('print')){
|
||||
$view->print = $page->filename('print', $request->getParams());
|
||||
}
|
||||
if ($page->exportable('pdf')){
|
||||
$view->pdf = $page->filename('pdf', $request->getParams());
|
||||
}
|
||||
|
||||
//Gestion affichage Lien XML
|
||||
}
|
||||
}
|
||||
}
|
16
library/Application/Controller/Plugin/Pdf.php
Normal file
16
library/Application/Controller/Plugin/Pdf.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
class Application_Controller_Plugin_Pdf extends Zend_Controller_Plugin_Abstract
|
||||
{
|
||||
public function dispatchLoopShutdown()
|
||||
{
|
||||
require_once 'Scores/PagePrint.php';
|
||||
$controller = $this->_request->getControllerName();
|
||||
$action = $this->_request->getActionName();
|
||||
$page = new PagePrint($controller, $action);
|
||||
if ($page->exportable('pdf')){
|
||||
$layout = $this->_response->getBody();
|
||||
$filename = $page->filename('pdf', $this->_request->getParams());
|
||||
file_put_contents(APPLICATION_PATH.'/../cache/pages/'.$filename.'.html', $layout);
|
||||
}
|
||||
}
|
||||
}
|
BIN
public/themes/default/images/interfaces/pdf.png
Normal file
BIN
public/themes/default/images/interfaces/pdf.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
BIN
public/themes/default/images/interfaces/printer.png
Normal file
BIN
public/themes/default/images/interfaces/printer.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 133 B |
BIN
public/themes/default/images/interfaces/xml.png
Normal file
BIN
public/themes/default/images/interfaces/xml.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
@ -97,3 +97,10 @@ table {
|
||||
border-collapse:separate;
|
||||
border-spacing:4px;
|
||||
}
|
||||
|
||||
.confidentiel {
|
||||
border-top:1px solid;
|
||||
padding-top:5px;
|
||||
font-style:italic;
|
||||
font-size:9px;
|
||||
}
|
||||
|
@ -89,3 +89,8 @@ div#menu ul.navigation li a.ui-state-hover,
|
||||
div#menu ul.navigation li a.ui-state-active {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
div#menu div.icones {
|
||||
text-align:center;
|
||||
margin-top:5px;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user