From 078e2e6060c42b13be057156d779a76ada064afd Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Thu, 17 Oct 2013 07:39:36 +0000 Subject: [PATCH] Partner : return value in fonction --- library/Scores/Partner/Report.php | 32 ++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/library/Scores/Partner/Report.php b/library/Scores/Partner/Report.php index c7b72a4..528b215 100644 --- a/library/Scores/Partner/Report.php +++ b/library/Scores/Partner/Report.php @@ -77,6 +77,10 @@ class Scores_Partner_Report $ws = new WsScores($this->login, $this->password); $infos = $ws->getRapport($siren, 3, 0); + if ($infos===false) { + return false; + } + //Identite require_once 'Scores/IdentiteEntreprise.php'; $identite = new IdentiteEntreprise($infos->Identite); @@ -642,31 +646,37 @@ class Scores_Partner_Report //Global $this->data->Global->raisonSociale = $infos->Identite->Nom; + + return true; } public function getContent() { $content = ''; - $this->getDataIndiscore3(); + if ( $this->getDataIndiscore3() ) { - if ( array_key_exists($this->reportName, $this->report) ) { + if ( array_key_exists($this->reportName, $this->report) ) { - foreach ( $this->report[$this->reportName] as $reportItem ) { - $view = $reportItem['view']; - $index = $reportItem['index']; - $this->view = new Scores_Partner_Report_Html(realpath(dirname(__FILE__)).'/Templates/'.$view); - if ( $index !== null ) { - foreach ($this->data->{$index} as $name => $value) { - $this->view->assignVars($name, $value); + foreach ( $this->report[$this->reportName] as $reportItem ) { + $view = $reportItem['view']; + $index = $reportItem['index']; + $this->view = new Scores_Partner_Report_Html(realpath(dirname(__FILE__)).'/Templates/'.$view); + if ( $index !== null ) { + foreach ($this->data->{$index} as $name => $value) { + $this->view->assignVars($name, $value); + } } + $content.= $this->view->getHtml(); } - $content.= $this->view->getHtml(); + } + return $content; + } - return $content; + return false; } } \ No newline at end of file