Merge pull request #16929 from aspangaro/14a28

NEW: Add company info in dropdown login menu
This commit is contained in:
Laurent Destailleur 2021-03-29 19:02:12 +02:00 committed by GitHub
commit 715490be0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 33 additions and 7 deletions

View File

@ -9,7 +9,7 @@
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr> * Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2018 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2018 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@open-dsi.fr> * Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2014 Cédric GROSS <c.gross@kreiz-it.fr> * Copyright (C) 2014 Cédric GROSS <c.gross@kreiz-it.fr>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>

View File

@ -181,6 +181,12 @@ ProfId3FR=Prof Id 3 (NAF, old APE)
ProfId4FR=Prof Id 4 (RCS/RM) ProfId4FR=Prof Id 4 (RCS/RM)
ProfId5FR=Prof Id 5 (numéro EORI) ProfId5FR=Prof Id 5 (numéro EORI)
ProfId6FR=- ProfId6FR=-
ProfId1ShortFR=SIREN
ProfId2ShortFR=SIRET
ProfId3ShortFR=NAF
ProfId4ShortFR=RCS
ProfId5ShortFR=EORI
ProfId6ShortFR=-
ProfId1GB=Registration Number ProfId1GB=Registration Number
ProfId2GB=- ProfId2GB=-
ProfId3GB=SIC ProfId3GB=SIC

View File

@ -1060,6 +1060,7 @@ YouAreCurrentlyInSandboxMode=You are currently in the %s "sandbox" mode
Inventory=Inventory Inventory=Inventory
AnalyticCode=Analytic code AnalyticCode=Analytic code
TMenuMRP=MRP TMenuMRP=MRP
ShowCompanyInfos=Show company infos
ShowMoreInfos=Show More Infos ShowMoreInfos=Show More Infos
NoFilesUploadedYet=Please upload a document first NoFilesUploadedYet=Please upload a document first
SeePrivateNote=See private note SeePrivateNote=See private note

View File

@ -14,6 +14,7 @@
* Copyright (C) 2020 Demarest Maxime <maxime@indelog.fr> * Copyright (C) 2020 Demarest Maxime <maxime@indelog.fr>
* Copyright (C) 2020 Charlene Benke <charlie@patas-monkey.com> * Copyright (C) 2020 Charlene Benke <charlie@patas-monkey.com>
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -1981,6 +1982,20 @@ function top_menu_user($hideloginname = 0, $urllogout = '')
} }
$dropdownBody = ''; $dropdownBody = '';
$dropdownBody .= '<span id="topmenulogincompanyinfo-btn"><i class="fa fa-caret-right"></i> '.$langs->trans("ShowCompanyInfos").'</span>';
$dropdownBody .= '<div id="topmenulogincompanyinfo" >';
if (!empty($conf->global->MAIN_INFO_SIREN)) $dropdownBody .= '<br><b>'.$langs->transcountry("ProfId1Short", $mysoc->country_code).'</b>: <span>'.showValueWithClipboardCPButton($conf->global->MAIN_INFO_SIREN).'</span>';
if (!empty($conf->global->MAIN_INFO_SIRET)) $dropdownBody .= '<br><b>'.$langs->transcountry("ProfId2Short", $mysoc->country_code).'</b>: <span>'.showValueWithClipboardCPButton($conf->global->MAIN_INFO_SIRET).'</span>';
if (!empty($conf->global->MAIN_INFO_APE)) $dropdownBody .= '<br><b>'.$langs->transcountry("ProfId3Short", $mysoc->country_code).'</b>: <span>'.showValueWithClipboardCPButton($conf->global->MAIN_INFO_APE).'</span>';
if (!empty($conf->global->MAIN_INFO_RCS)) $dropdownBody .= '<br><b>'.$langs->transcountry("ProfId4Short", $mysoc->country_code).'</b>: <span>'.showValueWithClipboardCPButton($conf->global->MAIN_INFO_RCS).'</span>';
if (!empty($conf->global->MAIN_INFO_PROFID5)) $dropdownBody .= '<br><b>'.$langs->transcountry("ProfId5Short", $mysoc->country_code).'</b>: <span>'.showValueWithClipboardCPButton($conf->global->MAIN_INFO_PROFID5).'</span>';
if (!empty($conf->global->MAIN_INFO_PROFID6)) $dropdownBody .= '<br><b>'.$langs->transcountry("ProfId6Short", $mysoc->country_code).'</b>: <span>'.showValueWithClipboardCPButton($conf->global->MAIN_INFO_PROFID6).'</span>';
if (!empty($conf->global->MAIN_INFO_TVAINTRA)) $dropdownBody .= '<br><b>'.$langs->trans("VATIntraShort").'</b>: <span>'.showValueWithClipboardCPButton($conf->global->MAIN_INFO_TVAINTRA).'</span>';
$dropdownBody .= '</div>';
$dropdownBody .= '<br>';
$dropdownBody .= '<span id="topmenuloginmoreinfo-btn"><i class="fa fa-caret-right"></i> '.$langs->trans("ShowMoreInfos").'</span>'; $dropdownBody .= '<span id="topmenuloginmoreinfo-btn"><i class="fa fa-caret-right"></i> '.$langs->trans("ShowMoreInfos").'</span>';
$dropdownBody .= '<div id="topmenuloginmoreinfo" >'; $dropdownBody .= '<div id="topmenuloginmoreinfo" >';
@ -2137,6 +2152,10 @@ function top_menu_user($hideloginname = 0, $urllogout = '')
$("#topmenu-login-dropdown").toggleClass("open"); $("#topmenu-login-dropdown").toggleClass("open");
}); });
$("#topmenulogincompanyinfo-btn").on("click", function() {
$("#topmenulogincompanyinfo").slideToggle();
});
$("#topmenuloginmoreinfo-btn").on("click", function() { $("#topmenuloginmoreinfo-btn").on("click", function() {
$("#topmenuloginmoreinfo").slideToggle(); $("#topmenuloginmoreinfo").slideToggle();
});'; });';

View File

@ -277,14 +277,14 @@ a.top-menu-dropdown-link {
text-decoration: none; text-decoration: none;
} }
#topmenuloginmoreinfo-btn{ #topmenuloginmoreinfo-btn, #topmenulogincompanyinfo-btn {
display: block; display: block;
text-aling: right; text-aling: right;
color:#666; color:#666;
cursor: pointer; cursor: pointer;
} }
#topmenuloginmoreinfo{ #topmenuloginmoreinfo, #topmenulogincompanyinfo {
display: none; display: none;
clear: both; clear: both;
font-size: 0.95em; font-size: 0.95em;

View File

@ -283,14 +283,14 @@ a.top-menu-dropdown-link {
text-decoration: none; text-decoration: none;
} }
#topmenuloginmoreinfo-btn{ #topmenuloginmoreinfo-btn, #topmenulogincompanyinfo-btn {
display: block; display: block;
text-aling: right; text-aling: right;
color:#666; color:#666;
cursor: pointer; cursor: pointer;
} }
#topmenuloginmoreinfo{ #topmenuloginmoreinfo, #topmenulogincompanyinfo {
display: none; display: none;
clear: both; clear: both;
font-size: 0.95em; font-size: 0.95em;