apply feedbacks
This commit is contained in:
parent
8f07c22d70
commit
436b8fa5b5
@ -141,7 +141,7 @@ function user_prepare_head($object)
|
|||||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'user');
|
complete_head_from_modules($conf, $langs, $object, $head, $h, 'user');
|
||||||
|
|
||||||
if ((!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read) && !empty($user->rights->hrm->read_employee->read))
|
if ((!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read))
|
||||||
|| (!empty($conf->hrm->enabled) && !empty($user->rights->hrm->employee->read))
|
|| (!empty($conf->hrm->enabled) && !empty($user->rights->hrm->employee->read))
|
||||||
|| (!empty($conf->expensereport->enabled) && !empty($user->rights->expensereport->lire) && ($user->id == $object->id || $user->rights->expensereport->readall))
|
|| (!empty($conf->expensereport->enabled) && !empty($user->rights->expensereport->lire) && ($user->id == $object->id || $user->rights->expensereport->readall))
|
||||||
|| (!empty($conf->holiday->enabled) && !empty($user->rights->holiday->read) && ($user->id == $object->id || $user->rights->holiday->readall))
|
|| (!empty($conf->holiday->enabled) && !empty($user->rights->holiday->read) && ($user->id == $object->id || $user->rights->holiday->readall))
|
||||||
|
|||||||
@ -249,22 +249,6 @@ class modHRM extends DolibarrModules
|
|||||||
$this->rights[$r][4] = 'compare_advance';
|
$this->rights[$r][4] = 'compare_advance';
|
||||||
$this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->hrm->compare_advance->read)
|
$this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->hrm->compare_advance->read)
|
||||||
$r++;
|
$r++;
|
||||||
|
|
||||||
// Read employee
|
|
||||||
$this->rights[$r][0] = 4031; // Permission id (must not be already used)
|
|
||||||
$this->rights[$r][1] = 'Read employee'; // Permission label
|
|
||||||
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
|
||||||
$this->rights[$r][4] = 'read_employee';
|
|
||||||
$this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->hrm->read_employee->read)
|
|
||||||
$r++;
|
|
||||||
|
|
||||||
// Write employee
|
|
||||||
$this->rights[$r][0] = 4032; // Permission id (must not be already used)
|
|
||||||
$this->rights[$r][1] = 'Write employee'; // Permission label
|
|
||||||
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
|
||||||
$this->rights[$r][4] = 'write_employee';
|
|
||||||
$this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->hrm->write_employee->write)
|
|
||||||
$r++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -969,8 +969,6 @@ Permission4021=Create/modify your evaluation
|
|||||||
Permission4022=Validate evaluation
|
Permission4022=Validate evaluation
|
||||||
Permission4023=Delete evaluation
|
Permission4023=Delete evaluation
|
||||||
Permission4030=See comparison menu
|
Permission4030=See comparison menu
|
||||||
Permission4031=Read employee
|
|
||||||
Permission4032=Write employee
|
|
||||||
Permission10001=Read website content
|
Permission10001=Read website content
|
||||||
Permission10002=Create/modify website content (html and javascript content)
|
Permission10002=Create/modify website content (html and javascript content)
|
||||||
Permission10003=Create/modify website content (dynamic php code). Dangerous, must be reserved to restricted developers.
|
Permission10003=Create/modify website content (dynamic php code). Dangerous, must be reserved to restricted developers.
|
||||||
|
|||||||
@ -230,6 +230,24 @@ if ($action == 'setpersonal_mobile' && $canadduser && !$cancel) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// update ref_employee
|
||||||
|
if ($action == 'setref_employee' && $canadduser && !$cancel) {
|
||||||
|
$object->ref_employee = (string) GETPOST('ref_employee', 'alphanohtml');
|
||||||
|
$result = $object->update($user);
|
||||||
|
if ($result < 0) {
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// update national_registration_number
|
||||||
|
if ($action == 'setnational_registration_number' && $canadduser && !$cancel) {
|
||||||
|
$object->national_registration_number = (string) GETPOST('national_registration_number', 'alphanohtml');
|
||||||
|
$result = $object->update($user);
|
||||||
|
if ($result < 0) {
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) {
|
if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) {
|
||||||
// update default_c_exp_tax_cat
|
// update default_c_exp_tax_cat
|
||||||
if ($action == 'setdefault_c_exp_tax_cat' && $canadduser) {
|
if ($action == 'setdefault_c_exp_tax_cat' && $canadduser) {
|
||||||
@ -509,17 +527,22 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Employee Number
|
// Employee Number
|
||||||
if (!empty($conf->accounting->enabled)) {
|
print '<tr class="nowrap">';
|
||||||
print '<tr><td>'.$langs->trans("RefEmployee").'</td>';
|
print '<td>';
|
||||||
print '<td>'.$object->ref_employee.'</td></tr>';
|
print $form->editfieldkey("RefEmployee", 'ref_employee', $object->ref_employee, $object, $user->rights->user->user->creer);
|
||||||
}
|
print '</td><td>';
|
||||||
|
print $form->editfieldval("RefEmployee", 'ref_employee', $object->ref_employee, $object, $user->rights->user->user->creer, 'string', $object->ref_employee);
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
// National registration number
|
// National registration number
|
||||||
if (!empty($conf->accounting->enabled)) {
|
print '<tr class="nowrap">';
|
||||||
print '<tr><td>'.$langs->trans("NationalRegistrationNumber").'</td>';
|
print '<td>';
|
||||||
print '<td>'.$object->national_registration_number.'</td></tr>';
|
print $form->editfieldkey("NationalRegistrationNumber", 'national_registration_number', $object->national_registration_number, $object, $user->rights->user->user->creer);
|
||||||
}
|
print '</td><td>';
|
||||||
|
print $form->editfieldval("NationalRegistrationNumber", 'national_registration_number', $object->national_registration_number, $object, $user->rights->user->user->creer, 'string', $object->national_registration_number);
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
|||||||
@ -849,18 +849,6 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Ref remployee
|
|
||||||
print '<tr><td>'.$langs->trans("RefEmployee").'</td>';
|
|
||||||
print '<td>';
|
|
||||||
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("NationalRegistrationNumber").'</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
|
// Login
|
||||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Login").'</span></td>';
|
print '<tr><td><span class="fieldrequired">'.$langs->trans("Login").'</span></td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
@ -2099,28 +2087,6 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Ref employee
|
|
||||||
print "<tr>".'<td>'.$langs->trans("RefEmployee").'</td>';
|
|
||||||
print '<td>';
|
|
||||||
if ($caneditfield && !$object->ldap_sid) {
|
|
||||||
print '<input class="minwidth100" type="text" class="flat" name="ref_employee" value="'.$object->ref_employee.'">';
|
|
||||||
} else {
|
|
||||||
print '<input type="hidden" name="ref_employee" value="'.$object->ref_employee.'">';
|
|
||||||
print $object->ref_employee;
|
|
||||||
}
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
// National registration number
|
|
||||||
print "<tr>".'<td>'.$langs->trans("NationalRegistrationNumber").'</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
|
// Login
|
||||||
print "<tr>".'<td><span class="fieldrequired">'.$langs->trans("Login").'</span></td>';
|
print "<tr>".'<td><span class="fieldrequired">'.$langs->trans("Login").'</span></td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user