suppression specificité staging

This commit is contained in:
benoitpotier 2017-04-12 11:32:28 +02:00
parent d1d3448e2d
commit c709e9c659

View File

@ -365,10 +365,10 @@ class IdentiteController extends Zend_Controller_Action
$user = new Scores_Utilisateur();
//Pagination
$request = $this->getRequest();
$page = $request->getParam('page', 1);
if ( $page <= 0 ) $page = 1;
$nbAffichage = 50;
$request = $this->getRequest();
$page = $request->getParam('page', 1);
if ( $page <= 0 ) $page = 1;
$nbAffichage = 50;
$position = ($page - 1 ) * $nbAffichage;
$ws = new WsScores();
@ -391,26 +391,26 @@ class IdentiteController extends Zend_Controller_Action
}
}
//Calcul pagination
$nbReponses = count($infos->result->item);
$nbReponsesTotal = $infos->nbReponses;
if ($nbReponses < $nbReponsesTotal) {
$pageTotal = ceil( $nbReponsesTotal / $nbAffichage );
$pageCurrent = $page;
$pagePrev = $page - 1;
if ($pagePrev < 1) {
$pagePrev = 1;
}
$pageNext = $page + 1;
if( $pageNext > $pageTotal ) {
$pageNext = $pageTotal;
}
} else {
$pageTotal = $pageCurrent = 1;
}
$this->view->assign('PageTotal', $pageTotal);
$this->view->assign('PagePrev', $pagePrev);
$this->view->assign('PageNext', $pageNext);
//Calcul pagination
$nbReponses = count($infos->result->item);
$nbReponsesTotal = $infos->nbReponses;
if ($nbReponses < $nbReponsesTotal) {
$pageTotal = ceil( $nbReponsesTotal / $nbAffichage );
$pageCurrent = $page;
$pagePrev = $page - 1;
if ($pagePrev < 1) {
$pagePrev = 1;
}
$pageNext = $page + 1;
if( $pageNext > $pageTotal ) {
$pageNext = $pageTotal;
}
} else {
$pageTotal = $pageCurrent = 1;
}
$this->view->assign('PageTotal', $pageTotal);
$this->view->assign('PagePrev', $pagePrev);
$this->view->assign('PageNext', $pageNext);
$this->view->assign('PageCurrent', $pageCurrent);
$this->view->assign('nbEtabActif', $nbEtabActif);
@ -699,7 +699,7 @@ class IdentiteController extends Zend_Controller_Action
$session = new Scores_Session_Entreprise($siren, null, true);
$this->view->assign('siren', $siren);
$this->view->assign('siret', $session->getSiret());
$this->view->assign('isin', $session->getIsin());
$this->view->assign('isin', $session->getIsin());
$this->view->assign('surveillance', $user->checkPerm('survdirigeants'));
}
@ -725,7 +725,7 @@ class IdentiteController extends Zend_Controller_Action
$this->view->assign('isin', $session->getIsin());
$this->view->assign('siren', $siren);
$this->view->assign('siret', $this->siret);
$this->view->assign('raisonSociale', $session->getRaisonSociale());
$this->view->assign('raisonSociale', $session->getRaisonSociale());
$this->view->assign('surveillance', $user->checkPerm('liens'));
//Check access to display group link
@ -748,18 +748,18 @@ class IdentiteController extends Zend_Controller_Action
$this->view->assign('PP', true);
//@todo : using this function is strange - How to get the id before ?
$result = $ws->searchLienRef($siren, 'siren');
if (count($result->item)>0) {
foreach ($result->item as $item) {
$id = $item->id;
break;
}
$result = $ws->searchLienRef($siren, 'siren');
if (count($result->item)>0) {
foreach ($result->item as $item) {
$id = $item->id;
break;
}
}
$result = $ws->getLienRef($id);
$this->view->assign('nom', $result->nom);
$this->view->assign('prenom', $result->prenom);
$this->view->assign('civilite', $result->civilite);
$this->view->assign('nom', $result->nom);
$this->view->assign('prenom', $result->prenom);
$this->view->assign('civilite', $result->civilite);
$this->view->assign('naissanceDate', $result->naissance_Date);
}
@ -1233,55 +1233,49 @@ 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');
$file = $avis->get();
if ($file === false) {
$avis->erreurcpt('plus');
echo $avis->erreurmsg();
} else {
// --- Envoi du fichier sur la sortie standard
$content_type = 'application/pdf';
if ( file_exists($file) ) {
$ws = new WsScores();
$ws->setLog('avis_situation', $this->siret, 0, '');
$modules = array(); //apache_get_modules();
if (in_array('mod_xsendfile', $modules)) {
header ('X-Sendfile: ' . $file);
header ('Content-Type: ' . $content_type);
header ('Content-Disposition: attachment; filename="' . $content_type . '"');
exit;
} else {
ini_set('zlib.output_compression', '0');
header('Content-Transfer-Encoding: none');
header('Content-Type: ' . $content_type.'');
header('Content-Length: ' . filesize($file));
header('Content-MD5: ' . base64_encode(md5_file($file)));
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
readfile($file);
exit;
}
$avis = new Scores_Insee_AvisSituation($this->siret);
if ( !$avis->erreur() ) {
$avis->erreurcpt('raz');
$file = $avis->get();
if ($file === false) {
$avis->erreurcpt('plus');
echo $avis->erreurmsg();
} else {
// --- Envoi du fichier sur la sortie standard
$content_type = 'application/pdf';
if ( file_exists($file) ) {
$ws = new WsScores();
$ws->setLog('avis_situation', $this->siret, 0, '');
$modules = array(); //apache_get_modules();
if (in_array('mod_xsendfile', $modules)) {
header ('X-Sendfile: ' . $file);
header ('Content-Type: ' . $content_type);
header ('Content-Disposition: attachment; filename="' . $content_type . '"');
exit;
} else {
echo "Impossible de charger le fichier";
ini_set('zlib.output_compression', '0');
header('Content-Transfer-Encoding: none');
header('Content-Type: ' . $content_type.'');
header('Content-Length: ' . filesize($file));
header('Content-MD5: ' . base64_encode(md5_file($file)));
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
readfile($file);
exit;
}
} else {
echo "Impossible de charger le fichier";
}
} else {
if ($avis->nberreur()==5){
$avis->mailerreur();
}
$avis->erreurcpt('plus');
echo $avis->erreurmsg();
}
}
}
} else {
if ($avis->nberreur()==5){
$avis->mailerreur();
}
$avis->erreurcpt('plus');
echo $avis->erreurmsg();
}
}
/**