Edition des annonces TESSI : reste un problème sur la selection du nic

This commit is contained in:
Michael RICOIS 2011-11-28 11:01:54 +00:00
parent f74441bd8e
commit ed3c5199a3
3 changed files with 74 additions and 59 deletions

View File

@ -717,6 +717,15 @@ class SaisieController extends Zend_Controller_Action
$nic = $request->getParam('nic', '');
$tribunal = $request->getParam('tribunal', '');
if(Zend_Session::namespaceIsset('saisie')){
$sessionSaisie = new Zend_Session_Namespace('saisie');
$this->view->assign('saisie', $sessionSaisie->tabSaisie);
$num = $sessionSaisie->tabSaisie['eventNum'];
$tribunal = $sessionSaisie->tabSaisie['tribunal'];
$siren = substr($siren, 0, 9);
$nic = substr($siren, 9, 5);
}
switch($num) {
case '5500':
//Liste des établissements
@ -883,7 +892,7 @@ class SaisieController extends Zend_Controller_Action
$siret = $request->getParam('siret');
$idan = $request->getParam('idan');
print_r($request->getParams());
@ -920,60 +929,72 @@ class SaisieController extends Zend_Controller_Action
$siren = substr($siret,0,9);
$nic = substr($siret,10,5);
if ( !empty($idan) ) {
if ( !empty($idan) )
{
$ws = new WsScores();
$reponse = $ws->getAnnonceCollecte($idan, $siret);
$idanResult = $reponse->result;
//Limitation des événements
$eventLimits = array('5500');
foreach ( $eventLimits as $eventLimit )
if ($reponse->error->errnum>0)
{
$isEditable = false;
foreach($idanResult->even->item as $even){
if ($eventLimit == $even->CodeEven){
$isEditable = true;
break;
}
}
if ( $isEditable && in_array($idanResult->source, array('JT', 'ANTE')))
$message = $reponse->error->errmsg;
$this->view->assign('message', $message);
}
else
{
$idanResult = $reponse->result;
//Limitation des événements
$eventLimits = array('5500');
foreach ( $eventLimits as $eventLimit )
{
//Mapper idanResult dans le tableau de saisie
$saisie = array(
'source' => isset($_SESSION['source']) ? $_SESSION['source'] : $idanResult->source,
'dateParution' => isset($_SESSION['dateParution']) ? $_SESSION['dateParution'] :
WDate::dateT('Y-m-d', 'd/m/Y', substr($idanResult->dateSource,0,10)),
'numParution' => isset($_SESSION['numParution']) ? $_SESSION['numParution'] : '',
'dateJugement' => WDate::dateT('Y-m-d', 'd/m/Y', $idanResult->dateEffetFinP),
'tribunal' => $idanResult->tribunal,
'even' => $idanResult->even->item,
'eventNum' => $eventLimit,
'comp' => $idanResult->complement,
'montant' => $idanResult->montant,
'dateFinPeriode' => WDate::dateT('Y-m-d', 'd/m/Y', $idanResult->dateJugement),
);
$intervenants = array();
for ( $i=0 ; $i<3 ; $i++ ) {
$intervenants[$i] = array(
'type' => $idanResult->{'inter'.($i+1).'type'},
'id' => $idanResult->{'inter'.($i+1).'id'},
'nom' => $idanResult->{'inter'.($i+1).'nom'},
$isEditable = false;
if (count($idanResult->even->item)>0){
foreach($idanResult->even->item as $even){
if ($eventLimit == $even->CodeEven){
$isEditable = true;
break;
}
}
}
if ( $isEditable && in_array($idanResult->source, array('JT', 'ANTE')))
{
//Mapper idanResult dans le tableau de saisie
$saisie = array(
'source' => isset($_SESSION['source']) ? $_SESSION['source'] : $idanResult->source,
'dateParution' => isset($_SESSION['dateParution']) ? $_SESSION['dateParution'] :
WDate::dateT('Y-m-d', 'd/m/Y', substr($idanResult->dateSource,0,10)),
'numParution' => isset($_SESSION['numParution']) ? $_SESSION['numParution'] : '',
'dateJugement' => WDate::dateT('Y-m-d', 'd/m/Y', $idanResult->dateEffetFinP),
'tribunal' => $idanResult->tribunal,
'even' => $idanResult->even->item,
'eventNum' => $eventLimit,
'comp' => $idanResult->complement,
'montant' => $idanResult->montant,
'dateFinPeriode' => WDate::dateT('Y-m-d', 'd/m/Y', $idanResult->dateJugement),
);
$intervenants = array();
for ( $i=0 ; $i<3 ; $i++ ) {
$intervenants[$i] = array(
'type' => $idanResult->{'inter'.($i+1).'type'},
'id' => $idanResult->{'inter'.($i+1).'id'},
'nom' => $idanResult->{'inter'.($i+1).'nom'},
);
}
$sessionSaisie = new Zend_Session_Namespace('saisie');
$sessionSaisie->tabSaisie = $saisie;
//require_once realpath(dirname(__FILE__)).'/constantes.php';
//require_once realpath(dirname(__FILE__)).'/saisie_form_event.php';
break;
} else {
$message = "Source : ".$idanResult->source."<br/>";
$message.= "Evénement(s) non éditable : <br/>";
foreach($idanResult->even->item as $even){
$message.= $even->CodeEven." - ".$this->tabEvent[$even->CodeEven]."<br/>";
}
$this->view->assign('message', $message);
}
$sessionSaisie = new Zend_Session_Namespace('saisie');
$sessionSaisie->tabSaisie = $saisie;
//require_once realpath(dirname(__FILE__)).'/constantes.php';
//require_once realpath(dirname(__FILE__)).'/saisie_form_event.php';
break;
} else {
$message = "Source : ".$idanResult->source."<br/>";
$message.= "Evénement(s) non éditable : <br/>";
foreach($idanResult->even->item as $even){
$message.= $even->CodeEven." - ".$this->tabEvent[$even->CodeEven]."<br/>";
}
$this->view->assign('message', $message);
}
}
}

View File

@ -1,10 +1,4 @@
<?php
if ( !isset($inEditDialog) || $inEditDialog === false ) {
$tribunal = (isset($_REQUEST['tribunal']) ? $_REQUEST['tribunal'] : '');
$siren = (isset($_REQUEST['siren']) ? $_REQUEST['siren'] : '');
$nic = (isset($_REQUEST['nic']) ? $_REQUEST['nic'] : '');
}
$tabPerimetreVente = array(
'5100' => "Fonds principal",
'5101' => "Fonds secondaire",
@ -24,10 +18,10 @@ $tabPerimetreVente = array(
<?=$this->action('champs', 'saisie', null, array('champ' => 'opposition'))?>
<label>Date de jouissance / effet :</label>
<input type="text" maxlength="10" class="date" name="jugement[dateFinPeriode]" value="<?=$saisie['dateFinPeriode']?>" />
<input type="text" maxlength="10" class="date" name="jugement[dateFinPeriode]" value="<?=$this->saisie['dateFinPeriode']?>" />
<span class="left">(Format JJ/MM/AAAA)</span>
<label>Montant de la vente</label>
<input type="text" class="widthauto" name="jugement[montant]" size="10" maxlength="15" value="<?=$saisie['montant']?>" />
<input type="text" class="widthauto" name="jugement[montant]" size="10" maxlength="15" value="<?=$this->saisie['montant']?>" />
<span class="left">en &euro; sans les cents</span>
<label>Etablissement concerné</label>
@ -50,7 +44,7 @@ foreach( $this->ListeEtablissements as $etablissement ) {
?>
</select>
<div class="info">
<a href="#" title="<?=$this->siren.$this->nic?>" id="etabnic">Utiliser l'établissement : <?=$this->nic?></a>
Utiliser l'établissement : <a href="#" title="<?=$this->siren.$this->nic?>" id="etabnic"><?=$this->nic?></a>
<div id="infoetabnic"></div>
<input type="hidden" name="etabnic" value=""/>
</div>

View File

@ -104,5 +104,5 @@ if (count($this->tabEvent)>0) {
?>
</select>
<div id="subFormSaisie">
<?=$this->action('even', 'saisie', null, array('num'=>$this->eventNum, 'siren'=>substr($this->siret,0,9)))?>
<?=$this->action('even', 'saisie', null, array('num'=>$this->eventNum, 'siren'=>$this->siret))?>
</div>