Removed method fetch_prods() and get_each_prod() not used, keep only
get_arbo_each_prod() that is better.
This commit is contained in:
parent
d6f3fc9fe7
commit
72cedcf9f3
@ -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 *****
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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)
|
||||
*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user