FIX: still prevent project creation if PROJECTLEADER role unavailable, but with a specific error message
This commit is contained in:
parent
7239fa3605
commit
f837845c12
@ -267,4 +267,5 @@ NewInvoice=New invoice
|
||||
OneLinePerTask=One line per task
|
||||
OneLinePerPeriod=One line per period
|
||||
RefTaskParent=Ref. Parent Task
|
||||
ProfitIsCalculatedWith=Profit is calculated using
|
||||
ProfitIsCalculatedWith=Profit is calculated using
|
||||
ErrorPROJECTLEADERRoleMissingOrDeActivatedPleaseRestoreItInContactTypesDictionary=The "PROJECTLEADER" role is missing or has been de-activited, please restore in the dictionary of contact types
|
||||
@ -178,7 +178,10 @@ if (empty($reshook))
|
||||
$result = $object->add_contact($user->id, $typeofcontact, 'internal');
|
||||
|
||||
// -3 means type not found (PROJECTLEADER renamed, de-activated or deleted), so don't prevent creation if it has been the case
|
||||
if ($result < 0 && $result != -3) {
|
||||
if ($result == -3) {
|
||||
setEventMessage('ErrorPROJECTLEADERRoleMissingOrDeActivatedPleaseRestoreItInContactTypesDictionary', 'errors');
|
||||
$error++;
|
||||
} elseif ($result < 0) {
|
||||
$langs->load("errors");
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$error++;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user