Merge pull request #1587 from aternatik/odt_thirdpartycontact
Fix : bad call of extrafields into contact substitution
This commit is contained in:
commit
6b1bdf9913
@ -110,7 +110,7 @@ abstract class CommonDocGenerator
|
||||
'mycompany_web'=>$mysoc->url,
|
||||
'mycompany_juridicalstatus'=>$mysoc->forme_juridique,
|
||||
'mycompany_managers'=>$mysoc->managers,
|
||||
'mycompany_capital'=>$mysoc->capital,
|
||||
'mycompany_capital'=>$mysoc->capital,
|
||||
'mycompany_barcode'=>$mysoc->barcode,
|
||||
'mycompany_idprof1'=>$mysoc->idprof1,
|
||||
'mycompany_idprof2'=>$mysoc->idprof2,
|
||||
@ -254,24 +254,22 @@ abstract class CommonDocGenerator
|
||||
);
|
||||
|
||||
// Retrieve extrafields
|
||||
if (is_array($object->array_options) && count($object->array_options)) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
|
||||
$extrafields = new ExtraFields($this->db);
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('contact', true);
|
||||
$object->fetch_optionals($object->id, $extralabels);
|
||||
|
||||
foreach($extrafields->attribute_label as $key => $label)
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
|
||||
$extrafields = new ExtraFields($this->db);
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('socpeople', true);
|
||||
$object->fetch_optionals($object->id, $extralabels);
|
||||
|
||||
foreach($extrafields->attribute_label as $key => $label)
|
||||
{
|
||||
if ($extrafields->attribute_type[$key] == 'price')
|
||||
{
|
||||
if ($extrafields->attribute_type[$key] == 'price')
|
||||
{
|
||||
$object->array_options['options_' . $key] = price($object->array_options ['options_' . $key], 0, $outputlangs, 0, 0, - 1, $conf->currency);
|
||||
}
|
||||
elseif($extrafields->attribute_type[$key] == 'select')
|
||||
{
|
||||
$object->array_options['options_' . $key] = $extrafields->attribute_param[$key]['options'][$object->array_options['options_' . $key]];
|
||||
}
|
||||
$array_contact = array_merge($array_contact, array('contact_options_' . $key => $object->array_options['options_'. $key]));
|
||||
$object->array_options['options_' . $key] = price($object->array_options ['options_' . $key], 0, $outputlangs, 0, 0, - 1, $conf->currency);
|
||||
}
|
||||
elseif($extrafields->attribute_type[$key] == 'select')
|
||||
{
|
||||
$object->array_options['options_' . $key] = $extrafields->attribute_param[$key]['options'][$object->array_options['options_' . $key]];
|
||||
}
|
||||
$array_contact = array_merge($array_contact, array($array_key.'_options_' . $key => $object->array_options['options_'. $key]));
|
||||
}
|
||||
return $array_contact;
|
||||
}
|
||||
|
||||
@ -329,7 +329,6 @@ class doc_generic_odt extends ModeleThirdPartyDoc
|
||||
foreach($contact_arrray as $array_key => $contact_id)
|
||||
{
|
||||
$res_contact = $contactstatic->fetch($contact_id);
|
||||
//$contact['fullname']=$objectdetail->getFullName($outputlangs,1);
|
||||
$tmparray=$this->get_substitutionarray_contact($contactstatic,$outputlangs,'contact');
|
||||
foreach($tmparray as $key => $val)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user