selection des types de surveillances sours forme de checkbox, le formulaire renvoi un tableau
This commit is contained in:
parent
77218c7c4a
commit
adc3d1e46f
@ -13,12 +13,12 @@
|
||||
*/
|
||||
function formSurveillance($source, $siret, $notEmail, $displayAjax = TRUE){
|
||||
$assocSourceTxt = array(
|
||||
'annonces' => 'les annonces légales',
|
||||
'insee' => 'les événements INSEE',
|
||||
'bilans' => 'les bilans',
|
||||
'score' => 'IndiScore',
|
||||
'actes' => 'les actes & status',
|
||||
'dirigeants' => 'les dirigeants',
|
||||
'annonces' => 'les annonces légales',
|
||||
'insee' => 'les événements INSEE',
|
||||
'bilans' => 'les bilans',
|
||||
'score' => 'IndiScore',
|
||||
'actes' => 'les actes & status',
|
||||
'dirigeants' => 'les dirigeants',
|
||||
);
|
||||
|
||||
$fileStyle = 'style.css';
|
||||
@ -35,23 +35,23 @@ function formSurveillance($source, $siret, $notEmail, $displayAjax = TRUE){
|
||||
$formHTML.= '<script type="text/javascript" src="./js/jquery.form.js"></script>'."\n";
|
||||
$formHTML.= '<script type="text/javascript">'.$js.'</script>'."\n";
|
||||
$formHTML.= '<style type="text/css">'.$style.'</style>'."\n";
|
||||
$formHTML.= '<form id="frmSurv" name="frmSurv" action="./pages/ajax_surveillance.php" method="POST">'."\n";
|
||||
$formHTML.= '<form id="frmSurv" name="frmSurv" action="./pages/ajax_surveillance.php" method="post">'."\n";
|
||||
if($displayAjax){
|
||||
$formHTML.= '<input name="surveillance" type="checkbox"/> Mettre sous surveillance '.$assocSourceTxt[$source].'<br/>'."\n";
|
||||
}
|
||||
$formHTML.= '<input name="q" type="hidden" value="setsurv"/>';
|
||||
$formHTML.= '<input name="formSurv[siret]" type="hidden" value="'.$siret.'"/>'."\n";
|
||||
|
||||
if(empty($source)){
|
||||
if(empty($source))
|
||||
{
|
||||
$formHTML.= '<div class="fieldgrp">'."\n";
|
||||
$formHTML.= '<label>Mettre en surveillance</label>'."\n";
|
||||
$formHTML.= '<label>Types</label>'."\n";
|
||||
$formHTML.= '<div class="field">'."\n";
|
||||
$formHTML.= '<select name="formSurv[source]">'."\n";
|
||||
foreach($assocSourceTxt as $Source => $Txt)
|
||||
{
|
||||
$formHTML.='<option value="'.$Source.'">'.$Txt.'</option>'."\n";
|
||||
//TODO : Vérifier les droits de mis en surveillance
|
||||
$formHTML.='<input type="checkbox" name="formSurv[source][]" value="'.$Source.'" checked/> '.$Txt."<br/>\n";
|
||||
}
|
||||
$formHTML.= '</select>'."\n";
|
||||
$formHTML.= '</div>'."\n";
|
||||
$formHTML.= '</div>'."\n";
|
||||
}else{
|
||||
@ -168,9 +168,18 @@ function setSurveillance($tabForm){
|
||||
$email = $tabForm['email'];
|
||||
$ref = $tabForm['ref'];
|
||||
$source = $tabForm['source'];
|
||||
$message = '';
|
||||
try{
|
||||
$result = $client->setSurveillance($siret, $email, $ref, $source);
|
||||
if(is_array($source))
|
||||
{
|
||||
foreach($source as $s)
|
||||
{
|
||||
$result = $client->setSurveillance($siret, $email, $ref, $s);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $client->setSurveillance($siret, $email, $ref, $source);
|
||||
}
|
||||
$firephp->log('Mise sous surveillance OK');
|
||||
return $result;
|
||||
}catch(SoapFault $fault){
|
||||
|
Loading…
x
Reference in New Issue
Block a user