Bridage dès l'interface des commandes multiples, issue #0000191

This commit is contained in:
Michael RICOIS 2010-03-10 10:53:39 +00:00
parent 491fd8edd9
commit 603394843e

View File

@ -105,14 +105,45 @@ else
switch($vue)
{
case 'actes':
$info = unserialize(urldecode($_REQUEST['info']));
//Pour les actes multiples
//Vérifier que le fichier n'est pas déjà présent en local
$option = explode('-',$ref);
$num_actes = explode('|',$option[7]);
if(is_array($num_actes) && count($num_actes)>1){
$date = substr($info['date_acte'],6,4).
substr($info['date_acte'],3,2).
substr($info['date_acte'],0,2);
$option_reel = $info['type'].'-'.$date.'-'.
$option[2].'-'.$option[3].'-'.
$option[4].'-'.$option[5].'-'.
$option[6].'-'.$info['num_acte'];
$file = 'acte-'.$siren.'-'.$option_reel.'.pdf';
FB::log($file, 'file detection');
if( file_exists(PATH_DATA.'/pdf/'.$file) ){
if(!INFOGREFFE_DEBUG) {
$client->setLog('greffe_'.$vue, $siren, 0, $ref);
}
$message.= '<br/><a href="./datafile.php?q='.
$file.'&type=pdf" target="_blank">'.
'Ouvrir le fichier '.$info['type_lib'].
' </a>';
echo $message;
exit;
}
}
//Process normal
$reponse = getGreffeActes($siren, $vecteur, $ref);
$firephp->log($reponse, 'getGreffeActes');
if(empty($reponse['error'])) $items = $reponse['result']['actes'];
else $error = $reponse['error']['errNum'].' - '.$reponse['error']['errMsg'];
if(empty($reponse['error'])){
$items = $reponse['result']['actes'];
}else{
$error = $reponse['error']['errNum'].' - '.
$reponse['error']['errMsg'];
}
if($error=='')
{
$firephp->log($items, 'items');
$info = unserialize(urldecode($_REQUEST['info']));
foreach($items as $item)
{
$firephp->log($info, 'info');