extranet/application/modules/default/controllers/JuridiqueController.php

688 lines
25 KiB
PHP
Raw Normal View History

2011-02-21 08:45:13 +00:00
<?php
class JuridiqueController extends Zend_Controller_Action
{
2015-07-08 13:48:28 +00:00
protected $theme;
protected $siret = null;
protected $id = 0;
2012-05-20 16:31:28 +00:00
public function init()
{
2015-07-08 20:38:22 +00:00
// --- Theme
$this->theme = Zend_Registry::get('theme');
$request = $this->getRequest();
$this->siret = $request->getParam('siret');
$this->id = $request->getParam('id', 0);
2012-05-20 16:31:28 +00:00
require_once 'Scores/WsScores.php';
}
2012-05-20 16:31:28 +00:00
/**
* Affichage de la liste des annonces ou d'une annonce
*/
public function annoncesAction()
{
$request = $this->getRequest();
2013-01-19 19:32:24 +00:00
$autrePage = $request->getParam('apage');
2013-01-19 19:32:24 +00:00
$idAnn = $request->getParam('idAnn', null);
$siren = substr($this->siret, 0,9);
2013-01-19 19:32:24 +00:00
2017-01-17 16:23:31 +01:00
$vue = $request->getParam('vue', 'bodacc');
$source = $request->getParam('source');
if (!empty($source)) {
switch ($source){
2017-01-17 16:23:31 +01:00
case 1: $vue = 'bodacc'; break;
case 2: $vue = 'balo'; break;
case 3: $vue = 'asso'; break;
}
}
2013-11-21 16:31:49 +00:00
$session = new Scores_Session_Entreprise($this->siret, $this->id);
$fj = $session->getFormeJuridique();
if ($fj > 9000 && $fj < 9999 && intval($siren) == 0) {
$vue = 'asso';
}
2013-01-19 19:32:24 +00:00
$this->view->assign('id', $session->getId());
$this->view->assign('siren', $siren);
$this->view->assign('siret', $this->siret);
$this->view->assign('raisonSociale', $session->getRaisonSociale());
$this->view->assign('AutrePage', $autrePage);
if ($session->getSource() == '006' || $session->getSourceId() == '007') {
$this->view->assign('AutreSource', true);
} else {
$this->view->assign('vue', $vue);
2017-01-17 16:23:31 +01:00
// Pagination
2014-03-03 16:40:07 +00:00
$page = $request->getParam('page', 1);
2017-01-17 16:23:31 +01:00
if ($page <= 0) {
$page = 1;
}
2014-03-03 16:40:07 +00:00
$nbAffichage = 20;
2017-01-17 16:23:31 +01:00
$position = ($page - 1) * $nbAffichage;
$ws = new WsScores();
2017-01-17 16:23:31 +01:00
switch ($vue) {
case 'balo':
2014-03-03 16:40:07 +00:00
$infos = $ws->getAnnoncesBalo($siren, $idAnn, null, $position, $nbAffichage);
break;
case 'asso':
2017-01-17 16:23:31 +01:00
if (intval($siren) == 0 && substr($session->getAutreId(),0,1) == 'W') {
2014-03-03 16:40:07 +00:00
$infos = $ws->getAnnoncesAsso($session->getAutreId(), $idAnn, null, $position, $nbAffichage);
2017-01-17 16:23:31 +01:00
} elseif (intval($siren) != 0) {
2014-03-03 16:40:07 +00:00
$infos = $ws->getAnnoncesAsso($siren, $idAnn, null, $position, $nbAffichage);
} else {
$idAnn = $session->getSourceId();
2017-01-17 16:23:31 +01:00
$this->redirect($this->view->url(array('controller'=>'juridique',
'action'=>'annonce', 'siret'=>$this->siret, 'id'=>$this->id,
'idAnn'=>$idAnn, 'vue'=>$vue), 'default', true));
}
break;
case 'bomp':
$filtre = $request->getParam('filtre', 'A');
$this->view->assign('filtre', $filtre);
2016-11-29 10:53:25 +01:00
Zend_Registry::get('firebug')->info("getAnnoncesBoamp");
2014-03-03 16:40:07 +00:00
$infos = $ws->getAnnoncesBoamp($siren, $idAnn, $filtre, $position, $nbAffichage);
break;
2016-11-29 10:53:25 +01:00
case 'bodacc':
case 'abod':
default:
2017-01-17 16:23:31 +01:00
if(intval($siren) == 0) {
2016-11-29 10:53:25 +01:00
$idAnn = $session->getSourceId();
2017-01-17 16:23:31 +01:00
$this->redirect($this->view->url(array('controller'=>'juridique',
'action'=>'annonce', 'siret'=>$this->siret, 'id'=>$this->id,
'idAnn'=>$idAnn, 'vue'=>$vue), 'default', true));
2016-11-29 10:53:25 +01:00
}
$infos = $ws->getAnnoncesLegales($siren, $idAnn, null, $position, $nbAffichage);
break;
}
2016-11-29 10:53:25 +01:00
Zend_Registry::get('firebug')->info($infos);
if ($infos === false) {
$this->forward('soap', 'error');
}
2016-11-29 10:53:25 +01:00
require_once 'Scores/Annonces.php';
$objAnnonces = new Annonces($infos->result->item);
$typeAnnonces = array(
'Bodacc',
'Balo',
'Bomp',
'Asso',
);
$user = new Scores_Utilisateur();
$this->view->assign('hasModeEdition', $user->checkModeEdition());
$this->view->assign('exportObjet', $infos);
$this->view->assign('surveillance', $user->checkPerm('survannonce'));
2017-01-17 16:23:31 +01:00
// --- Titre de la page
if ( empty($autrePage) ) {
if( empty($siren) ){
$titre = 'Identifiant '.$this->id;
} else {
2017-01-17 16:23:31 +01:00
$titre = 'Siret '.$siren;
}
2017-01-17 16:23:31 +01:00
$this->view->headTitle()->prepend('Annonces Légales - '.$titre);
}
2017-01-17 16:23:31 +01:00
// ---- 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);
2017-01-17 16:23:31 +01:00
$this->view->assign('nbReponses', empty($nbReponses) ? 0 : $nbReponses);
$this->view->assign('nbReponsesTotal', empty($nbReponsesTotal) ? 0 : $nbReponsesTotal);
2017-01-17 16:23:31 +01:00
$classType = 'annonces'.ucfirst($vue);;
$annonces = array();
if (count($objAnnonces->$classType) > 0) {
foreach($objAnnonces->$classType as $ann) {
$annonces[] = $objAnnonces->getAnnonceResume($ann);
}
Zend_Registry::get('firebug')->info($annonces);
$this->view->assign('annonces', $annonces);
}
$this->view->headScript()->appendFile($this->theme->pathScript.'/annonces.js', 'text/javascript');
}
}
/**
* Affichage d'une annonce
*/
public function annonceAction()
{
$request = $this->getRequest();
$autrePage = $request->getParam('apage');
$idAnn = $request->getParam('idAnn', null);
$siren = substr($this->siret, 0,9);
$vue = $request->getParam('vue', 'bodacc');
$source = $request->getParam('source');
if (!empty($source)) {
switch ($source){
case 1: $vue = 'bodacc'; break;
case 2: $vue = 'balo'; break;
case 3: $vue = 'asso'; break;
}
}
$session = new Scores_Session_Entreprise($this->siret, $this->id);
$fj = $session->getFormeJuridique();
if ($fj > 9000 && $fj < 9999 && intval($siren) == 0) {
$vue = 'asso';
}
$page = $request->getParam('page');
$this->view->assign('page', $page);
$this->view->assign('id', $session->getId());
$this->view->assign('siren', $siren);
$this->view->assign('siret', $this->siret);
$this->view->assign('raisonSociale', $session->getRaisonSociale());
$this->view->assign('AutrePage', $autrePage);
if ($session->getSource() == '006' || $session->getSourceId() == '007') {
$this->view->assign('AutreSource', true);
} else {
$this->view->assign('vue', $vue);
$ws = new WsScores();
switch ($vue) {
case 'balo':
$infos = $ws->getAnnoncesBalo($siren, $idAnn, null, $position, $nbAffichage);
break;
case 'asso':
if ( intval($siren)==0 && substr($session->getAutreId(),0,1)=='W' ) {
$infos = $ws->getAnnoncesAsso($session->getAutreId(), $idAnn, null, $position, $nbAffichage);
} elseif (intval($siren)!=0) {
$infos = $ws->getAnnoncesAsso($siren, $idAnn, null, $position, $nbAffichage);
} else {
$idAnn = $session->getSourceId();
$infos = $ws->getAnnoncesAsso($siren, $idAnn, null, $position, $nbAffichage);
2016-11-29 10:53:25 +01:00
}
2017-01-17 16:23:31 +01:00
break;
case 'bomp':
$filtre = $request->getParam('filtre', 'A');
$this->view->assign('filtre', $filtre);
$infos = $ws->getAnnoncesBoamp($siren, $idAnn, $filtre, $position, $nbAffichage);
break;
case 'bodacc':
case 'abod':
default:
if(intval($siren)==0) {
$idAnn = $session->getSourceId();
}
$infos = $ws->getAnnoncesLegales($siren, $idAnn, null, $position, $nbAffichage);
break;
}
Zend_Registry::get('firebug')->info($infos);
if ($infos === false) {
$this->forward('soap', 'error');
}
require_once 'Scores/Annonces.php';
$objAnnonces = new Annonces($infos->result->item);
$typeAnnonces = array(
'Bodacc',
'Balo',
'Bomp',
'Asso',
);
$user = new Scores_Utilisateur();
$this->view->assign('hasModeEdition', $user->checkModeEdition());
$this->view->assign('exportObjet', $infos);
$this->view->assign('surveillance', $user->checkPerm('survannonce'));
if ( $user->checkModeEdition() ){
$this->view->headScript()
->appendFile($this->theme->pathScript.'/saisieannonces.js', 'text/javascript');
}
$classType = 'annonces'.ucfirst($vue);
foreach($objAnnonces->$classType as $ann) {
if($ann->id==$idAnn) break;
}
Zend_Registry::get('firebug')->info($ann);
$annonce = array(
'Desc' => $objAnnonces->getAnnonceDesc($ann),
'Entree' => $objAnnonces->getAnnonceEntree($ann),
'EntreeSD' => $objAnnonces->getAnnonceEntreeSD($ann),
'Even' => $objAnnonces->getAnnonceEven($ann),
'Texte' => $objAnnonces->getAnnonceTexte($ann),
'Type' => $objAnnonces->getType($ann),
'Code' => $objAnnonces->getCode($ann),
'Annee' => $objAnnonces->getAnnee($ann),
'Num' => $objAnnonces->getNum($ann),
'Deleted' => $objAnnonces->isDeleted($ann),
'Entites' => $objAnnonces->getAnnonceEntite($ann)
);
$this->view->assign('source', $session->getSource());
if (intval($this->siret) == 0){
$this->view->assign('sourceId', $session->getSourceId());
} else {
$this->view->assign('sourceId', null);
}
$this->view->assign('idAnn', $idAnn);
$this->view->assign('annonce', $annonce);
if ($request->getParam('q') == 'ajax') {
$this->_helper->layout()->disableLayout();
$this->view->assign('ajax', 1);
} else {
// Définir url pour téléchargement pdf
if (in_array($annonce['Code'], array('BODA', 'BODB', 'BODC'))) {
$datePublication = DateTime::createFromFormat('Y-m-d', $ann->DateParution);
$dateBodacc = DateTime::createFromFormat('Ymd', '20080101');
$dateTemoinA = DateTime::createFromFormat('Ymd', '20161115');
$dateTemoinB = DateTime::createFromFormat('Ymd', '20161011');
$dateTemoinC = DateTime::createFromFormat('Ymd', '20160223');
$params = null;
if ($annonce['Code'] == 'BODA' && $datePublication >= $dateTemoinA) {
$params = array('unit'=>1);
$this->view->assign('bodaccLinkLabel', 'Télécharger le témoin de publication');
} elseif ($annonce['Code'] == 'BODB' && $datePublication >= $dateTemoinB) {
$params = array('unit'=>1);
$this->view->assign('bodaccLinkLabel', 'Télécharger le témoin de publication');
} elseif ($annonce['Code'] == 'BODC' && $datePublication >= $dateTemoinC) {
$params = array('unit'=>1);
$this->view->assign('bodaccLinkLabel', 'Télécharger le témoin de publication');
} elseif ($datePublication >= $dateBodacc) {
$params = array();
$this->view->assign('bodaccLinkLabel', 'Télécharger le bulletin officiel');
}
if ($params !== null) {
$params = array_merge($params, array('controller'=>'juridique',
'action'=>'bodaccpdf', 'siren'=>$siren, 'type'=>substr($annonce['Code'],3,1),
'parution'=>$annonce['Annee'].str_pad($ann->BodaccNum, 4, '0', STR_PAD_LEFT),
'annonce'=>$ann->NumAnnonce
));
$lienBodacc = $this->view->url($params, 'default', true);
$this->view->assign('bodaccLink', $lienBodacc);
}
}
}
}
}
2011-09-05 14:22:04 +00:00
/**
* Liste des contentieux
*/
public function ctxAction()
{
$request = $this->getRequest();
$session = new Scores_Session_Entreprise($this->siret, $this->id);
$this->view->headTitle()->prepend("Contentieux");
$this->view->headTitle()->prepend("Siret ".$this->siret);
$siren = substr($this->siret, 0,9);
$type = $request->getParam('type', 'DF');
$this->view->Type = $type;
$typeList = array(
'DE' => 'demandeur',
'DF' => 'défendeur',
);
$this->view->TypeLabel = '';
if (array_key_exists($type, $typeList)) {
$this->view->TypeLabel = $typeList[$type];
}
$this->view->TypeList = $typeList;
$nbReponses = 20;
$page = $request->getParam('page', 1);
if ( $page <= 0 ) $page = 1;
$position = ($page - 1 ) * $nbReponses;
$params = new stdClass();
$params->companyId = $siren;
$params->tiers = $type;
$params->p = $position;
$params->limit = $nbReponses;
try {
$ws = new Scores_Ws_Client('entreprise', '0.9');
$response = $ws->getGreffeAffaireList($params);
if ($response === false) {
$this->view->msg = "Erreur";
} else {
$this->view->List = $response->List->item;
// --- Pagination
$nbReponsesTotal = $response->Nb;
$pageTotal = $pageCurrent = 1;
$pagePrev = null;
$pageNext = null;
if ($nbReponses < $nbReponsesTotal) {
$pageTotal = ceil( $nbReponsesTotal / $nbReponses );
$pageCurrent = $page;
$pagePrev = $page - 1;
if ($pagePrev < 1) {
$pagePrev = 1;
}
$pageNext = $page + 1;
if( $pageNext > $pageTotal ) {
$pageNext = $pageTotal;
}
}
$this->view->assign('PageTotal', $pageTotal);
$this->view->assign('PagePrev', $pagePrev);
$this->view->assign('PageNext', $pageNext);
$this->view->assign('PageCurrent', $pageCurrent);
$this->view->assign('nbReponses', empty($nbReponses) ? 0 : $nbReponses);
$this->view->assign('nbReponsesTotal', empty($nbReponsesTotal) ? 0 : $nbReponsesTotal);
$this->view->assign('siren', $siren);
$this->view->assign('siret', $this->siret);
$this->view->assign('raisonSociale', $session->getRaisonSociale());
}
} catch (Exception $e) {
$this->view->msg = $e->getMessage();
}
}
public function ctxdetailAction()
{
$request = $this->getRequest();
$session = new Scores_Session_Entreprise($this->siret, $this->id);
$siren = substr($this->siret, 0,9);
$this->view->headTitle()->prepend("Contentieux");
$this->view->headTitle()->prepend("Siret ".$this->siret);
$this->view->assign('siren', $siren);
$this->view->assign('siret', $this->siret);
$this->view->assign('raisonSociale', $session->getRaisonSociale());
$id = $request->getParam('affaireId');
$params = new stdClass();
$params->id = $id;
try {
$ws = new Scores_Ws_Client('entreprise', '0.9');
$response = $ws->getGreffeAffaireDetail($params);
if ($response === false) {
$this->view->msg = "Erreur";
} else {
$this->view->Affaire = $response;
}
} catch (Exception $e) {
$this->view->msg = $e->getMessage();
}
}
2011-09-05 14:22:04 +00:00
/**
* Affichage infos réglementées
*/
public function infosregAction()
{
2013-12-26 14:42:44 +00:00
$this->view->headTitle()->prepend("Informations Réglementées");
$this->view->headTitle()->prepend("Siret ".$this->siret);
$request = $this->getRequest();
$idAnn = $request->getParam('idann', false);
$siren = substr($this->siret, 0,9);
2013-11-21 16:31:49 +00:00
$session = new Scores_Session_Entreprise($this->siret, $this->id);
2012-05-20 16:31:28 +00:00
$ws = new WsScores();
if ($idAnn!=false) {
$this->view->assign('idAnn', $idAnn);
$infos = $ws->getInfosReg($siren,$idAnn);
} else {
$infos = $ws->getInfosReg($siren);
}
2013-12-26 14:42:44 +00:00
if ($infos === false) $this->forward('soap', 'error');
2012-05-20 16:31:28 +00:00
if (is_string($infos)){
$this->view->assign('message', $infos);
}
2012-05-20 16:31:28 +00:00
$objAnnonces = $infos->result->item;
$annonces = array();
if (count($objAnnonces)>0) {
foreach ( $objAnnonces as $item ) {
2013-11-05 14:45:25 +00:00
$dateParution = new Zend_Date($item->DateParution, 'yyyy-MM-dd');
$dateInsertion = new Zend_Date($item->dateInsertionSD, 'yyyy-MM-dd');
$annonces[] = array(
'id' => $item->id,
'titre' => $item->titre,
'communique' => $item->communique,
'source' => $item->source,
2013-11-05 14:45:25 +00:00
'DateParution' => $dateParution->toString('dd/MM/yyyy'),
'dateInsertionSD' => $dateInsertion->toString('dd/MM/yyyy'),
);
}
}
$this->view->assign('annonces', $annonces);
$this->view->assign('siren', $siren);
$this->view->assign('siret', $this->siret);
$this->view->assign('raisonSociale', $session->getRaisonSociale());
2011-08-23 13:42:57 +00:00
$this->view->assign('exportObjet', $infos);
}
2012-05-20 16:31:28 +00:00
2011-09-05 14:22:04 +00:00
/**
* Affichage listes des compétences
*/
public function competencesAction()
{
2013-12-26 14:42:44 +00:00
$this->view->headTitle()->prepend("Compétences Territoriales");
$this->view->headTitle()->prepend("Siret ".$this->siret);
$request = $this->getRequest();
$type = $request->getParam('type', '');
$siren = substr($this->siret,0,9);
2013-11-21 16:31:49 +00:00
$session = new Scores_Session_Entreprise($this->siret, $this->id);
2012-05-20 16:31:28 +00:00
$abbrev = array(
' TGI ' => 'TRIBUNAL DE GRANDE INSTANCE DE ',
' TI ' => 'TRIBUNAL D\'INSTANCE DE ',
' TC ' => 'TRIBUNAL DE COMMERCE DE ',
' TGICC ' => 'TRIBUNAL DE GRANDE INSTANCE A COMPETENCE COMMERCIALE ',
' TICC ' => 'TRIBUNAL D\'INSTANCE A COMPETENCE COMMERCIALE '
);
2012-05-20 16:31:28 +00:00
if (!empty($type)){
$ws = new WsScores();
2014-12-18 16:04:47 +00:00
$infos = $ws->getListeCompetences($this->siret, $type, $session->getCodeCommune());
2011-08-19 13:00:53 +00:00
if ($infos === false) $this->_forward('soap', 'error');
2012-05-20 16:31:28 +00:00
$competences = $infos->result->item;
Zend_Registry::get('firebug')->info($infos);
if( $type=='tri' || $type=='cfe' ) {
$i=0;
foreach($competences as $comp){
$competences[$i]->Nom = strtr(' '.strtoupper($comp->Nom), $abbrev);
$i++;
}
}
$this->view->assign('competences', $competences);
$this->view->assign('type', $type);
2011-09-05 14:22:04 +00:00
$this->view->assign('exportObjet', $infos);
}
2012-05-20 16:31:28 +00:00
$this->view->assign('siren', $siren);
$this->view->assign('siret', $this->siret);
2012-05-20 16:31:28 +00:00
$this->view->assign('raisonSociale', $session->getRaisonSociale());
}
2012-05-20 16:31:28 +00:00
2011-09-05 14:22:04 +00:00
/**
* Affichage des la listes des conventions collectives
* Enter description here ...
*/
2011-05-02 12:14:05 +00:00
public function conventionsAction()
{
2013-12-26 14:42:44 +00:00
$this->view->headTitle()->prepend("Conventions Collectives");
$this->view->headTitle()->prepend("Siret ".$this->siret);
2011-05-02 12:14:05 +00:00
$siren = substr($this->siret, 0,9);
2013-11-21 16:31:49 +00:00
$session = new Scores_Session_Entreprise($this->siret, $this->id);
2011-05-02 12:14:05 +00:00
$this->view->assign('siren', $siren);
$this->view->assign('siret', $this->siret);
$this->view->assign('raisonSociale', $session->getRaisonSociale());
$ws = new WsScores();
$infos = $ws->getListeConventions($siren);
$conventions = $infos->result->item;
Zend_Registry::get('firebug')->info($conventions);
$this->view->assign('conventions', $conventions);
2011-09-05 14:22:04 +00:00
$this->view->assign('exportObjet', $infos);
2011-05-02 12:14:05 +00:00
}
2012-05-20 16:31:28 +00:00
2011-09-05 14:22:04 +00:00
/**
* Affichage des marques déposées
*/
2011-05-02 13:38:52 +00:00
public function marquesAction()
{
2013-12-26 14:42:44 +00:00
$this->view->headTitle()->prepend("Marques Déposées");
$this->view->headTitle()->prepend("Siret ".$this->siret);
2015-07-10 14:14:55 +00:00
$this->view->headScript()->appendFile($this->theme->pathScript.'/marques.js', 'text/javascript');
2012-05-20 16:31:28 +00:00
2011-05-02 13:38:52 +00:00
$request = $this->getRequest();
$idObject = $request->getParam('idObject', 0);
$siren = substr($this->siret, 0,9);
2013-11-21 16:31:49 +00:00
$session = new Scores_Session_Entreprise($this->siret, $this->id);
2011-05-02 13:38:52 +00:00
$this->view->assign('siren', $siren);
$this->view->assign('siret', $this->siret);
$this->view->assign('raisonSociale', $session->getRaisonSociale());
$ws = new WsScores();
$infos = $ws->getMarques($siren, $idObject);
2011-08-19 13:00:53 +00:00
if ($infos === false) $this->_forward('soap', 'error');
2012-05-20 16:31:28 +00:00
2011-05-02 13:38:52 +00:00
$marques = $infos->result->item;
$this->view->assign('marques', $marques);
$this->view->assign('idObject', $idObject);
2011-09-05 14:22:04 +00:00
$this->view->assign('exportObjet', $marques);
2011-05-02 13:38:52 +00:00
Zend_Registry::get('firebug')->info($infos);
}
2012-05-20 16:31:28 +00:00
2011-09-05 14:22:04 +00:00
/**
* Affiche le lien pour télécharger le fichier concernant le dépot
*/
2011-05-02 13:38:52 +00:00
public function getmarqueAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$request = $this->getRequest();
$numdepot = $request->getParam('numdepot', '');
if (empty($numdepot)){
echo 'Paramètres incorrects';
exit;
}
$c = Zend_Registry::get('config');
2016-02-12 14:25:27 +00:00
$directory = $c->profil->path->shared.'/persist/marques';
2011-05-02 13:38:52 +00:00
$file = $numdepot.'.pdf';
//Le fichier n'existe pas alors on le télécharger
if(!file_exists($directory.'/'.$file)
2013-02-05 15:59:10 +00:00
|| filesize($directory.'/'.$file)==0 ) {
$cmd = 'php ' . APPLICATION_PATH . '/../scripts/jobs/getMarque.php ' . $numdepot;
2013-02-13 09:31:37 +00:00
Zend_Registry::get('firebug')->info($cmd);
$result = exec($cmd);
Zend_Registry::get('firebug')->info($result);
2011-05-02 13:38:52 +00:00
}
//On vérfie que le fichier existe après le téléchargement
if(file_exists($directory.'/'.$file) && filesize($directory.'/'.$file)>0) {
$href = $this->view->url(array('module'=>'file', 'controller'=>'index', 'action'=>'marque', 'q'=>$file), 'default', true);
2011-05-02 13:38:52 +00:00
echo '<a href="'.$href.'" target="_blank">Télécharger le PDF de l\'insciption au BOPI.</a>';
} else {
echo 'Document introuvable.';
}
}
2012-05-20 16:31:28 +00:00
2017-01-16 17:12:04 +01:00
/**
* Gestion téléchargement du Bodacc au format pdf
*/
public function bodaccpdfAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$request = $this->getRequest();
2012-05-20 16:31:28 +00:00
$siren = $request->getParam('siren');
$type = $request->getParam('type');
$parution = $request->getParam('parution');
$annonce = $request->getParam('annonce');
$unit = $request->getParam('unit');
$annee = substr($parution,0,4);
2012-05-20 16:31:28 +00:00
$c = Zend_Registry::get('config');
$path = $c->profil->path->shared.'/persist/bodacc/'.$type.'/'.$annee;
if ($unit == 1) {
$file = $path."/BODACC_".$type."_".$annee."_".substr($parution,4)."_".$annonce.".pdf";
} else {
$file = $path."/BODACC_".$type."_".$annee."_".substr($parution,4).".pdf";
}
2012-05-20 16:31:28 +00:00
if (!file_exists($file)) {
$cli = "/../scripts/jobs/getBodaccPdf.php";
$params = "--siren ".$siren."--type ".$type." --parution ".$parution." --annonce ".$annonce;
exec('php ' . APPLICATION_PATH . "$cli $params >> getBodaccPdf.log");
}
if (file_exists($file)) {
$href = $this->view->url(array('module'=>'file', 'controller'=>'bodacc',
'action'=>'actual', 'q' => basename($file)), 'default', true);
2012-05-20 16:31:28 +00:00
echo "<a target=\"_blank\" href=\"".$href."\">Cliquer ici pour télécharger le fichier.</a>";
} else {
2012-05-20 16:31:28 +00:00
echo "Erreur lors du chargement du fichier.";
}
}
2012-05-20 16:31:28 +00:00
public function annoncenumAction()
{
$this->_helper->layout()->disableLayout();
2013-01-19 19:32:24 +00:00
$request = $this->getRequest();
$siren = $request->getParam('siren');
2013-01-19 19:32:24 +00:00
$ws = new WsScores();
$result = $ws->getAnnoncesNum($siren);
Zend_Registry::get('firebug')->info($result);
$numWS = array();
if (count($result->item)>0) {
foreach ($result->item as $item) {
$numWS[$item->type] = $item->num;
}
}
$types = array('bodacc', 'balo', 'boamp', 'asso');
2013-01-19 19:32:24 +00:00
$num = array();
foreach($types as $type) {
if ( array_key_exists($type, $numWS) ) {
$num['Type'.ucfirst($type)] = $numWS[$type];
}
}
2013-01-19 19:32:24 +00:00
$this->view->assign('num', $num);
}
2012-05-20 16:31:28 +00:00
2011-02-21 08:45:13 +00:00
}