From 2a3db5a3acdb051bb4d4c53bf822df0d9071381e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 May 2012 20:31:02 +0200 Subject: [PATCH] Fix: new self is not compatible with most version of PHP. Also result is not predicable as it depends on PHP version. --- htdocs/categories/class/categorie.class.php | 16 ++++++++-------- htdocs/categories/viewcat.php | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 3a31f6b0e7f..fccc9c68ce2 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -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(); diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 5d3fa1d0a55..c1974a95139 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -84,7 +84,7 @@ $form = new Form($db); llxHeader("","",$langs->trans("Categories")); -if ($mesg) print $mesg.'
'; +dol_htmloutput_mesg($mesg); if ($type == 0) $title=$langs->trans("ProductsCategoryShort"); elseif ($type == 1) $title=$langs->trans("SuppliersCategoryShort");