2
0
forked from Wavyzz/dolibarr

FIX : tool export handle the type "select" extrafields and return the value instead of id

This commit is contained in:
phf
2015-06-23 16:26:05 +02:00
parent 34468644ef
commit 06962cb4e6
4 changed files with 26 additions and 2 deletions

View File

@@ -252,6 +252,13 @@ class ExportCsv extends ModeleExports
$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);
$this->col++;
}

View File

@@ -305,7 +305,14 @@ class ExportExcel extends ModeleExports
$newvalue=$this->excel_clean($newvalue);
$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
if (preg_match('/^\((.*)\)$/i',$newvalue,$reg))
{

View File

@@ -226,7 +226,14 @@ class ExportTsv extends ModeleExports
if (preg_match('/^\((.*)\)$/i',$newvalue,$reg)) $newvalue=$outputlangs->transnoentities($reg[1]);
$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);
$this->col++;
}

View File

@@ -355,6 +355,9 @@ class modSociete extends DolibarrModules
case 'sellist':
$typeFilter="List:".$obj->param;
break;
case 'select':
$typeFilter="Select:".$obj->param;
break;
}
$this->export_fields_array[$r][$fieldname]=$fieldlabel;
$this->export_TypeFields_array[$r][$fieldname]=$typeFilter;