FIX hidden option MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN

This commit is contained in:
Laurent Destailleur 2017-09-11 13:39:03 +02:00
parent 61a0f04bbe
commit b87ce172c3
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
/* Useless, already into the create
if (! empty($conf->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN))
{
$originforcontact = $object->origin;
@ -420,7 +421,7 @@ if (empty($reshook))
}
}
else dol_print_error($resqlcontact);
}
}*/
// Hooks
$parameters = array('objFrom' => $srcobject);

View File

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

View File

@ -1249,6 +1249,7 @@ if (empty($reshook))
}
// 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))
{
$originforcontact = $object->origin;
@ -1271,7 +1272,7 @@ if (empty($reshook))
}
}
else dol_print_error($resqlcontact);
}
}*/
// Hooks
$parameters = array('objFrom' => $srcobject);

View File

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