Si box vide, on affiche "Pas de ...".

This commit is contained in:
Laurent Destailleur 2005-07-14 19:02:33 +00:00
parent 1364f98afd
commit eab61f62d7
4 changed files with 42 additions and 9 deletions

View File

@ -96,6 +96,20 @@ class box_factures_fourn_imp extends ModeleBoxes {
$i++;
}
$i=$num;
while ($i < $max)
{
if ($num==0 && $i==$num)
{
$this->info_box_contents[$i][0] = array('align' => 'center','text'=>$langs->trans("NoSupplierBillsUnpayed"));
$this->info_box_contents[$i][1] = array('text'=>'&nbsp;');
} else {
$this->info_box_contents[$i][0] = array('text'=>'&nbsp;');
$this->info_box_contents[$i][1] = array('text'=>'&nbsp;');
}
$i++;
}
}
else {
dolibarr_print_error($db);

View File

@ -93,8 +93,22 @@ class box_prospect extends ModeleBoxes {
$i++;
}
}
$i=$num;
while ($i < $max)
{
if ($num==0 && $i==$num)
{
$this->info_box_contents[$i][0] = array('align' => 'center','text'=>$langs->trans("NoRecordedProspects"));
$this->info_box_contents[$i][1] = array('text'=>'&nbsp;');
} else {
$this->info_box_contents[$i][0] = array('text'=>'&nbsp;');
$this->info_box_contents[$i][1] = array('text'=>'&nbsp;');
}
$i++;
}
}
}
else {
$this->info_box_contents[0][0] = array('align' => 'left',

View File

@ -22,9 +22,9 @@
*/
/**
\file htdocs/includes/boxes/box_services_vendus.php
\ingroup produits,services
\brief Module de génération de l'affichage de la box services_vendus
\file htdocs/includes/boxes/box_services_vendus.php
\ingroup produits,services
\brief Module de génération de l'affichage de la box services_vendus
*/
include_once(DOL_DOCUMENT_ROOT."/includes/boxes/modules_boxes.php");
@ -89,10 +89,12 @@ class box_services_vendus extends ModeleBoxes {
$this->info_box_contents[$i][0] = array('align' => 'left',
'logo' => ($objp->fk_product_type?'object_service':'object_product'),
'text' => $objp->label,
'maxlength' => 16,
'url' => DOL_URL_ROOT."/contrat/fiche.php?id=".$objp->rowid);
$this->info_box_contents[$i][1] = array('align' => 'left',
'text' => $objp->nom,
'maxlength' => 48,
'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->idp);
$i++;

View File

@ -36,7 +36,7 @@
class ModeleBoxes
{
var $MAXLENGTHBOX=70; // Mettre 0 pour pas de limite
var $MAXLENGTHBOX=60; // Mettre 0 pour pas de limite
var $error='';
@ -102,13 +102,16 @@ class ModeleBoxes
print img_object($langs->trans("Show"),$logo);
print '</a></td><td '.$tdparam.'><a href="'.$contents[$i][$j]['url'].'" title="'.$textewithnotags.'">';
}
if ($this->MAXLENGTHBOX && strlen($textewithnotags) > $this->MAXLENGTHBOX)
$maxlength=$this->MAXLENGTHBOX;
if (isset($contents[$i][$j]['maxlength'])) $maxlength=$contents[$i][$j]['maxlength'];
if ($maxlength && strlen($textewithnotags) > $maxlength)
{
$texte=substr($texte,0,$this->MAXLENGTHBOX)."...";
$texte=substr($texte,0,$maxlength)."...";
}
if ($this->MAXLENGTHBOX && strlen($texte2withnotags) > $this->MAXLENGTHBOX)
if ($maxlength && strlen($texte2withnotags) > $maxlength)
{
$texte2=substr($texte2,0,$this->MAXLENGTHBOX)."...";
$texte2=substr($texte2,0,$maxlength)."...";
}
print $texte;
if ($contents[$i][$j]['url']) print '</a>';