Text on tooltip can also be clickable

This commit is contained in:
Laurent Destailleur 2019-10-02 15:54:42 +02:00
parent 65d68a9de0
commit 320e9bbeec
3 changed files with 9 additions and 8 deletions

View File

@ -1122,7 +1122,7 @@ else
$htmltext.='</i>';
// Print mail content
print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto('<span class="hideonsmartphone">'.$langs->trans("AvailableVariables").'</span>', $htmltext, 1, 'help', '', 0, 2, 'emailsubstitionhelp'), 'generic');
print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto('<span class="opacitymedium hideonsmartphone">'.$langs->trans("AvailableVariables").'</span>', $htmltext, 1, 'helpclickable', '', 0, 2, 'emailsubstitionhelp'), 'generic');
dol_fiche_head('', '', '', -1);

View File

@ -519,11 +519,11 @@ class Form
* @param string $text Text to show
* @param string $htmltext Content of tooltip
* @param int $direction 1=Icon is after text, -1=Icon is before text, 0=no icon
* @param string $type Type of picto ('info', 'help', 'warning', 'superadmin', 'mypicto@mymodule', ...) or image filepath or 'none'
* @param string $type Type of picto ('info', 'infoclickable', 'help', 'helpclickable', 'warning', 'superadmin', 'mypicto@mymodule', ...) or image filepath or 'none'
* @param string $extracss Add a CSS style to td, div or span tag
* @param int $noencodehtmltext Do not encode into html entity the htmltext
* @param int $notabs 0=Include table and tr tags, 1=Do not include table and tr tags, 2=use div, 3=use span
* @param string $tooltiptrigger ''=Tooltip on hover, 'abc'=Tooltip on click (abc is a unique key, clickable link is on image or on link if param $type='none')
* @param string $tooltiptrigger ''=Tooltip on hover, 'abc'=Tooltip on click (abc is a unique key, clickable link is on image or on link if param $type='none' or on both if $type='xxxclickable')
* @param int $forcenowrap Force no wrap between text and picto (works with notabs=2 only)
* @return string HTML code of text, picto, tooltip
*/
@ -541,7 +541,7 @@ class Form
// If info or help with no javascript, show only text
if (empty($conf->use_javascript_ajax))
{
if ($type == 'info' || $type == 'help') return $text;
if ($type == 'info' || $type == 'infoclickable' || $type == 'help' || $type == 'helpclickable') return $text;
else
{
$alt = $htmltext;
@ -552,7 +552,7 @@ class Form
// If info or help with smartphone, show only text (tooltip hover can't works)
if (! empty($conf->dol_no_mouse_hover) && empty($tooltiptrigger))
{
if ($type == 'info' || $type == 'help') return $text;
if ($type == 'info' || $type == 'infoclickable' || $type == 'help' || $type == 'helpclickable') return $text;
}
// If info or help with smartphone, show only text (tooltip on click does not works with dialog on smaprtphone)
//if (! empty($conf->dol_no_mouse_hover) && ! empty($tooltiptrigger))
@ -563,12 +563,13 @@ class Form
$img='';
if ($type == 'info') $img = img_help(0, $alt);
elseif ($type == 'help') $img = img_help(($tooltiptrigger != '' ? 2 : 1), $alt);
elseif ($type == 'helpclickable') $img = img_help(($tooltiptrigger != '' ? 2 : 1), $alt);
elseif ($type == 'superadmin') $img = img_picto($alt, 'redstar');
elseif ($type == 'admin') $img = img_picto($alt, 'star');
elseif ($type == 'warning') $img = img_warning($alt);
elseif ($type != 'none') $img = img_picto($alt, $type); // $type can be an image path
return $this->textwithtooltip($text, $htmltext, (($tooltiptrigger && ! $img)?3:2), $direction, $img, $extracss, $notabs, '', $noencodehtmltext, $tooltiptrigger, $forcenowrap);
return $this->textwithtooltip($text, $htmltext, ((($tooltiptrigger && ! $img) || strpos($type, 'clickable'))?3:2), $direction, $img, $extracss, $notabs, '', $noencodehtmltext, $tooltiptrigger, $forcenowrap);
}
/**

View File

@ -791,7 +791,7 @@ table[summary="list_of_modules"] .fa-cog {
.hideobject { display: none; }
.minwidth50 { min-width: 50px; }
/* rule for not too small screen only */
@media only screen and (min-width: <?php echo empty($conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3) ? round($nbtopmenuentries * 47, 0) + 40 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3; ?>px)
@media only screen and (min-width: <?php echo empty($conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3) ? round($nbtopmenuentries * 47, 0) + 140 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3; ?>px)
{
.width25 { width: 25px; }
.width50 { width: 50px; }
@ -1143,7 +1143,7 @@ div.vmenu, td.vmenu {
.menuhider { display: none !important; }
/* rule to reduce top menu - 3rd reduction: The menu for user is on left */
@media only screen and (max-width: <?php echo empty($conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3) ? round($nbtopmenuentries * 47, 0) + 40 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3; ?>px) /* reduction 3 */
@media only screen and (max-width: <?php echo empty($conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3) ? round($nbtopmenuentries * 47, 0) + 140 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3; ?>px) /* reduction 3 */
{
body.sidebar-collapse .side-nav {
display: none;