Clean code

This commit is contained in:
Laurent Destailleur
2017-10-20 18:15:43 +02:00
parent 985675d680
commit ab4f5a3aea
2 changed files with 10 additions and 1 deletions

View File

@@ -2720,7 +2720,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
if (preg_match('/:[^\s0-9]/',$titlealt)) $tmparray=explode(':',$titlealt); // We explode if we have TextA:TextB. Not if we have TextA: TextB if (preg_match('/:[^\s0-9]/',$titlealt)) $tmparray=explode(':',$titlealt); // We explode if we have TextA:TextB. Not if we have TextA: TextB
$title=$tmparray[0]; $title=$tmparray[0];
$alt=empty($tmparray[1])?'':$tmparray[1]; $alt=empty($tmparray[1])?'':$tmparray[1];
return '<img src="'.$fullpathpicto.'" alt="'.dol_escape_htmltag($alt).'"'.($notitle?'':' title="'.dol_escape_htmltag($title).'"').($moreatt?' '.$moreatt:' class="inline-block valigntextbottom"').'>'; // Alt is used for accessibility, title for popup return '<img src="'.$fullpathpicto.'" alt="'.dol_escape_htmltag($alt).'"'.($notitle?'':' title="'.dol_escape_htmltag($title).'"').($moreatt?' '.$moreatt:' class="inline-block"').'>'; // Alt is used for accessibility, title for popup
} }
} }

View File

@@ -1048,7 +1048,16 @@ while ($i < min($num, $limit))
if (! empty($arrayfields['s.nom']['checked'])) if (! empty($arrayfields['s.nom']['checked']))
{ {
print '<td class="tdoverflowmax200">'; print '<td class="tdoverflowmax200">';
//if (! empty($arrayfields['s.name_alias']['checked'])) // Hide alias from output
//{
$savalias=$companystatic->name_alias;
$companystatic->name_alias='';
//}
print $companystatic->getNomUrl(1,'',100); print $companystatic->getNomUrl(1,'',100);
//if (! empty($arrayfields['s.name_alias']['checked'])) // Hide alias from output
//{
$companystatic->name_alias=$savalias;
//}
print "</td>\n"; print "</td>\n";
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
} }