diff --git a/htdocs/includes/boxes/box_comptes.php b/htdocs/includes/boxes/box_comptes.php index 716652eb8a0042b997a3ebbc62f2b410d58f349f..7fff988190c3ba59080383a78d002bf6bc4a28ba 100644 --- a/htdocs/includes/boxes/box_comptes.php +++ b/htdocs/includes/boxes/box_comptes.php @@ -27,6 +27,7 @@ */ include_once(DOL_DOCUMENT_ROOT."/includes/boxes/modules_boxes.php"); +include_once(DOL_DOCUMENT_ROOT."/compta/bank/account.class.php"); class box_comptes extends ModeleBoxes { diff --git a/htdocs/includes/boxes/modules_boxes.php b/htdocs/includes/boxes/modules_boxes.php index aa522517873def5d15b10b3ea8240bed49adb04e..cb4a400130fa16f29ea8f8a9fde7d6459185ee10 100644 --- a/htdocs/includes/boxes/modules_boxes.php +++ b/htdocs/includes/boxes/modules_boxes.php @@ -98,44 +98,42 @@ class ModeleBoxes if (isset($contents[$i][$j]['colspan'])) $tdparam.=' colspan="'. $contents[$i][$j]['colspan'].'"'; if (isset($contents[$i][$j]['class'])) $tdparam.=' class="'. $contents[$i][$j]['class'].'"'; - if ($contents[$i][$j]['text']) { - $texte=isset($contents[$i][$j]['text'])?$contents[$i][$j]['text']:''; - $textewithnotags=eregi_replace('<[^>]+>','',$texte); - $texte2=isset($contents[$i][$j]['text2'])?$contents[$i][$j]['text2']:''; - $texte2withnotags=eregi_replace('<[^>]+>','',$texte2); - //print "xxx $textewithnotags y"; + if (!$contents[$i][$j]['text']) $contents[$i][$j]['text']=""; + $texte=isset($contents[$i][$j]['text'])?$contents[$i][$j]['text']:''; + $textewithnotags=eregi_replace('<[^>]+>','',$texte); + $texte2=isset($contents[$i][$j]['text2'])?$contents[$i][$j]['text2']:''; + $texte2withnotags=eregi_replace('<[^>]+>','',$texte2); + //print "xxx $textewithnotags y"; + + if (isset($contents[$i][$j]['logo']) && $contents[$i][$j]['logo']) print '<td width="16">'; + else print '<td '.$tdparam.'>'; - if (isset($contents[$i][$j]['logo']) && $contents[$i][$j]['logo']) print '<td width="16">'; - else print '<td '.$tdparam.'>'; - - if (isset($contents[$i][$j]['url'])) print '<a href="'.$contents[$i][$j]['url'].'" title="'.$textewithnotags.'">'; - if (isset($contents[$i][$j]['logo']) && $contents[$i][$j]['logo']) - { - $logo=eregi_replace("^object_","",$contents[$i][$j]['logo']); - print img_object($langs->trans("Show"),$logo); - print '</a></td><td '.$tdparam.'><a href="'.$contents[$i][$j]['url'].'"'; - print ' title="'.$textewithnotags.'"'; - //print ' alt="'.$textewithnotags.'"'; // Pas de alt sur un "<a href>" - print isset($contents[$i][$j]['target'])?' target="'.$contents[$i][$j]['target'].'"':''; - print '>'; - } - $maxlength=$this->MAXLENGTHBOX; - if (isset($contents[$i][$j]['maxlength'])) $maxlength=$contents[$i][$j]['maxlength']; - - if ($maxlength && strlen($textewithnotags) > $maxlength) - { - $texte=substr($texte,0,$maxlength)."..."; - } - if ($maxlength && strlen($texte2withnotags) > $maxlength) - { - $texte2=substr($texte2,0,$maxlength)."..."; - } - print $texte; - if ($contents[$i][$j]['url']) print '</a>'; - print $texte2; - - print "</td>"; + if (isset($contents[$i][$j]['url'])) print '<a href="'.$contents[$i][$j]['url'].'" title="'.$textewithnotags.'">'; + if (isset($contents[$i][$j]['logo']) && $contents[$i][$j]['logo']) + { + $logo=eregi_replace("^object_","",$contents[$i][$j]['logo']); + print img_object($langs->trans("Show"),$logo); + print '</a></td><td '.$tdparam.'><a href="'.$contents[$i][$j]['url'].'"'; + print ' title="'.$textewithnotags.'"'; + //print ' alt="'.$textewithnotags.'"'; // Pas de alt sur un "<a href>" + print isset($contents[$i][$j]['target'])?' target="'.$contents[$i][$j]['target'].'"':''; + print '>'; + } + $maxlength=$this->MAXLENGTHBOX; + if (isset($contents[$i][$j]['maxlength'])) $maxlength=$contents[$i][$j]['maxlength']; + + if ($maxlength && strlen($textewithnotags) > $maxlength) + { + $texte=substr($texte,0,$maxlength)."..."; + } + if ($maxlength && strlen($texte2withnotags) > $maxlength) + { + $texte2=substr($texte2,0,$maxlength)."..."; } + print $texte; + if ($contents[$i][$j]['url']) print '</a>'; + print $texte2; + print "</td>"; } if (sizeof($contents[$i])) print '</tr>';