diff --git a/includes/export.php b/includes/export.php index eb659d6dd..66de57d10 100644 --- a/includes/export.php +++ b/includes/export.php @@ -104,7 +104,7 @@ class ExportCSV { fclose($fp); } - function array_flatten($array, &$newArray = Array() ,$prefix='',$delimiter='|') { + function array_flatten($array, &$newArray = Array(), $prefix='', $delimiter='|') { foreach ($array as $key => $child) { if (is_array($child)) { $newPrefix = $prefix.$key.$delimiter; @@ -118,6 +118,58 @@ class ExportCSV { } +class tabExport { + + public $tab = array(); + public $notdisplay = array(); + public $title = array(); + public $type = array(); + + public $convert = array(); + + function __construct() {} + + function convertTable(){ + $this->convert = $this->rArray($this->tab); + return $this->convert; + } + + function rArray($array) { + foreach ($array as $key => $child) { + if (is_array($child)) { + if(!in_array($key, $this->notdisplay, TRUE)){ + $newArray[$this->renameKey($key)] = $this->rArray($child); + } + }else{ + if(!in_array($key, $this->notdisplay, TRUE)){ + $newArray[$this->renameKey($key)] = $this->convertValue($key, $child); + } + } + } + return $newArray; + } + + function renameKey($key){ + $newKey = $key; + if(array_key_exists($key, $this->title)){ + $newKey = $this->title[$key]; + } + return $newKey; + } + + function convertValue($key, $value){ + if(array_key_exists($key, $this->type)){ + switch($this->type[$key]){ + case 'date': + //Test des différents formats de value + + break; + } + } + return $value; + } +} + class ExportPDF { function __construct(){} diff --git a/www/exportcsv.php b/www/exportcsv.php index d94cf7357..5eb2ae9b2 100644 --- a/www/exportcsv.php +++ b/www/exportcsv.php @@ -13,9 +13,11 @@ if (($siret*1)==0 || ($siren*1)<100){ $fileName = $path.'/'.$page.'-'.$siret; } -//Gestion des cas particulier +//Gestion des cas particuliers if($page=='dirigeants' && $_REQUEST['vue']=='histo'){ $fileName.= '-histo'; +}elseif($page=='annonces'){ + if(isset($_REQUEST['vue']) && $$_REQUEST['vue']!=''){$fileName.= '-'.$_REQUEST['vue'];} } //Ajout de l'extension diff --git a/www/exportpdf.php b/www/exportpdf.php index 56ce204e4..f892f4ab0 100644 --- a/www/exportpdf.php +++ b/www/exportpdf.php @@ -38,6 +38,8 @@ if (($siret*1)==0 || ($siren*1)<100){ //Gestion des cas particulier if($page=='dirigeants' && $_REQUEST['vue']=='histo'){ $fileName.= '-histo'; +}elseif($page=='annonces'){ + if(isset($_REQUEST['vue']) && $$_REQUEST['vue']!=''){$fileName.= '-'.$_REQUEST['vue'];} } //Ajout de l'extension diff --git a/www/exportxml.php b/www/exportxml.php index 9325d7a9c..809239ca4 100644 --- a/www/exportxml.php +++ b/www/exportxml.php @@ -16,6 +16,8 @@ if (($siret*1)==0 || ($siren*1)<100){ //Gestion des cas particulier if($page=='dirigeants' && $_REQUEST['vue']=='histo'){ $fileName.= '-histo'; +}elseif($page=='annonces'){ + if(isset($_REQUEST['vue']) && $$_REQUEST['vue']!=''){$fileName.= '-'.$_REQUEST['vue'];} } //Ajout de l'extension diff --git a/www/pages/menu2.php b/www/pages/menu2.php index 598d18975..3e853b239 100644 --- a/www/pages/menu2.php +++ b/www/pages/menu2.php @@ -222,7 +222,8 @@ if ($page=='identite' || $page=='etablissements' || $page=='liens' || $page=='evenements' || - $page=='dirigeants'){ + $page=='dirigeants'|| + $page=='annonces'){ ?> PDF  CSV