From adc3d1e46f19f2ca5149982df14732f20707a1f5 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Wed, 16 Dec 2009 08:17:03 +0000 Subject: [PATCH] selection des types de surveillances sours forme de checkbox, le formulaire renvoi un tableau --- includes/surveillance/surveillance.php | 37 ++++++++++++++++---------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/includes/surveillance/surveillance.php b/includes/surveillance/surveillance.php index 11e65b712..a1c8ea4e5 100644 --- a/includes/surveillance/surveillance.php +++ b/includes/surveillance/surveillance.php @@ -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.= ''."\n"; $formHTML.= ''."\n"; $formHTML.= ''."\n"; - $formHTML.= '
'."\n"; + $formHTML.= ''."\n"; if($displayAjax){ $formHTML.= ' Mettre sous surveillance '.$assocSourceTxt[$source].'
'."\n"; } $formHTML.= ''; $formHTML.= ''."\n"; - if(empty($source)){ + if(empty($source)) + { $formHTML.= '
'."\n"; - $formHTML.= ''."\n"; + $formHTML.= ''."\n"; $formHTML.= '
'."\n"; - $formHTML.= ' '.$Txt."
\n"; } - $formHTML.= ''."\n"; $formHTML.= '
'."\n"; $formHTML.= '
'."\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){