From b2674f8ae1f29426033c4e611fe981cfaf6459bd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 23 Oct 2004 21:02:56 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20Correction=20des=20mauvaises=20utilisati?= =?UTF-8?q?ons=20des=20fetch=5Fobjet=20ou=20on=20passait=20un=20param=E8tr?= =?UTF-8?q?e=20jamais=20utilis=E9.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/actioncomm.class.php | 2 +- htdocs/cactioncomm.class.php | 6 +++--- htdocs/chargesociales.class.php | 4 ++-- htdocs/companybankaccount.class.php | 2 +- htdocs/contact.class.php | 8 ++++---- htdocs/don.class.php | 2 +- htdocs/facture.class.php | 14 ++++++------- htdocs/facturefourn.class.php | 4 ++-- htdocs/html.form.class.php | 31 +++++++++++++++-------------- htdocs/index.php | 2 +- htdocs/master.inc.php | 5 +++-- htdocs/notify.class.php | 2 +- htdocs/paiement.class.php | 4 ++-- htdocs/project.class.php | 6 +++--- htdocs/projetdon.class.php | 2 +- htdocs/propal.class.php | 14 ++++++------- htdocs/service.class.php | 2 +- htdocs/societe.class.php | 16 +++++++-------- htdocs/societe.php | 4 ++-- htdocs/tva.class.php | 6 +++--- htdocs/user.class.php | 3 +-- 21 files changed, 70 insertions(+), 69 deletions(-) diff --git a/htdocs/actioncomm.class.php b/htdocs/actioncomm.class.php index 0778ec935d3..4aed13adad0 100644 --- a/htdocs/actioncomm.class.php +++ b/htdocs/actioncomm.class.php @@ -113,7 +113,7 @@ class ActionComm { if ($this->db->num_rows()) { - $obj = $this->db->fetch_object(0); + $obj = $this->db->fetch_object(); $this->id = $id; $this->type = $obj->libelle; diff --git a/htdocs/cactioncomm.class.php b/htdocs/cactioncomm.class.php index bc1e453db0a..e680bdba161 100644 --- a/htdocs/cactioncomm.class.php +++ b/htdocs/cactioncomm.class.php @@ -43,7 +43,7 @@ class CActioncomm { { if ($db->num_rows()) { - $obj = $db->fetch_object(0); + $obj = $db->fetch_object(); $this->id = $id; $this->libelle = $obj->libelle; @@ -87,7 +87,7 @@ class CActioncomm { $i = 0; while ($i < $nump) { - $obj = $this->db->fetch_object($i); + $obj = $this->db->fetch_object(); $ga[$obj->id] = $obj->libelle; $i++; @@ -117,7 +117,7 @@ class CActioncomm { { if ($this->db->num_rows()) { - $obj = $this->db->fetch_object($result , 0); + $obj = $this->db->fetch_object($result); return $obj->nom; } $this->db->free(); diff --git a/htdocs/chargesociales.class.php b/htdocs/chargesociales.class.php index 41c39591bec..66f195aabb2 100644 --- a/htdocs/chargesociales.class.php +++ b/htdocs/chargesociales.class.php @@ -146,7 +146,7 @@ class ChargeSociales { { if ($this->db->num_rows()) { - $obj = $this->db->fetch_object(0); + $obj = $this->db->fetch_object(); $this->id = $obj->rowid; $this->date_ech = $obj->date_ech; @@ -186,7 +186,7 @@ class ChargeSociales { if ($result) { if ($this->db->num_rows()) { - $obj = $this->db->fetch_object(0); + $obj = $this->db->fetch_object(); return $obj->amount; } else { return 0; diff --git a/htdocs/companybankaccount.class.php b/htdocs/companybankaccount.class.php index c26fc10d963..cd169d0dd3c 100644 --- a/htdocs/companybankaccount.class.php +++ b/htdocs/companybankaccount.class.php @@ -147,7 +147,7 @@ class CompanyBankAccount { if ($this->db->num_rows()) { - $obj = $this->db->fetch_object($result , 0); + $obj = $this->db->fetch_object($result); $this->bank = $obj->bank; $this->courant = $obj->courant; diff --git a/htdocs/contact.class.php b/htdocs/contact.class.php index bdb0c2d3c0d..5a8383658c5 100644 --- a/htdocs/contact.class.php +++ b/htdocs/contact.class.php @@ -343,7 +343,7 @@ class Contact { if ($this->db->num_rows()) { - $obj = $this->db->fetch_object($result , 0); + $obj = $this->db->fetch_object(); $this->id = $obj->idp; $this->civilite_id = $obj->civilite_id; @@ -386,7 +386,7 @@ class Contact { if ($this->db->num_rows()) { - $uobj = $this->db->fetch_object($result , 0); + $uobj = $this->db->fetch_object(); $this->user_id = $uobj->rowid; } @@ -426,7 +426,7 @@ class Contact { if ($this->db->num_rows()) { - $obj = $this->db->fetch_object($result , 0); + $obj = $this->db->fetch_object(); $this->birthday_alert = 1; } @@ -509,7 +509,7 @@ class Contact { if ($this->db->num_rows()) { - $obj = $this->db->fetch_object($result , 0); + $obj = $this->db->fetch_object(); $this->id = $obj->idp; diff --git a/htdocs/don.class.php b/htdocs/don.class.php index 5b3b8829912..666e26b13e2 100644 --- a/htdocs/don.class.php +++ b/htdocs/don.class.php @@ -290,7 +290,7 @@ class Don if ($this->db->num_rows()) { - $obj = $this->db->fetch_object(0); + $obj = $this->db->fetch_object(); $this->id = $obj->rowid; $this->date = $obj->datedon; diff --git a/htdocs/facture.class.php b/htdocs/facture.class.php index ef9ce4a9362..d2ed1f98913 100644 --- a/htdocs/facture.class.php +++ b/htdocs/facture.class.php @@ -106,7 +106,7 @@ class Facture { if ($this->db->num_rows()) { - $obj = $this->db->fetch_object(0); + $obj = $this->db->fetch_object(); $cdr_nbjour = $obj->nbjour; $cdr_fdm = $obj->fdm; } @@ -245,7 +245,7 @@ class Facture { if ($this->db->num_rows()) { - $obj = $this->db->fetch_object(0); + $obj = $this->db->fetch_object(); $this->id = $rowid; $this->datep = $obj->dp; @@ -291,7 +291,7 @@ class Facture while ($i < $num) { - $objp = $this->db->fetch_object($i); + $objp = $this->db->fetch_object($result); $faclig = new FactureLigne($this->db); $faclig->desc = stripslashes($objp->description); $faclig->qty = $objp->qty; @@ -542,7 +542,7 @@ class Facture $i = 0; while ($i < $num) { - $obj = $this->db->fetch_object($i); + $obj = $this->db->fetch_object($result); $sql = "UPDATE ".MAIN_DB_PREFIX."product SET nbvente=nbvente+1 WHERE rowid = ".$obj->fk_product; $db2 = $this->db->clone(); @@ -746,7 +746,7 @@ class Facture $i = 0; while ($i < $num) { - $obj = $this->db->fetch_object($i); + $obj = $this->db->fetch_object($result); $products[$i][0] = $obj->price; $products[$i][1] = $obj->qty; @@ -1024,7 +1024,7 @@ class Facture { if ($this->db->num_rows()) { - $obj = $this->db->fetch_object($result , 0); + $obj = $this->db->fetch_object($result); $this->id = $obj->rowid; @@ -1086,7 +1086,7 @@ class FactureLigne $result = $this->db->query($sql); if ($result) { - $objp = $this->db->fetch_object($i); + $objp = $this->db->fetch_object($result); $this->desc = stripslashes($objp->description); $this->qty = $objp->qty; $this->price = $objp->price; diff --git a/htdocs/facturefourn.class.php b/htdocs/facturefourn.class.php index ce20b66a389..0dae380cd40 100644 --- a/htdocs/facturefourn.class.php +++ b/htdocs/facturefourn.class.php @@ -163,7 +163,7 @@ class FactureFourn { if ($this->db->num_rows()) { - $obj = $this->db->fetch_object(0); + $obj = $this->db->fetch_object(); $this->id = $rowid; $this->datep = $obj->df; @@ -200,7 +200,7 @@ class FactureFourn { while ($i < $num) { - $obj = $this->db->fetch_object($i); + $obj = $this->db->fetch_object(); $this->lignes[$i][0] = stripslashes($obj->description); $this->lignes[$i][1] = $obj->pu_ht; $this->lignes[$i][2] = $obj->tva_taux; diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index 8bc0280b774..944b2693b5c 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -79,7 +79,7 @@ class Form $pays=''; while ($i < $num) { - $obj = $this->db->fetch_object( $i); + $obj = $this->db->fetch_object(); if ($obj->code == 0) { print ''; } @@ -138,7 +138,7 @@ class Form $pays=''; while ($i < $num) { - $obj = $this->db->fetch_object( $i); + $obj = $this->db->fetch_object(); if ($obj->code == 0) { print ''; } @@ -194,7 +194,7 @@ class Form $foundselected=false; while ($i < $num) { - $obj = $this->db->fetch_object( $i); + $obj = $this->db->fetch_object(); if ($selected > 0 && $selected == $obj->rowid) { $foundselected=true; @@ -275,7 +275,7 @@ class Form { while ($i < $num) { - $obj = $this->db->fetch_object( $i); + $obj = $this->db->fetch_object(); if ($selected > 0 && $selected == $obj->idp) { print ''; @@ -316,7 +316,7 @@ class Form { while ($i < $num) { - $obj = $this->db->fetch_object($i); + $obj = $this->db->fetch_object(); if ($selected && $selected == $obj->idp) { @@ -353,7 +353,7 @@ class Form if ($num) { - $obj = $this->db->fetch_object(0); + $obj = $this->db->fetch_object(); return $obj->libelle; } else @@ -389,7 +389,7 @@ class Form { while ($i < $num) { - $obj = $this->db->fetch_object( $i); + $obj = $this->db->fetch_object(); if ($selected == $obj->rowid) { print ''; } @@ -484,7 +484,7 @@ class Form print '
'; print ''; - print ''; + print '
'; print ''; print '
'.$title.'
'.$question.''; @@ -829,10 +829,10 @@ class Form /* - * \brief Selection de oui/non en caractere - * \param name nom du select - * \param value valeur présélectionnée - * \param option 0 retourne yes/no, 1 retourne 1/0 + * \brief Selection de oui/non en caractere (renvoi yes/no) + * \param name nom du select + * \param value valeur présélectionnée + * \param option 0 retourne yes/no, 1 retourne 1/0 */ function selectyesno($name,$value='',$option=0) { @@ -857,8 +857,9 @@ class Form } /* - * \brief Selection de oui/non en chiffre - * + * \brief Selection de oui/non en chiffre (renvoi 1/0) + * \param name nom du select + * \param value valeur présélectionnée */ function selectyesnonum($name,$value='') { diff --git a/htdocs/index.php b/htdocs/index.php index 90970af4f6a..c9b95aa6116 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -49,7 +49,7 @@ if ($result) while ($j < $num) { - $obj = $db->fetch_object($j); + $obj = $db->fetch_object($result); $boxes[$j] = "includes/boxes/".$obj->file; $j++; } diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index 96108a64fd6..6080c04b509 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -123,7 +123,7 @@ if ($result) while ($i < $numr) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); define ("$objp->name", $objp->value); $i++; } @@ -368,6 +368,7 @@ if (defined("MAIN_MAIL_NEW_SUBJECT")) */ $bc[0]="class=\"impair\""; $bc[1]="class=\"pair\""; - +$yesno[0]="no"; +$yesno[1]="yes"; ?> diff --git a/htdocs/notify.class.php b/htdocs/notify.class.php index f9ddee88c6e..f0d0a5d2a17 100644 --- a/htdocs/notify.class.php +++ b/htdocs/notify.class.php @@ -60,7 +60,7 @@ class Notify $i = 0; while ($i < $num) { - $obj = $this->db->fetch_object( $i); + $obj = $this->db->fetch_object($result); $sendto = $obj->firstname . " " . $obj->name . " <".$obj->email.">"; diff --git a/htdocs/paiement.class.php b/htdocs/paiement.class.php index 3c342f4da7b..2c406cf3577 100644 --- a/htdocs/paiement.class.php +++ b/htdocs/paiement.class.php @@ -78,7 +78,7 @@ class Paiement { if ($this->db->num_rows()) { - $obj = $this->db->fetch_object(0); + $obj = $this->db->fetch_object(); $this->id = $obj->rowid; $this->date = $obj->dp; @@ -273,7 +273,7 @@ class Paiement { if ($this->db->num_rows()) { - $obj = $this->db->fetch_object($result , 0); + $obj = $this->db->fetch_object(); $this->id = $obj->idp; diff --git a/htdocs/project.class.php b/htdocs/project.class.php index a4274f55805..c3e39909a35 100644 --- a/htdocs/project.class.php +++ b/htdocs/project.class.php @@ -63,7 +63,7 @@ class Project { if ($this->db->query($sql) ) { if ($this->db->num_rows()) { - $obj = $this->db->fetch_object(0); + $obj = $this->db->fetch_object(); $this->id = $rowid; $this->ref = $obj->ref; @@ -95,7 +95,7 @@ class Project { $i = 0; while ($i < $nump) { - $obj = $this->db->fetch_object($i); + $obj = $this->db->fetch_object(); $propales[$i] = $obj->rowid; @@ -140,7 +140,7 @@ class Project { $i = 0; while ($i < $nump) { - $obj = $this->db->fetch_object($i); + $obj = $this->db->fetch_object(); $projets[$obj->rowid] = $obj->title; $i++; diff --git a/htdocs/projetdon.class.php b/htdocs/projetdon.class.php index 3459015cf64..8cfd825c4d9 100644 --- a/htdocs/projetdon.class.php +++ b/htdocs/projetdon.class.php @@ -53,7 +53,7 @@ class ProjetDon { $i = 0; while ($i < $nump) { - $obj = $this->db->fetch_object($i); + $obj = $this->db->fetch_object(); $projets[$obj->rowid] = $obj->libelle; $i++; diff --git a/htdocs/propal.class.php b/htdocs/propal.class.php index 4b6172e1e18..a69cde78ebb 100644 --- a/htdocs/propal.class.php +++ b/htdocs/propal.class.php @@ -313,7 +313,7 @@ class Propal while ($i < $num) { - $obj = $this->db->fetch_object($i); + $obj = $this->db->fetch_object(); $products[$i][0] = $obj->price; $products[$i][1] = $obj->qty; $products[$i][2] = $obj->tva_tx; @@ -366,7 +366,7 @@ class Propal { if ($this->db->num_rows()) { - $obj = $this->db->fetch_object(0); + $obj = $this->db->fetch_object(); $this->id = $rowid; $this->datep = $obj->dp; @@ -417,7 +417,7 @@ class Propal while ($i < $num) { - $objp = $this->db->fetch_object($i); + $objp = $this->db->fetch_object(); $ligne = new PropaleLigne(); $ligne->libelle = stripslashes($objp->label); @@ -455,7 +455,7 @@ class Propal while ($j < $num) { - $objp = $this->db->fetch_object($i); + $objp = $this->db->fetch_object(); $ligne = new PropaleLigne(); $ligne->libelle = stripslashes($objp->description); $ligne->desc = stripslashes($objp->description); @@ -686,7 +686,7 @@ class Propal $i = 0; while ($i < $nump) { - $obj = $this->db->fetch_object($i); + $obj = $this->db->fetch_object(); $ga[$obj->rowid] = $obj->ref; $i++; @@ -720,7 +720,7 @@ class Propal $i = 0; while ($i < $nump) { - $obj = $this->db->fetch_object($i); + $obj = $this->db->fetch_object(); $ga[$i] = $obj->fk_commande; $i++; @@ -799,7 +799,7 @@ class Propal { if ($this->db->num_rows()) { - $obj = $this->db->fetch_object($result , 0); + $obj = $this->db->fetch_object(); $this->id = $obj->rowid; diff --git a/htdocs/service.class.php b/htdocs/service.class.php index 65ce4aaded2..db2f2597e09 100644 --- a/htdocs/service.class.php +++ b/htdocs/service.class.php @@ -154,7 +154,7 @@ class Service { if ($result) { if ($this->db->num_rows()) { - $obj = $this->db->fetch_object($result , 0); + $obj = $this->db->fetch_object($result); $this->id = $obj->rowid; $this->ref = $obj->ref; diff --git a/htdocs/societe.class.php b/htdocs/societe.class.php index 6089795b6cd..d4d91401461 100644 --- a/htdocs/societe.class.php +++ b/htdocs/societe.class.php @@ -227,7 +227,7 @@ class Societe { { if ($this->db->num_rows()) { - $obj = $this->db->fetch_object(0); + $obj = $this->db->fetch_object(); $this->date_update = $obj->date_update; @@ -375,7 +375,7 @@ class Societe { while ($i < $num) { - $objp = $this->db->fetch_object($i); + $objp = $this->db->fetch_object(); $array_push($facimp, $objp->rowid); $i++; print $i; @@ -534,7 +534,7 @@ class Societe { { if ($this->db->num_rows()) { - $obj = $this->db->fetch_object($result , 0); + $obj = $this->db->fetch_object($result); return $obj->nom; } $this->db->free(); @@ -565,7 +565,7 @@ class Societe { $i = 0; while ($i < $nump) { - $obj = $this->db->fetch_object($i); + $obj = $this->db->fetch_object(); $contact_email[$obj->idp] = "$obj->firstname $obj->name <$obj->email>"; $i++; @@ -600,7 +600,7 @@ class Societe { $i = 0; while ($i < $nump) { - $obj = $this->db->fetch_object($i); + $obj = $this->db->fetch_object(); $contacts[$obj->idp] = "$obj->firstname $obj->name"; $i++; @@ -633,7 +633,7 @@ class Societe { if ($nump) { - $obj = $this->db->fetch_object(0); + $obj = $this->db->fetch_object(); $contact_email = "$obj->firstname $obj->name <$obj->email>"; @@ -668,7 +668,7 @@ class Societe { while ($i < $num) { - $objp = $this->db->fetch_object($i); + $objp = $this->db->fetch_object(); $effs[$objp->id] = $objp->libelle; $i++; } @@ -698,7 +698,7 @@ class Societe { while ($i < $num) { - $objp = $this->db->fetch_object($i); + $objp = $this->db->fetch_object(); $fj[$objp->code] = $objp->libelle; $i++; } diff --git a/htdocs/societe.php b/htdocs/societe.php index 6ea5149e076..630eb07e693 100644 --- a/htdocs/societe.php +++ b/htdocs/societe.php @@ -81,7 +81,7 @@ if ($mode == 'search') { if ( $db->num_rows() == 1) { - $obj = $db->fetch_object(0); + $obj = $db->fetch_object(); $socid = $obj->idp; } $db->free(); @@ -174,7 +174,7 @@ if ($result) while ($i < min($num,$conf->liste_limit)) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); $var=!$var; print "
"; print "idp\">"; diff --git a/htdocs/tva.class.php b/htdocs/tva.class.php index a1f9b61dd3d..92fbc0bece3 100644 --- a/htdocs/tva.class.php +++ b/htdocs/tva.class.php @@ -80,7 +80,7 @@ class Tva { if ($this->db->num_rows()) { - $obj = $this->db->fetch_object(0); + $obj = $this->db->fetch_object($result); return $obj->amount; } else @@ -120,7 +120,7 @@ class Tva { if ($this->db->num_rows()) { - $obj = $this->db->fetch_object(0); + $obj = $this->db->fetch_object($result); return $obj->amount; } else @@ -161,7 +161,7 @@ class Tva { if ($this->db->num_rows()) { - $obj = $this->db->fetch_object(0); + $obj = $this->db->fetch_object($result); return $obj->amount; } else diff --git a/htdocs/user.class.php b/htdocs/user.class.php index 56edeefe1f9..da8b649d370 100644 --- a/htdocs/user.class.php +++ b/htdocs/user.class.php @@ -503,7 +503,6 @@ class User { if ($this->db->num_rows()) { - //$obj = $this->db->fetch_object($result , 0); $obj = $this->db->fetch_object($result); $this->id = $obj->rowid; $this->nom = stripslashes($obj->name); @@ -546,7 +545,7 @@ class User $this->page_param = array(); while ($i < $num) { - $obj = $this->db->fetch_object($i); + $obj = $this->db->fetch_object(); $this->page_param[$obj->param] = $obj->value; $page_param_url .= $obj->param . "=".$obj->value."&"; $i++;