Fix: new self is not compatible with most version of PHP. Also result is

not predicable as it depends on PHP version.
This commit is contained in:
Laurent Destailleur 2012-05-21 20:31:02 +02:00
parent 2b0cfb04af
commit 2a3db5a3ac
2 changed files with 9 additions and 9 deletions

View File

@ -579,7 +579,7 @@ class Categorie
$cats = array (); $cats = array ();
while ($rec = $this->db->fetch_array($res)) while ($rec = $this->db->fetch_array($res))
{ {
$cat = new self($this->db); $cat = new Categorie($this->db);
$cat->fetch($rec['fk_categorie_fille']); $cat->fetch($rec['fk_categorie_fille']);
$cats[] = $cat; $cats[] = $cat;
} }
@ -829,7 +829,7 @@ class Categorie
$cats = array (); $cats = array ();
while ($rec = $this->db->fetch_array($res)) while ($rec = $this->db->fetch_array($res))
{ {
$cat = new self($this->db); $cat = new Categorie($this->db);
$cat->fetch($rec['rowid']); $cat->fetch($rec['rowid']);
$cats[$record['rowid']] = $cat; $cats[$record['rowid']] = $cat;
} }
@ -1063,7 +1063,7 @@ class Categorie
{ {
while ($rec = $this->db->fetch_array($res)) while ($rec = $this->db->fetch_array($res))
{ {
$cat = new self($this->db); $cat = new Categorie($this->db);
$cat->fetch($rec['fk_categorie_mere']); $cat->fetch($rec['fk_categorie_mere']);
$meres[] = $cat; $meres[] = $cat;
} }
@ -1131,7 +1131,7 @@ class Categorie
{ {
while ($rec = $this->db->fetch_array($res)) while ($rec = $this->db->fetch_array($res))
{ {
$cat = new self($this->db); $cat = new Categorie($this->db);
$cat->fetch($rec['fk_categorie']); $cat->fetch($rec['fk_categorie']);
$cats[] = $cat; $cats[] = $cat;
} }
@ -1182,7 +1182,7 @@ class Categorie
{ {
while ($rec = $this->db->fetch_array($res)) while ($rec = $this->db->fetch_array($res))
{ {
$cat = new self($this->db); $cat = new Categorie($this->db);
$cat->fetch($rec['rowid']); $cat->fetch($rec['rowid']);
$cats[] = $cat; $cats[] = $cat;
} }

View File

@ -84,7 +84,7 @@ $form = new Form($db);
llxHeader("","",$langs->trans("Categories")); llxHeader("","",$langs->trans("Categories"));
if ($mesg) print $mesg.'<br>'; dol_htmloutput_mesg($mesg);
if ($type == 0) $title=$langs->trans("ProductsCategoryShort"); if ($type == 0) $title=$langs->trans("ProductsCategoryShort");
elseif ($type == 1) $title=$langs->trans("SuppliersCategoryShort"); elseif ($type == 1) $title=$langs->trans("SuppliersCategoryShort");