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:
parent
2b0cfb04af
commit
2a3db5a3ac
@ -141,7 +141,7 @@ class Categorie
|
||||
$this->error.=" : ".$langs->trans("CategoryExistsAtSameLevel");
|
||||
return -4;
|
||||
}
|
||||
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie (label, description,";
|
||||
@ -187,7 +187,7 @@ class Categorie
|
||||
$result=$interface->run_triggers('CATEGORY_CREATE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
|
||||
|
||||
$this->db->commit();
|
||||
return $id;
|
||||
}
|
||||
@ -579,7 +579,7 @@ class Categorie
|
||||
$cats = array ();
|
||||
while ($rec = $this->db->fetch_array($res))
|
||||
{
|
||||
$cat = new self($this->db);
|
||||
$cat = new Categorie($this->db);
|
||||
$cat->fetch($rec['fk_categorie_fille']);
|
||||
$cats[] = $cat;
|
||||
}
|
||||
@ -829,7 +829,7 @@ class Categorie
|
||||
$cats = array ();
|
||||
while ($rec = $this->db->fetch_array($res))
|
||||
{
|
||||
$cat = new self($this->db);
|
||||
$cat = new Categorie($this->db);
|
||||
$cat->fetch($rec['rowid']);
|
||||
$cats[$record['rowid']] = $cat;
|
||||
}
|
||||
@ -1063,7 +1063,7 @@ class Categorie
|
||||
{
|
||||
while ($rec = $this->db->fetch_array($res))
|
||||
{
|
||||
$cat = new self($this->db);
|
||||
$cat = new Categorie($this->db);
|
||||
$cat->fetch($rec['fk_categorie_mere']);
|
||||
$meres[] = $cat;
|
||||
}
|
||||
@ -1131,7 +1131,7 @@ class Categorie
|
||||
{
|
||||
while ($rec = $this->db->fetch_array($res))
|
||||
{
|
||||
$cat = new self($this->db);
|
||||
$cat = new Categorie($this->db);
|
||||
$cat->fetch($rec['fk_categorie']);
|
||||
$cats[] = $cat;
|
||||
}
|
||||
@ -1182,7 +1182,7 @@ class Categorie
|
||||
{
|
||||
while ($rec = $this->db->fetch_array($res))
|
||||
{
|
||||
$cat = new self($this->db);
|
||||
$cat = new Categorie($this->db);
|
||||
$cat->fetch($rec['rowid']);
|
||||
$cats[] = $cat;
|
||||
}
|
||||
@ -1290,7 +1290,7 @@ class Categorie
|
||||
function liste_photos($dir,$nbmax=0)
|
||||
{
|
||||
include_once(DOL_DOCUMENT_ROOT ."/core/lib/files.lib.php");
|
||||
|
||||
|
||||
$nbphoto=0;
|
||||
$tabobj=array();
|
||||
|
||||
|
||||
@ -84,7 +84,7 @@ $form = new Form($db);
|
||||
|
||||
llxHeader("","",$langs->trans("Categories"));
|
||||
|
||||
if ($mesg) print $mesg.'<br>';
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
if ($type == 0) $title=$langs->trans("ProductsCategoryShort");
|
||||
elseif ($type == 1) $title=$langs->trans("SuppliersCategoryShort");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user