Correction selection tribunal mandataire
This commit is contained in:
parent
2bb8c99fc5
commit
7bbd13f369
@ -79,7 +79,8 @@ class MandataireController extends Zend_Controller_Action
|
||||
|
||||
//Les tribunaux
|
||||
$tmp = $ws->getTribunaux(array('C','I','G')); //
|
||||
$tribunaux = $tmp->result;
|
||||
|
||||
$tribunaux = $tmp->result->item;
|
||||
}else{
|
||||
$message = 'Pas de tribunal sélectionné.';
|
||||
}
|
||||
@ -87,6 +88,7 @@ class MandataireController extends Zend_Controller_Action
|
||||
$this->view->assign('message', $message);
|
||||
$this->view->assign('tabMandataires', $tabMandataires);
|
||||
$this->view->assign('coursAppel', $this->coursAppel);
|
||||
$this->view->assign('tribunal', $tribunal);
|
||||
$this->view->assign('tribunaux', $tribunaux);
|
||||
}
|
||||
|
||||
@ -179,12 +181,10 @@ class MandataireController extends Zend_Controller_Action
|
||||
public function getAction()
|
||||
{
|
||||
$this->_helper->layout->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$siren = $request->getParam('siren', '');
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
$siren = trim($siren);
|
||||
$request = $this->getRequest();
|
||||
$siren = $request->getParam('siren');
|
||||
$siren = str_replace(' ','',$siren); //Remplacer les espaces
|
||||
|
||||
if ( $siren=='' || strlen($siren)!=14 ) {
|
||||
@ -198,20 +198,19 @@ class MandataireController extends Zend_Controller_Action
|
||||
$tabEntrep = array();
|
||||
$ws = new WsScores();
|
||||
$tabEntrep = $ws->getIdentite($siren);
|
||||
|
||||
/**
|
||||
* Utiliser la raison sociale la plus longue
|
||||
* Nom, Nom2, NomLong
|
||||
*/
|
||||
if (!empty($tabEntrep->NomLong) &&
|
||||
strlen($tabEntrep->NomLong)>strlen($tabEntrep->Nom)){
|
||||
$tabEntrep->Nom = $tabEntrep->NomLong;
|
||||
if ($tabEntrep!==false){
|
||||
/**
|
||||
* Utiliser la raison sociale la plus longue
|
||||
* Nom, Nom2, NomLong
|
||||
*/
|
||||
if (!empty($tabEntrep->NomLong) && strlen($tabEntrep->NomLong)>strlen($tabEntrep->Nom)){
|
||||
$tabEntrep->Nom = $tabEntrep->NomLong;
|
||||
}
|
||||
|
||||
//Retourner le tableau sous forme json
|
||||
echo json_encode($tabEntrep);
|
||||
}
|
||||
|
||||
//Retourner le tableau sous forme json
|
||||
$tabEntrepD = $this->htmlentitydecode_deep($tabEntrep);
|
||||
echo json_encode($tabEntrepD);
|
||||
|
||||
}
|
||||
|
||||
public function saveAction()
|
||||
@ -223,8 +222,7 @@ class MandataireController extends Zend_Controller_Action
|
||||
|
||||
$error = false;
|
||||
|
||||
$tabMandataires = array();
|
||||
$tabMandataires = $_REQUEST['tabMandataires'];
|
||||
$tabMandataires = $request->getParam('tabMandataires', array());
|
||||
|
||||
//Vérification des données
|
||||
$fields = array();
|
||||
@ -250,6 +248,8 @@ class MandataireController extends Zend_Controller_Action
|
||||
if($tabMandataires['ville']==''){$fields[] ='Ville'; $error = true;}
|
||||
if($tabMandataires['tel']==''){$fields[] ='Téléphone'; $error = true;}
|
||||
|
||||
|
||||
|
||||
//Envoi de la requête au webservices
|
||||
if ($error==true){
|
||||
$message = '<font color="red">';
|
||||
|
@ -65,9 +65,10 @@ foreach ($this->tribunaux as $item)
|
||||
{
|
||||
$select = '';
|
||||
if ($tabMandataires['tribunal']==$item->code) $select = ' selected';
|
||||
elseif ($item->code==$tribunal) $select = ' selected';
|
||||
if (strlen($item->lib)>39) $lib=substr($item->lib,0,41).'...';
|
||||
echo '<option value="'.$item->code.'"'.$select.'>'.$item->lib.'</option>';
|
||||
elseif ($item->code==$this->tribunal) $select = ' selected';
|
||||
|
||||
if (strlen($item->nom)>39) $lib=substr($item->nom,0,41).'...';
|
||||
echo '<option value="'.$item->code.'"'.$select.'>'.$item->nom.'</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
Loading…
x
Reference in New Issue
Block a user