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(); $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. // 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); 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 // We set entity=0 (all) because DATABASE_PWD_ENCRYPTED is a setup into conf file, so always shared for everybody
$entityforall = 0; $entityforall = 0;
dolibarr_set_const($db, "DATABASE_PWD_ENCRYPTED", "1", 'chaine', 0, '', $entityforall); 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_label;
public $export_icon;
public $export_permission; public $export_permission;
public $export_fields_array; 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_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_entities_array;
public $export_help_array;
public $export_special_array; // special or computed field public $export_special_array; // special or computed field
public $export_dependencies_array; public $export_dependencies_array;
public $export_sql_start; 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_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 * @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'); $listofprojcontact = $project->liste_type_contact('internal');
if (count($listofprojcontact)) { if (count($listofprojcontact)) {
$typeforprojectcontact = reset(array_keys($listofprojcontact)); $tmparray = array_keys($listofprojcontact);
$typeforprojectcontact = reset($tmparray);
$result = $project->add_contact($idfortaskuser, $typeforprojectcontact, 'internal'); $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'); $listofprojcontact = $project->liste_type_contact('internal');
if (count($listofprojcontact)) { if (count($listofprojcontact)) {
$typeforprojectcontact = reset(array_keys($listofprojcontact)); $tmparray = array_keys($listofprojcontact);
$typeforprojectcontact = reset($tmparray);
$result = $project->add_contact($idfortaskuser, $typeforprojectcontact, 'internal'); $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'); $listofprojcontact = $project->liste_type_contact('internal');
if (count($listofprojcontact)) { if (count($listofprojcontact)) {
$typeforprojectcontact = reset(array_keys($listofprojcontact)); $tmparray = array_keys($listofprojcontact);
$typeforprojectcontact = reset($tmparray);
$result = $project->add_contact($idfortaskuser, $typeforprojectcontact, 'internal'); $result = $project->add_contact($idfortaskuser, $typeforprojectcontact, 'internal');
} }
} }

View File

@ -99,7 +99,11 @@ if ($company->id) {
} elseif (empty(trim($user2->email))) { } elseif (empty(trim($user2->email))) {
// when user e-mail is empty, use only company e-mail // when user e-mail is empty, use only company e-mail
$v->setEmail($company->email, "TYPE=WORK"); $v->setEmail($company->email, "TYPE=WORK");
} elseif (strtolower(end(explode("@", $user2->email))) == strtolower(end(explode("@", $company->email)))) { } else {
$tmpuser2 = explode("@", trim($user2->email));
$tmpcompany = explode("@", trim($company->email));
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) // 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"); $v->setEmail($user2->email, "TYPE=WORK");
@ -112,6 +116,7 @@ if ($company->id) {
// support by Microsoft Outlook (2019 and possible earlier) // support by Microsoft Outlook (2019 and possible earlier)
$v->setEmail($user2->email, 'INTERNET'); $v->setEmail($user2->email, 'INTERNET');
} }
}
// Si user lie a un tiers non de type "particulier" // Si user lie a un tiers non de type "particulier"
if ($company->typent_code != 'TE_PRIVATE') { if ($company->typent_code != 'TE_PRIVATE') {

View File

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