diff --git a/application/controllers/ReportController.php b/application/controllers/ReportController.php index d2a8c39..c74aac9 100644 --- a/application/controllers/ReportController.php +++ b/application/controllers/ReportController.php @@ -371,34 +371,38 @@ class ReportController extends Zend_Controller_Action $row = $commandM->fetchRow($where); if ( $row!==null ) { - $infos = new stdClass(); - $infos->NumCommande = $row->cmdId; - $date = new Zend_Date($row->dateInsert); - $infos->DateCommande = $date->toString('dd/MM/yyyy HH:mm:ss'); - $infos->RaisonSociale = $row->rs; - $infos->NomPrenom = $row->nom . ' ' . $row->prenom; - $infos->Adresse = $row->adresse; - $infos->CpVille = $row->cp . ' ' . $row->ville; - $infos->Tel = $row->tel; - $infos->Mob = $row->mobile; + if ($row->eta == 0) { - $this->view->Infos = $infos; + $infos = new stdClass(); + $infos->NumCommande = $row->cmdId; + $date = new Zend_Date($row->dateInsert); + $infos->DateCommande = $date->toString('dd/MM/yyyy HH:mm:ss'); + $infos->RaisonSociale = $row->rs; + $infos->NomPrenom = $row->nom . ' ' . $row->prenom; + $infos->Adresse = $row->adresse; + $infos->CpVille = $row->cp . ' ' . $row->ville; + $infos->Tel = $row->tel; + $infos->Mob = $row->mobile; - $links = array(); + $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( + 'title' => 'Fichier PDF', + 'desc' => 'Télécharger le bilan financier', + 'url' => $this->view->url(array( + 'controller'=>'report', + 'action'=>'pdf', + 'id' => $row->cmdId)) + ); + } + + $this->view->links = $links; - if ( file_exists($pathCmd . DIRECTORY_SEPARATOR . $row->cmdId . '.html') ) { - //Define links to get the HTML and/or PDF - $links[] = array( - 'title' => 'Fichier PDF', - 'desc' => 'Télécharger le bilan financier', - 'url' => $this->view->url(array( - 'controller'=>'report', - 'action'=>'pdf', - 'id' => $row->cmdId)) - ); } - - $this->view->links = $links; } } @@ -435,10 +439,13 @@ class ReportController extends Zend_Controller_Action $c = Zend_Registry::get('config'); $source = $c->profil->path->data . DIRECTORY_SEPARATOR . $row->cmdId . '.html'; $dest = $c->profil->path->pages . DIRECTORY_SEPARATOR . $row->cmdId . '.html'; - if ( copy($source, $dest) ) { - $wkthml = new Scores_Wkhtml_Pdf(); - $file = $wkhtml->exec($dest); - } + + $content = file_get_contents($source); + $content = preg_replace('@exec($dest); } diff --git a/scripts/build/configure.php b/scripts/build/configure.php index 7e44e8b..870c61d 100644 --- a/scripts/build/configure.php +++ b/scripts/build/configure.php @@ -68,6 +68,10 @@ if(isset($opts->install)) APPLICATION_PATH.'/../library/Scores/Partner/Templates/pages '. APPLICATION_PATH.'/../data/'); + if (!file_exists($c->profil->path->pages.'/fichier/imgcache')) + passthru('ln -vs '.APPLICATION_PATH.'/../data/pages/imgcache'.' '. + $c->profil->path->pages.'/fichier/imgcache'); + //Modification des permissions passthru('chown -R www-data: '.APPLICATION_PATH.'/../'); }