Merge : Contentieux et plus

This commit is contained in:
Michael RICOIS 2016-04-18 09:32:50 +00:00
commit e672855857
22 changed files with 413 additions and 1444 deletions

View File

@ -224,6 +224,115 @@ 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');
$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();
}
}
/**
* Affichage infos réglementées
*/

View File

@ -90,7 +90,7 @@ class PiecesController extends Zend_Controller_Action
} else {
$this->view->ref = strtoupper($result);
}
} catch (Zend_Db_Exception $e) {
} catch (Exception $e) {
$this->view->msg = $e->getMessage();
}

View File

@ -2,32 +2,32 @@
<div class="paragraph">
<div id="infogeo" class="clearfix">
<div id="infogeo_txt">
<?php if ( $this->infos->GeoLat && $this->infos->GeoLon ):?>
<span id=geolocalisation>
<b>Information géographique :</b><br/>
Latitude : <?=$this->decLat?> (<?=$this->infos->GeoLat?>)<br />
Longitude : <?=$this->decLon?> (<?=$this->infos->GeoLon?>)<br />
</span>
<a id="lien-google" href="<?=$this->mapsHref?>" target="_blank">
Afficher l'adresse sur Google Map &copy;</a><br/>
<br/>
<?endif;?>
<b>Code commune / Rivoli :</b><br/>
<?=$this->infos->Dept.' '.$this->infos->codeCommune.' / '.$this->infos->Rivoli; ?>
<?php
if (count($this->infos->InfosIris)>0){
$InfosIris = $this->infos->InfosIris;
$codComIris = str_replace($InfosIris->codIris, '', $InfosIris->codComIris);
?>
<br/><br/><b>Iris :</b>
<?php if (intval($InfosIris->codIris) == 0){ ?>
<br/>Commune non découpée en Iris
<?php } else {?>
<br/>Code : <?=$codComIris?> <?=$InfosIris->codIris?>
<br/>Libellé : <a title="Consulter le plan d'assemblage de la commune" href="<?=$this->url(array('controller'=>'identite', 'action'=>'iris', 'code'=>$codComIris), 'default', true)?>" target="_blank"><?=$InfosIris->libIris?></a>
<img title="<?=$InfosIris->typIris?>" style="vertical-align:middle;" src="/themes/default/images/info.gif">
<?php }?>
<?php }?>
<?php if ( $this->infos->GeoLat && $this->infos->GeoLon ) {?>
<span id=geolocalisation>
<b>Information géographique :</b><br/>
Latitude : <?=$this->decLat?> (<?=$this->infos->GeoLat?>)<br />
Longitude : <?=$this->decLon?> (<?=$this->infos->GeoLon?>)<br />
</span>
<a id="lien-google" href="<?=$this->mapsHref?>" target="_blank">
Afficher l'adresse sur Google Map &copy;</a><br/>
<br/>
<?php }?>
<b>Code commune / Rivoli :</b><br/>
<?=$this->infos->Dept.' '.$this->infos->codeCommune.' / '.$this->infos->Rivoli; ?>
<?php
if (count($this->infos->InfosIris)>0){
$InfosIris = $this->infos->InfosIris;
$codComIris = str_replace($InfosIris->codIris, '', $InfosIris->codComIris);
?>
<br/><br/><b>Iris :</b>
<?php if (intval($InfosIris->codIris) == 0){ ?>
<br/>Commune non découpée en Iris
<?php } else {?>
<br/>Code : <?=$codComIris?> <?=$InfosIris->codIris?>
<br/>Libellé : <a title="Consulter le plan d'assemblage de la commune" href="<?=$this->url(array('controller'=>'identite', 'action'=>'iris', 'code'=>$codComIris), 'default', true)?>" target="_blank"><?=$InfosIris->libIris?></a>
<img title="<?=$InfosIris->typIris?>" style="vertical-align:middle;" src="/themes/default/images/info.gif">
<?php }?>
<?php }?>
</div>
<?php if ($this->facade) {?>

View File

@ -39,8 +39,7 @@ $('a.street-heading').click(function(e){
<?php if ($this->AuthorizeUpdate) {?>
<div>
<a class="street-original" href="#">Original</a> -
<a class="street-upload" href="#">Upload</a>
<a class="street-original" href="#">Original</a> - <a class="street-upload" href="#">Upload</a>
</div>
<?php }?>

View File

@ -0,0 +1,98 @@
<div id="center">
<h1 class="titre">Contentieux Judiciaires</h1>
<?php if ($this->msg) {?>
<div class="paragraph">
<div style="padding: 0 .7em;" class="ui-state-error ui-corner-all">
<p><span style="float: left; margin-right: .3em;" class="ui-icon ui-icon-alert"></span>
<strong>Alert:</strong> <?=$this->msg?></p>
</div>
</div>
<?php } else {?>
<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(s) en tant que</td>
<td width="350" class="StyleInfoData">
<form action="<?=$this->url(array('module'=>'default','controller'=>'juridique',
'action'=>'ctx'))?>" method="post">
<select name="type">
<?php foreach($this->TypeList as $k => $v) {?>
<option value="<?=$k?>" <?php if ($k==$this->Type){?> selected<?php }?>><?=$v?></option>
<?php }?>
</select>
<input type="submit" name="submit" value="OK">
</form>
</td>
</tr>
</table>
</div>
<h2>Liste des affaires en tant que <?=$this->TypeLabel?></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->Date, '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>
<?php }?>
<?=$this->render('cgu.phtml', $this->cgu)?>
</div>

View File

@ -0,0 +1,112 @@
<div id="center">
<h1 class="titre">Contentieux Judiciaires</h1>
<?php if ($this->msg) {?>
<div class="paragraph">
<div style="padding: 0 .7em;" class="ui-state-error ui-corner-all">
<p><span style="float: left; margin-right: .3em;" class="ui-icon ui-icon-alert"></span>
<strong>Alert:</strong> <?=$this->msg?></p>
</div>
</div>
<?php } else {?>
<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 de l'affaire</h2>
<div class="paragraph">
<table class="data">
<tbody>
<tr><td>Tribunal</td><td><?=$this->Affaire->GreffeLabel?></td></tr>
<tr>
<td>Date de l'affaire</td>
<td>
<?php
$dateString = '-';
try {
$date = new Zend_Date($this->Affaire->Date, 'y-MM-dd');
$dateString = $date->toString('dd/MM/y');
} catch(Zend_Date_Exception $e){}
?>
<?=$dateString?></td>
</tr>
<tr><td>Etat de l'affaire</td><td><?=$this->Affaire->StatusLabel?></td></tr>
<tr><td>Type de contentieux</td><td><?=$this->Affaire->CategoryLabel?></td></tr>
<tr><td>Nature de l'affaire</td><td><?=$this->Affaire->Label?></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') {?>
<div>
<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 }?>
</div>
<?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') {?>
<div>
<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 }?>
</div>
<?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>
<?php
$dateString = '-';
try {
$date = new Zend_Date($h->Date, 'y-MM-dd');
$dateString = $date->toString('dd/MM/y');
} catch(Zend_Date_Exception $e){}
?>
<?=$dateString?>
</td>
<td><?=$h->Label?></td>
</tr>
<?php }?>
<?php } else {?>
<tr><td colspan="2">- Aucune information -</td></tr>
<?php }?>
</tbody>
</table>
</div>
<?php }?>
</div>

View File

@ -4,7 +4,7 @@
<p><span style="float: left; margin-right: .3em;" class="ui-icon ui-icon-alert"></span>
<strong>Alert:</strong> <?=$this->msg?></p>
</div>
<?php } else if ($this->ref) {?>
Votre référence : <?=strtoupper($this->ref)?>

View File

@ -3,7 +3,9 @@ class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract
{
public function preDispatch(Zend_Controller_Request_Abstract $request)
{
$checkAuth = true;
Zend_Registry::get('firebug')->info('PLUGIN AUTH - START');
$checkAuth = true;
if ($request->getControllerName()=='user' && $request->getActionName()=='login') {
$checkAuth = false;
}
@ -150,5 +152,7 @@ class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract
}
}
}
Zend_Registry::get('firebug')->info('PLUGIN AUTH - END');
}
}

View File

@ -9,7 +9,9 @@ class Application_Controller_Plugin_Cgu extends Zend_Controller_Plugin_Abstract
*/
public function preDispatch(Zend_Controller_Request_Abstract $request)
{
$layout = Zend_Layout::getMVCInstance();
Zend_Registry::get('firebug')->info('PLUGIN CGU - START');
$layout = Zend_Layout::getMVCInstance();
if ($layout->isEnabled()) {
$tabCgu = array(
0 => 'La consultation ou la réception de documents n\'entraîne aucun '.
@ -55,5 +57,6 @@ class Application_Controller_Plugin_Cgu extends Zend_Controller_Plugin_Abstract
break;
}
}
Zend_Registry::get('firebug')->info('PLUGIN CGU - END');
}
}

View File

@ -9,6 +9,8 @@ class Application_Controller_Plugin_Lang extends Zend_Controller_Plugin_Abstract
*/
public function preDispatch(Zend_Controller_Request_Abstract $request)
{
Zend_Registry::get('firebug')->info('PLUGIN LANG - START');
$auth = Zend_Auth::getInstance();
if ( $auth->hasIdentity() ) {
$identity = $auth->getIdentity();
@ -52,5 +54,7 @@ class Application_Controller_Plugin_Lang extends Zend_Controller_Plugin_Abstract
$registry = Zend_Registry::getInstance();
$registry->set('Zend_Locale', $locale);
$registry->set('Zend_Translate', $translate);
Zend_Registry::get('firebug')->info('PLUGIN LANG - END');
}
}

View File

@ -7,7 +7,9 @@ class Application_Controller_Plugin_Menu extends Zend_Controller_Plugin_Abstract
*/
public function preDispatch(Zend_Controller_Request_Abstract $request)
{
$layout = Zend_Layout::getMVCInstance();
Zend_Registry::get('firebug')->info('PLUGIN MENU - START');
$layout = Zend_Layout::getMVCInstance();
$user = new Scores_Utilisateur();
if ( $user->isLog() && $layout->isEnabled() && $request->getControllerName()!='print' )
@ -77,5 +79,7 @@ class Application_Controller_Plugin_Menu extends Zend_Controller_Plugin_Abstract
{
//$view->aide = true;
}
Zend_Registry::get('firebug')->info('PLUGIN MENU - END');
}
}

View File

@ -3,7 +3,9 @@ class Application_Controller_Plugin_Pdf extends Zend_Controller_Plugin_Abstract
{
public function dispatchLoopShutdown()
{
$layout = Zend_Layout::getMVCInstance();
Zend_Registry::get('firebug')->info('PLUGIN PDF - START');
$layout = Zend_Layout::getMVCInstance();
if ($layout->isEnabled()) {
$controller = $this->_request->getControllerName();
$action = $this->_request->getActionName();
@ -18,5 +20,7 @@ class Application_Controller_Plugin_Pdf extends Zend_Controller_Plugin_Abstract
file_put_contents($c->profil->path->shared.'/temp/pages/'.$filename.'.html', $content);
}
}
Zend_Registry::get('firebug')->info('PLUGIN PDF - END');
}
}

View File

@ -3,7 +3,9 @@ class Application_Controller_Plugin_Theme extends Zend_Controller_Plugin_Abstrac
{
public function preDispatch(Zend_Controller_Request_Abstract $request)
{
$auth = Zend_Auth::getInstance();
Zend_Registry::get('firebug')->info('PLUGIN THEME - START');
$auth = Zend_Auth::getInstance();
$theme = 'default'; //$theme = 'mobile';
if ( $auth->hasIdentity() ) {
$theme = !empty($auth->getIdentity()->theme) ? $auth->getIdentity()->theme : 'default';
@ -118,12 +120,12 @@ class Application_Controller_Plugin_Theme extends Zend_Controller_Plugin_Abstrac
$view->headScript()
->appendFile('/libs/html5shiv.min.js', 'text/javascript', array('conditional' => 'lt IE 9'))
->appendFile('/libs/respond.min.js', 'text/javascript', array('conditional' => 'lt IE 9'))
->appendFile('/libs/jquery/jquery-1.12.0.min.js', 'text/javascript')
->appendFile('/libs/jquery/jquery-1.12.3.min.js', 'text/javascript')
->appendFile('/libs/jquery/jquery.placeholder.js', 'text/javascript')
->appendFile('/libs/bootstrap-3.3.6/js/bootstrap.min.js', 'text/javascript');
} else {
$view->headScript()
->appendFile('/libs/jquery/jquery-1.12.0.min.js', 'text/javascript');
->appendFile('/libs/jquery/jquery-1.12.3.min.js', 'text/javascript');
}
if ($isIE6) {
@ -184,5 +186,7 @@ class Application_Controller_Plugin_Theme extends Zend_Controller_Plugin_Abstrac
break;
}
Zend_Registry::get('firebug')->info('PLUGIN THEME - STOP');
}
}

View File

@ -3,7 +3,9 @@ class Application_Controller_Plugin_Xml extends Zend_Controller_Plugin_Abstract
{
public function dispatchLoopShutdown()
{
$layout = Zend_Layout::getMVCInstance();
Zend_Registry::get('firebug')->info('PLUGIN XML - START');
$layout = Zend_Layout::getMVCInstance();
if ($layout->isEnabled()) {
$user = new Scores_Utilisateur();
@ -17,5 +19,7 @@ class Application_Controller_Plugin_Xml extends Zend_Controller_Plugin_Abstract
$page->objectToXML($view->exportObjet, $this->_request->getParams());
}
}
Zend_Registry::get('firebug')->info('PLUGIN XML - END');
}
}

View File

@ -77,7 +77,7 @@ class Scores_Insee_AvisSituation
$date_creation = 0;
$date_modification = 0;
}
if ($nb>0 && $date_modification<$date_creation+$this->retryDelay){
if ($nb > 0 && $date_modification < $date_creation + $this->retryDelay) {
return true;
} else {
return false;
@ -89,10 +89,10 @@ class Scores_Insee_AvisSituation
$user = new Scores_Utilisateur();
$objet = "AVIS INSEE - (Date :".date("d")."/".date("m")."/".date("Y").")";
$texte = 'Accès impossible au site de situation INSEE : '.
$this->siret.EOL.
'http://avis-situation-sirene.insee.fr'.EOL.
'pour login '.$user->getLogin().EOL;
$texte = "Accès impossible au site de situation INSEE : ".
$this->siret."\n".
"http://avis-situation-sirene.insee.fr"."\n".
"pour login ".$user->getLogin()."\n";
$mail = new Scores_Mail_Method();
$mail->setFromKey('contact');

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 Judiciaires",
'controller' => 'juridique',
'action' => 'ctx',
),
array(
'label' => "Information Réglementée",
'controller' => 'juridique',

View File

@ -142,7 +142,7 @@ class Scores_Ws_Client extends Zend_Soap_Client
}
$methodConfig = $this->config[$name];
Zend_Registry::get('firebug')->info($methodConfig);
// --- Cache
$cacheEnable = false;
if ( array_key_exists('cache', $methodConfig) ) {
@ -197,6 +197,7 @@ class Scores_Ws_Client extends Zend_Soap_Client
// --- Gestion des SOAP fault
if ( array_key_exists('errorMsg', $methodConfig) ) {
if ( in_array($fault->faultcode, $methodConfig['errorMsg']) ) {
Zend_Registry::get('firebug')->info("Exception as error message : ".$fault->faultcode);
throw new Exception($fault->faultstring);
}
}

View File

@ -1,14 +1,24 @@
<?php
return array(
'0.9' => array(
'getGreffeAffaireList' => array(
'debug' => true,
'errorMsg' => array('0902'),
),
'getGreffeAffaireDetail' => array(
'debug' => true,
'errorMsg' => array('0902'),
),
'getIdentite' => array(
'debug' => true,
),
'getPrivilegeDetail' => array(
'debug' => true,
'errorMsg' => array('0902'),
),
'getPrivilegeList' => array(
'debug' => true,
'errorMsg' => array('0902'),
),
'getRNVP' => array(
'debug' => true,

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long