feat: add ref_employee and national_registration_number fields

This commit is contained in:
steve 2022-03-02 11:52:44 +01:00
parent cb17f2029e
commit dcabd046d9

View File

@ -261,7 +261,6 @@ if (empty($reshook)) {
$object->office_phone = GETPOST("office_phone", 'alphanohtml');
$object->office_fax = GETPOST("office_fax", 'alphanohtml');
$object->user_mobile = GETPOST("user_mobile", 'alphanohtml');
$object->ref_employee = GETPOST("ref_employee", 'alphanohtml');
if (!empty($conf->socialnetworks->enabled)) {
$object->socialnetworks = array();
@ -406,6 +405,7 @@ if (empty($reshook)) {
$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');
$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;
@ -855,6 +855,12 @@ if ($action == 'create' || $action == 'adduserldap') {
print '<input class="minwidth100 maxwidth150onsmartphone" type="text" name="ref_employee" value="'.dol_escape_htmltag(GETPOST('ref_employee', 'alphanohtml')).'">';
print '</td></tr>';
// National registration number
print '<tr><td>'.$langs->trans("national_registration_number").'</td>';
print '<td>';
print '<input class="minwidth100 maxwidth150onsmartphone" type="text" name="national_registration_number" value="'.dol_escape_htmltag(GETPOST('national_registration_number', 'alphanohtml')).'">';
print '</td></tr>';
// Login
print '<tr><td><span class="fieldrequired">'.$langs->trans("Login").'</span></td>';
print '<td>';
@ -2110,6 +2116,17 @@ if ($action == 'create' || $action == 'adduserldap') {
}
print '</td></tr>';
// National registration number
print "<tr>".'<td>'.$langs->trans("national_registration_number").'</td>';
print '<td>';
if ($caneditfield && !$object->ldap_sid) {
print '<input class="minwidth100" type="text" class="flat" name="national_registration_number" value="'.$object->national_registration_number.'">';
} else {
print '<input type="hidden" name="national_registration_number" value="'.$object->national_registration_number.'">';
print $object->national_registration_number;
}
print '</td></tr>';
// Login
print "<tr>".'<td><span class="fieldrequired">'.$langs->trans("Login").'</span></td>';
print '<td>';