NEW: Add company info in dropdown login menu

This commit is contained in:
Alexandre SPANGARO
2021-03-21 22:58:21 +01:00
parent eeb1c5d884
commit ea938f64da
6 changed files with 41 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>
@@ -3537,7 +3537,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'object_salary', 'object_shipment', 'object_share-alt', 'object_supplier_invoice', 'object_supplier_invoicea', 'object_supplier_invoiced', 'object_supplier_order', 'object_supplier_proposal', 'object_service', 'object_stock', 'object_salary', 'object_shipment', 'object_share-alt', 'object_supplier_invoice', 'object_supplier_invoicea', 'object_supplier_invoiced', 'object_supplier_order', 'object_supplier_proposal', 'object_service', 'object_stock',
'object_technic', 'object_ticket', 'object_trip', 'object_user', 'object_group', 'object_member', 'object_technic', 'object_ticket', 'object_trip', 'object_user', 'object_group', 'object_member',
'object_phoning', 'object_phoning_mobile', 'object_phoning_fax', 'object_email', 'object_website', 'object_movement', 'object_phoning', 'object_phoning_mobile', 'object_phoning_fax', 'object_email', 'object_website', 'object_movement',
'off', 'on', 'order', 'off', 'on', 'order', 'copy',
'paiment', 'play', 'pdf', 'playdisabled', 'previous', 'poll', 'pos', 'printer', 'product', 'propal', 'stock', 'resize', 'service', 'stats', 'trip', 'paiment', 'play', 'pdf', 'playdisabled', 'previous', 'poll', 'pos', 'printer', 'product', 'propal', 'stock', 'resize', 'service', 'stats', 'trip',
'setup', 'share-alt', 'sign-out', 'split', 'stripe', 'stripe-s', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'vcard', 'wrench', 'setup', 'share-alt', 'sign-out', 'split', 'stripe', 'stripe-s', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'vcard', 'wrench',
'github', 'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp', 'github', 'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp',

View File

@@ -180,6 +180,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
@@ -1127,3 +1128,4 @@ ConfirmAffectTagQuestion=Are you sure you want to affect tags to the %s selected
CategTypeNotFound=No tag type found for type of records CategTypeNotFound=No tag type found for type of records
CopiedToClipboard=Copied to clipboard CopiedToClipboard=Copied to clipboard
InformationOnLinkToContract=This amount is only the total of all the lines of the contract. No notion of time is taken into consideration. InformationOnLinkToContract=This amount is only the total of all the lines of the contract. No notion of time is taken into consideration.
HelpCopyToClipboardShort=Copier dans le presse-papier

View File

@@ -12,8 +12,9 @@
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* 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>'.$conf->global->MAIN_INFO_SIREN.'</span> <span class="copyToClipboard">'.img_picto($langs->trans("HelpCopyToClipboardShort"), 'copy').'</span></i>';
if(!empty($conf->global->MAIN_INFO_SIRET)) $dropdownBody .= '<br><b>'.$langs->transcountry("ProfId2Short", $mysoc->country_code).'</b>: <span>'.$conf->global->MAIN_INFO_SIRET.'</span> <span class="copyToClipboard">'.img_picto($langs->trans("HelpCopyToClipboardShort"), 'copy').'</span></i>';
if(!empty($conf->global->MAIN_INFO_APE)) $dropdownBody .= '<br><b>'.$langs->transcountry("ProfId3Short", $mysoc->country_code).'</b>: <span>'.$conf->global->MAIN_INFO_APE.'</span> <span class="copyToClipboard">'.img_picto($langs->trans("HelpCopyToClipboardShort"), 'copy').'</span></i>';
if(!empty($conf->global->MAIN_INFO_RCS)) $dropdownBody .= '<br><b>'.$langs->transcountry("ProfId4Short", $mysoc->country_code).'</b>: <span>'.$conf->global->MAIN_INFO_RCS.'</span> <span class="copyToClipboard">'.img_picto($langs->trans("HelpCopyToClipboardShort"), 'copy').'</span></i>';
if(!empty($conf->global->MAIN_INFO_PROFID5)) $dropdownBody .= '<br><b>'.$langs->transcountry("ProfId5Short", $mysoc->country_code).'</b>: <span>'.$conf->global->MAIN_INFO_PROFID5.'</span> <span class="copyToClipboard">'.img_picto($langs->trans("HelpCopyToClipboardShort"), 'copy').'</span></i>';
if(!empty($conf->global->MAIN_INFO_PROFID6)) $dropdownBody .= '<br><b>'.$langs->transcountry("ProfId6Short", $mysoc->country_code).'</b>: <span>'.$conf->global->MAIN_INFO_PROFID6.'</span> <span class="copyToClipboard">'.img_picto($langs->trans("HelpCopyToClipboardShort"), 'copy').'</span></i>';
if(!empty($conf->global->MAIN_INFO_TVAINTRA)) $dropdownBody .= '<br><b>'.$langs->trans("VATIntraShort").'</b>: <span>'.$conf->global->MAIN_INFO_TVAINTRA.'</span> <span class="copyToClipboard">'.img_picto($langs->trans("HelpCopyToClipboardShort"), 'copy').'</span></i>';
$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" >';
@@ -2138,6 +2153,17 @@ function top_menu_user($hideloginname = 0, $urllogout = '')
$("#topmenu-login-dropdown").toggleClass("open"); $("#topmenu-login-dropdown").toggleClass("open");
}); });
$(".copyToClipboard").on("click", function() {
var dummyContent = $(this).prevAll("span:first").text();
var dummy = $("<input id = \"dummy\">").val(dummyContent).appendTo("body").select();
document.execCommand("copy");
document.getElementById("dummy").remove();
});
$("#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;