Check file exist

This commit is contained in:
Michael RICOIS 2014-12-09 09:12:40 +00:00
parent f3ba67be30
commit 275c302020

View File

@ -454,7 +454,7 @@ class ReportController extends Zend_Controller_Action
} }
$row = $commandM->fetchRow($where); $row = $commandM->fetchRow($where);
if ( $row==null ) { if ( $row === null ) {
$this->view->msg = "Commande introuvable !"; $this->view->msg = "Commande introuvable !";
} else { } else {
@ -477,26 +477,24 @@ class ReportController extends Zend_Controller_Action
$links = array(); $links = array();
if ( file_exists($pathCmd . DIRECTORY_SEPARATOR . $row->cmdId . '.html') ) { //Define links to get the HTML and/or PDF
//Define links to get the HTML and/or PDF $links[] = array(
$links[] = array( 'title' => 'Fichier PDF',
'title' => 'Fichier PDF', 'desc' => 'Télécharger le bilan financier',
'desc' => 'Télécharger le bilan financier', 'url' => $this->view->url(array(
'url' => $this->view->url(array( 'controller'=>'delivery',
'controller'=>'delivery', 'action'=>'pdf',
'action'=>'pdf', 'id' => $row->cmdId))
'id' => $row->cmdId)) );
); //Facture
//Facture $links[] = array(
$links[] = array( 'title' => 'Facture',
'title' => 'Facture', 'desc' => 'Télécharger votre facture',
'desc' => 'Télécharger votre facture', 'url' => $this->view->url(array(
'url' => $this->view->url(array( 'controller'=>'delivery',
'controller'=>'delivery', 'action'=>'bill',
'action'=>'bill', 'id' => $row->cmdId))
'id' => $row->cmdId)) );
);
}
$this->view->links = $links; $this->view->links = $links;
$this->view->CmdValide = true; $this->view->CmdValide = true;