selection des types de surveillances sours forme de checkbox, le formulaire renvoi un tableau

This commit is contained in:
Michael RICOIS 2009-12-16 08:17:03 +00:00
parent 77218c7c4a
commit adc3d1e46f

View File

@ -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/>&nbsp;'.$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{
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){