Merge branch 'develop' into 'master'

Develop into master : logger + avis situations staging spécifique + SD 30

See merge request !3
This commit is contained in:
potier 2017-04-13 12:43:25 +00:00
commit 5eb4e10abe
7 changed files with 106 additions and 99 deletions

View File

@ -123,9 +123,9 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
if (APPLICATION_ENV == 'development') {
$level = Logger::DEBUG;
} else {
$level = Logger::INFO;
$level = Logger::NOTICE;
}
$log->pushHandler(new StreamHandler($logFile), $level);
$log->pushHandler(new StreamHandler($logFile, $level));
// Processor
$log->pushProcessor(new IntrospectionProcessor());

View File

@ -125,8 +125,7 @@ class IdentiteController extends Zend_Controller_Action
$datemajTexte = $dateDerMaj = '';
$datemajTexte.= '<table>';
foreach ($tabDate as $dateId => $dateLib ) {
if ( isset($infos->{$dateId})
&& !empty($infos->{$dateId})
if (isset($infos->{$dateId}) && !empty($infos->{$dateId})
&& $infos->{$dateId}!='0000-00-00') {
if ( $dateId == 'DateMajID') {
@ -1233,12 +1232,7 @@ class IdentiteController extends Zend_Controller_Action
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
// --- En environement de preprod, on envoi sur le site
if (APPLICATION_ENV == 'staging') {
$this->redirect('http://avis-situation-sirene.insee.fr/');
}
// --- Téléchargement du fichier et distribution
else {
$avis = new Scores_Insee_AvisSituation($this->siret);
if ( !$avis->erreur() ) {
$avis->erreurcpt('raz');
@ -1282,7 +1276,6 @@ class IdentiteController extends Zend_Controller_Action
echo $avis->erreurmsg();
}
}
}
/**
* Téléchargement des cartes IRIS

View File

@ -118,6 +118,7 @@ class SurveillanceController extends Zend_Controller_Action
$page = $request->getParam('page');
$from = $request->getParam('from');
$q = $request->getParam('q');
$siret = $request->getParam('siret', '');
$email = $request->getParam('email', '');
@ -136,6 +137,8 @@ class SurveillanceController extends Zend_Controller_Action
}
} elseif (isset($page)) {
$this->redirect('surveillance/liste/page/'.$page);
} elseif (isset($q)) {
$this->redirect('surveillance/liste/q/'.$q);
} else {
$this->redirect('surveillance/liste');
}
@ -424,8 +427,8 @@ class SurveillanceController extends Zend_Controller_Action
$pageTotal = $pageCurrent = 1;
}
$this->view->assign('PageTotal', $pageTotal);
$this->view->assign('PagePrev', $pagePrev);
$this->view->assign('PageNext', $pageNext);
$this->view->assign('PagePrev', isset($pagePrev)?$pagePrev:1);
$this->view->assign('PageNext', isset($pageNext)?$pageNext:1);
$this->view->assign('PageCurrent', $pageCurrent);
$this->view->assign('nbReponses', empty($nbReponses) ? 0 : $nbReponses);

View File

@ -152,7 +152,8 @@ par
'siret' => $item['siren'].$item['nic'],
'ref' => urlencode($surveillance['ref']),
'email' => $surveillance['email'],
'source' => $surveillance['source']
'source' => $surveillance['source'],
'q' => $this->q,
))?>" title="Supprimer la surveillance <?=$surveillance['source']?>">
<img src="/themes/default/images/interfaces/supprimer.png"/>
</a>

View File

@ -123,10 +123,11 @@ class Scores_Session_Entreprise
protected function getInfoEntrep($siret, $id = 0)
{
$this->logger->info('getInfoEntrep');
require_once 'Scores/WsScores.php';
$ws = new WsScores();
$etab = $ws->getIdentiteLight($siret, $id);
$ws = new Scores_Ws_Client('interne', '0.6');
$params = new stdClass();
$params->siret = $this->siret;
$params->id = $this->id;
$etab= $ws->getIdentiteLight($params);
$this->setSession($etab);
}

View File

@ -147,7 +147,7 @@ class Scores_Ws_Client extends Zend_Soap_Client
}
$methodConfig = $this->config[$name];
$this->logger->info(print_r($methodConfig,1));
// --- Cache
$cacheEnable = false;
if ( array_key_exists('cache', $methodConfig) ) {
@ -172,17 +172,22 @@ class Scores_Ws_Client extends Zend_Soap_Client
// --- Debug
if ( array_key_exists('debug', $methodConfig) ) {
$this->logger->info(__CLASS__.'->'.$name);
$this->logger->info(print_r($arguments,1));
$this->logger->info(__CLASS__.'->'.$name.':'.print_r($arguments,1));
}
try {
$response = parent::__call($name, $arguments);
// --- Response vide
if ($response == '') {
$this->logger->error(__CLASS__.'->'.$name.':'.print_r($arguments, 1));
return false;
}
// --- Debug
if ( array_key_exists('debug', $methodConfig) ) {
$this->logger->info(print_r($response,1));
$this->logger->info(__CLASS__.'->'.$name.':'.print_r($response,1));
}
// --- Cache
@ -196,13 +201,13 @@ class Scores_Ws_Client extends Zend_Soap_Client
// --- Debug
if ( array_key_exists('debug', $methodConfig) ) {
$this->logger->info($fault->faultcode.' - '.$fault->faultstring);
$this->logger->error(__CLASS__.'->'.$name.':'.$fault->faultcode.' - '.$fault->faultstring);
}
// --- Gestion des SOAP fault
if ( array_key_exists('errorMsg', $methodConfig) ) {
if ( in_array($fault->faultcode, $methodConfig['errorMsg']) ) {
$this->logger->info("Exception as error message : ".$fault->faultcode);
$this->logger->info(__CLASS__.'->'.$name.':'." Exception as error message : ".$fault->faultcode);
throw new Exception($fault->faultstring);
}
}

View File

@ -1,6 +1,10 @@
<?php
return array(
'0.6' => array(
'getIdentiteLight' => array(
'debug' => true,
'log' => 'mail',
),
'getRncsEven' => array(
'debug' => true,
'log' => 'mail',