2011-06-14 07:36:07 +00:00
|
|
|
<?php
|
|
|
|
class IdentiteProcol
|
|
|
|
{
|
|
|
|
protected $identite;
|
|
|
|
protected $annonces = array();
|
|
|
|
protected $procol;
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-06-14 07:36:07 +00:00
|
|
|
/**
|
|
|
|
* Construit l'identite entreprise afin de retourner les éléments formatter
|
|
|
|
* pour l'affichage
|
|
|
|
* @param stdClass $infos
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public function __construct($infos)
|
|
|
|
{
|
|
|
|
$this->identite = $infos->Identite;
|
|
|
|
$this->procol = new stdClass();
|
|
|
|
$this->procol->LibTypeEtab = $infos->LibTypeEtab;
|
|
|
|
$this->procol->StatutsConstDepot = $infos->StatutsConstDepot;
|
|
|
|
$this->procol->StatutsConst = $infos->StatutsConst;
|
|
|
|
$this->procol->StatutsModifDepot = $infos->StatutsModifDepot;
|
|
|
|
$this->procol->StatutsModif = $infos->StatutsModif;
|
|
|
|
$this->procol->CessionJugeLib = $infos->CessionJugeLib;
|
|
|
|
$this->procol->CessionJugeDate = $infos->CessionJugeDate;
|
|
|
|
$this->procol->CessionAvisBodac = $infos->CessionAvisBodac;
|
|
|
|
$this->procol->CessionInvenDate = $infos->CessionInvenDate;
|
|
|
|
$this->procol->CessionCAdeclare = $infos->CessionCAdeclare;
|
|
|
|
$this->procol->CessionEffectif = $infos->CessionEffectif;
|
|
|
|
$this->procol->CessionDesc = $infos->CessionDesc;
|
|
|
|
$this->procol->CessionDescDate = $infos->CessionDescDate;
|
|
|
|
$this->procol->CessionOffreDate = $infos->CessionOffreDate;
|
|
|
|
$this->procol->CessionMandataire = $infos->CessionMandataire;
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-06-14 07:36:07 +00:00
|
|
|
//Regroupement des annonces suivant le code even
|
|
|
|
if(count($infos->Annonces->item)>0) {
|
|
|
|
foreach ($infos->Annonces->item as $annonce) {
|
|
|
|
foreach($annonce->evenements->item as $even) {
|
|
|
|
$this->annonces[$even->CodeEven] = $annonce;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2011-06-14 09:19:33 +00:00
|
|
|
Zend_Registry::get('firebug')->info($this->annonces);
|
2011-06-14 07:36:07 +00:00
|
|
|
$this->view = new Zend_View();
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-06-14 07:36:07 +00:00
|
|
|
/**
|
|
|
|
* Sélectionne les annonces
|
|
|
|
* @param string $codeAnnonces
|
|
|
|
* : => 2100:2199 Selection de toutes les annonces de 2100 à 2199
|
|
|
|
* - => 2100-2102 Selection des annonces
|
|
|
|
*/
|
|
|
|
public function searchBlockAnnonces($codeAnnonces)
|
|
|
|
{
|
|
|
|
// : => 2100:2199 Selection de toutes les annonces de 2100 à 2199
|
|
|
|
// - => 2100-2102 Selection des annonces
|
2011-06-14 09:19:33 +00:00
|
|
|
$listAnnonces = explode('-', $codeAnnonces);
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-06-14 07:36:07 +00:00
|
|
|
$interAnnonces = array();
|
|
|
|
foreach($listAnnonces as $item) {
|
|
|
|
$interAnnonces[] = explode(':', $item);
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-06-14 07:36:07 +00:00
|
|
|
//Remplissage du tableau pour les intervalles
|
|
|
|
for($i=0;$i<count($interAnnonces);$i++) {
|
|
|
|
if(count($interAnnonces[$i])>1) {
|
|
|
|
$start = $interAnnonces[$i][0];
|
|
|
|
$cpt = $start;
|
|
|
|
$tabTemp = array();
|
|
|
|
while($cpt<$interAnnonces[$i][1]){
|
|
|
|
$tabTemp[] = $cpt;
|
|
|
|
$cpt++;
|
|
|
|
}
|
|
|
|
$interAnnonces[$i] = $tabTemp;
|
|
|
|
}
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-06-14 07:36:07 +00:00
|
|
|
$outputAnnonces = array();
|
|
|
|
//Parcours des annonces
|
|
|
|
foreach($interAnnonces as $tabCodeEven) {
|
|
|
|
foreach($tabCodeEven as $code_even) {
|
|
|
|
if(array_key_exists($code_even, $this->annonces)){
|
|
|
|
$outputAnnonces[] = $this->annonces[$code_even];
|
2011-06-14 09:19:33 +00:00
|
|
|
unset($this->annonces[$code_even]);
|
2011-06-14 07:36:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $outputAnnonces;
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-06-14 07:36:07 +00:00
|
|
|
/**
|
|
|
|
* Affiche les annonces sélectionnées
|
|
|
|
* @param array $annonces
|
|
|
|
* Tableau d'annonces sélectionnées
|
|
|
|
*/
|
|
|
|
public function dAnnonces($annonces)
|
|
|
|
{
|
|
|
|
$output = '';
|
|
|
|
if(is_array($annonces) && count($annonces)>0)
|
|
|
|
{
|
|
|
|
foreach($annonces as $annonce)
|
|
|
|
{
|
|
|
|
$output.= '<p class="libAnnonces">';
|
|
|
|
switch($annonce->BodaccCode)
|
|
|
|
{
|
|
|
|
case 'BALO': $vue = 'balo'; break;
|
|
|
|
case 'ASSO': $vue = 'asso'; break;
|
|
|
|
case 'BODA':
|
|
|
|
case 'BODB':
|
|
|
|
case 'BODC':
|
|
|
|
default: $vue = 'bodacc'; break;
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-06-14 07:36:07 +00:00
|
|
|
$href = $this->view->url(array(
|
|
|
|
'controller' => 'juridique',
|
|
|
|
'action' => 'annonces',
|
|
|
|
'siret' => $this->identite->Siret,
|
|
|
|
'idAnn' => $annonce->id,
|
2012-02-10 14:48:38 +00:00
|
|
|
'vue' => $vue,
|
2011-06-14 07:36:07 +00:00
|
|
|
));
|
|
|
|
$output.= '<a href="'.$href.'">';
|
2011-06-14 09:19:33 +00:00
|
|
|
$output.= html_entity_decode($annonce->evenements->item[0]->LibEven);
|
2011-06-14 07:36:07 +00:00
|
|
|
$output.= '</a>';
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-06-14 07:36:07 +00:00
|
|
|
if(!empty($annonce->dateJugement) && substr($annonce->dateJugement,0,4)!='0000') $output.= ', le '.WDate::dateT('Y-m-d','d/m/Y',$annonce->dateJugement);
|
|
|
|
elseif(!empty($annonce->dateEffet) && substr($annonce->dateEffet,0,4)!='0000') $output.= ', le '.WDate::dateT('Y-m-d','d/m/Y',$annonce->dateEffet);
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-06-14 07:36:07 +00:00
|
|
|
$output.= ', publié au ';
|
|
|
|
$tabSource=explode('-', $annonce->BodaccCode);
|
|
|
|
$source=$tabSource[0];
|
|
|
|
$idSource=@$tabSource[1];
|
|
|
|
if ($source[0] == 'B'){
|
|
|
|
$output.= 'BODACC n°'.$annonce->BodaccNum.' '.substr($source,-1);
|
|
|
|
}elseif ($source[0] == 'G' || $source[0] == 'T'){
|
|
|
|
$output.= 'Greffe';
|
|
|
|
}elseif ($source[0] == 'P'){
|
|
|
|
$output.= 'RNCS';
|
|
|
|
}else{
|
|
|
|
$output.='JAL';
|
|
|
|
}
|
|
|
|
if(!empty($annonce->DateParution)) $output.= ' le '.WDate::dateT('Y-m-d','d/m/Y',$annonce->DateParution);
|
|
|
|
$output.= '</p>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $output;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getTypeEtabLabel()
|
|
|
|
{
|
|
|
|
return 'Type d\'Etablissement';
|
|
|
|
}
|
|
|
|
public function getTypeEtabTexte()
|
|
|
|
{
|
|
|
|
if( $this->procol->LibTypeEtab=='N/C' || $this->procol->LibTypeEtab=='')
|
|
|
|
return false;
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-06-14 07:36:07 +00:00
|
|
|
return $this->procol->LibTypeEtab;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getStatutsConstLabel()
|
|
|
|
{
|
|
|
|
return 'Dépot des statuts';
|
|
|
|
}
|
|
|
|
public function getStatutsConstTexte()
|
|
|
|
{
|
|
|
|
$data = '';
|
|
|
|
if(!empty($this->procol->StatutsConst) && $this->procol->StatutsConst!='0000-00-00')
|
|
|
|
{
|
|
|
|
$data.= 'Constitués le '.WDate::dateT('Y-m-d', 'd/m/Y', $this->procol->StatutsConst);
|
|
|
|
}
|
|
|
|
if(!empty($this->procol->StatutsConstDepot) && $this->procol->StatutsConstDepot!='0000-00-00')
|
|
|
|
{
|
|
|
|
$data.= ' en dépôt du '.WDate::dateT('Y-m-d', 'd/m/Y', $this->procol->StatutsConstDepot);
|
|
|
|
}
|
|
|
|
if(empty($data)) return false;
|
|
|
|
return $data;
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-06-14 07:36:07 +00:00
|
|
|
public function getStatutsModifLabel()
|
|
|
|
{
|
|
|
|
return 'Modification des statuts';
|
|
|
|
}
|
|
|
|
public function getStatutsModifTexte()
|
|
|
|
{
|
|
|
|
$data = '';
|
|
|
|
if(!empty($this->procol->StatutsModif) && $this->procol->StatutsModif!='0000-00-00')
|
|
|
|
{
|
|
|
|
$data.= 'Modifiés le '.WDate::dateT('Y-m-d', 'd/m/Y', $this->procol->StatutsModif);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!empty($this->procol->StatutsModifDepot) && $this->procol->StatutsModifDepot!='0000-00-00')
|
|
|
|
{
|
|
|
|
$data.= ' en dépôt du '.WDate::dateT('Y-m-d', 'd/m/Y', $this->procol->StatutsModifDepot);
|
|
|
|
}
|
|
|
|
if(empty($data)) return false;
|
|
|
|
return $data;
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-06-14 07:36:07 +00:00
|
|
|
public function getCessionOffreDateLabel()
|
|
|
|
{
|
|
|
|
return '';
|
|
|
|
}
|
|
|
|
public function getCessionOffreDateTexte()
|
|
|
|
{
|
|
|
|
if (empty($this->procol->CessionOffreDate)) return false;
|
|
|
|
|
|
|
|
return 'Offres de reprises possibles jusqu\'au '.
|
|
|
|
WDate::DateT('Y-m-d', 'd/m/Y', $this->procol->CessionOffreDate);
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-06-14 07:36:07 +00:00
|
|
|
public function getCessionInvenDateLabel()
|
|
|
|
{
|
|
|
|
return '';
|
|
|
|
}
|
|
|
|
public function getCessionInvenDateTexte()
|
|
|
|
{
|
|
|
|
if (empty($this->procol->CessionInvenDate)) return false;
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-06-14 07:36:07 +00:00
|
|
|
return 'Inventaire déposé au greffe le '.
|
|
|
|
WDate::DateT('Y-m-d', 'd/m/Y', $this->procol->CessionInvenDate);
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-06-14 07:36:07 +00:00
|
|
|
public function getCessionDescLabel()
|
|
|
|
{
|
|
|
|
return '';
|
|
|
|
}
|
|
|
|
public function getCessionDescTexte()
|
|
|
|
{
|
|
|
|
if (empty($this->procol->CessionDesc)) return false;
|
|
|
|
|
|
|
|
return 'Actifs concernés '.$this->procol->CessionDesc;
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-06-14 07:36:07 +00:00
|
|
|
}
|