FIX : tool export handle the type "select" extrafields and return the value instead of id
This commit is contained in:
parent
34468644ef
commit
06962cb4e6
@ -252,6 +252,13 @@ class ExportCsv extends ModeleExports
|
|||||||
|
|
||||||
$newvalue=$this->csv_clean($newvalue,$outputlangs->charset_output);
|
$newvalue=$this->csv_clean($newvalue,$outputlangs->charset_output);
|
||||||
|
|
||||||
|
if (preg_match('/^Select:/i', $typefield, $reg) && $typefield = substr($typefield, 7))
|
||||||
|
{
|
||||||
|
$array = unserialize($typefield);
|
||||||
|
$array = $array['options'];
|
||||||
|
$newvalue = $array[$newvalue];
|
||||||
|
}
|
||||||
|
|
||||||
fwrite($this->handle,$newvalue.$this->separator);
|
fwrite($this->handle,$newvalue.$this->separator);
|
||||||
$this->col++;
|
$this->col++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -306,6 +306,13 @@ class ExportExcel extends ModeleExports
|
|||||||
$newvalue=$this->excel_clean($newvalue);
|
$newvalue=$this->excel_clean($newvalue);
|
||||||
$typefield=isset($array_types[$code])?$array_types[$code]:'';
|
$typefield=isset($array_types[$code])?$array_types[$code]:'';
|
||||||
|
|
||||||
|
if (preg_match('/^Select:/i', $typefield, $reg) && $typefield = substr($typefield, 7))
|
||||||
|
{
|
||||||
|
$array = unserialize($typefield);
|
||||||
|
$array = $array['options'];
|
||||||
|
$newvalue = $array[$newvalue];
|
||||||
|
}
|
||||||
|
|
||||||
// Traduction newvalue
|
// Traduction newvalue
|
||||||
if (preg_match('/^\((.*)\)$/i',$newvalue,$reg))
|
if (preg_match('/^\((.*)\)$/i',$newvalue,$reg))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -227,6 +227,13 @@ class ExportTsv extends ModeleExports
|
|||||||
|
|
||||||
$newvalue=$this->tsv_clean($newvalue,$outputlangs->charset_output);
|
$newvalue=$this->tsv_clean($newvalue,$outputlangs->charset_output);
|
||||||
|
|
||||||
|
if (preg_match('/^Select:/i', $typefield, $reg) && $typefield = substr($typefield, 7))
|
||||||
|
{
|
||||||
|
$array = unserialize($typefield);
|
||||||
|
$array = $array['options'];
|
||||||
|
$newvalue = $array[$newvalue];
|
||||||
|
}
|
||||||
|
|
||||||
fwrite($this->handle,$newvalue.$this->separator);
|
fwrite($this->handle,$newvalue.$this->separator);
|
||||||
$this->col++;
|
$this->col++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -355,6 +355,9 @@ class modSociete extends DolibarrModules
|
|||||||
case 'sellist':
|
case 'sellist':
|
||||||
$typeFilter="List:".$obj->param;
|
$typeFilter="List:".$obj->param;
|
||||||
break;
|
break;
|
||||||
|
case 'select':
|
||||||
|
$typeFilter="Select:".$obj->param;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
$this->export_fields_array[$r][$fieldname]=$fieldlabel;
|
$this->export_fields_array[$r][$fieldname]=$fieldlabel;
|
||||||
$this->export_TypeFields_array[$r][$fieldname]=$typeFilter;
|
$this->export_TypeFields_array[$r][$fieldname]=$typeFilter;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user