mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-14 08:54:21 +01:00
Call exclude() when updating status to -2
This commit is contained in:
@@ -329,7 +329,7 @@ class Members extends DolibarrApi
|
||||
continue;
|
||||
}
|
||||
// Process the status separately because it must be updated using
|
||||
// the validate() and resiliate() methods of the class Adherent.
|
||||
// the validate(), resiliate() and exclude() methods of the class Adherent.
|
||||
if ($field == 'statut') {
|
||||
if ($value == '0') {
|
||||
$result = $member->resiliate(DolibarrApiAccess::$user);
|
||||
@@ -341,6 +341,11 @@ class Members extends DolibarrApi
|
||||
if ($result < 0) {
|
||||
throw new RestException(500, 'Error when validating member: '.$member->error);
|
||||
}
|
||||
} elseif ($value == '-2') {
|
||||
$result = $member->exclude(DolibarrApiAccess::$user);
|
||||
if ($result < 0) {
|
||||
throw new RestException(500, 'Error when excluding member: '.$member->error);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$member->$field = $value;
|
||||
|
||||
Reference in New Issue
Block a user