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

This commit is contained in:
Laurent Destailleur 2023-01-26 02:22:19 +01:00
commit d5ff979d97
2 changed files with 22 additions and 2 deletions

View File

@ -417,8 +417,18 @@ if (empty($reshook)) {
$object->civility_code = GETPOST("civility_code", 'aZ09');
$object->lastname = GETPOST("lastname", 'alphanohtml');
$object->firstname = GETPOST("firstname", 'alphanohtml');
$object->ref_employee = GETPOST("ref_employee", 'alphanohtml');
$object->national_registration_number = GETPOST("national_registration_number", 'alphanohtml');
/*
* Protection against deletion of ref_employee while the field is not present in the user tab
*/
if (GETPOSTISSET("ref_employee")) {
$object->ref_employee = GETPOST("ref_employee", 'alphanohtml');
}
/*
* Protection against deletion of national_registration_number while the field is not present in the user tab
*/
if (GETPOSTISSET("national_registration_number")) {
$object->national_registration_number = GETPOST("national_registration_number", 'alphanohtml');
}
$object->gender = GETPOST("gender", 'aZ09');
$object->pass = GETPOST("password", 'none'); // We can keep 'none' for password fields
$object->api_key = (GETPOST("api_key", 'alphanohtml')) ? GETPOST("api_key", 'alphanohtml') : $object->api_key;

View File

@ -215,6 +215,16 @@ if (isModEnabled('ticket')) {
$tmparray['ticket/list.php?mainmenu=ticket&leftmenu='] = 'Tickets';
}
// Hook for insertion new items in the List of possible landing pages
$reshook = $hookmanager->executeHooks('addToLandingPageList', $tmparray, $object);
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
} elseif ($reshook > 0) {
$tmparray=$hookmanager->resArray;
} elseif ($reshook == 0) {
$tmparray=array_merge($tmparray, $hookmanager->resArray);
}
$head = user_prepare_head($object);
$title = $langs->trans("User");