FIX hidden option MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN

This commit is contained in:
Laurent Destailleur 2017-09-11 13:39:03 +02:00
parent 7d42a58230
commit 59ab52c718
4 changed files with 8 additions and 4 deletions

View File

@ -398,6 +398,7 @@ if (empty($reshook))
} }
// Now we create same links to contact than the ones found on origin object // Now we create same links to contact than the ones found on origin object
/* Useless, already into the create
if (! empty($conf->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN)) if (! empty($conf->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN))
{ {
$originforcontact = $object->origin; $originforcontact = $object->origin;
@ -420,7 +421,7 @@ if (empty($reshook))
} }
} }
else dol_print_error($resqlcontact); else dol_print_error($resqlcontact);
} }*/
// Hooks // Hooks
$parameters = array('objFrom' => $srcobject); $parameters = array('objFrom' => $srcobject);

View File

@ -920,7 +920,8 @@ class Commande extends CommonOrder
foreach ($exp->linkedObjectsIds['commande'] as $key => $value) foreach ($exp->linkedObjectsIds['commande'] as $key => $value)
{ {
$originforcontact = 'commande'; $originforcontact = 'commande';
$originidforcontact = $value->id; if (is_object($value)) $originidforcontact = $value->id;
else $originidforcontact = $value;
break; // We take first one break; // We take first one
} }
} }

View File

@ -1299,6 +1299,7 @@ if (empty($reshook))
} }
// Now we create same links to contact than the ones found on origin object // Now we create same links to contact than the ones found on origin object
/* Useless, already into the create
if (! empty($conf->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN)) if (! empty($conf->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN))
{ {
$originforcontact = $object->origin; $originforcontact = $object->origin;
@ -1321,7 +1322,7 @@ if (empty($reshook))
} }
} }
else dol_print_error($resqlcontact); else dol_print_error($resqlcontact);
} }*/
// Hooks // Hooks
$parameters = array('objFrom' => $srcobject); $parameters = array('objFrom' => $srcobject);

View File

@ -498,7 +498,8 @@ class Facture extends CommonInvoice
foreach ($exp->linkedObjectsIds['commande'] as $key => $value) foreach ($exp->linkedObjectsIds['commande'] as $key => $value)
{ {
$originforcontact = 'commande'; $originforcontact = 'commande';
$originidforcontact = $value->id; if (is_object($value)) $originidforcontact = $value->id;
else $originidforcontact = $value;
break; // We take first one break; // We take first one
} }
} }