diff --git a/ChangeLog b/ChangeLog index bfa1f0d3d5e..10c0c98c625 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,7 +17,7 @@ Following changes may create regressions for some external modules, but were nec * PHP 5.3 is no more supported. Minimum PHP is now 5.4+ * Remove the old deprecated code of doActions and getInstanceDao in canvas. The doActions of standard hooks are already available and are better. - +* Removed method fetch_prods() and get_each_prod() not used, keep only get_arbo_each_prod() that is better. ***** ChangeLog for 7.0.1 compared to 7.0.0 ***** diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 15c4a9d94de..dd0e41ee836 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1530,8 +1530,8 @@ class Commande extends CommonOrder { $prod = new Product($this->db); $prod->fetch($idproduct); - $prod -> get_sousproduits_arbo (); - $prods_arbo = $prod->get_each_prod(); + $prod -> get_sousproduits_arbo(); + $prods_arbo = $prod->get_arbo_each_prod(); if(count($prods_arbo) > 0) { foreach($prods_arbo as $key => $value) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 403b9b7e6ca..6dbf49f69ef 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3303,28 +3303,8 @@ class Product extends CommonObject } /** - * fonction recursive uniquement utilisee par get_each_prod, ajoute chaque sousproduits dans le tableau res - * - * @param array $prod Products array - * @return void - */ - function fetch_prods($prod) - { - $this->res; - foreach($prod as $nom_pere => $desc_pere) - { - // on est dans une sous-categorie - if(is_array($desc_pere)) - $this->res[]= array($desc_pere[1],$desc_pere[0]); - if(count($desc_pere) >1) - { - $this->fetch_prods($desc_pere); - } - } - } - - /** - * reconstruit l'arborescence des produits sous la forme d'un tableau + * Build the tree of subproducts into an array + * this->sousprods is loaded by this->get_sousproduits_arbo() * * @param int $multiply Because each sublevel must be multiplicated by parent nb * @return array $this->res @@ -3343,26 +3323,6 @@ class Product extends CommonObject return $this->res; } - /** - * Renvoie tous les sousproduits dans le tableau res, chaque ligne de res contient : id -> qty - * - * @return array $this->res - */ - function get_each_prod() - { - $this->res = array(); - if (is_array($this->sousprods)) - { - foreach($this->sousprods as $nom_pere => $desc_pere) - { - if (count($desc_pere) >1) $this->fetch_prods($desc_pere); - } - sort($this->res); - } - return $this->res; - } - - /** * Return all parent products for current product (first level only) *