Contentieux : Liste et Détails (alpha)

This commit is contained in:
Michael RICOIS 2016-04-06 12:29:06 +00:00
parent 5942b7f910
commit f29a3b62d8
5 changed files with 246 additions and 0 deletions

View File

@ -224,6 +224,89 @@ class JuridiqueController extends Zend_Controller_Action
}
}
/**
* 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');
$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;
$ws = new Scores_Ws_Client('entreprise', '0.9');
$response = $ws->getGreffeAffaireList($params);
$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());
}
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;
$ws = new Scores_Ws_Client('entreprise', '0.9');
$response = $ws->getGreffeAffaireDetail($params);
$this->view->Affaire = $response;
}
/**
* Affichage infos réglementées
*/

View File

@ -0,0 +1,76 @@
<div id="center">
<h1 class="titre">Contentieux</h1>
<div class="paragraph">
<table class="identite">
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Num&eacute;ro identifiant Siren</td>
<td width="350" class="StyleInfoData"><?=$this->SirenTexte($this->siren)?></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Dénomination Sociale</td>
<td width="350" class="StyleInfoData"><?=$this->raisonSociale?></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Affaire en tant que</td>
<td width="350" class="StyleInfoData">Défendeur / Demandeur</td>
</tr>
</table>
</div>
<h2>Liste des contentieux en tant que défendeur</h2>
<div class="paragraph">
<?php if (count($this->List) > 0) {?>
<table class="data">
<thead>
<tr>
<th>Date</th>
<th>Catégorie</th>
<th>Libellé</th>
<th>Tiers demandeur</th>
<th>Etat</th>
</tr>
</thead>
<tbody>
<?php foreach ($this->List as $k => $item) {?>
<tr>
<td>
<?php
$dateString = '-';
try {
$date = new Zend_Date($item->EnrolementDate, 'y-MM-dd');
$dateString = $date->toString('dd/MM/y');
} catch(Zend_Date_Exception $e){}
?><a href="<?=$this->url(array('action'=>'ctxdetail', 'affaireId'=>$item->Id))?>"><?=$dateString?></a></td>
<td><?=$item->CategoryLabel?></td>
<td><?=$item->Label?></td>
<td>
<?php foreach($item->TierName->item as $t) {?>
<?=$t?>
<?php }?>
</td>
<td><?=$item->StatusLabel?></td>
</tr>
<?php }?>
</tbody>
</table>
<?php if ($this->PageTotal>1) {?>
<div class="paragraph">
<div class="pagination clearfix">
<a class="first" href="<?=$this->url(array('page'=>1))?>">&laquo;</a>
<a class="previous" href="<?=$this->url(array('page'=>$this->PagePrev))?>">&lsaquo;</a>
<span>Page <?=$this->PageCurrent?>/<?=$this->PageTotal?></span>
<a class="next" href="<?=$this->url(array('page'=>$this->PageNext))?>">&rsaquo;</a>
<a class="last" href="<?=$this->url(array('page'=>$this->PageTotal))?>">&raquo;</a>
</div>
</div>
<?php }?>
<?php }?>
</div>
<?=$this->render('cgu.phtml', $this->cgu)?>
</div>

View File

@ -0,0 +1,73 @@
<div id="center">
<h1 class="titre">Contentieux</h1>
<div class="paragraph">
<table class="identite">
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Num&eacute;ro identifiant Siren</td>
<td width="350" class="StyleInfoData"><?=$this->SirenTexte($this->siren)?></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Dénomination Sociale</td>
<td width="350" class="StyleInfoData"><?=$this->raisonSociale?></td>
</tr>
</table>
</div>
<h2>Détail du contentieux</h2>
<div class="paragraph">
<table class="data">
<tbody>
<tr><td>Tribunal</td><td><?=$this->Affaire->GreffeLabel?></td></tr>
<tr><td>Date d'enrôlement</td><td><?=$this->Affaire->EnrolementDate?></td></tr>
<tr><td>Etat de l'affaire</td><td><?=$this->Affaire->StatusLabel?></td></tr>
<tr><td>Nature de la demande</td><td><?=$this->Affaire->Label?></td></tr>
<tr><td>Type de procédure</td><td><?=$this->Affaire->CategoryLabel?></td></tr>
<tr>
<td>Demandeurs</td>
<td>
<?php if (count($this->Affaire->Tiers->item) > 0) {?>
<?php foreach ($this->Affaire->Tiers->item as $t) {?>
<?php if ($t->TypeCode == 'DE') {?>
<strong><?=$t->companyNom?></strong><?php if (!empty($t->companyId)) {?> (<?=$this->SirenTexte($t->companyId)?>) <?php }?>
<?php if (!empty($t->Acteur)) {?>
<?php foreach($t->Acteur->item as $acteur) {?>
<br/> - <?=$acteur->Nom?>
<?php }?>
<?php }?>
<?php }?>
<?php }?>
<?php }?>
</td>
</tr>
<tr>
<td>Défendeurs</td>
<td>
<?php if (count($this->Affaire->Tiers->item) > 0) {?>
<?php foreach ($this->Affaire->Tiers->item as $t) {?>
<?php if ($t->TypeCode == 'DF') {?>
<strong><?=$t->companyNom?></strong><?php if (!empty($t->companyId)) {?> (<?=$this->SirenTexte($t->companyId)?>) <?php }?>
<?php if (!empty($t->Acteur)) {?>
<?php foreach($t->Acteur->item as $acteur) {?>
<br/> - <?=$acteur->Nom?>
<?php }?>
<?php }?>
<?php }?>
<?php }?>
<?php }?>
</td>
</tr>
<tr><td colspan="2">Historique</td></tr>
<?php if (property_exists($this->Affaire->Histo, 'item') && count($this->Affaire->Histo->item) > 0) {?>
<?php foreach ($this->Affaire->Histo->item as $h){?>
<tr><td><?=$h->Date?></td><td><?=$h->Label?></td></tr>
<?php }?>
<?php } else {?>
<tr><td colspan="2">-Aucune information-</td></tr>
<?php }?>
</tbody>
</table>
</div>
</div>

View File

@ -253,6 +253,9 @@ class Scores_Menu
),
array(
'label' => 'ELEMENTS JURIDIQUES',
'activateMenu' => array(
array('controller'=>'juridique', 'action'=>'ctxdetail'),
),
'pages' => array(
array(
'label' => "Annonces Légales",
@ -261,6 +264,11 @@ class Scores_Menu
'forceVisible' => true,
'permission' => 'ANNONCES',
),
array(
'label' => "Contentieux",
'controller' => 'juridique',
'action' => 'ctx',
),
array(
'label' => "Information Réglementée",
'controller' => 'juridique',

View File

@ -1,6 +1,12 @@
<?php
return array(
'0.9' => array(
'getGreffeAffaireList' => array(
'debug' => true,
),
'getGreffeAffaireDetail' => array(
'debug' => true,
),
'getIdentite' => array(
'debug' => true,
),