diff --git a/application/configs/application.ini b/application/configs/application.ini index 054609b58..6f94b2980 100644 --- a/application/configs/application.ini +++ b/application/configs/application.ini @@ -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" diff --git a/application/configs/webservices.ini b/application/configs/webservices.ini index b6d12d2b7..2ac590d6d 100644 --- a/application/configs/webservices.ini +++ b/application/configs/webservices.ini @@ -23,4 +23,4 @@ webservices.interne.options.soap_version = SOAP_1_2 webservices.entreprise.wsdl = "http://webservice.sd.lan/entreprise/v0.2?wsdl-auto" webservices.entreprise.options.trace = 1 -webservices.entreprise.options.soap_version = SOAP_1_2 \ No newline at end of file +webservices.entreprise.options.soap_version = SOAP_1_2 diff --git a/application/controllers/IdentiteController.php b/application/controllers/IdentiteController.php index f9c85b27c..d4d98c7c0 100644 --- a/application/controllers/IdentiteController.php +++ b/application/controllers/IdentiteController.php @@ -9,7 +9,7 @@ class IdentiteController extends Zend_Controller_Action $request = $this->getRequest(); $this->siret = $request->getParam('siret'); $this->id = $request->getParam('id', 0); - + require_once 'Scores/WsScores.php'; require_once 'Scores/Utilisateur.php'; require_once 'Scores/SessionEntreprise.php'; @@ -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()); diff --git a/application/controllers/PrintController.php b/application/controllers/PrintController.php new file mode 100644 index 000000000..f24a54e8c --- /dev/null +++ b/application/controllers/PrintController.php @@ -0,0 +1,62 @@ +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); + + } +} \ No newline at end of file diff --git a/application/views/default/scripts/header.phtml b/application/views/default/scripts/header.phtml index fab339648..4786161f9 100644 --- a/application/views/default/scripts/header.phtml +++ b/application/views/default/scripts/header.phtml @@ -1,14 +1,25 @@ +navigation()->menu()->hasPages()) { ?> \ No newline at end of file + + \ No newline at end of file diff --git a/application/views/default/scripts/identite/etablissement-item.phtml b/application/views/default/scripts/identite/etablissement-item.phtml new file mode 100644 index 000000000..b3d9bbc7f --- /dev/null +++ b/application/views/default/scripts/identite/etablissement-item.phtml @@ -0,0 +1 @@ +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 -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']); diff --git a/library/Application/Controller/Plugin/Menu.php b/library/Application/Controller/Plugin/Menu.php index cf9a46310..51a6e8456 100644 --- a/library/Application/Controller/Plugin/Menu.php +++ b/library/Application/Controller/Plugin/Menu.php @@ -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 } } } \ No newline at end of file diff --git a/library/Application/Controller/Plugin/Pdf.php b/library/Application/Controller/Plugin/Pdf.php new file mode 100644 index 000000000..94fbe0789 --- /dev/null +++ b/library/Application/Controller/Plugin/Pdf.php @@ -0,0 +1,16 @@ +_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); + } + } +} \ No newline at end of file diff --git a/public/themes/default/images/interfaces/pdf.png b/public/themes/default/images/interfaces/pdf.png new file mode 100644 index 000000000..b624387ec Binary files /dev/null and b/public/themes/default/images/interfaces/pdf.png differ diff --git a/public/themes/default/images/interfaces/printer.png b/public/themes/default/images/interfaces/printer.png new file mode 100644 index 000000000..5935c7fbd Binary files /dev/null and b/public/themes/default/images/interfaces/printer.png differ diff --git a/public/themes/default/images/interfaces/xml.png b/public/themes/default/images/interfaces/xml.png new file mode 100644 index 000000000..5c6b4b8f3 Binary files /dev/null and b/public/themes/default/images/interfaces/xml.png differ diff --git a/public/themes/default/styles/main.css b/public/themes/default/styles/main.css index 12896ebd6..109fa0bc9 100644 --- a/public/themes/default/styles/main.css +++ b/public/themes/default/styles/main.css @@ -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; +} diff --git a/public/themes/default/styles/menu.css b/public/themes/default/styles/menu.css index d73cc4deb..85d791077 100644 --- a/public/themes/default/styles/menu.css +++ b/public/themes/default/styles/menu.css @@ -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; +}