From b4d77ea50445f06e1e38e095f77c1f9214d0cd00 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Fri, 15 Nov 2013 09:37:46 +0000 Subject: [PATCH] Diverse correction --- application/controllers/ReportController.php | 17 +++++++++-------- application/views/scripts/report/deliver.phtml | 2 +- application/views/scripts/report/retour.phtml | 4 ++-- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/application/controllers/ReportController.php b/application/controllers/ReportController.php index 38bd90f..46e63db 100644 --- a/application/controllers/ReportController.php +++ b/application/controllers/ReportController.php @@ -296,6 +296,8 @@ class ReportController extends Zend_Controller_Action $cmdState = 4; + $cmdId = $request->getParam('id'); + $session = new Zend_Session_Namespace('Cmd'); if ( $session->state > $cmdState || $session->CmdID != $cmdId ) { $url = $this->view->url(array( @@ -308,8 +310,6 @@ class ReportController extends Zend_Controller_Action $session->state = $cmdState; } - $cmdId = $request->getParam('id'); - //Vérification que la commande existe $commandM = new Application_Model_Command(); $row = $commandM->fetchRow('cmdId="'.$cmdId.'"'); @@ -382,20 +382,21 @@ class ReportController extends Zend_Controller_Action $this->view->Infos = $infos; + $links = array(); + if ( file_exists($pathCmd . DIRECTORY_SEPARATOR . $row->cmdId . '.html') ) { //Define links to get the HTML and/or PDF - $links = array( - 0 => array( + $links[] = array( 'title' => 'Fichier PDF', 'desc' => 'Télécharger le bilan financier', 'url' => $this->view->url(array( 'controller'=>'report', 'action'=>'pdf', - 'id' => $row->cmdId - )) - ), - ); + 'id' => $row->cmdId)) + ); } + + $this->view->links = $links; } } diff --git a/application/views/scripts/report/deliver.phtml b/application/views/scripts/report/deliver.phtml index e83daae..8fbab5a 100644 --- a/application/views/scripts/report/deliver.phtml +++ b/application/views/scripts/report/deliver.phtml @@ -47,7 +47,7 @@ links as $link ) {?>
- +

diff --git a/application/views/scripts/report/retour.phtml b/application/views/scripts/report/retour.phtml index 982438c..a350ebf 100644 --- a/application/views/scripts/report/retour.phtml +++ b/application/views/scripts/report/retour.phtml @@ -1,7 +1,7 @@ render('report/header.phtml')?> PaiementError ) {?> @@ -11,7 +11,7 @@ + Consulter vos fichiers en cliquant ici