From ffc07efb64f95dd86e413943b229f66031f0f22a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 Oct 2021 14:28:04 +0200 Subject: [PATCH] Look and feel v15 --- htdocs/core/class/html.form.class.php | 25 ++-- htdocs/core/modules/modUser.class.php | 18 +-- htdocs/theme/eldy/global.inc.php | 13 +- htdocs/theme/eldy/info-box.inc.php | 5 +- htdocs/theme/md/info-box.inc.php | 4 +- htdocs/user/bank.php | 158 +++++++++++++++++++++++- htdocs/user/card.php | 171 ++++++++++++-------------- htdocs/user/document.php | 20 ++- htdocs/user/note.php | 20 ++- htdocs/user/notify/card.php | 16 ++- 10 files changed, 328 insertions(+), 122 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 68bba0e04b5..98ba6ca3cc2 100644 --- a/htdocs/core/class/html.form.class.php +++ b/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 .= ''; + $ret .= ''; } elseif (preg_match('/^(checkbox)/', $typeofdata)) { $tmp = explode(':', $typeofdata); $ret .= ''; @@ -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.'
'.$object->label; } elseif (in_array($object->element, array('adherent_type'))) { @@ -9085,7 +9094,7 @@ class Form } $ret .= ''; if ($object->photo) { - $ret .= ''; + $ret .= ''; } $ret .= ''; $ret .= '
'.$langs->trans("Delete").'



'; diff --git a/htdocs/core/modules/modUser.class.php b/htdocs/core/modules/modUser.class.php index 292fc227db5..abeca50b77d 100644 --- a/htdocs/core/modules/modUser.class.php +++ b/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 diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 2fd4c7c966f..6aa2a066e89 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/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; */ } diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index 3fe2552c86a..d1d47c568c5 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/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; */ } diff --git a/htdocs/theme/md/info-box.inc.php b/htdocs/theme/md/info-box.inc.php index a363475c409..a4af0081aeb 100644 --- a/htdocs/theme/md/info-box.inc.php +++ b/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; diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 6bf0cc66c7c..fa4c7231de5 100644 --- a/htdocs/user/bank.php +++ b/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 ''; - print ''; - print ''; + print ''; + if (!empty($object->ldap_sid) && $object->statut == 0) { + print ''; + } else { + print ''; + } print ''; + + // Hierarchy + print ''; + print ''; + print "\n"; + + // Expense report validator + if (!empty($conf->expensereport->enabled)) { + print ''; + print ''; + print "\n"; + } + + // Holiday request validator + if (!empty($conf->holiday->enabled)) { + print ''; + print ''; + print "\n"; + } + + // Position/Job + print ''; + print ''; + print ''."\n"; + + // Weeklyhours + print ''; + print ''; + print "\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 ''; + print ''; + print "\n"; + + // THM + print ''; + print ''; + print "\n"; + + // TJM + print ''; + print ''; + print "\n"; + } + + // Date employment + print ''; + print ''; + print "\n"; + + // Date of birth + print ''; + print ''; + print "\n"; + + // Personal email print ''; print ''; print ''; + // Personal phone print ''; print ''; print ''; diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 7df2c29dcc2..2e06d89c39c 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1408,23 +1408,24 @@ if ($action == 'create' || $action == 'adduserldap') { // Login print ''; if (!empty($object->ldap_sid) && $object->statut == 0) { - print ''; + print ''; } else { - print ''; + print ''; } print ''."\n"; - // Administrator - print ''."\n"; - // Type print ''."\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 ''; @@ -1506,30 +1507,31 @@ if ($action == 'create' || $action == 'adduserldap') { print "\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 ''; - } - // Position/Job print ''; print ''; print ''."\n"; - if ((!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read) && in_array($id, $childids)) + // Weeklyhours + print ''; + print ''; + print "\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 ''; + print ''; + print "\n"; + // THM print ''; print "\n"; - - // Salary - print ''; - print ''; - print "\n"; } - // Weeklyhours - print ''; - print ''; - print "\n"; - // Date employment print ''; print ''; print "\n"; - // Date of birth - print ''; - print ''; - print "\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 ''; + } // Accountancy code if (!empty($conf->accounting->enabled)) { @@ -2336,6 +2329,18 @@ if ($action == 'create' || $action == 'adduserldap') { print ''; } + // OpenID url + if (isset($conf->file->main_authentication) && preg_match('/openid/', $conf->file->main_authentication) && !empty($conf->global->MAIN_OPENIDURL_PERUSER)) { + print "".''; + print ''; + } print '
'.$langs->trans("Login").''.$object->login.'
'.$langs->trans("Login").''; + print $langs->trans("LoginAccountDisableInDolibarr"); + print ''; + $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 '
'.$langs->trans("HierarchicalResponsible").''; + if (empty($object->fk_user)) { + print ''.$langs->trans("None").''; + } else { + $huser = new User($db); + if ($object->fk_user > 0) { + $huser->fetch($object->fk_user); + print $huser->getNomUrl(1); + } else { + print ''.$langs->trans("None").''; + } + } + print '
'; + $text = $langs->trans("ForceUserExpenseValidator"); + print $form->textwithpicto($text, $langs->trans("ValidatorIsSupervisorByDefault"), 1, 'help'); + print ''; + if (!empty($object->fk_user_expense_validator)) { + $evuser = new User($db); + $evuser->fetch($object->fk_user_expense_validator); + print $evuser->getNomUrl(1); + } + print '
'; + $text = $langs->trans("ForceUserHolidayValidator"); + print $form->textwithpicto($text, $langs->trans("ValidatorIsSupervisorByDefault"), 1, 'help'); + print ''; + if (!empty($object->fk_user_holiday_validator)) { + $hvuser = new User($db); + $hvuser->fetch($object->fk_user_holiday_validator); + print $hvuser->getNomUrl(1); + } + print '
'.$langs->trans("PostOrFunction").''.dol_escape_htmltag($object->job).'
'.$langs->trans("WeeklyHours").''; + print price2num($object->weeklyhours); + print '
'.$langs->trans("Salary").''; + print ($object->salary != '' ? img_picto('', 'salary', 'class="pictofixedwidth paddingright"').''.price($object->salary, '', $langs, 1, -1, -1, $conf->currency) : '').''; + print '
'; + $text = $langs->trans("THM"); + print $form->textwithpicto($text, $langs->trans("THMDescription"), 1, 'help', 'classthm'); + print ''; + print ($object->thm != '' ?price($object->thm, '', $langs, 1, -1, -1, $conf->currency) : ''); + print '
'; + $text = $langs->trans("TJM"); + print $form->textwithpicto($text, $langs->trans("TJMDescription"), 1, 'help', 'classtjm'); + print ''; + print ($object->tjm != '' ?price($object->tjm, '', $langs, 1, -1, -1, $conf->currency) : ''); + print '
'.$langs->trans("DateOfEmployment").''; + if ($object->dateemployment) { + print ''.$langs->trans("FromDate").' '; + print dol_print_date($object->dateemployment, 'day'); + } + if ($object->dateemploymentend) { + print ' - '.$langs->trans("To").' '; + print dol_print_date($object->dateemploymentend, 'day'); + } + print '
'; + print $form->editfieldkey("DateOfBirth", 'birth', $object->birth, $object, $user->rights->user->user->creer); + print ''; + print $form->editfieldval("DateOfBirth", 'birth', $object->birth, $object, $user->rights->user->user->creer, 'day', $object->birth); + print '
'; print $form->editfieldkey("UserPersonalEmail", 'personal_email', $object->personal_email, $object, $user->rights->user->user->creer); print ''; - 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 '
'; print $form->editfieldkey("UserPersonalMobile", 'personal_mobile', $object->personal_mobile, $object, $user->rights->user->user->creer); print ''; - 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 '
'.$langs->trans("Login").''.$langs->trans("LoginAccountDisableInDolibarr").''; + print $langs->trans("LoginAccountDisableInDolibarr"); + print ''.showValueWithClipboardCPButton($object->login).''; + $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 '
'.$langs->trans("Administrator").''; - 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 '
'; $text = $langs->trans("Type"); @@ -1455,7 +1456,7 @@ if ($action == 'create' || $action == 'adduserldap') { //print yn($object->employee); print '
'.$langs->trans("HierarchicalResponsible").'
'.$langs->trans("DefaultWarehouse").''; - if ($object->fk_warehouse > 0) { - $warehousestatic = new Entrepot($db); - $warehousestatic->fetch($object->fk_warehouse); - print $warehousestatic->getNomUrl(1); - } - print '
'.$langs->trans("PostOrFunction").''.dol_escape_htmltag($object->job).'
'.$langs->trans("WeeklyHours").''; + print price2num($object->weeklyhours); + print '
'.$langs->trans("Salary").''; + print ($object->salary != '' ? img_picto('', 'salary', 'class="pictofixedwidth paddingright"').''.price($object->salary, '', $langs, 1, -1, -1, $conf->currency) : '').''; + print '
'; $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 '
'.$langs->trans("Salary").''; - print ($object->salary != '' ? img_picto('', 'salary', 'class="pictofixedwidth paddingright"').''.price($object->salary, '', $langs, 1, -1, -1, $conf->currency) : '').''; - print '
'.$langs->trans("WeeklyHours").''; - print price2num($object->weeklyhours); - print '
'.$langs->trans("DateOfEmployment").''; @@ -1579,12 +1567,17 @@ if ($action == 'create' || $action == 'adduserldap') { print '
'.$langs->trans("DateOfBirth").''; - print dol_print_date($object->birth, 'day'); - print '
'.$langs->trans("DefaultWarehouse").''; + if ($object->fk_warehouse > 0) { + $warehousestatic = new Entrepot($db); + $warehousestatic->fetch($object->fk_warehouse); + print $warehousestatic->getNomUrl(1); + } + print '
'.$langs->trans("OpenIDURL").''; + if ($caneditfield) { + print ''; + } else { + print ''; + print $object->openid; + } + print '

'; @@ -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 "".''; - print '
'.$langs->trans("OpenIDURL").''; - if ($caneditfield) { - print ''; - } else { - print ''; - print $object->openid; - } + print '

'; + + // Default warehouse + if (!empty($conf->stock->enabled) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) { + print ''; } - print '
'.$langs->trans("DefaultWarehouse").''; + print $formproduct->selectWarehouses($object->fk_warehouse, 'fk_warehouse', 'warehouseopen', 1); + print ' '; print '

'; - // Accountancy code if (!empty($conf->accounting->enabled)) { print ""; @@ -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 ''; - } - // Position/Job print ''; print ''; - if ((!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read) && in_array($id, $childids)) + // Weeklyhours + print ''; + print ''; + print "\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 ''; + print ''; + print "\n"; // THM print ''; print "\n"; - - // Salary - print ''; - print ''; - print "\n"; } - // Weeklyhours - print ''; - print ''; - print "\n"; - // Date employment print ''; print '
'.$langs->trans("DefaultWarehouse").''; - print $formproduct->selectWarehouses($object->fk_warehouse, 'fk_warehouse', 'warehouseopen', 1); - print ' '; - print '
'.$langs->trans("PostOrFunction").''; @@ -2656,10 +2648,29 @@ if ($action == 'create' || $action == 'adduserldap') { } print '
'.$langs->trans("WeeklyHours").''; + if ($caneditfield) { + print ''; + } else { + print price2num($object->weeklyhours); + } + print '
'.$langs->trans("Salary").''; + print img_picto('', 'salary', 'class="pictofixedwidth paddingright"').''; + print '
'; @@ -2688,26 +2699,8 @@ if ($action == 'create' || $action == 'adduserldap') { } print '
'.$langs->trans("Salary").''; - print img_picto('', 'salary', 'class="pictofixedwidth paddingright"').''; - print '
'.$langs->trans("WeeklyHours").''; - if ($caneditfield) { - print ''; - } else { - print price2num($object->weeklyhours); - } - print '
'.$langs->trans("DateEmployment").''; diff --git a/htdocs/user/document.php b/htdocs/user/document.php index 9bd109ec5fb..e420c63cfa9 100644 --- a/htdocs/user/document.php +++ b/htdocs/user/document.php @@ -163,7 +163,25 @@ if ($object->id) { print ''; // Login - print ''; + print ''; + if (!empty($object->ldap_sid) && $object->statut == 0) { + print ''; + } else { + print ''; + } + print ''; // Nunber of files print ''; diff --git a/htdocs/user/note.php b/htdocs/user/note.php index ba8c10f351b..1cf1f112df4 100644 --- a/htdocs/user/note.php +++ b/htdocs/user/note.php @@ -112,7 +112,25 @@ if ($id) { print '
'.$langs->trans("Login").''.$object->login.' 
'.$langs->trans("Login").''; + print $langs->trans("LoginAccountDisableInDolibarr"); + print ''; + $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 '
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'; // Login - print ''; + print ''; + if (!empty($object->ldap_sid) && $object->statut == 0) { + print ''; + } else { + print ''; + } + print ''; $editenabled = (($action == 'edit') && !empty($user->rights->user->user->creer)); diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php index 48cbad46799..615e2983b73 100644 --- a/htdocs/user/notify/card.php +++ b/htdocs/user/notify/card.php @@ -164,9 +164,21 @@ if ($result > 0) { // Login print ''; if (!empty($object->ldap_sid) && $object->statut == 0) { - print ''; + print ''; } else { - print ''; + print ''; } print ''."\n";
'.$langs->trans("Login").''.$object->login.' 
'.$langs->trans("Login").''; + print $langs->trans("LoginAccountDisableInDolibarr"); + print ''; + $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 '
'.$langs->trans("Login").''.$langs->trans("LoginAccountDisableInDolibarr").''; + print $langs->trans("LoginAccountDisableInDolibarr"); + print ''.$object->login.''; + $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 '