Browse Source

Look and feel v15

Laurent Destailleur 3 years ago
parent
commit
ffc07efb64

+ 17 - 8
htdocs/core/class/html.form.class.php

@@ -193,12 +193,12 @@ class Form
 	 * @param	object	$object			Object
 	 * @param	boolean	$perm			Permission to allow button to edit parameter
 	 * @param	string	$typeofdata		Type of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols%', 'datepicker' ('day' do not work, don't know why), 'dayhour' or 'datepickerhour', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select;xkey:xval,ykey:yval,...')
-	 * @param	string	$editvalue		When in edit mode, use this value as $value instead of value (for example, you can provide here a formated price instead of value). Use '' to use same than $value
+	 * @param	string	$editvalue		When in edit mode, use this value as $value instead of value (for example, you can provide here a formated price instead of numeric value). Use '' to use same than $value
 	 * @param	object	$extObject		External object
 	 * @param	mixed	$custommsg		String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage')
 	 * @param	string	$moreparam		More param to add on the form action href URL
 	 * @param   int     $notabletag     Do no output table tags
-	 * @param	string	$formatfunc		Call a specific function to output field
+	 * @param	string	$formatfunc		Call a specific function to output field in view mode (For example: 'dol_print_email')
 	 * @param	string	$paramid		Key of parameter for id ('id', 'socid')
 	 * @return  string					HTML edit field
 	 */
@@ -214,7 +214,7 @@ class Form
 		}
 
 		// When option to edit inline is activated
-		if (!empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && !preg_match('/^select;|datehourpicker/', $typeofdata)) { // TODO add jquery timepicker and support select
+		if (!empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && !preg_match('/^select;|day|datepicker|dayhour|datehourpicker/', $typeofdata)) { // TODO add jquery timepicker and support select
 			$ret .= $this->editInPlace($object, $value, $htmlname, $perm, $typeofdata, $editvalue, $extObject, $custommsg);
 		} else {
 			$editmode = (GETPOST('action', 'aZ09') == 'edit'.$htmlname);
@@ -236,7 +236,7 @@ class Form
 				} elseif (preg_match('/^(numeric|amount)/', $typeofdata)) {
 					$tmp = explode(':', $typeofdata);
 					$valuetoshow = price2num($editvalue ? $editvalue : $value);
-					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($valuetoshow != '' ?price($valuetoshow) : '').'"'.($tmp[1] ? ' size="'.$tmp[1].'"' : '').' autofocus>';
+					$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($valuetoshow != '' ? price($valuetoshow) : '').'"'.($tmp[1] ? ' size="'.$tmp[1].'"' : '').' autofocus>';
 				} elseif (preg_match('/^(checkbox)/', $typeofdata)) {
 					$tmp = explode(':', $typeofdata);
 					$ret .= '<input type="checkbox" id="' . $htmlname . '" name="' . $htmlname . '" value="' . $value . '"' . ($tmp[1] ? $tmp[1] : '') . '/>';
@@ -8679,7 +8679,7 @@ class Form
 	 */
 	public function showrefnav($object, $paramid, $morehtml = '', $shownav = 1, $fieldid = 'rowid', $fieldref = 'ref', $morehtmlref = '', $moreparam = '', $nodbprefix = 0, $morehtmlleft = '', $morehtmlstatus = '', $morehtmlright = '')
 	{
-		global $langs, $conf, $hookmanager, $extralanguages;
+		global $conf, $langs, $hookmanager, $extralanguages;
 
 		$ret = '';
 		if (empty($fieldid)) {
@@ -8691,7 +8691,7 @@ class Form
 
 		// Preparing gender's display if there is one
 		$addgendertxt = '';
-		if (!empty($object->gender)) {
+		if (property_exists($object, 'gender') && !empty($object->gender)) {
 			$addgendertxt = ' ';
 			switch ($object->gender) {
 				case 'man':
@@ -8705,6 +8705,15 @@ class Form
 					break;
 			}
 		}
+		/*
+		$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"');
+			}
+		}*/
 
 		// Add where from hooks
 		if (is_object($hookmanager)) {
@@ -8837,7 +8846,7 @@ class Form
 				$ret .= dol_htmlentities($fullname).$addgendertxt.((!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : '');
 			}
 		} elseif (in_array($object->element, array('contact', 'user', 'usergroup'))) {
-			$ret .= dol_htmlentities($object->getFullName($langs)).$addgendertxt;
+			$ret .= dol_htmlentities($object->getFullName($langs));
 		} elseif (in_array($object->element, array('action', 'agenda'))) {
 			$ret .= $object->ref.'<br>'.$object->label;
 		} elseif (in_array($object->element, array('adherent_type'))) {
@@ -9085,7 +9094,7 @@ class Form
 				}
 				$ret .= '<table class="nobordernopadding centpercent">';
 				if ($object->photo) {
-					$ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> '.$langs->trans("Delete").'<br><br></td></tr>';
+					$ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">'.$langs->trans("Delete").'</label><br><br></td></tr>';
 				}
 				$ret .= '<tr><td class="tdoverflow"><input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"'.($capture ? ' capture="'.$capture.'"' : '').'></td></tr>';
 				$ret .= '</table>';

+ 9 - 9
htdocs/core/modules/modUser.class.php

@@ -49,7 +49,7 @@ class modUser extends DolibarrModules
 		$this->module_position = '05';
 		// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
 		$this->name = preg_replace('/^mod/i', '', get_class($this));
-		$this->description = "Gestion des utilisateurs (requis)";
+		$this->description = "Management of users and groups of users (mandatory)";
 
 		// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
 		$this->version = 'dolibarr';
@@ -90,7 +90,7 @@ class modUser extends DolibarrModules
 
 		$r++;
 		$this->rights[$r][0] = 251;
-		$this->rights[$r][1] = 'Read information of other users';
+		$this->rights[$r][1] = 'Read information of other users, groups and permissions';
 		$this->rights[$r][2] = 'r';
 		$this->rights[$r][3] = 0;
 		$this->rights[$r][4] = 'user';
@@ -101,12 +101,12 @@ class modUser extends DolibarrModules
 		$this->rights[$r][1] = 'Read permissions of other users';
 		$this->rights[$r][2] = 'r';
 		$this->rights[$r][3] = 0;
-		$this->rights[$r][4] = 'user_advance';
+		$this->rights[$r][4] = 'user_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on
 		$this->rights[$r][5] = 'readperms';
 
 		$r++;
 		$this->rights[$r][0] = 253;
-		$this->rights[$r][1] = 'Create/modify internal and external users';
+		$this->rights[$r][1] = 'Create/modify internal and external users, groups and permissions';
 		$this->rights[$r][2] = 'w';
 		$this->rights[$r][3] = 0;
 		$this->rights[$r][4] = 'user';
@@ -117,7 +117,7 @@ class modUser extends DolibarrModules
 		$this->rights[$r][1] = 'Create/modify external users only';
 		$this->rights[$r][2] = 'w';
 		$this->rights[$r][3] = 0;
-		$this->rights[$r][4] = 'user_advance';
+		$this->rights[$r][4] = 'user_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on
 		$this->rights[$r][5] = 'write';
 
 		$r++;
@@ -170,7 +170,7 @@ class modUser extends DolibarrModules
 
 		$r++;
 		$this->rights[$r][0] = 351;
-		$this->rights[$r][1] = 'Consulter les groupes';
+		$this->rights[$r][1] = 'Read groups';
 		$this->rights[$r][2] = 'r';
 		$this->rights[$r][3] = 0;
 		$this->rights[$r][4] = 'group_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on
@@ -178,7 +178,7 @@ class modUser extends DolibarrModules
 
 		$r++;
 		$this->rights[$r][0] = 352;
-		$this->rights[$r][1] = 'Consulter les permissions des groupes';
+		$this->rights[$r][1] = 'Read permissions of groups';
 		$this->rights[$r][2] = 'r';
 		$this->rights[$r][3] = 0;
 		$this->rights[$r][4] = 'group_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on
@@ -186,7 +186,7 @@ class modUser extends DolibarrModules
 
 		$r++;
 		$this->rights[$r][0] = 353;
-		$this->rights[$r][1] = 'Creer/modifier les groupes et leurs permissions';
+		$this->rights[$r][1] = 'Create/modify groups and permissions';
 		$this->rights[$r][2] = 'w';
 		$this->rights[$r][3] = 0;
 		$this->rights[$r][4] = 'group_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on
@@ -194,7 +194,7 @@ class modUser extends DolibarrModules
 
 		$r++;
 		$this->rights[$r][0] = 354;
-		$this->rights[$r][1] = 'Supprimer ou desactiver les groupes';
+		$this->rights[$r][1] = 'Delete groups';
 		$this->rights[$r][2] = 'd';
 		$this->rights[$r][3] = 0;
 		$this->rights[$r][4] = 'group_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on

+ 11 - 2
htdocs/theme/eldy/global.inc.php

@@ -1432,7 +1432,7 @@ table[summary="list_of_modules"] .fa-cog {
 .minheight40 { min-height: 40px; }
 .titlefieldcreate { width: 20%; }
 .titlefield       { /* width: 25%; */ width: 250px; }
-.titlefieldmiddle { width: 50%; }
+.titlefieldmiddle { width: 45%; }
 .titlefieldmax45 { max-width: 45%; }
 .imgmaxwidth180 { max-width: 180px; }
 .imgmaxheight50 { max-height: 50px; }
@@ -3385,6 +3385,15 @@ td.border, div.tagtable div div.border {
 	width:auto;
 }
 
+/* To have left column sticky
+.tagtable td[data-key="ref"] {
+	position: sticky;
+	left: 0;
+	top: 0;
+	max-width: 150px !important;
+}
+*/
+
 
 /* Main boxes */
 .nobordertop, .nobordertop tr:first-of-type td {
@@ -4471,7 +4480,7 @@ div.titre {
 }
 div.fiche > table.table-fiche-title:first-of-type div {
 	color: var(--colortexttitlenotab);
-	font-size: 1.05em;
+	font-size: 1.1em;
 	/* text-transform: uppercase; */
 	/* font-weight: 600; */
 }

+ 3 - 2
htdocs/theme/eldy/info-box.inc.php

@@ -150,13 +150,14 @@ a.info-box-text-a i.fa.fa-exclamation-triangle {
 	cursor: default;
 
 	font-size: 10px;
-	line-height: 22px;
-	padding: 0px 3px;
+	line-height: 1.5em;
+	padding: 4px 3px;
 	text-align: center;
 	opacity: 1;
 	-webkit-transition: opacity 0.5s, visibility 0s 0.5s;
 	transition: opacity 0.5s, visibility 0s 0.5s;
 }
+
 .box-flex-item.info-box-module.--disabled {
 	/* opacity: 0.6; */
 }

+ 2 - 2
htdocs/theme/md/info-box.inc.php

@@ -242,8 +242,8 @@ a.info-box-text-a i.fa.fa-exclamation-triangle {
 	cursor: default;
 
 	font-size: 10px;
-	line-height: 22px;
-	padding: 0px 3px;
+	line-height: 1.5em;
+	padding: 4px 3px;
 	text-align: center;
 	opacity: 1;
 	-webkit-transition: opacity 0.5s, visibility 0s 0.5s;

+ 152 - 6
htdocs/user/bank.php

@@ -203,8 +203,17 @@ if ($action == 'update' && !$cancel && $permissiontoaddbankaccount) {
 	}
 }
 
+// update birth
+if ($action == 'setbirth' && $canadduser && !$cancel) {
+	$object->birth = dol_mktime(0, 0, 0, GETPOST('birthmonth', 'int'), GETPOST('birthday', 'int'), GETPOST('birthyear', 'int'));
+	$result = $object->update($user);
+	if ($result < 0) {
+		setEventMessages($object->error, $object->errors, 'errors');
+	}
+}
+
 // update personal email
-if ($action == 'setpersonal_email' && $canadduser) {
+if ($action == 'setpersonal_email' && $canadduser && !$cancel) {
 	$object->personal_email = (string) GETPOST('personal_email', 'alphanohtml');
 	$result = $object->update($user);
 	if ($result < 0) {
@@ -213,7 +222,7 @@ if ($action == 'setpersonal_email' && $canadduser) {
 }
 
 // update personal mobile
-if ($action == 'setpersonal_mobile' && $canadduser) {
+if ($action == 'setpersonal_mobile' && $canadduser && !$cancel) {
 	$object->personal_mobile = (string) GETPOST('personal_mobile', 'alphanohtml');
 	$result = $object->update($user);
 	if ($result < 0) {
@@ -288,23 +297,160 @@ if ($action != 'edit' && $action != 'create') {		// If not bank account yet, $ac
 
 	print '<table class="border centpercent tableforfield">';
 
-	print '<tr><td class="titlefield">'.$langs->trans("Login").'</td>';
-	print '<td>'.$object->login.'</td>';
+	print '<tr><td class="titlefieldmiddle">'.$langs->trans("Login").'</td>';
+	if (!empty($object->ldap_sid) && $object->statut == 0) {
+		print '<td class="error">';
+		print $langs->trans("LoginAccountDisableInDolibarr");
+		print '</td>';
+	} else {
+		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>';
 
+
+	// Hierarchy
+	print '<tr><td>'.$langs->trans("HierarchicalResponsible").'</td>';
+	print '<td>';
+	if (empty($object->fk_user)) {
+		print '<span class="opacitymedium">'.$langs->trans("None").'</span>';
+	} else {
+		$huser = new User($db);
+		if ($object->fk_user > 0) {
+			$huser->fetch($object->fk_user);
+			print $huser->getNomUrl(1);
+		} else {
+			print '<span class="opacitymedium">'.$langs->trans("None").'</span>';
+		}
+	}
+	print '</td>';
+	print "</tr>\n";
+
+	// Expense report validator
+	if (!empty($conf->expensereport->enabled)) {
+		print '<tr><td>';
+		$text = $langs->trans("ForceUserExpenseValidator");
+		print $form->textwithpicto($text, $langs->trans("ValidatorIsSupervisorByDefault"), 1, 'help');
+		print '</td>';
+		print '<td>';
+		if (!empty($object->fk_user_expense_validator)) {
+			$evuser = new User($db);
+			$evuser->fetch($object->fk_user_expense_validator);
+			print $evuser->getNomUrl(1);
+		}
+		print '</td>';
+		print "</tr>\n";
+	}
+
+	// Holiday request validator
+	if (!empty($conf->holiday->enabled)) {
+		print '<tr><td>';
+		$text = $langs->trans("ForceUserHolidayValidator");
+		print $form->textwithpicto($text, $langs->trans("ValidatorIsSupervisorByDefault"), 1, 'help');
+		print '</td>';
+		print '<td>';
+		if (!empty($object->fk_user_holiday_validator)) {
+			$hvuser = new User($db);
+			$hvuser->fetch($object->fk_user_holiday_validator);
+			print $hvuser->getNomUrl(1);
+		}
+		print '</td>';
+		print "</tr>\n";
+	}
+
+	// Position/Job
+	print '<tr><td>'.$langs->trans("PostOrFunction").'</td>';
+	print '<td>'.dol_escape_htmltag($object->job).'</td>';
+	print '</tr>'."\n";
+
+	// 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))) {
+		$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");
+		print $form->textwithpicto($text, $langs->trans("THMDescription"), 1, 'help', 'classthm');
+		print '</td>';
+		print '<td>';
+		print ($object->thm != '' ?price($object->thm, '', $langs, 1, -1, -1, $conf->currency) : '');
+		print '</td>';
+		print "</tr>\n";
+
+		// TJM
+		print '<tr><td>';
+		$text = $langs->trans("TJM");
+		print $form->textwithpicto($text, $langs->trans("TJMDescription"), 1, 'help', 'classtjm');
+		print '</td>';
+		print '<td>';
+		print ($object->tjm != '' ?price($object->tjm, '', $langs, 1, -1, -1, $conf->currency) : '');
+		print '</td>';
+		print "</tr>\n";
+	}
+
+	// Date employment
+	print '<tr><td>'.$langs->trans("DateOfEmployment").'</td>';
+	print '<td>';
+	if ($object->dateemployment) {
+		print '<span class="opacitymedium">'.$langs->trans("FromDate").'</span> ';
+		print dol_print_date($object->dateemployment, 'day');
+	}
+	if ($object->dateemploymentend) {
+		print '<span class="opacitymedium"> - '.$langs->trans("To").'</span> ';
+		print dol_print_date($object->dateemploymentend, 'day');
+	}
+	print '</td>';
+	print "</tr>\n";
+
+	// Date of birth
+	print '<tr>';
+	print '<td>';
+	print $form->editfieldkey("DateOfBirth", 'birth', $object->birth, $object, $user->rights->user->user->creer);
+	print '</td><td>';
+	print $form->editfieldval("DateOfBirth", 'birth', $object->birth, $object, $user->rights->user->user->creer, 'day', $object->birth);
+	print '</td>';
+	print "</tr>\n";
+
+	// Personal email
 	print '<tr class="nowrap">';
 	print '<td>';
 	print $form->editfieldkey("UserPersonalEmail", 'personal_email', $object->personal_email, $object, $user->rights->user->user->creer);
 	print '</td><td>';
-	print $form->editfieldval("UserPersonalEmail", 'personal_email', $object->personal_email, $object, $user->rights->user->user->creer, 'email', ($object->personal_email != '' ? dol_print_email($object->personal_email) : ''));
+	print $form->editfieldval("UserPersonalEmail", 'personal_email', $object->personal_email, $object, $user->rights->user->user->creer, 'email', '', null, null, '', 0, 'dol_print_email');
 	print '</td>';
 	print '</tr>';
 
+	// Personal phone
 	print '<tr class="nowrap">';
 	print '<td>';
 	print $form->editfieldkey("UserPersonalMobile", 'personal_mobile', $object->personal_mobile, $object, $user->rights->user->user->creer);
 	print '</td><td>';
-	print $form->editfieldval("UserPersonalMobile", 'personal_mobile', $object->personal_mobile, $object, $user->rights->user->user->creer, 'string', ($object->personal_mobile != '' ? dol_print_phone($object->personal_mobile) : ''));
+	print $form->editfieldval("UserPersonalMobile", 'personal_mobile', $object->personal_mobile, $object, $user->rights->user->user->creer, 'string', '', null, null, '', 0, 'dol_print_phone');
 	print '</td>';
 	print '</tr>';
 

+ 82 - 89
htdocs/user/card.php

@@ -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>';

+ 19 - 1
htdocs/user/document.php

@@ -163,7 +163,25 @@ if ($object->id) {
 	print '<table class="border tableforfield centpercent">';
 
 	// Login
-	print '<tr><td class="titlefield">'.$langs->trans("Login").'</td><td class="valeur">'.$object->login.'&nbsp;</td></tr>';
+	print '<tr><td class="titlefield">'.$langs->trans("Login").'</td>';
+	if (!empty($object->ldap_sid) && $object->statut == 0) {
+		print '<td class="error">';
+		print $langs->trans("LoginAccountDisableInDolibarr");
+		print '</td>';
+	} else {
+		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>';
 
 	// Nunber of files
 	print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td>'.count($filearray).'</td></tr>';

+ 19 - 1
htdocs/user/note.php

@@ -112,7 +112,25 @@ if ($id) {
 	print '<table class="border centpercent tableforfield">';
 
 	// Login
-	print '<tr><td class="titlefield">'.$langs->trans("Login").'</td><td class="valeur">'.$object->login.'&nbsp;</td></tr>';
+	print '<tr><td class="titlefield">'.$langs->trans("Login").'</td>';
+	if (!empty($object->ldap_sid) && $object->statut == 0) {
+		print '<td class="error">';
+		print $langs->trans("LoginAccountDisableInDolibarr");
+		print '</td>';
+	} else {
+		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>';
 
 	$editenabled = (($action == 'edit') && !empty($user->rights->user->user->creer));
 

+ 14 - 2
htdocs/user/notify/card.php

@@ -164,9 +164,21 @@ if ($result > 0) {
 	// Login
 	print '<tr><td class="titlefield">'.$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>'.$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";