mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-12 20:41:26 +01:00
Fix the extracss parameter was overwritten other css into
textwithtooltip function. Add tooltip on THM and TJM parameter of user.
This commit is contained in:
@@ -376,7 +376,7 @@ class Form
|
|||||||
* @return string Code html du tooltip (texte+picto)
|
* @return string Code html du tooltip (texte+picto)
|
||||||
* @see Use function textwithpicto if you can.
|
* @see Use function textwithpicto if you can.
|
||||||
*/
|
*/
|
||||||
function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 0, $incbefore = '', $noencodehtmltext = 0)
|
function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 2, $incbefore = '', $noencodehtmltext = 0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@@ -391,14 +391,19 @@ class Form
|
|||||||
$htmltext=str_replace("\r","",$htmltext);
|
$htmltext=str_replace("\r","",$htmltext);
|
||||||
$htmltext=str_replace("\n","",$htmltext);
|
$htmltext=str_replace("\n","",$htmltext);
|
||||||
|
|
||||||
|
$extrastyle='';
|
||||||
|
if ($direction < 0) { $extracss=($extracss?$extracss.' ':'').'inline-block'; $extrastyle='padding: 0px; padding-left: 3px !important;'; }
|
||||||
|
if ($direction > 0) { $extracss=($extracss?$extracss.' ':'').'inline-block'; $extrastyle='padding: 0px; padding-right: 3px !important;'; }
|
||||||
|
|
||||||
$htmltext=str_replace('"',""",$htmltext);
|
$htmltext=str_replace('"',""",$htmltext);
|
||||||
if ($tooltipon == 2 || $tooltipon == 3) $paramfortooltipimg=' class="classfortooltip inline-block'.($extracss?' '.$extracss:'').'" style="padding: 0px;" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on td img tag to store tooltip
|
if ($tooltipon == 2 || $tooltipon == 3) $paramfortooltipimg=' class="classfortooltip inline-block'.($extracss?' '.$extracss:'').'" style="padding: 0px;'.($extrastyle?' '.$extrastyle:'').'" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on td img tag to store tooltip
|
||||||
else $paramfortooltipimg =($extracss?' class="'.$extracss.'"':''); // Attribut to put on td text tag
|
else $paramfortooltipimg =($extracss?' class="'.$extracss.'"':'').($extrastyle?' style="'.$extrastyle.'"':''); // Attribut to put on td text tag
|
||||||
if ($tooltipon == 1 || $tooltipon == 3) $paramfortooltiptd=' class="classfortooltip inline-block'.($extracss?' '.$extracss:'').'" style="padding: 0px;" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on td tag to store tooltip
|
if ($tooltipon == 1 || $tooltipon == 3) $paramfortooltiptd=' class="classfortooltip inline-block'.($extracss?' '.$extracss:'').'" style="padding: 0px;'.($extrastyle?' '.$extrastyle:'').'" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on td tag to store tooltip
|
||||||
else $paramfortooltiptd =($extracss?' class="'.$extracss.'"':''); // Attribut to put on td text tag
|
else $paramfortooltiptd =($extracss?' class="'.$extracss.'"':'').($extrastyle?' style="'.$extrastyle.'"':''); // Attribut to put on td text tag
|
||||||
$s="";
|
$s="";
|
||||||
if (empty($notabs)) $s.='<table class="nobordernopadding" summary=""><tr style="height: auto;">';
|
if (empty($notabs)) $s.='<table class="nobordernopadding" summary=""><tr style="height: auto;">';
|
||||||
elseif ($notabs == 2) $s.='<div class="inline-block nowrap">';
|
elseif ($notabs == 2) $s.='<div class="inline-block nowrap">';
|
||||||
|
// Define value if value is before
|
||||||
if ($direction < 0) {
|
if ($direction < 0) {
|
||||||
$s.='<'.$tag.$paramfortooltipimg;
|
$s.='<'.$tag.$paramfortooltipimg;
|
||||||
if ($tag == 'td') {
|
if ($tag == 'td') {
|
||||||
@@ -407,16 +412,12 @@ class Form
|
|||||||
$s.= '>'.$img.'</'.$tag.'>';
|
$s.= '>'.$img.'</'.$tag.'>';
|
||||||
}
|
}
|
||||||
// Use another method to help avoid having a space in value in order to use this value with jquery
|
// Use another method to help avoid having a space in value in order to use this value with jquery
|
||||||
// TODO add this in css
|
// Define label
|
||||||
//if ($text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.(($direction < 0)?' ':'').$text.(($direction > 0)?' ':'').'</'.$tag.'>';
|
|
||||||
$paramfortooltiptd.= (($direction < 0)?' class="inline-block" style="padding: 0px; padding-left: 3px !important;"':'');
|
|
||||||
$paramfortooltiptd.= (($direction > 0)?' class="inline-block" style="padding: 0px; padding-right: 3px !important;"':'');
|
|
||||||
if ((string) $text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>';
|
if ((string) $text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>';
|
||||||
|
// Define value if value is after
|
||||||
if ($direction > 0) {
|
if ($direction > 0) {
|
||||||
$s.='<'.$tag.$paramfortooltipimg;
|
$s.='<'.$tag.$paramfortooltipimg;
|
||||||
if ($tag == 'td') {
|
if ($tag == 'td') $s .= ' valign="middle" width="14"';
|
||||||
$s .= ' valign="middle" width="14"';
|
|
||||||
}
|
|
||||||
$s.= '>'.$img.'</'.$tag.'>';
|
$s.= '>'.$img.'</'.$tag.'>';
|
||||||
}
|
}
|
||||||
if (empty($notabs)) $s.='</tr></table>';
|
if (empty($notabs)) $s.='</tr></table>';
|
||||||
@@ -437,7 +438,7 @@ class Form
|
|||||||
* @param int $notabs 0=Include table and tr tags, 1=Do not include table and tr tags, 2=use div, 3=use span
|
* @param int $notabs 0=Include table and tr tags, 1=Do not include table and tr tags, 2=use div, 3=use span
|
||||||
* @return string HTML code of text, picto, tooltip
|
* @return string HTML code of text, picto, tooltip
|
||||||
*/
|
*/
|
||||||
function textwithpicto($text, $htmltext, $direction = 1, $type = 'help', $extracss = '', $noencodehtmltext = 0, $notabs = 0)
|
function textwithpicto($text, $htmltext, $direction = 1, $type = 'help', $extracss = '', $noencodehtmltext = 0, $notabs = 2)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
|
|||||||
@@ -2186,7 +2186,7 @@ function img_help($usehelpcursor = 1, $usealttitle = 1)
|
|||||||
else $usealttitle = $langs->trans('Info');
|
else $usealttitle = $langs->trans('Info');
|
||||||
}
|
}
|
||||||
|
|
||||||
return img_picto($usealttitle, 'info.png', ($usehelpcursor ? 'style="cursor: help"' : ''));
|
return img_picto($usealttitle, 'info.png', ($usehelpcursor ? 'style="vertical-align: middle; cursor: help"' : 'style="vertical-align: middle;"'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2201,7 +2201,7 @@ function img_info($titlealt = 'default')
|
|||||||
|
|
||||||
if ($titlealt == 'default') $titlealt = $langs->trans('Informations');
|
if ($titlealt == 'default') $titlealt = $langs->trans('Informations');
|
||||||
|
|
||||||
return img_picto($titlealt, 'info.png');
|
return img_picto($titlealt, 'info.png', 'style="vertical-align: middle;"');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -10,4 +10,6 @@ SalariesPayments=Salaries payments
|
|||||||
ShowSalaryPayment=Show salary payment
|
ShowSalaryPayment=Show salary payment
|
||||||
THM=Average hourly price
|
THM=Average hourly price
|
||||||
TJM=Average daily price
|
TJM=Average daily price
|
||||||
CurrentSalary=Current salary
|
CurrentSalary=Current salary
|
||||||
|
THMDescription=This value may be used to calculate cost of time consumed on a project entered by users if module project is used
|
||||||
|
TJMDescription=This value is currently as information only and is not used for any calculation
|
||||||
|
|||||||
@@ -1272,10 +1272,12 @@ else
|
|||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
// Type
|
// Type
|
||||||
print '<tr><td>'.$langs->trans("Type").'</td><td colspan="2">';
|
print '<tr><td>';
|
||||||
|
$text=$langs->trans("Type");
|
||||||
|
print $form->textwithpicto($text, $langs->trans("InternalExternalDesc"));
|
||||||
|
print '</td><td colspan="2">';
|
||||||
$type=$langs->trans("Internal");
|
$type=$langs->trans("Internal");
|
||||||
if ($object->societe_id) $type=$langs->trans("External");
|
if ($object->societe_id) $type=$langs->trans("External");
|
||||||
print $form->textwithpicto($type, $langs->trans("InternalExternalDesc"), 1, 'help', '', 0, 2);
|
|
||||||
if ($object->ldap_sid) print ' ('.$langs->trans("DomainUser").')';
|
if ($object->ldap_sid) print ' ('.$langs->trans("DomainUser").')';
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
@@ -1337,14 +1339,20 @@ else
|
|||||||
$langs->load("salaries");
|
$langs->load("salaries");
|
||||||
|
|
||||||
// THM
|
// THM
|
||||||
print '<tr><td>'.$langs->trans("THM").'</td>';
|
print '<tr><td>';
|
||||||
|
$text=$langs->trans("THM");
|
||||||
|
print $form->textwithpicto($text, $langs->trans("THMDescription"), 1, 'help', 'classthm');
|
||||||
|
print '</td>';
|
||||||
print '<td colspan="2">';
|
print '<td colspan="2">';
|
||||||
print ($object->thm!=''?price($object->thm,'',$langs,1,-1,-1,$conf->currency):'');
|
print ($object->thm!=''?price($object->thm,'',$langs,1,-1,-1,$conf->currency):'');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
// TJM
|
// TJM
|
||||||
print '<tr><td>'.$langs->trans("TJM").'</td>';
|
print '<tr><td>';
|
||||||
|
$text=$langs->trans("TJM");
|
||||||
|
print $form->textwithpicto($text, $langs->trans("TJMDescription"), 1, 'help', 'classtjm');
|
||||||
|
print '</td>';
|
||||||
print '<td colspan="2">';
|
print '<td colspan="2">';
|
||||||
print ($object->tjm!=''?price($object->tjm,'',$langs,1,-1,-1,$conf->currency):'');
|
print ($object->tjm!=''?price($object->tjm,'',$langs,1,-1,-1,$conf->currency):'');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
Reference in New Issue
Block a user