From 1bde35f98e0ad8c2316085014a96b487a56b0985 Mon Sep 17 00:00:00 2001 From: abb Date: Sun, 13 Dec 2015 12:10:43 +0100 Subject: [PATCH] add change customer function in customer orders --- htdocs/commande/card.php | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) 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 '' . $soc->getNomUrl(1) . ''; + print ''; + print ''; + print ''; + print ''; + print '
' . $langs->trans('Company') . ''; + if (! empty($conf->global->COMMANDE_CHANGE_THIRDPARTY) && $action != 'editthirdparty' && $object->brouillon && $user->rights->commande->creer) + print 'id . '">' . img_edit($langs->trans('SetLinkToThirdParty'), 1) . '
'; + print ''; + if ($action == 'editthirdparty') { + $form->form_thirdparty($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, 'socid','client>0'); + } else { + print '  ' . $soc->getNomUrl(1, 'compta'); + } print ''; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {