diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 8748b283abe..2b9163886f4 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1149,7 +1149,16 @@ if (empty($reshook)) $action = 'edit_extras'; } - include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; + if ($action == 'set_thirdparty' && $user->rights->commande->creer) + { + $object->fetch($id); + $object->setValueFrom('fk_soc', $socid); + + header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id); + exit(); + } + + include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; /* @@ -1812,8 +1821,19 @@ if ($action == 'create' && $user->rights->commande->creer) print ''; // Third party - print '
| ' . $langs->trans('Company') . ' | '; + print ''; + if (! empty($conf->global->COMMANDE_CHANGE_THIRDPARTY) && $action != 'editthirdparty' && $object->brouillon && $user->rights->commande->creer) + print ' | id . '">' . img_edit($langs->trans('SetLinkToThirdParty'), 1) . ' | '; + print '||||