diff --git a/htdocs/includes/boxes/box_factures_fourn.php b/htdocs/includes/boxes/box_factures_fourn.php
index 72d8ed86e1a..69c2f9a3033 100644
--- a/htdocs/includes/boxes/box_factures_fourn.php
+++ b/htdocs/includes/boxes/box_factures_fourn.php
@@ -38,7 +38,8 @@ class box_factures_fourn extends ModeleBoxes {
var $db;
var $param;
-
+ var $textnohtmlencoded=true;
+
var $info_box_head = array();
var $info_box_contents = array();
@@ -50,7 +51,7 @@ class box_factures_fourn extends ModeleBoxes {
global $langs;
$langs->load("boxes");
- $this->boxlabel=$langs->trans("BoxLastSupplierBills");
+ $this->boxlabel=$langs->transnoentities("BoxLastSupplierBills");
}
/**
@@ -65,7 +66,7 @@ class box_factures_fourn extends ModeleBoxes {
$facturestatic=new FactureFournisseur($db);
$this->info_box_head = array(
- 'text' => $langs->trans("BoxTitleLastSupplierBills",$max),
+ 'text' => $langs->transnoentities("BoxTitleLastSupplierBills",$max),
);
if ($user->rights->fournisseur->facture->lire)
@@ -89,7 +90,7 @@ class box_factures_fourn extends ModeleBoxes {
if ($result)
{
- $num = $db->num_rows();
+ $num = $db->num_rows($result);
$i = 0;
@@ -124,7 +125,7 @@ class box_factures_fourn extends ModeleBoxes {
}
else {
$this->info_box_contents[0][0] = array('align' => 'left',
- 'text' => $langs->trans("ReadPermissionNotAllowed"));
+ 'text' => $langs->transnoentities("ReadPermissionNotAllowed"));
}
}
diff --git a/htdocs/includes/boxes/modules_boxes.php b/htdocs/includes/boxes/modules_boxes.php
index d6bfd2cd217..8e6e8a71313 100644
--- a/htdocs/includes/boxes/modules_boxes.php
+++ b/htdocs/includes/boxes/modules_boxes.php
@@ -38,7 +38,7 @@ class ModeleBoxes
var $db;
var $error='';
-
+ var $textnohtmlencoded=false;
/*
* \brief Constructeur
@@ -105,123 +105,138 @@ class ModeleBoxes
$bcx[0] = 'class="box_pair"';
$bcx[1] = 'class="box_impair"';
-
$var = true;
+
+ // Define nbcol and nblines
$nbcol=0;
if (isset($contents[0])) $nbcol=sizeof($contents[0])+1;
$nblines=sizeof($contents);
print "\n\n\n";
- print '
box_id)) print ' id="boxobject_'.$this->box_id.'"';
- print '>';
+ print ''."\n";
// Affiche titre de la boite
- print '
';
- print ' 0) { print ' colspan="'.$nbcol.'"'; }
- print '>';
-
- if ($conf->use_ajax)
+ if (! empty($head['text']) || ! empty($head['sublink']))
{
- print '';
+ print ''."\n";
+ print ' '."\n";
+ print '';
+ print ' 0) { print ' colspan="'.$nbcol.'"'; }
+ print '>';
+ if ($conf->use_ajax)
+ {
+ print '| ';
+ }
+ if (! empty($head['text']))
+ {
+ $s=dolibarr_trunc($head['text'],isset($head['limit'])?$head['limit']:$this->MAXLENGTHBOX);
+ if ($this->textnohtmlencoded) print htmlentities($s);
+ else print $s;
+ }
+ if (! empty($head['sublink']))
+ {
+ print ' '.img_picto($head['subtext'],$head['subpicto']).'';
+ }
+ if ($conf->use_ajax)
+ {
+ print ' | ';
+ print img_picto($langs->trans("MoveBox",$this->box_id),'uparrow','style="cursor:move;"');
+ print ' | ';
+ }
+ print ' | ';
+ print " \n";
+ print " \n";
+ print " \n";
}
- if (isset($head['text'])) print dolibarr_trunc($head['text'],isset($head['limit'])?$head['limit']:$this->MAXLENGTHBOX);
- if (isset($head['sublink']) && $head['sublink'])
- {
- print ' '.img_picto($head['subtext'],$head['subpicto']).'';
- }
- if ($conf->use_ajax)
- {
- print ' | ';
- print img_picto($langs->trans("Move"),'uparrow','style="cursor:move;"');
- print ' | ';
- }
-
- print ' | ';
- print '
';
-
+
// Affiche chaque ligne de la boite
- for ($i=0, $n=$nblines; $i < $n; $i++)
- {
- if (isset($contents[$i]))
- {
- $var=!$var;
- if (sizeof($contents[$i]))
- {
- if (isset($contents[$i][-1]['class'])) print '
';
- else print '
';
- }
+ if ($nblines)
+ {
+ print ''."\n";
+ for ($i=0, $n=$nblines; $i < $n; $i++)
+ {
+ if (isset($contents[$i]))
+ {
+ $var=!$var;
+ if (sizeof($contents[$i]))
+ {
+ if (isset($contents[$i][-1]['class'])) print '';
+ else print '
';
+ }
- // Affiche chaque cellule
- for ($j=0, $m=isset($contents[$i][-1])?sizeof($contents[$i])-1:sizeof($contents[$i]); $j < $m; $j++)
- {
- $tdparam="";
- if (isset($contents[$i][$j]['align'])) $tdparam.=' align="'. $contents[$i][$j]['align'].'"';
- if (isset($contents[$i][$j]['nowrap'])) $tdparam.=' nowrap="'. $contents[$i][$j]['align'].'"';
- if (isset($contents[$i][$j]['width'])) $tdparam.=' width="'. $contents[$i][$j]['width'].'"';
- 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 (isset($contents[$i][$j]['td'])) $tdparam.=' '.$contents[$i][$j]['td'];
+ // Affiche chaque cellule
+ for ($j=0, $m=isset($contents[$i][-1])?sizeof($contents[$i])-1:sizeof($contents[$i]); $j < $m; $j++)
+ {
+ $tdparam="";
+ if (isset($contents[$i][$j]['align'])) $tdparam.=' align="'. $contents[$i][$j]['align'].'"';
+ if (isset($contents[$i][$j]['nowrap'])) $tdparam.=' nowrap="'. $contents[$i][$j]['align'].'"';
+ if (isset($contents[$i][$j]['width'])) $tdparam.=' width="'. $contents[$i][$j]['width'].'"';
+ 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 (isset($contents[$i][$j]['td'])) $tdparam.=' '.$contents[$i][$j]['td'];
- 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 (!$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 ' | ';
- // Picto
- if (isset($contents[$i][$j]['url'])) {
- print '"
- print isset($contents[$i][$j]['target'])?' target="'.$contents[$i][$j]['target'].'"':'';
- print '>';
- }
+ // Picto
+ if (isset($contents[$i][$j]['url'])) {
+ print '"
+ print isset($contents[$i][$j]['target'])?' target="'.$contents[$i][$j]['target'].'"':'';
+ print '>';
+ }
- // Texte
- 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);
- if (isset($contents[$i][$j]['url'])) print '';
- print ' | ';
- if (isset($contents[$i][$j]['url']))
- {
- 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'];
+ // Texte
+ 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);
+ if (isset($contents[$i][$j]['url'])) print '';
+ print ' | ';
+ if (isset($contents[$i][$j]['url']))
+ {
+ 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 (isset($contents[$i][$j]['url'])) print '';
- print $texte2;
- print " | ";
- }
+ if ($maxlength && strlen($textewithnotags) > $maxlength)
+ {
+ $texte=substr($texte,0,$maxlength)."...";
+ }
+ if ($maxlength && strlen($texte2withnotags) > $maxlength)
+ {
+ $texte2=substr($texte2,0,$maxlength)."...";
+ }
+ print $texte;
+ if (isset($contents[$i][$j]['url'])) print '';
+ print $texte2;
+ print "";
+ }
- if (sizeof($contents[$i])) print '
';
- }
- }
-
- print "
";
-
- print "\n\n\n";
+ if (sizeof($contents[$i])) print "
\n";
+ }
+ }
+ print "
\n";
+ }
+ // If invisible box with no contents
+ if (empty($head['text']) && empty($head['sublink']) && ! $nblines) print "
\n";
+
+ print "\n";
+ print "\n\n";
}
}
diff --git a/htdocs/index.php b/htdocs/index.php
index edf4e8fdbce..c3f3a84e51c 100644
--- a/htdocs/index.php
+++ b/htdocs/index.php
@@ -550,7 +550,8 @@ if (sizeof($boxarray))
print ''."\n";
// Affichage colonne gauche
- print ''."\n";
+ print "\n\n";
+ print ' '."\n";
$ii=0;
foreach ($boxarray as $key => $box)
{
@@ -558,21 +559,31 @@ if (sizeof($boxarray))
if (eregi('^A',$box->box_order)) // colonne A
{
$ii++;
- print ' ';
//print 'box_id '.$boxarray[$ii]->box_id.' ';
//print 'box_order '.$boxarray[$ii]->box_order.' ';
$boxid_left[$key] = $boxarray[$key]->box_id;
// Affichage boite key
$box->loadBox();
$box->showBox();
-
- print ' ';
}
}
- print ' ';
+
+ // If no box on left, we show add an invisible empty box
+ if (! $ii)
+ {
+ $box->box_id='A';
+ $box->info_box_head=array();
+ $box->info_box_contents=array();
+ $box->showBox();
+ }
+
+ print " \n";
+ print "\n";
print "\n";
// Affichage colonne droite
+ print "\n\n";
+// print ''."\n";
print ' '."\n";
$ii=0;
foreach ($boxarray as $key => $box)
@@ -580,26 +591,35 @@ if (sizeof($boxarray))
if (eregi('^B',$box->box_order)) // colonne B
{
$ii++;
- print ' ';
//print 'box_id '.$boxarray[$ii]->box_id.' ';
//print 'box_order '.$boxarray[$ii]->box_order.' ';
$boxid_right[$key] = $boxarray[$key]->box_id;
// Affichage boite key
$box->loadBox();
$box->showBox();
-
- print ' ';
}
}
- print ' ';
- print "\n";
- print " | ";
- print "";
+ // If no box on left, we show add an invisible empty box
+ if (! $ii)
+ {
+ $box->box_id='B';
+ $box->info_box_head=array();
+ $box->info_box_contents=array();
+ $box->showBox();
+ }
+
+ print "\n";
+ print "\n";
+ print "\n";
+
+ print "";
+ print "";
}
if ($conf->use_ajax)
{
+ print "\n";
print '