Fix: Echec mise en page sur boite rss si echec de recup du flux
This commit is contained in:
parent
b43c4643d1
commit
c2fed80874
@ -69,10 +69,12 @@ class box_external_rss extends ModeleBoxes {
|
|||||||
if ($rss->ERROR) {
|
if ($rss->ERROR) {
|
||||||
// Affiche warning car il y a eu une erreur
|
// Affiche warning car il y a eu une erreur
|
||||||
$title.=" ".img_error($langs->trans("FailedToRefreshDataInfoNotUpToDate",(isset($rss->date)?dolibarr_print_date($rss->date,"%d %b %Y %H:%M"):'unknown date')));
|
$title.=" ".img_error($langs->trans("FailedToRefreshDataInfoNotUpToDate",(isset($rss->date)?dolibarr_print_date($rss->date,"%d %b %Y %H:%M"):'unknown date')));
|
||||||
$this->info_box_head = array('text' => $title);
|
$this->info_box_head = array('text' => $title,'limit' => 0);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
$this->info_box_head = array('text' => $title);
|
{
|
||||||
|
$this->info_box_head = array('text' => $title);
|
||||||
|
}
|
||||||
|
|
||||||
for($i = 0; $i < $max ; $i++){
|
for($i = 0; $i < $max ; $i++){
|
||||||
$item = $rss->items[$i];
|
$item = $rss->items[$i];
|
||||||
|
|||||||
@ -70,7 +70,8 @@ class ModeleBoxes
|
|||||||
// Affiche titre de la boite
|
// Affiche titre de la boite
|
||||||
print '<tr class="box_titre"><td';
|
print '<tr class="box_titre"><td';
|
||||||
if ($nbcol > 0) { print ' colspan="'.$nbcol.'"'; }
|
if ($nbcol > 0) { print ' colspan="'.$nbcol.'"'; }
|
||||||
print '>'.dolibarr_trunc($head['text'],$this->MAXLENGTHBOX);
|
print '>';
|
||||||
|
print dolibarr_trunc($head['text'],isset($head['limit'])?$head['limit']:$this->MAXLENGTHBOX);
|
||||||
if ($head['sublink'])
|
if ($head['sublink'])
|
||||||
{
|
{
|
||||||
print ' <a href="'.$head['sublink'].'">'.img_picto($head['subtext'],$head['subpicto']).'</a>';
|
print ' <a href="'.$head['sublink'].'">'.img_picto($head['subtext'],$head['subpicto']).'</a>';
|
||||||
|
|||||||
@ -516,11 +516,12 @@ function dolibarr_print_phone($phone,$country="FR")
|
|||||||
/**
|
/**
|
||||||
\brief Tronque une chaine à une taille donnée en ajoutant les points de suspension si cela dépasse
|
\brief Tronque une chaine à une taille donnée en ajoutant les points de suspension si cela dépasse
|
||||||
\param string Chaine à tronquer
|
\param string Chaine à tronquer
|
||||||
\param size Longueur max de la chaine
|
\param size Longueur max de la chaine. Si 0, pas de limite.
|
||||||
\return string Chaine tronquée
|
\return string Chaine tronquée
|
||||||
*/
|
*/
|
||||||
function dolibarr_trunc($string,$size=40)
|
function dolibarr_trunc($string,$size=40)
|
||||||
{
|
{
|
||||||
|
if ($size==0) return $string;
|
||||||
if (strlen($string) > $size)
|
if (strlen($string) > $size)
|
||||||
return substr($string,0,$size).'...';
|
return substr($string,0,$size).'...';
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user