Ajout sources de surveillance actes et dirigeants

This commit is contained in:
Michael RICOIS 2009-09-18 14:33:42 +00:00
parent a65164f733
commit 4c8e3e29f8

View File

@ -17,6 +17,8 @@ function formSurveillance($source, $siret, $notEmail, $displayAjax = TRUE){
'insee' => 'les événements INSEE',
'bilans' => 'les bilans',
'score' => 'IndiScore',
'actes' => 'les actes & status',
'dirigeants' => 'les dirigeants',
);
$fileStyle = 'style.css';
@ -33,22 +35,22 @@ 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">';
$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/>';
$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.'"/>';
$formHTML.= '<input name="formSurv[source]" type="hidden" value="'.$source.'"/>';
$formHTML.= '<input name="formSurv[siret]" type="hidden" value="'.$siret.'"/>'."\n";
$formHTML.= '<input name="formSurv[source]" type="hidden" value="'.$source.'"/>'."\n";
$ref='';
if(isset($_REQUEST['ref'])){
$ref = $_REQUEST['ref'];
}
$formHTML.= '<div id="survForm">';
$formHTML.= '<div class="fieldgrp">';
$formHTML.= '<label class="StyleInfoLib">Votre référence</label><div class="field"><input name="formSurv[ref]" type="text" value="'.$ref.'" size="10"/></div>';
$formHTML.= '</div>';
$formHTML.= '<div id="survForm">'."\n";
$formHTML.= '<div class="fieldgrp">'."\n";
$formHTML.= '<label class="StyleInfoLib">Votre référence</label><div class="field"><input name="formSurv[ref]" type="text" value="'.$ref.'" size="10"/></div>'."\n";
$formHTML.= '</div>'."\n";
$email = '';
if(!in_array($_SESSION['tabInfo']['login'],$notEmail) && !isset($_REQUEST['email'])){
@ -56,14 +58,14 @@ function formSurveillance($source, $siret, $notEmail, $displayAjax = TRUE){
}elseif(isset($_REQUEST['email'])){
$email = $_REQUEST['email'];
}
$formHTML.= '<div class="fieldgrp">';
$formHTML.= '<label class="StyleInfoLib">Adresse email du destinataire</label><div class="field"><input name="formSurv[email]" type="text" value="'.$email.'" size="20"/></div>';
$formHTML.= '</div>';
$formHTML.= '<div class="submit"><p class="submit-button">';
$formHTML.= '<input class="submit" type="image" src="./img/boutton_valider_off.gif" name="submit" onmouseover="this.src=\'./img/boutton_valider_on.gif\'" onmouseout="this.src=\'./img/boutton_valider_off.gif\'" title="Mettre sous surveillance...">';
$formHTML.= '</p></div>';
$formHTML.= '</div>';
$formHTML.= '</form>';
$formHTML.= '<div class="fieldgrp">'."\n";;
$formHTML.= '<label class="StyleInfoLib">Adresse email du destinataire</label><div class="field"><input name="formSurv[email]" type="text" value="'.$email.'" size="20"/></div>'."\n";
$formHTML.= '</div>'."\n";;
$formHTML.= '<div class="submit"><p class="submit-button">'."\n";;
$formHTML.= '<input class="submit" type="image" src="./img/boutton_valider_off.gif" name="submit" onmouseover="this.src=\'./img/boutton_valider_on.gif\'" onmouseout="this.src=\'./img/boutton_valider_off.gif\'" title="Mettre sous surveillance...">'."\n";
$formHTML.= '</p></div>'."\n";
$formHTML.= '</div>'."\n";
$formHTML.= '</form>'."\n";
return $formHTML;
}
@ -85,24 +87,27 @@ function getSurveillance($page, $siret){
'evenements' => 'survinsee',
'liasse' => 'survbilan',
'indiscore' => 'survscore',
'actes' => 'survactes',
'dirigeants' => 'survdirigeants',
);
$assocPageSource = array(
'annonces' => 'annonces',
'evenements' => 'insee',
'liasse' => 'bilans',
'indiscore' => 'score',
'greffes' => 'actes',
'dirigeants' => 'dirigeants',
);
$return = '';
$firephp->log($_SESSION,'SESSION');
if(preg_match('/'.$assocPageDroit[$page].'/i', $_SESSION['tabInfo']['droits'])){
//if(preg_match('/'.$assocPageDroit[$page].'/i', $_SESSION['tabInfo']['droits'])){
if(preg_match('/voirsurv/i', $_SESSION['tabInfo']['pref']) && inSurveillance($assocPageSource[$page], $siret)){
$return = '<br/>L\'entité est sous surveillance.'."\n";
}else{
$notEmail = array('testreunica', 'reunicacsf');
$return = formSurveillance($assocPageSource[$page], $siret, $notEmail);
}
}
//}
return $return;
}