|
@@ -1408,23 +1408,24 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|
|
// Login
|
|
|
print '<tr><td class="titlefieldmiddle">'.$langs->trans("Login").'</td>';
|
|
|
if (!empty($object->ldap_sid) && $object->statut == 0) {
|
|
|
- print '<td class="error">'.$langs->trans("LoginAccountDisableInDolibarr").'</td>';
|
|
|
+ print '<td class="error">';
|
|
|
+ print $langs->trans("LoginAccountDisableInDolibarr");
|
|
|
+ print '</td>';
|
|
|
} else {
|
|
|
- print '<td>'.showValueWithClipboardCPButton($object->login).'</td>';
|
|
|
+ print '<td>';
|
|
|
+ $addadmin = '';
|
|
|
+ if (property_exists($object, 'admin')) {
|
|
|
+ if (!empty($conf->multicompany->enabled) && !empty($object->admin) && empty($object->entity)) {
|
|
|
+ $addadmin .= img_picto($langs->trans("SuperAdministratorDesc"), "redstar", 'class="paddingleft"');
|
|
|
+ } elseif (!empty($object->admin)) {
|
|
|
+ $addadmin .= img_picto($langs->trans("AdministratorDesc"), "star", 'class="paddingleft"');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ print showValueWithClipboardCPButton($object->login).$addadmin;
|
|
|
+ print '</td>';
|
|
|
}
|
|
|
print '</tr>'."\n";
|
|
|
|
|
|
- // Administrator
|
|
|
- print '<tr><td>'.$langs->trans("Administrator").'</td><td>';
|
|
|
- if (!empty($conf->multicompany->enabled) && $object->admin && !$object->entity) {
|
|
|
- print $form->textwithpicto(yn($object->admin), $langs->trans("SuperAdministratorDesc"), 1, "superadmin");
|
|
|
- } elseif ($object->admin) {
|
|
|
- print $form->textwithpicto(yn($object->admin), $langs->trans("AdministratorDesc"), 1, "admin");
|
|
|
- } else {
|
|
|
- print yn($object->admin);
|
|
|
- }
|
|
|
- print '</td></tr>'."\n";
|
|
|
-
|
|
|
// Type
|
|
|
print '<tr><td>';
|
|
|
$text = $langs->trans("Type");
|
|
@@ -1455,7 +1456,7 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|
|
//print yn($object->employee);
|
|
|
print '</td></tr>'."\n";
|
|
|
|
|
|
- // TODO Move this into tab RH, visible when salarie or RH is visible (HierarchicalResponsible must be on both tab)
|
|
|
+ // TODO This is also available into the tab RH
|
|
|
|
|
|
// Hierarchy
|
|
|
print '<tr><td>'.$langs->trans("HierarchicalResponsible").'</td>';
|
|
@@ -1506,30 +1507,31 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|
|
print "</tr>\n";
|
|
|
}
|
|
|
|
|
|
- // Default warehouse
|
|
|
- if (!empty($conf->stock->enabled) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) {
|
|
|
- require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
|
|
|
- print '<tr><td>'.$langs->trans("DefaultWarehouse").'</td><td>';
|
|
|
- if ($object->fk_warehouse > 0) {
|
|
|
- $warehousestatic = new Entrepot($db);
|
|
|
- $warehousestatic->fetch($object->fk_warehouse);
|
|
|
- print $warehousestatic->getNomUrl(1);
|
|
|
- }
|
|
|
- print '</td></tr>';
|
|
|
- }
|
|
|
-
|
|
|
// Position/Job
|
|
|
print '<tr><td>'.$langs->trans("PostOrFunction").'</td>';
|
|
|
print '<td>'.dol_escape_htmltag($object->job).'</td>';
|
|
|
print '</tr>'."\n";
|
|
|
|
|
|
- if ((!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read) && in_array($id, $childids))
|
|
|
+ // Weeklyhours
|
|
|
+ print '<tr><td>'.$langs->trans("WeeklyHours").'</td>';
|
|
|
+ print '<td>';
|
|
|
+ print price2num($object->weeklyhours);
|
|
|
+ print '</td>';
|
|
|
+ print "</tr>\n";
|
|
|
+
|
|
|
+ // Sensitive salary/value information
|
|
|
+ if ((empty($user->socid) && in_array($id, $childids)) // A user can always see salary/value information for its subordinates
|
|
|
|| (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->readall))
|
|
|
|| (!empty($conf->hrm->enabled) && !empty($user->rights->hrm->employee->read))) {
|
|
|
- // Even a superior can't see this info of its subordinates wihtout $user->rights->salaries->read and $user->rights->hrm->employee->read (setting/viewing is reserverd to HR people).
|
|
|
- // However, he can see the valuation of timesheet of its subordinates even without these permissions.
|
|
|
$langs->load("salaries");
|
|
|
|
|
|
+ // Salary
|
|
|
+ print '<tr><td>'.$langs->trans("Salary").'</td>';
|
|
|
+ print '<td>';
|
|
|
+ print ($object->salary != '' ? img_picto('', 'salary', 'class="pictofixedwidth paddingright"').'<span class="amount">'.price($object->salary, '', $langs, 1, -1, -1, $conf->currency) : '').'</span>';
|
|
|
+ print '</td>';
|
|
|
+ print "</tr>\n";
|
|
|
+
|
|
|
// THM
|
|
|
print '<tr><td>';
|
|
|
$text = $langs->trans("THM");
|
|
@@ -1549,22 +1551,8 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|
|
print ($object->tjm != '' ?price($object->tjm, '', $langs, 1, -1, -1, $conf->currency) : '');
|
|
|
print '</td>';
|
|
|
print "</tr>\n";
|
|
|
-
|
|
|
- // Salary
|
|
|
- print '<tr><td>'.$langs->trans("Salary").'</td>';
|
|
|
- print '<td>';
|
|
|
- print ($object->salary != '' ? img_picto('', 'salary', 'class="pictofixedwidth paddingright"').'<span class="amount">'.price($object->salary, '', $langs, 1, -1, -1, $conf->currency) : '').'</span>';
|
|
|
- print '</td>';
|
|
|
- print "</tr>\n";
|
|
|
}
|
|
|
|
|
|
- // Weeklyhours
|
|
|
- print '<tr><td>'.$langs->trans("WeeklyHours").'</td>';
|
|
|
- print '<td>';
|
|
|
- print price2num($object->weeklyhours);
|
|
|
- print '</td>';
|
|
|
- print "</tr>\n";
|
|
|
-
|
|
|
// Date employment
|
|
|
print '<tr><td>'.$langs->trans("DateOfEmployment").'</td>';
|
|
|
print '<td>';
|
|
@@ -1579,12 +1567,17 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|
|
print '</td>';
|
|
|
print "</tr>\n";
|
|
|
|
|
|
- // Date of birth
|
|
|
- print '<tr><td>'.$langs->trans("DateOfBirth").'</td>';
|
|
|
- print '<td>';
|
|
|
- print dol_print_date($object->birth, 'day');
|
|
|
- print '</td>';
|
|
|
- print "</tr>\n";
|
|
|
+ // Default warehouse
|
|
|
+ if (!empty($conf->stock->enabled) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) {
|
|
|
+ require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
|
|
|
+ print '<tr><td>'.$langs->trans("DefaultWarehouse").'</td><td>';
|
|
|
+ if ($object->fk_warehouse > 0) {
|
|
|
+ $warehousestatic = new Entrepot($db);
|
|
|
+ $warehousestatic->fetch($object->fk_warehouse);
|
|
|
+ print $warehousestatic->getNomUrl(1);
|
|
|
+ }
|
|
|
+ print '</td></tr>';
|
|
|
+ }
|
|
|
|
|
|
// Accountancy code
|
|
|
if (!empty($conf->accounting->enabled)) {
|
|
@@ -2336,6 +2329,18 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|
|
print '</td></tr>';
|
|
|
}
|
|
|
|
|
|
+ // OpenID url
|
|
|
+ if (isset($conf->file->main_authentication) && preg_match('/openid/', $conf->file->main_authentication) && !empty($conf->global->MAIN_OPENIDURL_PERUSER)) {
|
|
|
+ print "<tr>".'<td>'.$langs->trans("OpenIDURL").'</td>';
|
|
|
+ print '<td>';
|
|
|
+ if ($caneditfield) {
|
|
|
+ print '<input class="minwidth100" type="url" name="openid" class="flat" value="'.$object->openid.'">';
|
|
|
+ } else {
|
|
|
+ print '<input type="hidden" name="openid" value="'.$object->openid.'">';
|
|
|
+ print $object->openid;
|
|
|
+ }
|
|
|
+ print '</td></tr>';
|
|
|
+ }
|
|
|
|
|
|
print '</table><hr><table class="border centpercent">';
|
|
|
|
|
@@ -2465,21 +2470,16 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // OpenID url
|
|
|
- if (isset($conf->file->main_authentication) && preg_match('/openid/', $conf->file->main_authentication) && !empty($conf->global->MAIN_OPENIDURL_PERUSER)) {
|
|
|
- print "<tr>".'<td>'.$langs->trans("OpenIDURL").'</td>';
|
|
|
- print '<td>';
|
|
|
- if ($caneditfield) {
|
|
|
- print '<input class="minwidth100" type="url" name="openid" class="flat" value="'.$object->openid.'">';
|
|
|
- } else {
|
|
|
- print '<input type="hidden" name="openid" value="'.$object->openid.'">';
|
|
|
- print $object->openid;
|
|
|
- }
|
|
|
+ print '</table><hr><table class="border centpercent">';
|
|
|
+
|
|
|
+ // Default warehouse
|
|
|
+ if (!empty($conf->stock->enabled) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) {
|
|
|
+ print '<tr><td class="titlefield">'.$langs->trans("DefaultWarehouse").'</td><td>';
|
|
|
+ print $formproduct->selectWarehouses($object->fk_warehouse, 'fk_warehouse', 'warehouseopen', 1);
|
|
|
+ print ' <a href="'.DOL_URL_ROOT.'/product/stock/card.php?action=create&token='.newToken().'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit&token='.newToken()).'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddWarehouse").'"></span></a>';
|
|
|
print '</td></tr>';
|
|
|
}
|
|
|
|
|
|
- print '</table><hr><table class="border centpercent">';
|
|
|
-
|
|
|
// Accountancy code
|
|
|
if (!empty($conf->accounting->enabled)) {
|
|
|
print "<tr>";
|
|
@@ -2637,14 +2637,6 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|
|
|
|
|
// TODO Move this into tab RH (HierarchicalResponsible must be on both tab)
|
|
|
|
|
|
- // Default warehouse
|
|
|
- if (!empty($conf->stock->enabled) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) {
|
|
|
- print '<tr><td class="titlefield">'.$langs->trans("DefaultWarehouse").'</td><td>';
|
|
|
- print $formproduct->selectWarehouses($object->fk_warehouse, 'fk_warehouse', 'warehouseopen', 1);
|
|
|
- print ' <a href="'.DOL_URL_ROOT.'/product/stock/card.php?action=create&token='.newToken().'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit&token='.newToken()).'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddWarehouse").'"></span></a>';
|
|
|
- print '</td></tr>';
|
|
|
- }
|
|
|
-
|
|
|
// Position/Job
|
|
|
print '<tr><td class="titlefieldcreate">'.$langs->trans("PostOrFunction").'</td>';
|
|
|
print '<td>';
|
|
@@ -2656,10 +2648,29 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|
|
}
|
|
|
print '</td></tr>';
|
|
|
|
|
|
- if ((!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read) && in_array($id, $childids))
|
|
|
+ // Weeklyhours
|
|
|
+ print '<tr><td>'.$langs->trans("WeeklyHours").'</td>';
|
|
|
+ print '<td>';
|
|
|
+ if ($caneditfield) {
|
|
|
+ print '<input size="8" type="text" name="weeklyhours" value="'.price2num(GETPOST('weeklyhours') ?GETPOST('weeklyhours') : $object->weeklyhours).'">';
|
|
|
+ } else {
|
|
|
+ print price2num($object->weeklyhours);
|
|
|
+ }
|
|
|
+ print '</td>';
|
|
|
+ print "</tr>\n";
|
|
|
+
|
|
|
+ // Sensitive salary/value information
|
|
|
+ if ((empty($user->socid) && in_array($id, $childids)) // A user can always see salary/value information for its subordinates
|
|
|
|| (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->readall))
|
|
|
|| (!empty($conf->hrm->enabled) && !empty($user->rights->hrm->employee->read))) {
|
|
|
- $langs->load("salaries");
|
|
|
+ $langs->load("salaries");
|
|
|
+
|
|
|
+ // Salary
|
|
|
+ print '<tr><td>'.$langs->trans("Salary").'</td>';
|
|
|
+ print '<td>';
|
|
|
+ print img_picto('', 'salary', 'class="pictofixedwidth paddingright"').'<input size="8" type="text" name="salary" value="'.price2num(GETPOST('salary') ?GETPOST('salary') : $object->salary).'">';
|
|
|
+ print '</td>';
|
|
|
+ print "</tr>\n";
|
|
|
|
|
|
// THM
|
|
|
print '<tr><td>';
|
|
@@ -2688,26 +2699,8 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|
|
}
|
|
|
print '</td>';
|
|
|
print "</tr>\n";
|
|
|
-
|
|
|
- // Salary
|
|
|
- print '<tr><td>'.$langs->trans("Salary").'</td>';
|
|
|
- print '<td>';
|
|
|
- print img_picto('', 'salary', 'class="pictofixedwidth paddingright"').'<input size="8" type="text" name="salary" value="'.price2num(GETPOST('salary') ?GETPOST('salary') : $object->salary).'">';
|
|
|
- print '</td>';
|
|
|
- print "</tr>\n";
|
|
|
}
|
|
|
|
|
|
- // Weeklyhours
|
|
|
- print '<tr><td>'.$langs->trans("WeeklyHours").'</td>';
|
|
|
- print '<td>';
|
|
|
- if ($caneditfield) {
|
|
|
- print '<input size="8" type="text" name="weeklyhours" value="'.price2num(GETPOST('weeklyhours') ?GETPOST('weeklyhours') : $object->weeklyhours).'">';
|
|
|
- } else {
|
|
|
- print price2num($object->weeklyhours);
|
|
|
- }
|
|
|
- print '</td>';
|
|
|
- print "</tr>\n";
|
|
|
-
|
|
|
// Date employment
|
|
|
print '<tr><td>'.$langs->trans("DateEmployment").'</td>';
|
|
|
print '<td>';
|