Fixing style errors.
This commit is contained in:
parent
1ae0e2a920
commit
b7045ef3a0
@ -561,35 +561,35 @@ if (empty($reshook)) {
|
|||||||
}
|
}
|
||||||
// Auto-create thirdparty on member creation
|
// Auto-create thirdparty on member creation
|
||||||
if (!empty($conf->global->ADHERENT_DEFAULT_CREATE_THIRDPARTY)) {
|
if (!empty($conf->global->ADHERENT_DEFAULT_CREATE_THIRDPARTY)) {
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
// User creation
|
// User creation
|
||||||
$company = new Societe($db);
|
$company = new Societe($db);
|
||||||
|
|
||||||
$companyalias = '';
|
$companyalias = '';
|
||||||
$fullname = $object->getFullName($langs);
|
$fullname = $object->getFullName($langs);
|
||||||
|
|
||||||
if ($object->morphy == 'mor') {
|
if ($object->morphy == 'mor') {
|
||||||
$companyname = $object->company;
|
$companyname = $object->company;
|
||||||
if (!empty($fullname)) {
|
if (!empty($fullname)) {
|
||||||
$companyalias = $fullname;
|
$companyalias = $fullname;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$companyname = $fullname;
|
$companyname = $fullname;
|
||||||
if (!empty($object->company)) {
|
if (!empty($object->company)) {
|
||||||
$companyalias = $object->company;
|
$companyalias = $object->company;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $company->create_from_member($object, $companyname, $companyalias);
|
$result = $company->create_from_member($object, $companyname, $companyalias);
|
||||||
|
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
setEventMessages($langs->trans($company->error), null, 'errors');
|
setEventMessages($langs->trans($company->error), null, 'errors');
|
||||||
setEventMessages($company->error, $company->errors, 'errors');
|
setEventMessages($company->error, $company->errors, 'errors');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$action = ($result < 0 || !$error) ? '' : 'create';
|
$action = ($result < 0 || !$error) ? '' : 'create';
|
||||||
|
|||||||
@ -3804,9 +3804,9 @@ class Societe extends CommonObject
|
|||||||
|
|
||||||
if ($result >= 0) {
|
if ($result >= 0) {
|
||||||
// Auto-create contact on thirdparty creation
|
// Auto-create contact on thirdparty creation
|
||||||
if (!empty($conf->global->THIRDPARTY_DEFAULT_CREATE_CONTACT)) {
|
if (!empty($conf->global->THIRDPARTY_DEFAULT_CREATE_CONTACT)) {
|
||||||
// Fill fields needed by contact
|
// Fill fields needed by contact
|
||||||
$this->name_bis = $member->lastname;
|
$this->name_bis = $member->lastname;
|
||||||
$this->firstname = $member->firstname;
|
$this->firstname = $member->firstname;
|
||||||
$this->civility_id = $member->civility_id;
|
$this->civility_id = $member->civility_id;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user