mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-24 18:31:29 +01:00
Qual: Export descriptor in modules are simpler
This commit is contained in:
@@ -149,7 +149,10 @@ class ExportExcel extends ModeleExports
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* 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)
|
||||
{
|
||||
@@ -179,9 +182,12 @@ class ExportExcel extends ModeleExports
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 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)
|
||||
{
|
||||
$outputlangs->charset_output='ISO-8859-1'; // Because Excel 5 format is ISO
|
||||
|
||||
@@ -197,7 +203,8 @@ class ExportExcel extends ModeleExports
|
||||
$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;
|
||||
|
||||
$newvalue=$this->excel_clean($newvalue);
|
||||
|
||||
@@ -150,10 +150,10 @@ class ModeleExports
|
||||
|
||||
/**
|
||||
* \brief Lance la generation du fichier
|
||||
* \remarks Les tableaux array_export_xxx sont d<EFBFBD>j<EFBFBD> charg<EFBFBD>es pour le bon datatoexport
|
||||
* aussi le parametre datatoexport est inutilis<EFBFBD>
|
||||
* \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)
|
||||
/*function build_file($model, $datatoexport, $array_selected)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
@@ -180,7 +180,7 @@ class ModeleExports
|
||||
while ($objp = $this->db->fetch_object($resql))
|
||||
{
|
||||
$var=!$var;
|
||||
$obj->write_record($objp,$array_selected);
|
||||
$obj->write_record($array_selected,$objp);
|
||||
}
|
||||
|
||||
// Genere en-tete
|
||||
@@ -192,7 +192,7 @@ class ModeleExports
|
||||
dol_syslog("Error: sql=$sql ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user