dolibarr-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Dolibarr-dev] 2 patches


From: Franky Van Liedekerke
Subject: Re: [Dolibarr-dev] 2 patches
Date: Mon, 05 Feb 2007 10:13:46 +0100
User-agent: Thunderbird 1.5.0.9 (X11/20061219)

Hi,

je peux bien accepter si vous n'aimer pas la manière

$product = new Product($db, $_GET["id"]);

mais alors il faut être consistant dans le code.
Si on fait un grep comme:

grep -ri "new product" *|grep "\,"

on voit beaucoup de lignes pareilles:

categories/categorie.class.php:                         $prod = new
Product ($this->db, $rec['fk_product']);
comm/propal.php:            $prod = new Product($db, $_POST['idprod']);
comm/propal.php:                        $prod = new Product($db,
$_POST['idprod']);
comm/propal.php:                                        $prod_arbo = new
Product($db, $value[1]);
commande/fiche.php:       $prod = new Product($db, $_POST['idprod']);
commande/fiche.php:                     $prod = new Product($db,
$_POST['idprod']);
commande/fiche.php:                                     $prod_arbo = new
Product($db, $value[1]);
commande/commande.class.php:                $prod = new
Product($this->db, $this->lignes[$i]->fk_product);
commande/commande.class.php:       $product = new
Product($this->db,$ligne->fk_product);
commande/commande.class.php:    $prod=new Product($this->db,$idproduct);
commande/commande.class.php:          $prod = new Product($this->db,
$idproduct);
commande/commande.class.php:            $product = new
Product($this->db,$ligne->fk_product);
commande/commande.class.php:            $product = new
Product($this->db,$LigneOld->produit_id);
commande/commande.class.php:       $product = new
Product($this->db,$ligne->fk_product);
commande/commande.class.php:    $product = new
Product($this->db,$this->fk_product);
compta/facture.php:            $prod = new Product($db, $_POST['idprod']);
contrat/contrat.class.php:                $prod = new Product($this->db,
$fk_product);
expedition/expedition.class.php:                            $product =
new Product($this->db,$obj->fk_product);
facture.class.php:                  $prod = new Product($this->db,
$_facrec->lignes[$i]->produit_id);
fourn/fournisseur.commande.class.php:       $prod = new
Product($this->db, $fk_product);
fourn/fournisseur.commande.class.php:   $prod = new Product($this->db,
$comclient->lignes[$i]->fk_product);
product/sousproduits/fiche.php:   $prod_arbo=new Product($db,$objp->rowid);
product/fiche.php:  $prod = new Product($db, $_GET['id']);
product.class.php:                 $product = new Product($this->db,
$value[1]);
propal.class.php:                               $prod = new
Product($this->db, $idproduct);

Dans les cas suivants ces lignes sont suivi d'un fetch:

categories/categorie.class.php:365:                             $prod =
new Product ($this->db, $rec['fk_product']);
categories/categorie.class.php-366-
$prod->fetch ($prod->id);

comm/propal.php:538:            $prod = new Product($db, $_POST['idprod']);
comm/propal.php-539-            $prod->fetch($_POST['idprod']);

commande/fiche.php:277:   $prod = new Product($db, $_POST['idprod']);
commande/fiche.php-278-   $prod->fetch($_POST['idprod']);

compta/facture.php:637:            $prod = new Product($db,
$_POST['idprod']);
compta/facture.php-638-            $prod->fetch($_POST['idprod']);

contrat/contrat.class.php:619:                $prod = new
Product($this->db, $fk_product);
contrat/contrat.class.php-620-                if
($prod->fetch($fk_product) > 0)

facture.class.php:249:              $prod = new Product($this->db,
$_facrec->lignes[$i]->produit_id);
facture.class.php-250-
$res=$prod->fetch($_facrec->lignes[$i]->produit_id);

fourn/fournisseur.commande.class.php:647:           $prod = new
Product($this->db, $fk_product);
fourn/fournisseur.commande.class.php-648-           if
($prod->fetch($fk_product) > 0)

fourn/fournisseur.commande.class.php:1049:      $prod = new
Product($this->db, $comclient->lignes[$i]->fk_product);
fourn/fournisseur.commande.class.php-1050-      if
($prod->fetch($comclient->lignes[$i]->fk_product) > 0)

product/fiche.php:279:  $prod = new Product($db, $_GET['id']);
product/fiche.php-280-  $result=$prod->fetch($_GET['id']);


Alors, pouvez-vous me dire quelle manière est la bonne?


Franky


Franky Van Liedekerke wrote:
> Rodolphe Quiedeville wrote:
>> Le 02.02.2007 16:38, Franky Van Liedekerke a ecrit :
>>> 2 patches:
>>>
>>> - remplacer le code
>>>
>>>   $product = new Product($db);
>>>   $product->fetch($_GET["id"]);
>>>
>>>   par
>>>
>>>   $product = new Product($db, $_GET["id"]);
>>>
>>>   Naturellement ce n'est pas nécessaire, mais c'est plus facile à
>>> comprendre: si tu veut adapter un produit, tu donne l'id avec, et si tu
>>> veux créer un nouveau produit, tu donne rien comme id.
>> Bonjour,
>>
>> Je ne suis pas d'accord avec cette modification, je n'en vois pas
>> l'intérêt et de plus dans certaine page cela créérait un bug.
>>
>> Donc on n'applique pas le patch.
>>
>> A++
>>
>>
> 
> Bonjour,
> 
> tu peut me dire dans quelle page le bug serait si on applique cette
> patch? Je veux bien comprendre ce que je fais de mal là.
> Et le 2ième patch?
> 
> Franky
> 
> 
> _______________________________________________
> Dolibarr-dev mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/dolibarr-dev
> 
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]