From 331ebbdd738a94d031a619d7f42a6b226e26c754 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Jun 2015 11:42:24 +0200 Subject: [PATCH] Fix behaviour on grey/visible menu must be same everywhere on application. --- htdocs/core/class/html.formcompany.class.php | 2 +- htdocs/core/menus/standard/eldy.lib.php | 41 +++++++++++-------- htdocs/langs/en_US/admin.lang | 1 - htdocs/langs/en_US/main.lang | 1 + htdocs/langs/en_US/users.lang | 1 + htdocs/main.inc.php | 2 +- htdocs/societe/class/societe.class.php | 11 ++--- htdocs/societe/soc.php | 4 +- htdocs/theme/eldy/img/help.png | Bin 657 -> 312 bytes htdocs/theme/eldy/img/info.png | Bin 657 -> 317 bytes htdocs/theme/eldy/style.css.php | 4 +- htdocs/user/class/user.class.php | 7 ++-- 12 files changed, 42 insertions(+), 32 deletions(-) diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index 05200feee30..19685bd950f 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -513,7 +513,7 @@ class FormCompany } } $out.= ''; - if ($user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); + if ($user->admin) $out.= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); // Make select dynamic include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index b1197202d1b..874aa723c69 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -462,15 +462,16 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu { $langs->load("users"); - if ($user->admin) - { - $langs->load("admin"); - $langs->load("help"); + //if ($user->admin) + //{ // Setup - $newmenu->add("/admin/index.php?mainmenu=home&leftmenu=setup", $langs->trans("Setup"), 0, 1, '', $mainmenu, 'setup'); + $newmenu->add("/admin/index.php?mainmenu=home&leftmenu=setup", $langs->trans("Setup"), 0, $user->admin, '', $mainmenu, 'setup'); if (empty($leftmenu) || $leftmenu=="setup") { + $langs->load("admin"); + $langs->load("help"); + $warnpicto=''; if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) { @@ -503,9 +504,12 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu } // System tools - $newmenu->add("/admin/tools/index.php?mainmenu=home&leftmenu=admintools", $langs->trans("SystemTools"), 0, 1, '', $mainmenu, 'admintools'); + $newmenu->add("/admin/tools/index.php?mainmenu=home&leftmenu=admintools", $langs->trans("SystemTools"), 0, $user->admin, '', $mainmenu, 'admintools'); if (empty($leftmenu) || preg_match('/^admintools/',$leftmenu)) { + $langs->load("admin"); + $langs->load("help"); + $newmenu->add('/admin/system/dolibarr.php?mainmenu=home&leftmenu=admintools_info', $langs->trans('InfoDolibarr'), 1); if (empty($leftmenu) || $leftmenu=='admintools_info') $newmenu->add('/admin/system/modules.php?mainmenu=home&leftmenu=admintools_info', $langs->trans('Modules'), 2); if (empty($leftmenu) || $leftmenu=='admintools_info') $newmenu->add('/admin/triggers.php?mainmenu=home&leftmenu=admintools_info', $langs->trans('Triggers'), 2); @@ -534,7 +538,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu { if (empty($user->societe_id)) { - $newmenu->add("/admin/tools/index.php?mainmenu=home&leftmenu=modulesadmintools", $langs->trans("ModulesSystemTools"), 0, 1, '', $mainmenu, 'modulesadmintools'); + $newmenu->add("/admin/tools/index.php?mainmenu=home&leftmenu=modulesadmintools", $langs->trans("ModulesSystemTools"), 0, $user->admin, '', $mainmenu, 'modulesadmintools'); // Special case: This entry can't be embedded into modules because we need it for both module service and products and we don't want duplicate lines. if ((empty($leftmenu) || $leftmenu=="modulesadmintools") && $user->admin) { @@ -543,18 +547,21 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu } } } - } + //} - $newmenu->add("/user/home.php?leftmenu=users", $langs->trans("MenuUsersAndGroups"), 0, 1, '', $mainmenu, 'users'); - if (empty($leftmenu) || $leftmenu == 'none' || $leftmenu=="users") + $newmenu->add("/user/home.php?leftmenu=users", $langs->trans("MenuUsersAndGroups"), 0, $user->rights->user->user->lire, '', $mainmenu, 'users'); + if ($user->rights->user->user->lire) { - $newmenu->add("", $langs->trans("Users"), 1, $user->rights->user->user->lire || $user->admin); - $newmenu->add("/user/card.php?action=create", $langs->trans("NewUser"),2, $user->rights->user->user->creer || $user->admin, '', 'home'); - $newmenu->add("/user/index.php", $langs->trans("ListOfUsers"), 2, $user->rights->user->user->lire || $user->admin); - $newmenu->add("/user/hierarchy.php", $langs->trans("HierarchicView"), 2, $user->rights->user->user->lire || $user->admin); - $newmenu->add("", $langs->trans("Groups"), 1, $user->rights->user->user->lire || $user->admin); - $newmenu->add("/user/group/card.php?action=create", $langs->trans("NewGroup"), 2, ($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->write:$user->rights->user->user->creer) || $user->admin); - $newmenu->add("/user/group/index.php", $langs->trans("ListOfGroups"), 2, ($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->read:$user->rights->user->user->lire) || $user->admin); + if (empty($leftmenu) || $leftmenu == 'none' || $leftmenu=="users") + { + $newmenu->add("", $langs->trans("Users"), 1, $user->rights->user->user->lire || $user->admin); + $newmenu->add("/user/card.php?action=create", $langs->trans("NewUser"),2, $user->rights->user->user->creer || $user->admin, '', 'home'); + $newmenu->add("/user/index.php", $langs->trans("ListOfUsers"), 2, $user->rights->user->user->lire || $user->admin); + $newmenu->add("/user/hierarchy.php", $langs->trans("HierarchicView"), 2, $user->rights->user->user->lire || $user->admin); + $newmenu->add("", $langs->trans("Groups"), 1, $user->rights->user->user->lire || $user->admin); + $newmenu->add("/user/group/card.php?action=create", $langs->trans("NewGroup"), 2, ($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->write:$user->rights->user->user->creer) || $user->admin); + $newmenu->add("/user/group/index.php", $langs->trans("ListOfGroups"), 2, ($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->read:$user->rights->user->user->lire) || $user->admin); + } } } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 2c6db68dac7..61ce5d93edf 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -149,7 +149,6 @@ MenuForUsers=Menu for users LangFile=.lang file System=System SystemInfo=System information -SystemTools=System tools SystemToolsArea=System tools area SystemToolsAreaDesc=This area provides administration features. Use the menu to choose the feature you're looking for. Purge=Purge diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index b61140df377..ae766c7a147 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -680,6 +680,7 @@ LinkedToSpecificUsers=Linked to a particular user contact DeleteAFile=Delete a file ConfirmDeleteAFile=Are you sure you want to delete file NoResults=No results +SystemTools=System tools ModulesSystemTools=Modules tools Test=Test Element=Element diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang index 9670d002be6..e6764df49a2 100644 --- a/htdocs/langs/en_US/users.lang +++ b/htdocs/langs/en_US/users.lang @@ -57,6 +57,7 @@ RemoveFromGroup=Remove from group PasswordChangedAndSentTo=Password changed and sent to %s. PasswordChangeRequestSent=Request to change password for %s sent to %s. MenuUsersAndGroups=Users & Groups +MenuMyUserCard=My user card LastGroupsCreated=Last %s created groups LastUsersCreated=Last %s users created ShowGroup=Show group diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 13ef97c514e..7a390ab7d9d 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1877,9 +1877,9 @@ if (! function_exists("llxFooter")) if ($comment) print ''."\n"; printCommonFooter($zone); + //var_dump($langs); // Uncommment to see the property _tab_loaded to see which language file were loaded if (empty($conf->dol_hide_leftmenu) && empty($conf->dol_use_jmobile) && empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print ' '."\n"; // End div container - print "\n"; print "\n"; } diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 18bfea5fb0c..e4b6334690e 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -83,14 +83,14 @@ class Societe extends CommonObject var $state_id; var $state_code; var $state; - + /** - * State code + * State code * @var string * @deprecated Use state_code instead */ var $departement_code; - + /** * @var string * @deprecated Use state instead @@ -1762,7 +1762,8 @@ class Societe extends CommonObject if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; - if ($conf->global->SOCIETE_ADD_REF_IN_LIST && (!empty($withpicto))) { + if ($conf->global->SOCIETE_ADD_REF_IN_LIST && (!empty($withpicto))) + { if (($this->client) && (! empty ( $this->code_client ))) { $code = $this->code_client . ' - '; } @@ -1834,7 +1835,7 @@ class Societe extends CommonObject if ($withpicto) $result.=($link.img_object(($notooltip?'':$label), 'company', ($notooltip?'':'class="classfortooltip"')).$linkend); if ($withpicto && $withpicto != 2) $result.=' '; - $result.=$link.($maxlen?dol_trunc($name,$maxlen):$name).$linkend; + if ($withpicto != 2) $result.=$link.($maxlen?dol_trunc($name,$maxlen):$name).$linkend; return $result; } diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 9d7a0cf8a1e..760982b9ad7 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -1124,11 +1124,11 @@ else // Type - Size print ''."\n"; print $form->selectarray("typent_id", $formcompany->typent_array(0), $object->typent_id, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT)); - if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); + if ($user->admin) print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print ''; print ''; print $form->selectarray("effectif_id", $formcompany->effectif_array(0), $object->effectif_id); - if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); + if ($user->admin) print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print ''; // Legal Form diff --git a/htdocs/theme/eldy/img/help.png b/htdocs/theme/eldy/img/help.png index 12e6cd655d6630345cd24c74b5e85bec38524c1a..2c56e645a01cb767febeb54c59743603f8c21d88 100644 GIT binary patch delta 296 zcmV+@0oVSK1-Jr`8Gi%-006Z?6u8U8^~Z+I|nh!pVXXz^WDK|A_&)GLK_v u&n4cy3HMgkmm$==kOw#ZER?6QuJ!{>j4kTO#l(jI0000)|woIwP4ys zs;*RF5w)vCVL*&qR2c9w5Y#SIVXP%i1k*uL*yC0y?jL4|XVwN4`s`Qw2fruet4szv#Ko z!?y9*U`!BR%>|lc8w9~4W{(Xg!~1hx2c^AnDL#-potGt9m1H0(x}<=-tmb7cuY!W2 z6*MTTK-M@&QFTQFie{)fP<5yRr0GD@4GnOh##h7C0n!buBLWN)KnVE3qz1$WchiE% zga|`Kpot-0F@@NM#6ieJCPpSfm_re^5U~+;OiWB-VGgC3a(A%BVc2GbT7=rfvWVpn zixJx)JaibfY-%&=FpI;O?aJY0JIrRxam9E!jLWs^n@Au3qm#v4X2{L{gM=&dZ$*B` zvveXhEY>B_TPiP???gj0p4q9HW^L+dyxG+#f6umFSgKw-ayC@2@9V4{PksD$sJhhg zKDhR`w(-mF_4Q)ZdpXk5cX%=Ub+s{SY$=U)PmE6t?Yh`IG7^~VtS^6F%sjaJj@Ha< z==|#^w{P|BoPYeNeNLRMER5~gU9D6;eDY0Rzxh&q{xIAfsGaz+b>-@Sz7p+kDNSpM g1Dkpq*)x%ZNBGkg{q?jb>Emw}(#cF>A%1T9ALDq4X#fBK diff --git a/htdocs/theme/eldy/img/info.png b/htdocs/theme/eldy/img/info.png index 12e6cd655d6630345cd24c74b5e85bec38524c1a..78650eb53645eb397f4174b7262c2e581db1671d 100644 GIT binary patch delta 301 zcmV+|0n+}F1-$~08Gi%-006Z?igj)$v))YTXGHZX_q5{+NCOnh2voLD)noi57ILyLk?&88_+wElG1hJ;%Oc)upqS}nQe_pxOc89d| z5GTTc8+`hZOeQTe;I(pI&aZ5oZT@-|f02FxJ{K{gwpaUp00000NkvXXu0mjfT)|woIwP4ys zs;*RF5w)vCVL*&qR2c9w5Y#SIVXP%i1k*uL*yC0y?jL4|XVwN4`s`Qw2fruet4szv#Ko z!?y9*U`!BR%>|lc8w9~4W{(Xg!~1hx2c^AnDL#-potGt9m1H0(x}<=-tmb7cuY!W2 z6*MTTK-M@&QFTQFie{)fP<5yRr0GD@4GnOh##h7C0n!buBLWN)KnVE3qz1$WchiE% zga|`Kpot-0F@@NM#6ieJCPpSfm_re^5U~+;OiWB-VGgC3a(A%BVc2GbT7=rfvWVpn zixJx)JaibfY-%&=FpI;O?aJY0JIrRxam9E!jLWs^n@Au3qm#v4X2{L{gM=&dZ$*B` zvveXhEY>B_TPiP???gj0p4q9HW^L+dyxG+#f6umFSgKw-ayC@2@9V4{PksD$sJhhg zKDhR`w(-mF_4Q)ZdpXk5cX%=Ub+s{SY$=U)PmE6t?Yh`IG7^~VtS^6F%sjaJj@Ha< z==|#^w{P|BoPYeNeNLRMER5~gU9D6;eDY0Rzxh&q{xIAfsGaz+b>-@Sz7p+kDNSpM g1Dkpq*)x%ZNBGkg{q?jb>Emw}(#cF>A%1T9ALDq4X#fBK diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index a546ba1544a..5a6723ed535 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1040,11 +1040,11 @@ div.vmenu, td.vmenu { #menu_contenu_logo { padding-right: 4px; } a.vmenu:link, a.vmenu:visited, a.vmenu:hover, a.vmenu:active { font-size:px; font-family: ; text-align: ; font-weight: bold; } -font.vmenudisabled { font-size:px; font-family: ; text-align: ; font-weight: bold; color: #93a5aa; } +font.vmenudisabled { font-size:px; font-family: ; text-align: ; font-weight: bold; color: #aaa; } a.vmenu:link, a.vmenu:visited { color: #; } a.vsmenu:link, a.vsmenu:visited, a.vsmenu:hover, a.vsmenu:active, span.vsmenu { font-size:px; font-family: ; text-align: ; font-weight: normal; color: #202020; margin: 1px 1px 1px 8px; } -font.vsmenudisabled { font-size:px; font-family: ; text-align: ; font-weight: normal; color: #93a5aa; } +font.vsmenudisabled { font-size:px; font-family: ; text-align: ; font-weight: normal; color: #aaa; } a.vsmenu:link, a.vsmenu:visited { color: #; } font.vsmenudisabledmargin { margin: 1px 1px 1px 8px; } diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 0da1b5f8d90..b255e3ffa68 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1829,10 +1829,11 @@ class User extends CommonObject $label.= '
' . $langs->trans("EMail").': '.$this->email; if (! empty($this->admin)) $label.= '
' . $langs->trans("Administrator").': '.yn($this->admin); - if (! empty($this->societe_id)) { + if (! empty($this->societe_id)) // Add thirdparty for external users + { $thirdpartystatic = new Societe($db); $thirdpartystatic->fetch($this->societe_id); - $companylink = ' ('.$thirdpartystatic->getNomUrl('','').')'; + $companylink = ' '.$thirdpartystatic->getNomUrl(2); // picto only of company $company=' ('.$langs->trans("Company").': '.$thirdpartystatic->name.')'; } $type=($this->societe_id?$langs->trans("External").$company:$langs->trans("Internal")); @@ -1875,7 +1876,7 @@ class User extends CommonObject $result.=($link.img_object(($notooltip?'':$label), 'user', ($notooltip?'':'class="classfortooltip"')).$linkend); if ($withpicto != 2) $result.=' '; } - $result.= $link . $this->getFullName($langs,'',-1,$maxlen) . $companylink . $linkend; + $result.= $link . $this->getFullName($langs,'',-1,$maxlen) . $linkend . $companylink; return $result; }