Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2022-12-28 04:01:11 +01:00
commit ad184c4644
7 changed files with 38 additions and 16 deletions

View File

@ -56,8 +56,8 @@ if ($action == 'activate_encrypt') {
$db->begin();
// On old version a bug created the constant into user entity, so we delete it to be sure, such entry won't exists. We want it in entity 0 or nowhere.
dolibarr_del_const($db, "DATABASE_PWD_ENCRYPTED", "1", 'chaine', 0, '', $conf->entity);
// On old version, a bug created the constant into user entity, so we delete it to be sure such entry won't exists. We want it in entity 0 or nowhere.
dolibarr_del_const($db, "DATABASE_PWD_ENCRYPTED", $conf->entity);
// We set entity=0 (all) because DATABASE_PWD_ENCRYPTED is a setup into conf file, so always shared for everybody
$entityforall = 0;
dolibarr_set_const($db, "DATABASE_PWD_ENCRYPTED", "1", 'chaine', 0, '', $entityforall);

View File

@ -232,10 +232,13 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
*/
public $export_label;
public $export_icon;
public $export_permission;
public $export_fields_array;
public $export_TypeFields_array; // Array of key=>type where type can be 'Numeric', 'Date', 'Text', 'Boolean', 'Status', 'List:xxx:login:rowid'
public $export_entities_array;
public $export_help_array;
public $export_special_array; // special or computed field
public $export_dependencies_array;
public $export_sql_start;
@ -255,6 +258,17 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
*/
public $import_label;
public $import_icon;
public $import_entities_array;
public $import_tables_array;
public $import_fields_array;
public $import_fieldshidden_array;
public $import_convertvalue_array;
public $import_regex_array;
public $import_examplevalues_array;
public $import_updatekeys_array;
/**
* @var string Module constant name

View File

@ -222,7 +222,8 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask')
$listofprojcontact = $project->liste_type_contact('internal');
if (count($listofprojcontact)) {
$typeforprojectcontact = reset(array_keys($listofprojcontact));
$tmparray = array_keys($listofprojcontact);
$typeforprojectcontact = reset($tmparray);
$result = $project->add_contact($idfortaskuser, $typeforprojectcontact, 'internal');
}
}

View File

@ -167,7 +167,8 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask')
$listofprojcontact = $project->liste_type_contact('internal');
if (count($listofprojcontact)) {
$typeforprojectcontact = reset(array_keys($listofprojcontact));
$tmparray = array_keys($listofprojcontact);
$typeforprojectcontact = reset($tmparray);
$result = $project->add_contact($idfortaskuser, $typeforprojectcontact, 'internal');
}
}

View File

@ -229,7 +229,8 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask')
$listofprojcontact = $project->liste_type_contact('internal');
if (count($listofprojcontact)) {
$typeforprojectcontact = reset(array_keys($listofprojcontact));
$tmparray = array_keys($listofprojcontact);
$typeforprojectcontact = reset($tmparray);
$result = $project->add_contact($idfortaskuser, $typeforprojectcontact, 'internal');
}
}

View File

@ -99,18 +99,23 @@ if ($company->id) {
} elseif (empty(trim($user2->email))) {
// when user e-mail is empty, use only company e-mail
$v->setEmail($company->email, "TYPE=WORK");
} elseif (strtolower(end(explode("@", $user2->email))) == strtolower(end(explode("@", $company->email)))) {
// when e-mail domain of user and company are the same, use user e-mail at first (and company e-mail at second)
$v->setEmail($user2->email, "TYPE=WORK");
// support by Microsoft Outlook (2019 and possible earlier)
$v->setEmail($company->email, 'INTERNET');
} else {
// when e-mail of user and company complete different use company e-mail at first (and user e-mail at second)
$v->setEmail($company->email, "TYPE=WORK");
$tmpuser2 = explode("@", trim($user2->email));
$tmpcompany = explode("@", trim($company->email));
// support by Microsoft Outlook (2019 and possible earlier)
$v->setEmail($user2->email, 'INTERNET');
if (strtolower(end($tmpuser2)) == strtolower(end($tmpcompany))) {
// when e-mail domain of user and company are the same, use user e-mail at first (and company e-mail at second)
$v->setEmail($user2->email, "TYPE=WORK");
// support by Microsoft Outlook (2019 and possible earlier)
$v->setEmail($company->email, 'INTERNET');
} else {
// when e-mail of user and company complete different use company e-mail at first (and user e-mail at second)
$v->setEmail($company->email, "TYPE=WORK");
// support by Microsoft Outlook (2019 and possible earlier)
$v->setEmail($user2->email, 'INTERNET');
}
}
// Si user lie a un tiers non de type "particulier"

View File

@ -496,7 +496,7 @@ if (!empty($id) || !empty($ref)) {
}
if ($action == 'add') {
$prodattr_all = $prodattr->fetchAll(1);
$prodattr_all = $prodattr->fetchAll();
if (!$selected) {
$selected = $prodattr_all[key($prodattr_all)]->id;