diff --git a/core/tpl/easycrm_quickcreation_actions.tpl.php b/core/tpl/easycrm_quickcreation_actions.tpl.php index 9830899..f0bdb32 100644 --- a/core/tpl/easycrm_quickcreation_actions.tpl.php +++ b/core/tpl/easycrm_quickcreation_actions.tpl.php @@ -25,6 +25,7 @@ $thirdparty->email = trim(GETPOST('email_thirdparty', 'custom', 0, FILTER_SANITIZE_EMAIL)); $thirdparty->url = trim(GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL)); $thirdparty->note_private = GETPOST('note_private'); + $thirdparty->country_id = $mysoc->country_id; $thirdpartyID = $thirdparty->create($user); if ($thirdpartyID > 0) { @@ -60,10 +61,13 @@ } if (!empty(GETPOST('title'))) { - $project->socid = !empty($thirdpartyID) ? $thirdpartyID : ''; - $project->ref = GETPOST('ref'); - $project->title = GETPOST('title'); - $project->opp_status = GETPOST('opp_status', 'int'); + $project->socid = !empty($thirdpartyID) ? $thirdpartyID : ''; + $project->ref = GETPOST('ref'); + $project->title = GETPOST('title'); + $project->opp_status = GETPOST('opp_status', 'int'); + + $extrafields->fetch_name_optionals_label($project->table_element); + $extrafields->setOptionalsFromPost([], $project); switch ($project->opp_status) { case 2: diff --git a/view/quickcreation.php b/view/quickcreation.php index 93f7f72..1ccd746 100644 --- a/view/quickcreation.php +++ b/view/quickcreation.php @@ -48,7 +48,7 @@ } // Global variables definitions -global $conf, $db, $hookmanager, $langs, $user; +global $conf, $db, $hookmanager, $mysoc, $langs, $user; // Load translation files required by the page saturne_load_langs(['categories']);