diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php index 8467e31ed8e69aab7a9c70feab68bf12e43f72aa..6775ff49fce9b913f9047bed44e1b90ad17bf3f7 100644 --- a/htdocs/exports/class/export.class.php +++ b/htdocs/exports/class/export.class.php @@ -280,7 +280,7 @@ class Export } // end of special operation processing - $objmodel->write_record($this->array_export_fields[$indice],$array_selected,$objp,$outputlangs); + $objmodel->write_record($array_selected,$objp,$outputlangs); } // Genere en-tete diff --git a/htdocs/includes/modules/export/export_csv.modules.php b/htdocs/includes/modules/export/export_csv.modules.php index b60f6f2dd8a2ee2cc9383b65b691aaaf8f80cac3..293f8f14ebef0a8082a609ee53a8279e25e6dc0d 100644 --- a/htdocs/includes/modules/export/export_csv.modules.php +++ b/htdocs/includes/modules/export/export_csv.modules.php @@ -147,8 +147,10 @@ class ExportCsv extends ModeleExports /** - * \brief Output title line into file - * \param langs Output language + * Output title line into file + * @param array_export_fields_label Array with list of label of fields + * @param array_selected_sorted Array with list of field to export + * @param outputlangs Object lang to translate values */ function write_title($array_export_fields_label,$array_selected_sorted,$outputlangs) { @@ -176,9 +178,12 @@ class ExportCsv extends ModeleExports /** - * \brief Output record line into file + * Output record line into file + * @param array_selected_sorted Array with list of field to export + * @param objp A record from a fetch with all fields from select + * @param outputlangs Object lang to translate values */ - function write_record($array_alias,$array_selected_sorted,$objp,$outputlangs) + function write_record($array_selected_sorted,$objp,$outputlangs) { global $conf; diff --git a/htdocs/includes/modules/export/export_excel.modules.php b/htdocs/includes/modules/export/export_excel.modules.php index cc06e749f1df742270ba165927f56918b344a205..32cdc6f3e921d4404560e96a3663ff9d5c1f6ee7 100644 --- a/htdocs/includes/modules/export/export_excel.modules.php +++ b/htdocs/includes/modules/export/export_excel.modules.php @@ -20,7 +20,7 @@ /** * \file htdocs/includes/modules/export/export_excel.modules.php * \ingroup export - * \brief Fichier de la classe permettant de g�n�rer les export au format Excel + * \brief File of class to generate export file with Excel format * \author Laurent Destailleur * \version $Id$ */ diff --git a/htdocs/includes/modules/export/export_tsv.modules.php b/htdocs/includes/modules/export/export_tsv.modules.php index 218694016c2b685ccbbfc8e1ea3354331cb6cc94..9c90d1fcc94a2956cb3e2423703ddd019127733a 100644 --- a/htdocs/includes/modules/export/export_tsv.modules.php +++ b/htdocs/includes/modules/export/export_tsv.modules.php @@ -48,9 +48,9 @@ class ExportTsv extends ModeleExports /** - \brief Constructeur - \param db Handler acc�s base de donn�e - */ + * \brief Constructeur + * \param db Database handler + */ function ExportTsv($db) { global $conf; @@ -141,8 +141,10 @@ class ExportTsv extends ModeleExports /** - * \brief Output title line into file - * \param langs Output language + * Output title line into file + * @param array_export_fields_label Array with list of label of fields + * @param array_selected_sorted Array with list of field to export + * @param outputlangs Object lang to translate values */ function write_title($array_export_fields_label,$array_selected_sorted,$outputlangs) { @@ -159,14 +161,17 @@ class ExportTsv extends ModeleExports /** - * \brief Output record line into file + * Output record line into file + * @param array_selected_sorted Array with list of field to export + * @param objp A record from a fetch with all fields from select + * @param outputlangs Object lang to translate values */ - function write_record($array_alias,$array_selected_sorted,$objp,$outputlangs) + function write_record($array_selected_sorted,$objp,$outputlangs) { $this->col=0; foreach($array_selected_sorted as $code => $value) { - $alias=$array_alias[$code]; + $alias=str_replace(array('.','-'),'_',$code); if (empty($alias)) dol_print_error('','Bad value for field with code='.$code.'. Try to redefine export.'); $newvalue=$objp->$alias; diff --git a/htdocs/includes/modules/export/modules_export.php b/htdocs/includes/modules/export/modules_export.php index b0dbf3dcddeaef3747a4c4e908999721b062b471..460f5b429794cd2e3844ae3572a312751ce1e0ec 100644 --- a/htdocs/includes/modules/export/modules_export.php +++ b/htdocs/includes/modules/export/modules_export.php @@ -146,54 +146,6 @@ class ModeleExports return $this->libversion[$key]; } - - - /** - * \brief Lance la generation du fichier - * \remarks Les tableaux array_export_xxx sont deja chargees pour le bon datatoexport - * aussi le parametre datatoexport est inutilise - */ - /*function build_file($model, $datatoexport, $array_selected) - { - global $langs; - - dol_syslog("Export::build_file $model, $datatoexport, $array_selected"); - - // Creation de la classe d'export du model ExportXXX - $dir = DOL_DOCUMENT_ROOT . "/includes/modules/export/"; - $file = "export_".$model.".modules.php"; - $classname = "Export".$model; - require_once($dir.$file); - $obj = new $classname($db); - - // Execute requete export - $sql=$this->array_export_sql[0]; - $resql = $this->db->query($sql); - if ($resql) - { - // Genere en-tete - $obj->write_header(); - - // Genere ligne de titre - $obj->write_title(); - - while ($objp = $this->db->fetch_object($resql)) - { - $var=!$var; - $obj->write_record($array_selected,$objp); - } - - // Genere en-tete - $obj->write_footer(); - } - else - { - $this->error=$this->db->error(); - dol_syslog("Error: sql=$sql ".$this->error, LOG_ERR); - return -1; - } - }*/ - }