diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 00c5bb781b2..4ee23fd632b 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -136,9 +136,11 @@ if (empty($reshook)) { $error++; } - if (GETPOST('opp_amount') != '' && !(GETPOST('opp_status') > 0)) { - $error++; - setEventMessages($langs->trans("ErrorOppStatusRequiredIfAmount"), null, 'errors'); + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + if (GETPOST('opp_amount') != '' && !(GETPOST('opp_status') > 0)) { + $error++; + setEventMessages($langs->trans("ErrorOppStatusRequiredIfAmount"), null, 'errors'); + } } // Create with status validated immediatly @@ -274,9 +276,11 @@ if (empty($reshook)) { } } - if ($object->opp_amount && ($object->opp_status <= 0)) { - $error++; - setEventMessages($langs->trans("ErrorOppStatusRequiredIfAmount"), null, 'errors'); + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + if ($object->opp_amount && ($object->opp_status <= 0)) { + $error++; + setEventMessages($langs->trans("ErrorOppStatusRequiredIfAmount"), null, 'errors'); + } } if (!$error) {