Fix opp statusbrequires even if PROJECT_USE_OPPORTUNITIES off
If I modify a project and do not have PROJECT_USE_OPPORTUNITIES enabled, I cannot change the project budget. I get the error message that ErrorOppStatusRequiredIfAmount. However, I do not have the opportunities enabled and it does not make sense for that message to appear when I have not added any opportunities.
This commit is contained in:
parent
ae2866ccd7
commit
f8563ace0d
@ -136,9 +136,11 @@ if (empty($reshook)) {
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GETPOST('opp_amount') != '' && !(GETPOST('opp_status') > 0)) {
|
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
|
||||||
$error++;
|
if (GETPOST('opp_amount') != '' && !(GETPOST('opp_status') > 0)) {
|
||||||
setEventMessages($langs->trans("ErrorOppStatusRequiredIfAmount"), null, 'errors');
|
$error++;
|
||||||
|
setEventMessages($langs->trans("ErrorOppStatusRequiredIfAmount"), null, 'errors');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create with status validated immediatly
|
// Create with status validated immediatly
|
||||||
@ -274,9 +276,11 @@ if (empty($reshook)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($object->opp_amount && ($object->opp_status <= 0)) {
|
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
|
||||||
$error++;
|
if ($object->opp_amount && ($object->opp_status <= 0)) {
|
||||||
setEventMessages($langs->trans("ErrorOppStatusRequiredIfAmount"), null, 'errors');
|
$error++;
|
||||||
|
setEventMessages($langs->trans("ErrorOppStatusRequiredIfAmount"), null, 'errors');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user