diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index ac774209d30..c2276e8693e 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1731,11 +1731,13 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename = * @param string $url Relative Url to open. For example '/project/card.php' * @param string $disabled Disabled text * @param string $morecss More CSS + * @param string $jsonopen Some JS code to execute on click/open of popup * @param string $backtopagejsfields The back to page must be managed using javascript instead of a redirect. * Value is 'keyforpopupid:Name_of_html_component_to_set_with id,Name_of_html_component_to_set_with_label' + * @param string $accesskey A key to use shortcut * @return string HTML component with button */ -function dolButtonToOpenUrlInDialogPopup($name, $label, $buttonstring, $url, $disabled = '', $morecss = 'classlink button bordertransp', $backtopagejsfields = '') +function dolButtonToOpenUrlInDialogPopup($name, $label, $buttonstring, $url, $disabled = '', $morecss = 'classlink button bordertransp', $jsonopen = '', $backtopagejsfields = '', $accesskey = '') { global $conf; @@ -1763,9 +1765,11 @@ function dolButtonToOpenUrlInDialogPopup($name, $label, $buttonstring, $url, $di //print ''; $out .= ''; - $out .= 'use_javascript_ajax)) { $out .= ' href="'.DOL_URL_ROOT.$url.'" target="_blank"'; + } elseif ($jsonopen) { + $out .= ' onclick="javascript:'.$jsonopen.'"'; } $out .= '>'.$buttonstring.''; @@ -2324,7 +2328,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi // Add alias for thirdparty if (!empty($object->name_alias)) { - $morehtmlref .= '
'.$object->name_alias.'
'; + $morehtmlref .= '
'.dol_escape_htmltag($object->name_alias).'
'; } // Add label @@ -2346,7 +2350,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi if (!empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && ($conf->global->MAIN_SHOW_TECHNICAL_ID == '1' || preg_match('/'.preg_quote($object->element, '/').'/i', $conf->global->MAIN_SHOW_TECHNICAL_ID)) && !empty($object->id)) { $morehtmlref .= '
'; $morehtmlref .= '
'; - $morehtmlref .= $langs->trans("TechnicalID").': '.$object->id; + $morehtmlref .= $langs->trans("TechnicalID").': '.((int) $object->id); $morehtmlref .= '
'; } @@ -3166,11 +3170,10 @@ function dol_print_socialnetworks($value, $cid, $socid, $type, $dictsocialnetwor if (!empty($type)) { $htmllink = '
'; // Use dictionary definition for picto $dictsocialnetworks[$type]['icon'] - $htmllink .= ''; + $htmllink .= ''; if ($type == 'skype') { $htmllink .= dol_escape_htmltag($value); - $htmllink .= ' '; - $htmllink .= 'trans("Call").' '.$value.'" title="'.dol_escape_htmltag($langs->trans("Call").' '.$value).'">'; $htmllink .= ''; @@ -3208,9 +3211,9 @@ function dol_print_socialnetworks($value, $cid, $socid, $type, $dictsocialnetwor } $link = str_replace('{socialid}', $value, $dictsocialnetworks[$type]['url']); if (preg_match('/^https?:\/\//i', $link)) { - $htmllink .= ' '.dol_escape_htmltag($value).''; + $htmllink .= ''.dol_escape_htmltag($value).''; } else { - $htmllink .= ' '.dol_escape_htmltag($value).''; + $htmllink .= ''.dol_escape_htmltag($value).''; } } else { $htmllink .= dol_escape_htmltag($value); @@ -3263,7 +3266,7 @@ function dol_print_profids($profID, $profIDtype, $countrycode = '', $addcpButton * @param string $countrycode Country code to use for formatting * @param int $cid Id of contact if known * @param int $socid Id of third party if known - * @param string $addlink ''=no link to create action, 'AC_TEL'=add link to clicktodial (if module enabled) and add link to create event (if conf->global->AGENDA_ADDACTIONFORPHONE set) + * @param string $addlink ''=no link to create action, 'AC_TEL'=add link to clicktodial (if module enabled) and add link to create event (if conf->global->AGENDA_ADDACTIONFORPHONE set), 'tel'=Force "tel:..." link * @param string $separ Separation between numbers for a better visibility example : xx.xx.xx.xx.xx * @param string $withpicto Show picto ('fax', 'phone', 'mobile') * @param string $titlealt Text to show on alt @@ -3471,7 +3474,7 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli } } if (!empty($addlink)) { // Link on phone number (+ link to add action if conf->global->AGENDA_ADDACTIONFORPHONE set) - if ($conf->browser->layout == 'phone' || (isModEnabled('clicktodial') && !empty($conf->global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS))) { // If phone or option for, we use link of phone + if ($addlink == 'tel' || $conf->browser->layout == 'phone' || (isModEnabled('clicktodial') && !empty($conf->global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS))) { // If phone or option for, we use link of phone $newphoneform = $newphone; $newphone = ''; diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index e747f004c87..2473659a5c7 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -226,6 +226,7 @@ NoUserGroupDefined=No user group defined Password=Password PasswordRetype=Repeat your password NoteSomeFeaturesAreDisabled=Note that a lot of features/modules are disabled in this demonstration. +YourUserFile=Your user file Name=Name NameSlashCompany=Name / Company Person=Person @@ -1213,4 +1214,5 @@ InternalUser=Internal user ExternalUser=External user NoSpecificContactAddress=No specific contact or address NoSpecificContactAddressBis=This tab is dedicated to force specific contacts or addresses for the current object. Use it only if you want to define one or several specific contacts or addresses for the object when the information on the thirdparty is not enough or not accurate. - +HideOnVCard=Hide %s +AddToContacts=Add address to my contacts diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 17912f81101..a21082a8bc6 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2280,12 +2280,14 @@ function top_menu_user($hideloginname = 0, $urllogout = '') if (empty($urllogout)) { $urllogout = DOL_URL_ROOT.'/user/logout.php?token='.newToken(); } - $logoutLink = ' '.$langs->trans("Logout").''; - $profilLink = ' '.$langs->trans("Card").''; + // Defined the links for bottom of card + $profilLink = ' '.$langs->trans("Card").''; + $urltovirtualcard = '/user/virtualcard.php?id='.((int) $user->id); + $virtuelcardLink = dolButtonToOpenUrlInDialogPopup('publicvirtualcardmenu', $langs->trans("PublicVirtualCardUrl"), img_picto($langs->trans("PublicVirtualCardUrl"), 'card', ''), $urltovirtualcard, '', 'button-top-menu-dropdown marginleftonly nohover', "closeTopMenuLoginDropdown()", '', 'v'); + $logoutLink = ' '.$langs->trans("Logout").''; $profilName = $user->getFullName($langs).' ('.$user->login.')'; - if (!empty($user->admin)) { $profilName = ' '.$profilName; } @@ -2341,6 +2343,9 @@ function top_menu_user($hideloginname = 0, $urllogout = '')
'.$profilLink.'
+
+ '.$virtuelcardLink.' +
'.$logoutLink.'
@@ -2363,12 +2368,15 @@ function top_menu_user($hideloginname = 0, $urllogout = '') $btnUser .= '