diff --git a/htdocs/core/class/commonpeople.class.php b/htdocs/core/class/commonpeople.class.php index 00063ad2685..7dce8b3c4dc 100644 --- a/htdocs/core/class/commonpeople.class.php +++ b/htdocs/core/class/commonpeople.class.php @@ -236,11 +236,14 @@ trait CommonPeople } $outdone = 0; if (!empty($this->email)) { - $out .= dol_print_email($this->email, $this->id, $object->id, 'AC_EMAIL', 0, 0, 1); + $out .= dol_print_email($this->email, $this->id, $object->id, 1, 0, 0, 1); $outdone++; } if (!empty($this->url)) { //$out.=dol_print_url($this->url,'_goout',0,1);//steve changed to blank + if (!empty($this->email)) { + $out .= ' '; + } $out .= dol_print_url($this->url, '_blank', 0, 1); $outdone++; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index c1fbff4a59e..b9b5d61e2a5 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2677,7 +2677,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi // Show address and email if (method_exists($object, 'getBannerAddress') && !in_array($object->element, array('product', 'bookmark', 'ecm_directories', 'ecm_files'))) { - $moreaddress = $object->getBannerAddress('refaddress', $object); + $moreaddress = $object->getBannerAddress('refaddress', $object); // address, email, url, social networks if ($moreaddress) { $morehtmlref .= '
'; $morehtmlref .= $moreaddress; @@ -3379,9 +3379,9 @@ function dol_print_url($url, $target = '_blank', $max = 32, $withpicto = 0, $mor $linkend = ''; if ($morecss == 'float') { // deprecated - return '
'.($withpicto ? img_picto($langs->trans("Url"), 'globe').' ' : '').$link.'
'; + return '
'.($withpicto ? img_picto($langs->trans("Url"), 'globe', 'class="paddingrightonly"') : '').$link.'
'; } else { - return $linkstart.''.($withpicto ? img_picto('', 'globe').' ' : '').$link.''.$linkend; + return $linkstart.''.($withpicto ? img_picto('', 'globe', 'class="paddingrightonly"') : '').$link.''.$linkend; } } @@ -3399,7 +3399,10 @@ function dol_print_url($url, $target = '_blank', $max = 32, $withpicto = 0, $mor */ function dol_print_email($email, $cid = 0, $socid = 0, $addlink = 0, $max = 64, $showinvalid = 1, $withpicto = 0) { - global $conf, $user, $langs, $hookmanager; + global $user, $langs, $hookmanager; + + //global $conf; $conf->global->AGENDA_ADDACTIONFOREMAIL = 1; + //$showinvalid = 1; $email = 'rrrrr'; $newemail = dol_escape_htmltag($email); @@ -3412,30 +3415,35 @@ function dol_print_email($email, $cid = 0, $socid = 0, $addlink = 0, $max = 64, } if (!empty($addlink)) { - $newemail = ''; + + $newemail .= ($withpicto ? img_picto($langs->trans("EMail").' : '.$email, (is_numeric($withpicto) ? 'email' : $withpicto), 'class="paddingrightonly"') : ''); + $newemail .= dol_trunc($email, $max); $newemail .= ''; if ($showinvalid && !isValidEmail($email)) { $langs->load("errors"); - $newemail .= img_warning($langs->trans("ErrorBadEMail", $email)); + $newemail .= img_warning($langs->trans("ErrorBadEMail", $email), '', 'paddingrightonly'); } if (($cid || $socid) && isModEnabled('agenda') && $user->hasRight("agenda", "myactions", "create")) { $type = 'AC_EMAIL'; - $link = ''; + $linktoaddaction = ''; if (getDolGlobalString('AGENDA_ADDACTIONFOREMAIL')) { - $link = ''.img_object($langs->trans("AddAction"), "calendar").''; + $linktoaddaction = ''.img_object($langs->trans("AddAction"), "calendar").''; } - if ($link) { - $newemail = '
'.$newemail.' '.$link.'
'; + if ($linktoaddaction) { + $newemail = '
'.$newemail.' '.$linktoaddaction.'
'; } } } else { + $newemail = ($withpicto ? img_picto($langs->trans("EMail").' : '.$email, (is_numeric($withpicto) ? 'email' : $withpicto), 'class="paddingrightonly"') : '').$newemail; + if ($showinvalid && !isValidEmail($email)) { $langs->load("errors"); $newemail .= img_warning($langs->trans("ErrorBadEMail", $email)); @@ -3443,8 +3451,10 @@ function dol_print_email($email, $cid = 0, $socid = 0, $addlink = 0, $max = 64, } //$rep = '
'; - $rep = ($withpicto ? img_picto($langs->trans("EMail").' : '.$email, (is_numeric($withpicto) ? 'email' : $withpicto)).' ' : '').$newemail; + //$rep = ($withpicto ? img_picto($langs->trans("EMail").' : '.$email, (is_numeric($withpicto) ? 'email' : $withpicto), 'class="paddingrightonly"') : '').$newemail; //$rep .= '
'; + $rep = $newemail; + if ($hookmanager) { $parameters = array('cid' => $cid, 'socid' => $socid, 'addlink' => $addlink, 'picto' => $withpicto);