diff --git a/htdocs/boxes.php b/htdocs/boxes.php
index 7f1b80e6d53..98f2e04c0da 100644
--- a/htdocs/boxes.php
+++ b/htdocs/boxes.php
@@ -190,10 +190,12 @@ class InfoBox
$listarray=split(',',$list);
foreach ($listarray as $id)
{
- //dolibarr_syslog("aaaaa".sizeof($listarray));
- $i++;
- $ii=sprintf('%02d',$i);
- $sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes";
+ if (is_numeric($id))
+ {
+ //dolibarr_syslog("aaaaa".sizeof($listarray));
+ $i++;
+ $ii=sprintf('%02d',$i);
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes";
$sql.= "(box_id, position, box_order, fk_user)";
$sql.= " values (";
$sql.= " ".$id.",";
@@ -201,14 +203,15 @@ class InfoBox
$sql.= " '".$colonne.$ii."',";
$sql.= " ".$userid;
$sql.= ")";
-
- dolibarr_syslog("InfoBox::saveboxorder sql=".$sql);
+
+ dolibarr_syslog("InfoBox::saveboxorder sql=".$sql);
$result = $this->db->query($sql);
- if ($result < 0)
- {
- $error++;
- break;
- }
+ if ($result < 0)
+ {
+ $error++;
+ break;
+ }
+ }
}
}
if ($error)
@@ -229,6 +232,6 @@ class InfoBox
$this->db->rollback();
return -1;
}
- }
+ }
}
?>
diff --git a/htdocs/index.php b/htdocs/index.php
index 1051aa59844..6b5b6883c5c 100644
--- a/htdocs/index.php
+++ b/htdocs/index.php
@@ -560,8 +560,8 @@ if (sizeof($boxarray))
{
$ii++;
//print 'box_id '.$boxarray[$ii]->box_id.' ';
- //print 'box_order '.$boxarray[$ii]->box_order.'
';
- $boxid_left[$key] = $boxarray[$key]->box_id;
+ //print 'box_order '.$boxarray[$ii]->box_order.'
';
+ $boxid_left[$key] = $boxarray[$key]->box_id;
// Affichage boite key
$box->loadBox();
$box->showBox();
@@ -569,7 +569,7 @@ if (sizeof($boxarray))
}
// If no box on left, we show add an invisible empty box
- if (! $ii)
+ if ($ii==0)
{
$box->box_id='A';
$box->info_box_head=array();
@@ -586,22 +586,24 @@ if (sizeof($boxarray))
// print '