Skip to content

Commit

Permalink
Eoxia#87 [QuckCreation] fix: missing setOptionalsFromPost for extrafi…
Browse files Browse the repository at this point in the history
…elds
  • Loading branch information
nicolas-eoxia committed Jul 19, 2023
1 parent d9abd3c commit 2d8bf44
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions core/tpl/easycrm_quickcreation_actions.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion view/quickcreation.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down

0 comments on commit 2d8bf44

Please sign in to comment.