From e86efa925ed967a21bcdde8d35c6ca44f1f83413 Mon Sep 17 00:00:00 2001 From: ccomb Date: Tue, 15 Nov 2005 15:41:54 +0000 Subject: [PATCH] la boite account de l'accueil ne marchait pas - manquait un include - manquait des colonnes en cas de cellule vide --- htdocs/includes/boxes/box_comptes.php | 1 + htdocs/includes/boxes/modules_boxes.php | 70 ++++++++++++------------- 2 files changed, 35 insertions(+), 36 deletions(-) diff --git a/htdocs/includes/boxes/box_comptes.php b/htdocs/includes/boxes/box_comptes.php index 716652eb8a0..7fff988190c 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 aa522517873..cb4a400130f 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 ''; + else print ''; - if (isset($contents[$i][$j]['logo']) && $contents[$i][$j]['logo']) print ''; - else print ''; - - if (isset($contents[$i][$j]['url'])) print ''; - 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 '" - 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 ''; - print $texte2; - - print ""; + if (isset($contents[$i][$j]['url'])) print ''; + 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 '" + 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 ''; + print $texte2; + print ""; } if (sizeof($contents[$i])) print '';