From 4ce75b6a7838d37646a261148abdb7e6a2abbd62 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 23 Oct 2004 16:55:07 +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/adherents/adherent.class.php | 6 +- htdocs/adherents/adherent_type.class.php | 4 +- htdocs/adherents/cartes/carte.php | 2 +- htdocs/adherents/cartes/etiquette.php | 2 +- htdocs/adherents/cotisation.class.php | 2 +- htdocs/adherents/cotisations.php | 87 ++++++-------- htdocs/adherents/edit.php | 2 +- htdocs/adherents/fiche.php | 2 +- htdocs/adherents/htpasswd.php | 2 +- htdocs/adherents/index.php | 4 +- htdocs/adherents/liste.php | 4 +- htdocs/adherents/type.php | 2 +- htdocs/admin/adherent.php | 5 +- htdocs/admin/boutique-special-all.php | 2 +- htdocs/admin/boutique-update-all.php | 2 +- htdocs/admin/boxes.php | 6 +- htdocs/admin/compta.php | 2 +- htdocs/admin/const.php | 2 +- htdocs/admin/dict.php | 4 +- htdocs/admin/external_rss.php | 4 +- htdocs/admin/osc-languages.php | 2 +- htdocs/admin/perms.php | 2 +- htdocs/admin/sqltables.php | 8 +- htdocs/admin/system/constall.php | 2 +- htdocs/admin/system/database.php | 2 +- htdocs/admin/update/paiement.php | 2 +- htdocs/boutique/auteur/auteur.class.php | 2 +- htdocs/boutique/auteur/index.php | 18 +-- htdocs/boutique/client/fiche.php | 25 ++-- htdocs/boutique/client/index.php | 32 ++--- htdocs/boutique/commande/ca.php | 8 +- htdocs/boutique/commande/fiche.php | 20 ++-- htdocs/boutique/commande/index.php | 4 +- htdocs/boutique/editeur/editeur.class.php | 4 +- htdocs/boutique/editeur/index.php | 14 +-- htdocs/boutique/livre/index.php | 18 +-- htdocs/boutique/livre/livre.class.php | 4 +- htdocs/boutique/livre/vignettes.php | 20 ++-- htdocs/boutique/newsletter/fiche.php | 12 +- htdocs/boutique/newsletter/index.php | 4 +- .../boutique/newsletter/newsletter.class.php | 2 +- htdocs/boutique/notification/index.php | 18 +-- .../notification/notification.class.php | 2 +- htdocs/boutique/notification/produits.php | 2 +- htdocs/comm/action/index.php | 6 +- htdocs/comm/action/rapport/index.php | 8 +- htdocs/comm/action/rapport/rapport.pdf.php | 2 +- htdocs/comm/addpropal.php | 15 ++- htdocs/comm/bookmark.php | 24 ++-- htdocs/comm/clients.php | 15 +-- htdocs/comm/contact.php | 32 ++--- htdocs/comm/fiche.php | 14 +-- htdocs/comm/index.php | 16 +-- htdocs/comm/people.php | 8 +- htdocs/comm/propal.php | 31 +++-- htdocs/comm/propal_model_pdf.class.php | 2 +- htdocs/comm/prospect/fiche.php | 18 +-- htdocs/comm/prospect/index.php | 10 +- htdocs/comm/prospect/prospects.php | 26 ++-- htdocs/commande/commande.class.php | 6 +- htdocs/commande/fiche.php | 20 ++-- htdocs/commande/index.php | 8 +- htdocs/commande/liste.php | 2 +- htdocs/commande/osccommande.class.php | 2 +- htdocs/compta/bank/account.class.php | 4 +- htdocs/compta/bank/account.php | 4 +- htdocs/compta/bank/bplc.php | 2 +- htdocs/compta/bank/budget.php | 6 +- htdocs/compta/bank/categ.php | 2 +- htdocs/compta/bank/config.php | 2 +- htdocs/compta/bank/functions.lib.php | 10 +- htdocs/compta/bank/index.php | 4 +- htdocs/compta/bank/ligne.php | 8 +- htdocs/compta/bank/pre.inc.php | 2 +- htdocs/compta/bank/rappro.php | 4 +- htdocs/compta/bank/releve.php | 13 +- htdocs/compta/bank/search.php | 6 +- htdocs/compta/bank/virement.php | 4 +- htdocs/compta/charges.php | 2 +- htdocs/compta/charges/index.php | 4 +- htdocs/compta/clients.php | 4 +- htdocs/compta/commande.php | 4 +- htdocs/compta/config.php | 2 +- htdocs/compta/deplacement/index.php | 2 +- htdocs/compta/dons/fiche.php | 4 +- htdocs/compta/dons/index.php | 2 +- htdocs/compta/dons/liste.php | 8 +- htdocs/compta/dons/stats.php | 2 +- htdocs/compta/facture.php | 113 ++++++++++-------- htdocs/compta/facture/facture-rec.class.php | 8 +- htdocs/compta/facture/fiche-rec.php | 4 +- htdocs/compta/fiche.php | 10 +- htdocs/compta/index.php | 16 +-- htdocs/compta/ligne.php | 4 +- htdocs/compta/paiement.php | 14 +-- htdocs/compta/paiement/fiche.php | 2 +- htdocs/compta/paiement/liste.php | 6 +- htdocs/compta/paiement_charge.php | 6 +- htdocs/compta/pmt.php | 16 ++- htdocs/compta/pointmort.php | 4 +- htdocs/compta/propal.php | 10 +- htdocs/compta/resultat/clientfourn.php | 8 +- htdocs/compta/sociales/charges.php | 2 +- htdocs/compta/sociales/index.php | 4 +- htdocs/compta/stats/cabyuser.php | 6 +- htdocs/compta/stats/casoc.php | 4 +- htdocs/compta/stats/comp.php | 6 +- htdocs/compta/stats/cumul.php | 2 +- htdocs/compta/stats/exercices.php | 4 +- htdocs/compta/stats/prev.php | 22 ++-- htdocs/compta/tva.php | 4 +- htdocs/compta/tva/index.php | 6 +- htdocs/compta/tva/reglement.php | 4 +- htdocs/compta/voyage/bilan.php | 6 +- htdocs/compta/voyage/index.php | 4 +- htdocs/compta/voyage/reduc.class.php | 2 +- htdocs/compta/voyage/reduc.php | 2 +- htdocs/contact/index.php | 9 +- htdocs/contrat/contrat.class.php | 2 +- htdocs/contrat/enservice.php | 2 +- htdocs/contrat/index.php | 2 +- htdocs/domain/index.php | 14 +-- htdocs/expedition/commande.php | 8 +- htdocs/expedition/expedition.class.php | 2 +- htdocs/expedition/fiche.php | 6 +- htdocs/expedition/index.php | 8 +- htdocs/expedition/liste.php | 2 +- 127 files changed, 543 insertions(+), 554 deletions(-) diff --git a/htdocs/adherents/adherent.class.php b/htdocs/adherents/adherent.class.php index 96f3eb133a0..360bb5760ff 100644 --- a/htdocs/adherents/adherent.class.php +++ b/htdocs/adherents/adherent.class.php @@ -433,7 +433,7 @@ class Adherent { if ($this->db->num_rows()) { - $obj = $this->db->fetch_object(0); + $obj = $this->db->fetch_object(); $this->fetch($obj->rowid); } } @@ -461,7 +461,7 @@ class Adherent if ($this->db->num_rows()) { - $obj = $this->db->fetch_object(0); + $obj = $this->db->fetch_object(); $this->id = $obj->rowid; $this->typeid = $obj->fk_adherent_type; @@ -508,7 +508,6 @@ class Adherent if ( $this->db->query( $sql) ){ if ($this->db->num_rows()){ - //$obj = $this->db->fetch_object(0); $tab = $this->db->fetch_array(); foreach ($tab as $key => $value){ @@ -534,7 +533,6 @@ class Adherent if ( $this->db->query( $sql) ){ if ($this->db->num_rows()){ - //$tab = $this->db->fetch_object(); //$array_name_options[]=$tab->Field; while ($tab = $this->db->fetch_object()){ if ($tab->Field != 'optid' && $tab->Field != 'tms' && $tab->Field != 'adhid'){ diff --git a/htdocs/adherents/adherent_type.class.php b/htdocs/adherents/adherent_type.class.php index d5cf0845061..2bb87de7703 100644 --- a/htdocs/adherents/adherent_type.class.php +++ b/htdocs/adherents/adherent_type.class.php @@ -167,7 +167,7 @@ class AdherentType if ($this->db->num_rows()) { - $obj = $this->db->fetch_object(0); + $obj = $this->db->fetch_object(); $this->id = $obj->rowid; $this->libelle = $obj->libelle; @@ -200,7 +200,7 @@ class AdherentType $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/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php index 796e7128b11..42b0548898a 100755 --- a/htdocs/adherents/cartes/carte.php +++ b/htdocs/adherents/cartes/carte.php @@ -82,7 +82,7 @@ if ($result) $i = 0; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); // attribut a remplacer $replace = array ( ucfirst(strtolower($objp->prenom)), diff --git a/htdocs/adherents/cartes/etiquette.php b/htdocs/adherents/cartes/etiquette.php index edc9594d283..7c19ca11a23 100755 --- a/htdocs/adherents/cartes/etiquette.php +++ b/htdocs/adherents/cartes/etiquette.php @@ -70,7 +70,7 @@ if ($result) $i = 0; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); // imprime le texte specifique sur la carte $pdf->Add_PDF_card(sprintf("%s\n%s\n%s %s\n%s", ucfirst(strtolower($objp->prenom))." ".strtoupper($objp->nom), ucwords(strtolower($objp->adresse)), $objp->cp, strtoupper($objp->ville), ucfirst(strtolower($objp->pays))),'',''); $i++; diff --git a/htdocs/adherents/cotisation.class.php b/htdocs/adherents/cotisation.class.php index 686d2ff11b0..9700686c8af 100644 --- a/htdocs/adherents/cotisation.class.php +++ b/htdocs/adherents/cotisation.class.php @@ -289,7 +289,7 @@ class Cotisation 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/adherents/cotisations.php b/htdocs/adherents/cotisations.php index 79bced4cccb..dc2b95c8b11 100644 --- a/htdocs/adherents/cotisations.php +++ b/htdocs/adherents/cotisations.php @@ -62,13 +62,13 @@ if ($_POST["action"] == '2bank' && $_POST["rowid"] !=''){ $num = $db->num_rows(); if ($num>0) { - $objp = $db->fetch_object(0); + $objp = $db->fetch_object($result); $amount=$objp->cotisation; $acct=new Account($db,ADHERENT_BANK_ACCOUNT); $insertid=$acct->addline($dateop, $_POST["operation"], $_POST["label"], $amount, $_POST["num_chq"],ADHERENT_BANK_CATEGORIE); if ($insertid == '') { - print "

Probleme d'insertion : ".$db->error(); + dolibarr_print_error($db); } else { @@ -81,20 +81,19 @@ if ($_POST["action"] == '2bank' && $_POST["rowid"] !=''){ } else { - print "

Probleme d'insertion $sql : ".$db->error(); + dolibarr_print_error($db); } } } else { - print "

Probleme SQL : $sql : ".$db->error(); + dolibarr_print_error($db); } } else { - print "

Probleme SQL : $sql : ".$db->error(); + dolibarr_print_error($db); } - } } @@ -123,7 +122,7 @@ if ($result) $i = 0; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); $Total[strftime("%Y",$objp->dateadh)]+=price($objp->cotisation); $Number[strftime("%Y",$objp->dateadh)]+=1; $i++; @@ -145,77 +144,64 @@ if ($result) print_barre_liste("Liste des cotisations", $page, "cotisations.php", "&statut=$statut&sortorder=$sortorder&sortfield=$sortfield"); - print "\n"; - print ''; + print "
\n"; + print ''; print ""; - print ''; - print ""; - print "\n"; - print "\n"; + print ''; + print ""; + print "\n"; + print "\n"; foreach ($Total as $key=>$value){ $var=!$var; - print "\n"; + print "\n"; } - print "
AnneeMontantNombreMoyenne
MontantNombreMoyenne
$key".price($value)."".$Number[$key]."".price($value/$Number[$key])."
$key".price($value)."".$Number[$key]."".price($value/$Number[$key])."

\n"; + print "
\n"; - print ""; + print "
"; - print ''; - //print ""; - print ''; + print '\n"; + print "\n"; - //print ""; - print '\n"; + print "\n"; - //print ""; - print '\n"; + print "\n"; if (defined("ADHERENT_BANK_USE") && ADHERENT_BANK_USE !=0){ - print '\n"; + print 'Bank
(Type,Numéro,Libelle)'; + print "\n"; } - print "\n"; + print "\n"; $var=True; $total=0; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $var=!$var; - print ""; - print "\n"; - print ''; - //$Total[strftime("%Y",$objp->dateadh)]+=price($objp->cotisation); + print ""; + print "\n"; + print ''; $total+=price($objp->cotisation); - /* - if ($objp->societe != ''){ - print "\n"; - }else{ - print "\n"; - } - */ - print "\n"; + print "\n"; if (defined("ADHERENT_BANK_USE") && ADHERENT_BANK_USE !=0){ if ($objp->bank !='' ){ - print ""; + print ""; }else{ - print ""; print ''; print "\n"; - print "\n"; + print "\n"; } } print ""; @@ -250,8 +236,7 @@ if ($result) } else { - print $sql; - print $db->error(); + dolibarr_print_error($db); } diff --git a/htdocs/adherents/edit.php b/htdocs/adherents/edit.php index 8753985a704..a0e1bf929f5 100644 --- a/htdocs/adherents/edit.php +++ b/htdocs/adherents/edit.php @@ -116,7 +116,7 @@ if ($rowid) if ($result) { $num = $db->num_rows(); if ($num) { - $obj = $db->fetch_object( 0); + $obj = $db->fetch_object($result); $total = $obj->total; } diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 696845fbf08..131073f6a64 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -650,7 +650,7 @@ if ($result) $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); $var=!$var; print ""; print "\n"; diff --git a/htdocs/adherents/htpasswd.php b/htdocs/adherents/htpasswd.php index 8ec62c86da2..1670134687d 100644 --- a/htdocs/adherents/htpasswd.php +++ b/htdocs/adherents/htpasswd.php @@ -64,7 +64,7 @@ if ($result) print "
\n"; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); $htpass=crypt($objp->pass,initialiser_sel()); print $objp->login.":".$htpass."
\n"; $i++; diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 9eb7468cba3..c61f6d0c5af 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -70,7 +70,7 @@ if ($result) $i = 0; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); $AdherentsAll[$objp->libelle]=$objp->rowid; if ($objp->statut == -1) { $AdherentsAValider[$objp->libelle]=$objp->somme; } if ($objp->statut == 1) { $Adherents[$objp->libelle]=$objp->somme; } @@ -93,7 +93,7 @@ if ($result) $i = 0; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); $Cotisants[$objp->libelle]=$objp->somme; $i++; } diff --git a/htdocs/adherents/liste.php b/htdocs/adherents/liste.php index e097d21f574..93a239a8900 100644 --- a/htdocs/adherents/liste.php +++ b/htdocs/adherents/liste.php @@ -85,7 +85,7 @@ if ($result) } if ($_GET["type"]) { - $objp = $db->fetch_object(0); + $objp = $db->fetch_object($result); $titre.=" (".$objp->type.")"; } @@ -127,7 +127,7 @@ if ($result) { if ($_GET["type"] && $i==0) { # Fetch deja fait } else { - $objp = $db->fetch_object($i); + $objp = $db->fetch_object($result); } $adh=new Adherent($db); diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 4989d21688f..e00bf11a169 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -109,7 +109,7 @@ if ($result) $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); $var=!$var; print ""; print "\n"; diff --git a/htdocs/admin/adherent.php b/htdocs/admin/adherent.php index 6c5cd35e711..391af735737 100644 --- a/htdocs/admin/adherent.php +++ b/htdocs/admin/adherent.php @@ -245,8 +245,7 @@ function form_constantes($tableau){ print ''; print ''; print ''; - //print ''; - print ""; + print ''; print "\n"; $var=True; @@ -254,7 +253,7 @@ function form_constantes($tableau){ $sql = "SELECT rowid, name, value, type, note FROM ".MAIN_DB_PREFIX."const WHERE name='$const'"; $result = $db->query($sql); if ($result && ($db->num_rows() == 1)) { - $obj = $db->fetch_object(0); + $obj = $db->fetch_object($result); $var=!$var; print ''; print ''; diff --git a/htdocs/admin/boutique-special-all.php b/htdocs/admin/boutique-special-all.php index 49ccc5cd432..32a3eaa9984 100644 --- a/htdocs/admin/boutique-special-all.php +++ b/htdocs/admin/boutique-special-all.php @@ -51,7 +51,7 @@ if ( $db->query($sql) ) $i = 0; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $livre = new Livre($db); if ($livre->fetch($objp->rowid)) diff --git a/htdocs/admin/boutique-update-all.php b/htdocs/admin/boutique-update-all.php index 48f1ce95cf8..d38eab32392 100644 --- a/htdocs/admin/boutique-update-all.php +++ b/htdocs/admin/boutique-update-all.php @@ -50,7 +50,7 @@ if ( $db->query($sql) ) $i = 0; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $livre = new Livre($db); if ($livre->fetch($objp->rowid)) diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index cbc2c0fade8..bb07ac9cb48 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -84,7 +84,7 @@ if ($result) while ($i < $num) { $var = ! $var; - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object($result); //print "pos ".$obj->position; $boxes[$obj->position][$obj->box_id]=1; $i++; @@ -121,7 +121,7 @@ if ($result) while ($i < $num) { $var = ! $var; - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object($result); print ''; print ''; @@ -171,7 +171,7 @@ if ($result) while ($i < $num) { $var = ! $var; - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object($result); print ''; print ''; diff --git a/htdocs/admin/compta.php b/htdocs/admin/compta.php index 1e88a605df7..610283b5132 100644 --- a/htdocs/admin/compta.php +++ b/htdocs/admin/compta.php @@ -113,7 +113,7 @@ if ($result) while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object($result); $var=!$var; print ''; diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index 38b89122d41..2d429dda160 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -115,7 +115,7 @@ if ($result) while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object($result); $var=!$var; print ''; diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 062a2d1f18a..af2ac1ca202 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -148,7 +148,7 @@ if ($_POST["actionadd"]) { $result = $db->query($sql); if ($result) { - $obj = $db->fetch_object(0); + $obj = $db->fetch_object($result); $newid=($obj->newid + 1); } else { @@ -369,7 +369,7 @@ if ($_GET["id"]) // Lignes de valeurs while ($i < $num) { - $obj = $db->fetch_object($i); + $obj = $db->fetch_object(); $var=!$var; print ""; diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php index 7632c17aa15..2523d5a90a9 100644 --- a/htdocs/admin/external_rss.php +++ b/htdocs/admin/external_rss.php @@ -42,8 +42,8 @@ if (!$user->admin) $def = array(); // positionne la variable pour le nombre de rss externes -$db->query("select count(*) nb from ".MAIN_DB_PREFIX."const WHERE name like 'EXTERNAL_RSS_URLRSS_%'"); -$obj = $db->fetch_object(0); +$result=$db->query("select count(*) nb from ".MAIN_DB_PREFIX."const WHERE name like 'EXTERNAL_RSS_URLRSS_%'"); +$obj = $db->fetch_object($result); $nbexternalrss = $obj->nb; if ($_POST["action"] == 'add') diff --git a/htdocs/admin/osc-languages.php b/htdocs/admin/osc-languages.php index e59d6875ebd..33c9bfae467 100644 --- a/htdocs/admin/osc-languages.php +++ b/htdocs/admin/osc-languages.php @@ -74,7 +74,7 @@ if ( $db->query($sql) ) { $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $var=!$var; print ""; print "\n"; diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index e3af7e46aaa..41c5b0dcf52 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -70,7 +70,7 @@ if ($result) $old = ""; while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object($result); $var=!$var; if ($old <> $obj->module) diff --git a/htdocs/admin/sqltables.php b/htdocs/admin/sqltables.php index 8c7a985bcc9..b7a680ce5bd 100644 --- a/htdocs/admin/sqltables.php +++ b/htdocs/admin/sqltables.php @@ -39,11 +39,11 @@ print_barre_liste("Liste des tables", $page, "sqltables.php"); $sql = "SELECT name, loaded FROM ".MAIN_DB_PREFIX."sqltables"; -print "
Date'; + print '
'; print_liste_field_titre("Date
","cotisations.php","c.dateadh","&page=$page&statut=$statut"); - print "
Montant'; + print ''; print_liste_field_titre("Montant
","cotisations.php","c.cotisation","&page=$page&statut=$statut"); - print "
Prenom Nom / Société'; - // print_liste_field_titre("Prenom","cotisations.php","d.prenom","&page=$page&statut=$statut"); + print ''; print_liste_field_titre("Prenom Nom
","cotisations.php","d.nom","&page=$page&statut=$statut"); - // print " / Société"; - print "
'; + print ''; // print_liste_field_titre("Bank","cotisations.php","c.fk_bank","&page=$page&statut=$statut"); - print 'Bank
(Type,Numéro,Libelle)'; - print "
rowid&action=edit\">".strftime("%d %B %Y",$objp->dateadh)."'.price($objp->cotisation).'
rowid&action=edit\">".strftime("%d %B %Y",$objp->dateadh)."'.price($objp->cotisation).'rowid&action=edit\">".stripslashes($objp->prenom)." ".stripslashes($objp->nom)." /
".stripslashes($objp->societe)."
rowid&action=edit\">".stripslashes($objp->prenom)." ".stripslashes($objp->nom)."rowid&action=edit\">".stripslashes($objp->prenom)." ".stripslashes($objp->nom)."rowid&action=edit\">".stripslashes($objp->prenom)." ".stripslashes($objp->nom)."DeposéDeposé"; + print ""; print "
"; print ''; print ''; print '
".dolibarr_print_date($objp->dateadh)."
".$objp->rowid."'.$langs->trans("Description").''.$langs->trans("Value").''.$langs->trans("Type").'NoteAction'.$langs->trans("Action").'
'.$obj->name.'' . $obj->file . '
'.$obj->name.' 
$objp->languages_id
"; +print "
"; print ''; -print ""; +print ''; print ''; -print ''; +print ''; print "\n"; if ( $db->query($sql) ) { @@ -52,7 +52,7 @@ if ( $db->query($sql) ) { $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $var=!$var; print ""; print "\n"; diff --git a/htdocs/admin/system/constall.php b/htdocs/admin/system/constall.php index 01ae18c1e71..a35b41ca13f 100644 --- a/htdocs/admin/system/constall.php +++ b/htdocs/admin/system/constall.php @@ -55,7 +55,7 @@ if ($result) while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object($result); $var=!$var; print "\n"; diff --git a/htdocs/admin/system/database.php b/htdocs/admin/system/database.php index 7f078fcd317..449e9c51d2e 100644 --- a/htdocs/admin/system/database.php +++ b/htdocs/admin/system/database.php @@ -67,7 +67,7 @@ if ($result) $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); $var=!$var; print ""; if ($base==1) diff --git a/htdocs/admin/update/paiement.php b/htdocs/admin/update/paiement.php index 3156cad5daa..87f67d6bcbd 100644 --- a/htdocs/admin/update/paiement.php +++ b/htdocs/admin/update/paiement.php @@ -44,7 +44,7 @@ if ($result) while ($i < $num) { - $obj = $db->fetch_object($result , $i); + $obj = $db->fetch_object($result); $row[$i][0] = $obj->rowid ; $row[$i][1] = $obj->fk_facture; $row[$i][2] = $obj->amount; diff --git a/htdocs/boutique/auteur/auteur.class.php b/htdocs/boutique/auteur/auteur.class.php index 9bc3879b7ba..2c9f8ed7ce4 100644 --- a/htdocs/boutique/auteur/auteur.class.php +++ b/htdocs/boutique/auteur/auteur.class.php @@ -83,7 +83,7 @@ class Auteur { $i = 0; while ($i < $nump) { - $obj = $this->db->fetch_object($i); + $obj = $this->db->fetch_object(); $ga[$obj->rowid] = $obj->nom; $i++; diff --git a/htdocs/boutique/auteur/index.php b/htdocs/boutique/auteur/index.php index c559fc57ad6..d1fb5624be5 100644 --- a/htdocs/boutique/auteur/index.php +++ b/htdocs/boutique/auteur/index.php @@ -46,26 +46,26 @@ $sql .= $db->plimit( $limit ,$offset); if ( $db->query($sql) ) { $num = $db->num_rows(); $i = 0; - print "

Nom'.$langs->trans("Name").'ChargéeAction'.$langs->trans("Action").'
$objp->name
$obj->name
"; - print "
"; + print ""; + print ""; - print "\n"; + print "\n"; $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $var=!$var; - print ""; - print "\n"; - print "\n"; + print ""; + print "\n"; + print "\n"; $i++; } - print "
"; print_liste_field_titre("Nom","index.php", "e.nom"); print "
rowid\">$objp->nom
rowid\">$objp->nom
"; + print "
"; $db->free(); } else { - print $db->error(); + dolibarr_print_error($db); } $db->close(); diff --git a/htdocs/boutique/client/fiche.php b/htdocs/boutique/client/fiche.php index 5c6100b610b..9c4a3f21442 100644 --- a/htdocs/boutique/client/fiche.php +++ b/htdocs/boutique/client/fiche.php @@ -73,34 +73,34 @@ if ($action == 'update' && !$cancel) { { $num = $db->num_rows(); $i = 0; - print '

'; - print ""; + print '
Commandes
'; + print ""; print "\n"; $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $var=!$var; - print ""; + print ""; print '\n"; - print "\n"; + print "\n"; $i++; } - print "
Commandes
Fiche '; print "orders_id\">".strftime("%d %B %Y",$objp->date_purchased)."
"; + print ""; $db->free(); } else { - print $db->error(); + dolibarr_print_error($db); } } else { - print "Fetch failed"; + dolibarr_print_error($db); } @@ -117,14 +117,7 @@ if ($action == 'update' && !$cancel) { /* */ /* ************************************************************************** */ -print '
'; -print ''; -print ''; -print ''; -print ''; -print ''; -print '
-----

'; - +// Pas d'action $db->close(); diff --git a/htdocs/boutique/client/index.php b/htdocs/boutique/client/index.php index a8926bb4a90..1d514447a53 100644 --- a/htdocs/boutique/client/index.php +++ b/htdocs/boutique/client/index.php @@ -22,6 +22,8 @@ require("./pre.inc.php"); +$langs->load("companies"); + llxHeader(); if ($sortfield == "") { @@ -47,32 +49,32 @@ if ( $db->query($sql) ) { $num = $db->num_rows(); $i = 0; - print "

"; - print "
"; - print_liste_field_titre("Prénom","index.php", "c.customers_firstname"); + print ""; + print "'; - print "\n"; + print_liste_field_titre($langs->trans("Lastname"),"index.php", "c.customers_lastname"); + print ''; + print "\n"; $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $var=!$var; - print ""; - print '\n"; - print '\n"; - print "\n"; - print "\n"; - print "\n"; + print ""; + print '\n"; + print '\n"; + print "\n"; + print "\n"; + print "\n"; $i++; } - print "
"; + print_liste_field_titre($langs->trans("Firstname"),"index.php", "c.customers_firstname"); print ""; - print_liste_field_titre("Nom","index.php", "c.customers_lastname"); - print 'EmailNewsletter
'.$langs->trans("EMail").'Newsletter
'.$objp->customers_firstname."'.$objp->customers_lastname."$objp->customers_email_address$objp->customers_newsletter
'.$objp->customers_firstname."'.$objp->customers_lastname."$objp->customers_email_address$objp->customers_newsletter
"; + print "
"; $db->free(); } else { - print $db->error(); + dolibarr_print_error($db); } $db->close(); diff --git a/htdocs/boutique/commande/ca.php b/htdocs/boutique/commande/ca.php index 2c1f79c839a..d89ff792ac7 100644 --- a/htdocs/boutique/commande/ca.php +++ b/htdocs/boutique/commande/ca.php @@ -55,7 +55,7 @@ if ( $db->query($sql) ) $var=True; if ($num > 0) { - $objp = $db->fetch_object(0); + $objp = $db->fetch_object(); $var=!$var; print ""; print 'Somme des commandes'; @@ -69,7 +69,7 @@ if ( $db->query($sql) ) } else { - print $db->error(); + dolibarr_print_error($db); } $sql = "SELECT sum(t.value) as value"; @@ -83,7 +83,7 @@ if ( $db->query($sql) ) $var=True; if ($num > 0) { - $objp = $db->fetch_object(0); + $objp = $db->fetch_object(); $var=!$var; print ""; print 'Somme des frais de port'; @@ -95,7 +95,7 @@ if ( $db->query($sql) ) } else { - print $db->error(); + dolibarr_print_error($db); } diff --git a/htdocs/boutique/commande/fiche.php b/htdocs/boutique/commande/fiche.php index 50ea1e20847..d3eb16ec420 100644 --- a/htdocs/boutique/commande/fiche.php +++ b/htdocs/boutique/commande/fiche.php @@ -24,6 +24,8 @@ require("./pre.inc.php"); +$langs->load("products"); + llxHeader(); /* @@ -70,30 +72,30 @@ if ($id) { $num = $db->num_rows(); $i = 0; - print ''; - print ''; + print '
Produits
'; + print ''; print ''; print "\n"; $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $var=!$var; - print ""; + print ""; print '"; - print '\n"; - print "\n"; - print "\n"; + print '\n"; + print "\n"; + print "\n"; - print "\n"; + print "\n"; $i++; } - print "
'.$langs->trans("Products").''.$langs->trans("Number").''.$langs->trans("Price").'Prix final
'; print 'Fiche livre'; print ''.$objp->products_name.''; print "$objp->products_quantityrowid\">".price($objp->products_price)."rowid\">".price($objp->final_price)."$objp->products_quantityrowid\">".price($objp->products_price)."rowid\">".price($objp->final_price)."
"; + print ""; $db->free(); } else diff --git a/htdocs/boutique/commande/index.php b/htdocs/boutique/commande/index.php index 45c5a8dfd80..9d9abca8946 100644 --- a/htdocs/boutique/commande/index.php +++ b/htdocs/boutique/commande/index.php @@ -59,7 +59,7 @@ if ( $db->query($sql) ) $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $var=!$var; print ""; @@ -76,7 +76,7 @@ if ( $db->query($sql) ) } else { - print $db->error(); + dolibarr_print_error($db); } $db->close(); diff --git a/htdocs/boutique/editeur/editeur.class.php b/htdocs/boutique/editeur/editeur.class.php index d70ae62708b..213fcfc372b 100644 --- a/htdocs/boutique/editeur/editeur.class.php +++ b/htdocs/boutique/editeur/editeur.class.php @@ -70,7 +70,7 @@ class Editeur { $i = 0; while ($i < $nump) { - $obj = $this->db->fetch_object($i); + $obj = $this->db->fetch_object(); $ga[$obj->rowid] = $obj->nom; $i++; @@ -152,7 +152,7 @@ class Editeur { $i = 0; while ($i < $nump) { - $obj = $this->db->fetch_object($i); + $obj = $this->db->fetch_object(); $ga[$obj->rowid] = $obj->title; $i++; diff --git a/htdocs/boutique/editeur/index.php b/htdocs/boutique/editeur/index.php index 4fb2f384c50..e7515030050 100644 --- a/htdocs/boutique/editeur/index.php +++ b/htdocs/boutique/editeur/index.php @@ -46,18 +46,18 @@ $sql .= $db->plimit( $limit ,$offset); if ( $db->query($sql) ) { $num = $db->num_rows(); $i = 0; - print "

"; - print ""; diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 5645b92a8b8..e68343b804f 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -159,7 +159,7 @@ if ( $db->query($sql) ) print_barre_liste("Liste des actions commerciales réalisées ou à faire", $page, "index.php",'',$sortfield,$sortorder,'',$num); } $i = 0; - print "
"; + print ""; + print ""; - print "\n"; + print "\n"; $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $var=!$var; - print ""; - print "\n"; - print "\n"; + print ""; + print "\n"; + print "\n"; $i++; } print "
"; print_liste_field_titre("Nom","index.php", "e.nom"); print "
rowid\">$objp->nom
rowid\">$objp->nom
"; diff --git a/htdocs/boutique/livre/index.php b/htdocs/boutique/livre/index.php index 90fc1adefb8..9bde3d09fae 100644 --- a/htdocs/boutique/livre/index.php +++ b/htdocs/boutique/livre/index.php @@ -61,19 +61,19 @@ if ( $db->query($sql) ) { $num = $db->num_rows(); $i = 0; - print "

"; - print "
"; + print ""; + print ""; print ''; - print "\n"; + print "\n"; $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $var=!$var; - print ""; + print ""; print ''; print ''; - print ''; + print ''; } else { @@ -94,15 +94,15 @@ if ( $db->query($sql) ) print ''; } - print "\n"; + print "\n"; $i++; } - print "
"; print_liste_field_titre($langs->trans("Ref"),"index.php", "l.ref"); print ""; print_liste_field_titre("Titre","index.php", "l.title"); print " 
Fiche livre '; @@ -85,7 +85,7 @@ if ( $db->query($sql) ) { print 'Fiche en ligneFiche en ligne 
"; + print "
"; $db->free(); } else { - print $db->error(); + dolibarr_print_error($db); } $db->close(); diff --git a/htdocs/boutique/livre/livre.class.php b/htdocs/boutique/livre/livre.class.php index 7d95ce31d5e..1db954c693f 100644 --- a/htdocs/boutique/livre/livre.class.php +++ b/htdocs/boutique/livre/livre.class.php @@ -145,7 +145,7 @@ class Livre { $i = 0; while ($i < $nump) { - $obj = $this->db->fetch_object($i); + $obj = $this->db->fetch_object(); $ga[$obj->rowid] = $obj->nom; $i++; @@ -247,7 +247,7 @@ class Livre { $i = 0; while ($i < $nump) { - $obj = $this->db->fetch_object($i); + $obj = $this->db->fetch_object(); $pcat[$i] = $obj->categories_id; $i++; } diff --git a/htdocs/boutique/livre/vignettes.php b/htdocs/boutique/livre/vignettes.php index ec2081a56a5..60ef7d03fca 100644 --- a/htdocs/boutique/livre/vignettes.php +++ b/htdocs/boutique/livre/vignettes.php @@ -60,33 +60,33 @@ if ( $db->query($sql) ) { $num = $db->num_rows(); $i = 0; - print "

"; - print "
"; + print ""; + print ""; print ''; - print "\n"; + print "\n"; $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); if(! file_exists(OSC_CATALOG_DIRECTORY."images/".$objp->ref.".jpg")) { $var=!$var; - print ""; + print ""; print '\n"; - print "\n"; + print "\n"; if ($objp->status == 1) { print ''; print ''; - print ''; + print ''; } else @@ -96,17 +96,17 @@ if ( $db->query($sql) ) print ''; } - print "\n"; + print "\n"; } $i++; } - print "
"; print_liste_field_titre($langs->trans("Ref"),"vignettes.php", "l.ref"); print ""; print_liste_field_titre("Titre","vignettes.php", "l.title"); print " 
Fiche livre '; print "rowid\">$objp->refrowid\">$objp->titlerowid\">$objp->titleFiche en ligneFiche en ligne 
"; + print "
"; $db->free(); } else { - print $db->error(); + dolibarr_print_error($db); } $db->close(); diff --git a/htdocs/boutique/newsletter/fiche.php b/htdocs/boutique/newsletter/fiche.php index bb9715e7117..c018fc1348d 100644 --- a/htdocs/boutique/newsletter/fiche.php +++ b/htdocs/boutique/newsletter/fiche.php @@ -21,9 +21,15 @@ * */ +/*! \file htdocs/boutique/newsletter/fiche.php + \ingroup boutique + \brief Fiche newsletter + \version $Revision$ +*/ + require("./pre.inc.php"); -if ($action == 'add') { +if ($_POST["action"] == 'add') { $newsletter = new Newsletter($db); $newsletter->email_subject = $_POST["email_subject"]; @@ -35,13 +41,13 @@ if ($action == 'add') { $id = $newsletter->create($user); } -if ($action == 'addga') { +if ($_POST["action"] == 'addga') { $newsletter = new Newsletter($db); $newsletter->linkga($id, $ga); } -if ($action == 'update' && !$cancel) +if ($_POST["action"] == 'update' && !$cancel) { $newsletter = new Newsletter($db); diff --git a/htdocs/boutique/newsletter/index.php b/htdocs/boutique/newsletter/index.php index 79594ca1fce..7a89763c0e0 100644 --- a/htdocs/boutique/newsletter/index.php +++ b/htdocs/boutique/newsletter/index.php @@ -47,7 +47,7 @@ if ( $db->query($sql) ) { $num = $db->num_rows(); $i = 0; - print ""; + print "
"; print ""; @@ -57,7 +57,7 @@ if ( $db->query($sql) ) $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $var=!$var; print ""; diff --git a/htdocs/boutique/newsletter/newsletter.class.php b/htdocs/boutique/newsletter/newsletter.class.php index 3ee5ee32647..806d18c449b 100644 --- a/htdocs/boutique/newsletter/newsletter.class.php +++ b/htdocs/boutique/newsletter/newsletter.class.php @@ -151,7 +151,7 @@ class Newsletter { $i = 0; while ($i < $nump) { - $obj = $this->db->fetch_object($i); + $obj = $this->db->fetch_object(); $ga[$obj->rowid] = $obj->nom; $i++; diff --git a/htdocs/boutique/notification/index.php b/htdocs/boutique/notification/index.php index 6814e4a3b9d..6692f282c88 100644 --- a/htdocs/boutique/notification/index.php +++ b/htdocs/boutique/notification/index.php @@ -51,29 +51,29 @@ if ( $db->query($sql) ) { $num = $db->num_rows(); $i = 0; - print "

"; print_liste_field_titre("Sujet","index.php", "email_subject"); print "
"; - print "
"; + print ""; + print ""; print ""; - print "\n"; + print "\n"; $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $var=!$var; - print ""; - print "\n"; + print ""; + print "\n"; print '"; - print "\n"; + print "\n"; $i++; } - print "
"; print_liste_field_titre("Client","index.php", "c.customers_lastname"); print "Produit
rowid\">$objp->customers_firstname $objp->customers_lastname
rowid\">$objp->customers_firstname $objp->customers_lastname'.$objp->products_name."
"; + print "
"; $db->free(); } else { - print $db->error(); + dolibarr_print_error($db); } $db->close(); diff --git a/htdocs/boutique/notification/notification.class.php b/htdocs/boutique/notification/notification.class.php index ffa990a604b..8df613ce97c 100644 --- a/htdocs/boutique/notification/notification.class.php +++ b/htdocs/boutique/notification/notification.class.php @@ -70,7 +70,7 @@ class Editeur { $i = 0; while ($i < $nump) { - $obj = $this->db->fetch_object($i); + $obj = $this->db->fetch_object(); $ga[$obj->rowid] = $obj->nom; $i++; diff --git a/htdocs/boutique/notification/produits.php b/htdocs/boutique/notification/produits.php index 23e73d52c22..85e7be9e37e 100644 --- a/htdocs/boutique/notification/produits.php +++ b/htdocs/boutique/notification/produits.php @@ -59,7 +59,7 @@ if ( $db->query($sql) ) $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $var=!$var; print "

"; + print "
"; print ''; print ''; print ''; @@ -168,10 +168,10 @@ if ( $db->query($sql) ) print ''; print ""; print "\n"; - $var=True; + $var=true; while ($i < min($num,$limit)) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); $var=!$var; diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php index 7e68bb19346..59f69ee650c 100644 --- a/htdocs/comm/action/rapport/index.php +++ b/htdocs/comm/action/rapport/index.php @@ -156,16 +156,16 @@ if ( $db->query($sql) ) print ''; print ''; print "\n"; - $var=True; + $var=true; while ($i < min($num,$limit)) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); $var=!$var; - print ""; + print ""; - print "\n"; + print "\n"; print ''; print ''; diff --git a/htdocs/comm/action/rapport/rapport.pdf.php b/htdocs/comm/action/rapport/rapport.pdf.php index 109f8c4c7d9..f183d755224 100644 --- a/htdocs/comm/action/rapport/rapport.pdf.php +++ b/htdocs/comm/action/rapport/rapport.pdf.php @@ -153,7 +153,7 @@ class CommActionRapport { $y2 = 0; while ($i < $num) { - $obj = $this->db->fetch_object($i); + $obj = $this->db->fetch_object(); $y = max($pdf->GetY(), $y1, $y2) + 1; $pdf->SetFont('Arial','',10); diff --git a/htdocs/comm/addpropal.php b/htdocs/comm/addpropal.php index 871e46bf1f8..4dde08f0506 100644 --- a/htdocs/comm/addpropal.php +++ b/htdocs/comm/addpropal.php @@ -23,6 +23,9 @@ require("./pre.inc.php"); require("./propal_model_pdf.class.php"); +$langs->load("projects"); + + $user->getrights('propale'); $user->getrights('fichinter'); $user->getrights('commande'); @@ -112,7 +115,7 @@ if ($_GET["action"] == 'create') while ($i < $numdest) { - $contact = $db->fetch_object( $i); + $contact = $db->fetch_object(); print '"; $i++; } @@ -169,7 +172,7 @@ if ($_GET["action"] == 'create') } else { - print $db->error()."$sql"; + dolibarr_print_error($db); } @@ -191,13 +194,13 @@ if ($_GET["action"] == 'create') $sql .= " ORDER BY ref DESC"; if ( $db->query($sql) ) { - $opt = ""; + $opt = ""; if ($result) { $num = $db->num_rows(); $i = 0; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $opt .= "\n"; $i++; } @@ -211,7 +214,7 @@ if ($_GET["action"] == 'create') print_titre("Services/Produits"); - print '
'.$langs->trans("Date").'AvancementContact".$langs->trans("Comments")."".$langs->trans("Author")."
DateTaille
$obj->df$obj->df'.$obj->cc.''.img_file_new().'
'; + print '
'; print ''; for ($i = 1 ; $i <= PROPALE_NEW_FORM_NB_PRODUCT ; $i++) { diff --git a/htdocs/comm/bookmark.php b/htdocs/comm/bookmark.php index 6ad1fb9b114..789c40fcc6a 100644 --- a/htdocs/comm/bookmark.php +++ b/htdocs/comm/bookmark.php @@ -79,7 +79,7 @@ if ( $db->query($sql) ) { $sortorder="DESC"; } - print "

ProduitQuan.Remise
"; + print "

"; print ""; print ""; print ""; @@ -94,7 +94,7 @@ if ( $db->query($sql) ) $var=True; while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); $var=!$var; $bc1="bgcolor=\"#90c090\""; @@ -107,24 +107,24 @@ if ( $db->query($sql) ) { $bc=$bc2; } - print ""; - print ""; - print ""; - print "\n"; + print ""; + print ""; + print ""; + print "\n"; - print "\n"; - print "\n"; + print "\n"; + print "\n"; print ""; - print "\n"; - print "\n"; + print "\n"; + print "\n"; $i++; } - print "
 Id
" . ($i + 1 + ($limit * $page)) . "$obj->idpidp\">$obj->nom
" . ($i + 1 + ($limit * $page)) . "$obj->idpidp\">$obj->nom$obj->stcomm$obj->author$obj->stcomm$obj->author".strftime("%d %b %Y %H:%M", $obj->dateb) ."[bid\">Delete]
[bid\">Delete]
"; + print ""; $db->free(); } else { - print $db->error(); + dolibarr_print_error()$db; } $db->close(); diff --git a/htdocs/comm/clients.php b/htdocs/comm/clients.php index f660885de82..0027a6311bf 100644 --- a/htdocs/comm/clients.php +++ b/htdocs/comm/clients.php @@ -85,21 +85,12 @@ if ($sortfield == "") $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit +1, $offset); + $result = $db->query($sql); if ($result) { $num = $db->num_rows(); - /* - if ($num == 1) - { - $obj = $db->fetch_object(0); - Header("Location: fiche.php?socid=$obj->idp"); - } - else - { - llxHeader(); - } - */ + llxHeader(); @@ -149,7 +140,7 @@ if ($result) while ($i < min($num,$conf->liste_limit)) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object($result); $var=!$var; diff --git a/htdocs/comm/contact.php b/htdocs/comm/contact.php index 7b7a37b7b6f..7c93656ef4b 100644 --- a/htdocs/comm/contact.php +++ b/htdocs/comm/contact.php @@ -23,6 +23,8 @@ */ require("./pre.inc.php"); +$langs->load("companies"); + $user->getrights('propale'); $user->getrights('fichinter'); $user->getrights('commande'); @@ -130,7 +132,7 @@ if ($result) print_barre_liste("Liste des contacts $label",$page, "contact.php", "&type=$type",$sortfield,$sortorder,"",$num); - print "

"; + print "
"; print "| *\n| "; for ($i = 65 ; $i < 91; $i++) { @@ -159,45 +161,43 @@ if ($result) print ''; print '"; - print ''; + print_liste_field_titre($langs->trans("Company"),"contact.php","lower(s.nom)", $begin,"&type=$type"); + print ''; + print ''; print "\n"; $var=True; $i = 0; while ($i < min($num,$limit)) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); $var=!$var; - print ""; - print '"; + print ''; - print ""; + print ""; - print '\n"; print ''; print ''; - print "\n"; + print "\n"; $i++; } - print "
'; - print_liste_field_titre("Nom","contact.php","lower(p.name)", $begin,"&type=$type"); + print_liste_field_titre($langs->trans("Lastname"),"contact.php","lower(p.name)", $begin,"&type=$type"); print ""; - print_liste_field_titre("Prénom","contact.php","lower(p.firstname)", $begin,"&type=$type"); + print_liste_field_titre($langs->trans("Firstname"),"contact.php","lower(p.firstname)", $begin,"&type=$type"); print ""; - print_liste_field_titre("Société","contact.php","lower(s.nom)", $begin,"&type=$type"); - print "emailTéléphone'.$langs->trans("Lastname").''.$langs->trans("Phone").'
'.img_file(); + print "
'.img_file(); print ' '.$obj->name.'$obj->firstname$obj->firstnamefiltrer '; + print 'filtrer '; print "idp\">$obj->nom'.$obj->email.' '.dolibarr_print_phone($obj->phone).' 

"; + print "

"; $db->free(); } else { - print_barre_liste("Liste des contacts $label",$page, "contact.php"); - - print $db->error(); + dolibarr_print_error($db); } $db->close(); diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index e7bd4fb7bda..57315874b66 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -98,7 +98,7 @@ if ($mode == 'search') { if ( $db->query($sql) ) { if ( $db->num_rows() == 1) { - $obj = $db->fetch_object(0); + $obj = $db->fetch_object(); $socid = $obj->idp; } $db->free(); @@ -269,7 +269,7 @@ if ($_socid > 0) $i = 0; $now = time(); $lim = 3600 * 24 * 15 ; while ($i < $num && $i < 2) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); print ""; print "propalid\">$objp->ref\n"; if ( ($now - $objp->dp) > $lim && $objp->statutid == 1 ) @@ -307,7 +307,7 @@ if ($_socid > 0) $i = 0; $now = time(); $lim = 3600 * 24 * 15 ; while ($i < $num && $i < 2) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $var=!$var; print ""; print ''.$objp->ref."\n"; @@ -339,7 +339,7 @@ if ($_socid > 0) print "id\">liste des projets ($num)"; } while ($i < $num && $i < 5) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); $tag = !$tag; print ""; print ''.$obj->title.''; @@ -426,7 +426,7 @@ if ($_socid > 0) $i = 0 ; $num = $db->num_rows(); $tag = True; while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); $var = !$var; print ""; @@ -486,7 +486,7 @@ if ($_socid > 0) while ($i < $num) { $var = !$var; - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); print ""; if ($oldyear == strftime("%Y",$obj->da) ) @@ -578,7 +578,7 @@ if ($_socid > 0) { $var = !$var; - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); print ""; if ($oldyear == strftime("%Y",$obj->da) ) diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index b6db43f3bfa..e6ced2b262d 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -109,7 +109,7 @@ if ($conf->propal->enabled) { while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); $var=!$var; print "rowid."\">".$obj->ref.""; $i++; @@ -144,7 +144,7 @@ if ($conf->commande->enabled) $var = False; while ($i < $num) { - $obj = $db->fetch_object($i); + $obj = $db->fetch_object(); print "rowid\">$obj->ref"; print ''.$obj->nom.''; $i++; @@ -184,7 +184,7 @@ if ( $db->query($sql) ) while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); $var = !$var; print ""; print ''.$obj->nom.''; @@ -225,7 +225,7 @@ if ( $db->query($sql) ) while ($i < $num ) { - $obj = $db->fetch_object($i); + $obj = $db->fetch_object(); $var=!$var; print ""; @@ -272,7 +272,7 @@ if ( $db->query($sql) ) while ($i < $num ) { - $obj = $db->fetch_object($i); + $obj = $db->fetch_object(); $var=!$var; print ""; @@ -332,7 +332,7 @@ if ($conf->contrat->enabled) $var=false; while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); print "rowid."\">".img_file()." "; print "rowid."\">".$obj->ref.""; print "idp\">$obj->nom\n"; @@ -375,7 +375,7 @@ if ($conf->propal->enabled) { $var=false; while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); print "propalid."\">".img_file()." "; print "propalid."\">".$obj->ref.""; print "idp\">$obj->nom\n"; @@ -417,7 +417,7 @@ if ($conf->propal->enabled) { $var=False; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); print ""; print ''; print ''.img_file().''; diff --git a/htdocs/comm/people.php b/htdocs/comm/people.php index 91f67b89209..862332c27be 100644 --- a/htdocs/comm/people.php +++ b/htdocs/comm/people.php @@ -86,7 +86,7 @@ if ($_GET["socid"] > 0) if ($result) { - $objsoc = $db->fetch_object( 0); + $objsoc = $db->fetch_object($result); /* * @@ -130,7 +130,7 @@ if ($_GET["socid"] > 0) while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); print ""; print "$obj->firstname $obj->name"; print "$obj->poste "; @@ -171,7 +171,7 @@ if ($_GET["socid"] > 0) if ( $num >0 ) { - $obj = $db->fetch_object( 0); + $obj = $db->fetch_object(); } print ""; @@ -227,7 +227,7 @@ if ($_GET["socid"] > 0) $i = 0 ; $num = $db->num_rows(); $tag = True; while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); $var=!$var; print ""; diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index f39861c22f2..52db2e88d9d 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -275,7 +275,7 @@ if ($_GET["propalid"]) if ( $result ) { - $obj = $db->fetch_object( 0 ); + $obj = $db->fetch_object($result); if ($db->num_rows()) { @@ -416,7 +416,7 @@ if ($_GET["propalid"]) while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); $var=!$var; print ""; print "[$objp->ref]\n"; @@ -446,7 +446,7 @@ if ($_GET["propalid"]) $i = 0; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $var=!$var; print " \n"; print ''.$objp->description.''; @@ -473,15 +473,14 @@ if ($_GET["propalid"]) { $sql = "SELECT p.rowid,p.label,p.ref,p.price FROM ".MAIN_DB_PREFIX."product as p WHERE p.envente=1 ORDER BY p.nbvente DESC LIMIT 20"; // RyXéo on a ORDER BY p.ref et pas de limit - if ( $db->query($sql) ) - { - $opt = ""; + $result = $db->query($sql); if ($result) { + $opt = ""; $num = $db->num_rows(); $i = 0; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); $opt .= "\n"; $i++; } @@ -743,12 +742,12 @@ if ($_GET["propalid"]) while ($i < $num) { - $objp = $db->fetch_object( $i); - print "".strftime("%d %B %Y %H:%M:%S",$objp->da)."\n"; + $objp = $db->fetch_object(); + print "".strftime("%d %B %Y %H:%M:%S",$objp->da)."\n"; $authoract = new User($db); $authoract->id = $objp->fk_user_author; $authoract->fetch(''); - print "$authoract->code\n"; + print "$authoract->code\n"; print "$objp->note"; $i++; } @@ -899,11 +898,11 @@ if ($_GET["propalid"]) print_liste_field_titre_new ($langs->trans("Status"),"propal.php","p.fk_statut","","&socidp=$socidp&viewstatut=$viewstatut",'width="10%" align="center"',$sortfield); print "\n"; - $var=True; + $var=true; while ($i < min($num,$limit)) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $now = time(); $var=!$var; print ""; @@ -930,7 +929,7 @@ if ($_GET["propalid"]) print " "; } - print ""; + print ""; $y = strftime("%Y",$objp->dp); $m = strftime("%m",$objp->dp); @@ -940,9 +939,9 @@ if ($_GET["propalid"]) print " "; print strftime("%Y",$objp->dp)."\n"; - print "".price($objp->price)."\n"; - print "$objp->statut\n"; - print "\n"; + print "".price($objp->price)."\n"; + print "$objp->statut\n"; + print "\n"; $total = $total + $objp->price; $subtotal = $subtotal + $objp->price; diff --git a/htdocs/comm/propal_model_pdf.class.php b/htdocs/comm/propal_model_pdf.class.php index aca69c70815..cb057bf064b 100644 --- a/htdocs/comm/propal_model_pdf.class.php +++ b/htdocs/comm/propal_model_pdf.class.php @@ -49,7 +49,7 @@ class Propal_Model_Pdf { $i = 0; while ($i < $nump) { - $obj = $this->db->fetch_object($i); + $obj = $this->db->fetch_object(); $projets[$obj->nom] = $obj->nom; $i++; diff --git a/htdocs/comm/prospect/fiche.php b/htdocs/comm/prospect/fiche.php index b04ed7725e6..e6364ccacf6 100644 --- a/htdocs/comm/prospect/fiche.php +++ b/htdocs/comm/prospect/fiche.php @@ -183,7 +183,7 @@ if ($socid > 0) $i = 0; $now = time(); $lim = 3600 * 24 * 15 ; while ($i < $num && $i < 2) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); print ""; print "propalid\">"; print img_file(); @@ -245,7 +245,7 @@ if ($socid > 0) $i = 0 ; $num = $db->num_rows(); $tag = True; while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object($result); $var = !$var; print ""; @@ -306,7 +306,7 @@ if ($socid > 0) while ($i < $num) { $var = !$var; - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); print ""; @@ -398,12 +398,12 @@ if ($socid > 0) if ($num) { - print ''; + print '
'; print ''; print ''; print '
Actions effectuées
'; - print ''; + print '
'; $oldyear=''; $oldmonth=''; @@ -411,7 +411,7 @@ if ($socid > 0) { $var = !$var; - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); print ""; if ($oldyear == strftime("%Y",$obj->da) ) @@ -430,12 +430,12 @@ if ($socid > 0) } else { - print "\n"; + print "\n"; $oldmonth = strftime("%Y%b",$obj->da); } - print "\n"; - print "\n"; + print "\n"; + print "\n"; print ''; diff --git a/htdocs/comm/prospect/index.php b/htdocs/comm/prospect/index.php index fff0a9dc1b4..8012d2eee2e 100644 --- a/htdocs/comm/prospect/index.php +++ b/htdocs/comm/prospect/index.php @@ -84,7 +84,7 @@ if ( $db->query($sql) ) print ''; while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); $var=!$var; print ""; $i++; @@ -113,7 +113,7 @@ if ($conf->propal->enabled) while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); $var=!$var; print ""; $i++; @@ -147,7 +147,7 @@ if ( $db->query($sql) ) $i = 0; while ($i < $num ) { - $obj = $db->fetch_object($i); + $obj = $db->fetch_object(); $var=!$var; print ""; @@ -185,7 +185,7 @@ if ( $db->query($sql) ) while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); $var=!$var; print "\n"; print ''; @@ -370,7 +370,7 @@ if ($_GET["action"] == 'create') $i = 0; while ($i < $num) { - $objp = $db->fetch_object($i); + $objp = $db->fetch_object(); $var=!$var; print "\n"; print ''; @@ -558,7 +558,7 @@ else $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); print ""; if ($objp->fk_product > 0) { @@ -636,7 +636,7 @@ else $num = $db->num_rows(); $i = 0; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $opt .= "\n"; $i++; } @@ -744,7 +744,7 @@ else $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $var=!$var; print ""; print ''; @@ -774,13 +774,13 @@ else { print_titre("Factures"); $i = 0; $total = 0; - print '
" .strftime("%b",$obj->da)."" .strftime("%b",$obj->da)."" .strftime("%d",$obj->da)."" .strftime("%H:%M",$obj->da)."" .strftime("%d",$obj->da)."" .strftime("%H:%M",$obj->da)." Prospects par statut
id."\">".$obj->libelle."".$obj->cc."
rowid."\">".$obj->ref."
".strftime("%d %b %Y",$obj->da)."
rowid."\">"; print img_file(); @@ -221,7 +221,7 @@ if ( $db->query($sql) ) while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); $var=!$var; print "
rowid."\">"; print img_file(); diff --git a/htdocs/comm/prospect/prospects.php b/htdocs/comm/prospect/prospects.php index 29d9c796c38..da08e00a54b 100644 --- a/htdocs/comm/prospect/prospects.php +++ b/htdocs/comm/prospect/prospects.php @@ -112,7 +112,7 @@ if ($result) if ($num == 1 && $socname) { - $obj = $db->fetch_object(0); + $obj = $db->fetch_object($result); Header("Location: fiche.php?socid=$obj->idp"); } else @@ -144,9 +144,9 @@ if ($result) $i = 0; - print ''; - print ''; - print "
"; + print ''; + print ''; + print "'; - print "\n"; - $var=True; + print "\n"; + $var=true; while ($i < min($num,$conf->liste_limit)) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); $var=!$var; @@ -171,13 +171,13 @@ if ($result) print '\n"; - print "\n"; - print "\n"; + print "\n"; + print "\n"; print "\n"; if ($user->societe_id == 0) { - print "\n"; + print "\n"; } else @@ -200,15 +200,15 @@ if ($result) } } - print "\n"; + print "\n"; $i++; } - print "
"; print_liste_field_titre("Société","prospects.php","s.nom"); print ""; print_liste_field_titre("Ville","prospects.php","s.ville"); @@ -158,12 +158,12 @@ if ($result) print ""; print_liste_field_titre("Insertion","prospects.php","s.datec"); print ' 
'; print img_file(); print " idp\">$obj->nom".$obj->ville." $obj->departement".$obj->ville." $obj->departement".$obj->stcomm."idp&action=create\">".strftime("%d/%b/%y",$obj->datec)."idp&action=create\">".strftime("%d/%b/%y",$obj->datec)."
"; + print "
"; $db->free(); } else { - print $db->error() . ' ' . $sql; + dolibarr_print_error($db); } $db->close(); diff --git a/htdocs/commande/commande.class.php b/htdocs/commande/commande.class.php index 46c48879128..4882e0c92ca 100644 --- a/htdocs/commande/commande.class.php +++ b/htdocs/commande/commande.class.php @@ -449,7 +449,7 @@ class Commande { if ($this->db->num_rows()) { - $obj = $this->db->fetch_object(0); + $obj = $this->db->fetch_object(); $this->propale_id = $obj->fk_propale; } @@ -495,7 +495,7 @@ class Commande { $ligne = new CommandeLigne(); - $objp = $this->db->fetch_object( $i); + $objp = $this->db->fetch_object($result); $ligne->id = $objp->rowid; @@ -649,7 +649,7 @@ class Commande 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; diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index ef030d85ee4..84d68d480b9 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -225,7 +225,7 @@ if ($_GET["action"] == 'create') $num = $db->num_rows(); if ($num) { - $obj = $db->fetch_object(0); + $obj = $db->fetch_object(); $soc = new Societe($db); $soc->fetch($obj->idp); @@ -291,13 +291,13 @@ if ($_GET["action"] == 'create') $sql .= " ORDER BY p.nbvente DESC LIMIT 20"; if ( $db->query($sql) ) { - $opt = ""; + $opt = ""; if ($result) { $num = $db->num_rows(); $i = 0; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $opt .= "\n"; $i++; } @@ -351,7 +351,7 @@ if ($_GET["action"] == 'create') $var=True; while ($i < $num) { - $objp = $db->fetch_object($i); + $objp = $db->fetch_object(); $var=!$var; print "
[$objp->ref]'.$objp->product.'
 '.$objp->product.'
'.stripslashes($objp->ref).'
'; + print '
'; print "\n"; $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $var=!$var; print ""; print ''; diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index a877efb036f..f12a1b04a4d 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -67,7 +67,7 @@ if ( $db->query($sql) ) while ($i < $num) { $var=!$var; - $obj = $db->fetch_object($i); + $obj = $db->fetch_object(); print ""; print ''; @@ -101,7 +101,7 @@ if ( $db->query($sql) ) while ($i < $num) { $var=!$var; - $obj = $db->fetch_object($i); + $obj = $db->fetch_object(); print ""; print ''; @@ -139,7 +139,7 @@ if ( $db->query($sql) ) while ($i < $num) { $var=!$var; - $obj = $db->fetch_object($i); + $obj = $db->fetch_object(); print ""; print ''; @@ -172,7 +172,7 @@ if ( $db->query($sql) ) while ($i < $num) { $var=!$var; - $obj = $db->fetch_object($i); + $obj = $db->fetch_object(); print ""; print ''; diff --git a/htdocs/commande/liste.php b/htdocs/commande/liste.php index 9e6809c90a6..b1281df8c9a 100644 --- a/htdocs/commande/liste.php +++ b/htdocs/commande/liste.php @@ -108,7 +108,7 @@ if ( $db->query($sql) ) while ($i < min($num,$limit)) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $var=!$var; print ""; diff --git a/htdocs/commande/osccommande.class.php b/htdocs/commande/osccommande.class.php index fe56c226dfc..574003115ff 100644 --- a/htdocs/commande/osccommande.class.php +++ b/htdocs/commande/osccommande.class.php @@ -78,7 +78,7 @@ class OscCommande { $i = 0; while ($i < $nump) { - $obj = $this->db->fetch_object($i); + $obj = $this->db->fetch_object(); $ga[$obj->rowid] = $obj->title; $i++; diff --git a/htdocs/compta/bank/account.class.php b/htdocs/compta/bank/account.class.php index 4ac08c9fc58..9887801adf0 100644 --- a/htdocs/compta/bank/account.class.php +++ b/htdocs/compta/bank/account.class.php @@ -116,7 +116,7 @@ class Account $num = $this->db->num_rows(); while ($i < $num) { - $obj = $this->db->fetch_object($result, $i); + $obj = $this->db->fetch_object($result); $lines[$i][0] = $obj->url; $lines[$i][1] = $obj->url_id; $lines[$i][2] = $obj->label; @@ -297,7 +297,7 @@ class Account { if ($this->db->num_rows()) { - $obj = $this->db->fetch_object($result , 0); + $obj = $this->db->fetch_object($result); $this->bank = $obj->bank; $this->label = $obj->label; diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 1708fadad47..e8062c24bf0 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -111,7 +111,7 @@ if ($account > 0) $options = ""; while ($i < $num) { - $obj = $db->fetch_object($i); + $obj = $db->fetch_object($result); $options .= "\n"; $i++; } $db->free(); @@ -329,7 +329,7 @@ function _print_lines($db,$sql,$acct) while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $total = $total + $objp->amount; $time = time(); if ($i >= ($nbline - $viewline)) diff --git a/htdocs/compta/bank/bplc.php b/htdocs/compta/bank/bplc.php index 0b5e6da76bc..b7e62208a87 100644 --- a/htdocs/compta/bank/bplc.php +++ b/htdocs/compta/bank/bplc.php @@ -68,7 +68,7 @@ if ($result) { $sep = 0; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); print ""; diff --git a/htdocs/compta/bank/budget.php b/htdocs/compta/bank/budget.php index e1a2b8e3aba..377b1b72751 100644 --- a/htdocs/compta/bank/budget.php +++ b/htdocs/compta/bank/budget.php @@ -58,7 +58,7 @@ if ($_GET["bid"] == 0) $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); $var=!$var; print ""; print ""; @@ -116,10 +116,10 @@ else $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); $var=!$var; print ""; - print "\n"; + print "\n"; print ""; print ""; diff --git a/htdocs/compta/bank/categ.php b/htdocs/compta/bank/categ.php index ff6b6fc39f0..0ce0c8b7168 100644 --- a/htdocs/compta/bank/categ.php +++ b/htdocs/compta/bank/categ.php @@ -69,7 +69,7 @@ if ($result) $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); $var=!$var; print ""; print ""; diff --git a/htdocs/compta/bank/config.php b/htdocs/compta/bank/config.php index 0fb900bb23a..0ec5301b6fe 100644 --- a/htdocs/compta/bank/config.php +++ b/htdocs/compta/bank/config.php @@ -60,7 +60,7 @@ if ($result) $sep = 0; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); $var=!$var; print ""; diff --git a/htdocs/compta/bank/functions.lib.php b/htdocs/compta/bank/functions.lib.php index cfd6d95666d..c49b8db3bc4 100644 --- a/htdocs/compta/bank/functions.lib.php +++ b/htdocs/compta/bank/functions.lib.php @@ -32,7 +32,7 @@ function gljPrintSelect($db, $refid) { $num = $db->num_rows(); $i = 0; while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); print "
FactureDate
'.stripslashes($objp->facnumber).'
rowid\">".img_file()." "; print "rowid\">$obj->ref'.$obj->nom.'
rowid\">".img_file().""; print " rowid\">$obj->ref'.$obj->nom.'
rowid\">".img_file()." "; print "rowid\">$obj->ref'.$obj->nom.'
rowid\">".img_file()." "; print "rowid\">$obj->ref'.$obj->nom.'
rowid\">$objp->label
".strftime("%d %B %Y",$objp->do)."".strftime("%d %B %Y",$objp->do)."rowid\">$objp->label".price(0 - $objp->amount)." 
$objp->rowid
$objp->rowidrowid\">$objp->label
'; +print '
'; print ''; print ''; print "\n"; diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index 86e3b6e79c0..8502801d295 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -81,7 +81,7 @@ if ($_POST["action"] == 'UPDATE') $var=True; $amount = str_replace(' ','',$_POST['amount']); $num = $db->num_rows(); - $objp = $db->fetch_object( 0); + $objp = $db->fetch_object($result); if ($objp->rappro) die ("Vous ne pouvez pas modifier une écriture déjà rapprochée"); $sql = "UPDATE ".MAIN_DB_PREFIX."bank set label='".$_POST["label"]."' , dateo = '".$_POST["date"]."', amount='$amount' WHERE rowid = $rowid;"; @@ -115,7 +115,7 @@ if ($result) $options = ""; while ($i < $num) { - $obj = $db->fetch_object($i); + $obj = $db->fetch_object($result); $options .= "\n"; $i++; } @@ -150,7 +150,7 @@ if ($result) $i = 0; $total = 0; while ($i < $num) { - $objp = $db->fetch_object($i); + $objp = $db->fetch_object($result); $total = $total + $objp->amount; $acct=new Account($db,$objp->fk_account); @@ -269,7 +269,7 @@ if ($result) $i = 0; $total = 0; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); $var=!$var; print ""; diff --git a/htdocs/compta/bank/pre.inc.php b/htdocs/compta/bank/pre.inc.php index 5b6497e913b..12d2fe5b049 100644 --- a/htdocs/compta/bank/pre.inc.php +++ b/htdocs/compta/bank/pre.inc.php @@ -49,7 +49,7 @@ function llxHeader($head = "") while ($i < $numr) { - $objp = $db->fetch_object($i); + $objp = $db->fetch_object($result); $menu->add(DOL_URL_ROOT."/compta/bank/account.php?account=" . $objp->rowid, $objp->label); $menu->add_submenu(DOL_URL_ROOT."/compta/bank/releve.php?account=" . $objp->rowid ,"Relevés"); $menu->add_submenu(DOL_URL_ROOT."/compta/bank/annuel.php?account=" . $objp->rowid ,"Rapport mensuel E/S"); diff --git a/htdocs/compta/bank/rappro.php b/htdocs/compta/bank/rappro.php index b10876a5eb6..fab6fc4f307 100644 --- a/htdocs/compta/bank/rappro.php +++ b/htdocs/compta/bank/rappro.php @@ -88,7 +88,7 @@ if ($result) { $i = 0; while ($i < $num) { if ($options == "") { $options = ""; } - $obj = $db->fetch_object($i); + $obj = $db->fetch_object($result); $options .= "\n"; $i++; } $db->free(); @@ -157,7 +157,7 @@ if ($result) $i = 0; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $var=!$var; print ""; diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 1411a74874c..b193fb02a9f 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -90,7 +90,7 @@ if (! isset($_GET["num"])) while ($i < min($numrows,$limit)) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); $var=!$var; if (! $objp->numr) { @@ -200,7 +200,7 @@ else while ($i < $numrows) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); $total = $total + $objp->amount; $var=!$var; @@ -222,23 +222,22 @@ else if ($ve) { - $dc = $db->clone(); $sql = "SELECT label FROM ".MAIN_DB_PREFIX."bank_categ as ct, ".MAIN_DB_PREFIX."bank_class as cl WHERE ct.rowid=cl.fk_categ AND cl.lineid=$objp->rowid"; - $resc = $dc->query($sql); + $resc = $db->query($sql); if ($resc) { - $numc = $dc->num_rows(); + $numc = $db->num_rows(); $ii = 0; while ($ii < $numc) { - $objc = $dc->fetch_object($ii); + $objc = $db->fetch_object($resc); print "
$objc->label"; $ii++; } } else { - print $dc->error(); + dolibarr_print_error($db); } } diff --git a/htdocs/compta/bank/search.php b/htdocs/compta/bank/search.php index a53e1020002..85cafff553e 100644 --- a/htdocs/compta/bank/search.php +++ b/htdocs/compta/bank/search.php @@ -94,9 +94,9 @@ if ($result) { $var=True; $num = $db->num_rows(); $i = 0; - $options = ""; + $options = ""; while ($i < $num) { - $obj = $db->fetch_object($i); + $obj = $db->fetch_object($result); $options .= "\n"; $i++; } $db->free(); @@ -140,7 +140,7 @@ if ($result) $i = 0; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); $var=!$var; diff --git a/htdocs/compta/bank/virement.php b/htdocs/compta/bank/virement.php index 86a6e96acae..84e353f24fc 100644 --- a/htdocs/compta/bank/virement.php +++ b/htdocs/compta/bank/virement.php @@ -110,7 +110,7 @@ if ($result) while ($i < $num) { - $objp = $db->fetch_object($i); + $objp = $db->fetch_object($result); print ""; $i++; } @@ -128,7 +128,7 @@ if ($result) while ($i < $num) { - $objp = $db->fetch_object($i); + $objp = $db->fetch_object($result); print ""; $i++; } diff --git a/htdocs/compta/charges.php b/htdocs/compta/charges.php index 7abf7065631..0f58fa53787 100644 --- a/htdocs/compta/charges.php +++ b/htdocs/compta/charges.php @@ -82,7 +82,7 @@ if ( $db->query($sql) ) { $i = 0; while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); $var = !$var; print ""; print ''; diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index f90e3c9dd88..9b17ed97150 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -66,7 +66,7 @@ if ( $db->query($sql) ) $i = 0; while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); $var = !$var; print ""; print ''; @@ -95,7 +95,7 @@ if ( $db->query($sql) ) { $i = 0; while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); $var = !$var; print ""; print ''; diff --git a/htdocs/compta/clients.php b/htdocs/compta/clients.php index 9d45abcc47b..02d0bd3db1d 100644 --- a/htdocs/compta/clients.php +++ b/htdocs/compta/clients.php @@ -144,7 +144,7 @@ if ($mode == 'search') { if ( $db->query($sql) ) { if ( $db->num_rows() == 1) { - $obj = $db->fetch_object(0); + $obj = $db->fetch_object(); $socid = $obj->idp; } $db->free(); @@ -224,7 +224,7 @@ if ($result) while ($i < min($num,$conf->liste_limit)) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); $var=!$var; diff --git a/htdocs/compta/commande.php b/htdocs/compta/commande.php index 3322cc4caa3..bc5978ea984 100644 --- a/htdocs/compta/commande.php +++ b/htdocs/compta/commande.php @@ -168,7 +168,7 @@ if ($_GET["id"] > 0) $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); print ""; if ($objp->fk_product > 0) { @@ -263,7 +263,7 @@ if ($_GET["id"] > 0) $var=True; while ($i < $num_fac_asso) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $var=!$var; print ""; print ""; diff --git a/htdocs/compta/deplacement/index.php b/htdocs/compta/deplacement/index.php index 9825d1ef851..12e7d1c9440 100644 --- a/htdocs/compta/deplacement/index.php +++ b/htdocs/compta/deplacement/index.php @@ -76,7 +76,7 @@ if ( $db->query($sql) ) $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $var=!$var; print ""; print ''; diff --git a/htdocs/compta/dons/fiche.php b/htdocs/compta/dons/fiche.php index 02d1283212e..134ce525316 100644 --- a/htdocs/compta/dons/fiche.php +++ b/htdocs/compta/dons/fiche.php @@ -187,7 +187,7 @@ if ($_GET["action"] == 'create') { $i = 0; while ($i < $num) { - $objopt = $db->fetch_object( $i); + $objopt = $db->fetch_object(); print "\n"; $i++; } @@ -260,7 +260,7 @@ if ($_GET["rowid"] && $_GET["action"] == 'edit') $i = 0; while ($i < $num) { - $objopt = $db->fetch_object( $i); + $objopt = $db->fetch_object(); print "\n"; $i++; } diff --git a/htdocs/compta/dons/index.php b/htdocs/compta/dons/index.php index b8209a6ee1c..fe2c9e6081d 100644 --- a/htdocs/compta/dons/index.php +++ b/htdocs/compta/dons/index.php @@ -42,7 +42,7 @@ if ($result) $i = 0; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); $somme[$objp->fk_statut] = $objp->somme; $i++; diff --git a/htdocs/compta/dons/liste.php b/htdocs/compta/dons/liste.php index 35b4760130b..87dabfc69ef 100644 --- a/htdocs/compta/dons/liste.php +++ b/htdocs/compta/dons/liste.php @@ -91,12 +91,12 @@ if ($result) $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $var=!$var; print ""; - print "\n"; - print "\n"; - print "\n"; + print "\n"; + print "\n"; + print "\n"; print "\n"; print "\n"; print ''; diff --git a/htdocs/compta/dons/stats.php b/htdocs/compta/dons/stats.php index 326e8d18fe0..6dec0181cf5 100644 --- a/htdocs/compta/dons/stats.php +++ b/htdocs/compta/dons/stats.php @@ -48,7 +48,7 @@ if ($result) $total=0; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); $total += $objp->amount; $i++; } diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 98853d2d96e..b66ec820814 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -69,6 +69,7 @@ if ($_POST["action"] == 'classin') $facture->fetch($_POST["facid"]); $facture->classin($_POST["projetid"]); } + /* * */ @@ -333,11 +334,11 @@ if ($_POST["action"] == 'send' || $_POST["action"] == 'relance') $sendto = $_POST["sendto"]; $sendtoid = 0; } - elseif ($_POST["destinataire"]) { + elseif ($_POST["receiver"]) { // Le destinataire a été fourni via la liste déroulante $soc = new Societe($db, $fac->socidp); - $sendto = $soc->contact_get_email($_POST["destinataire"]); - $sendtoid = $_POST["destinataire"]; + $sendto = $soc->contact_get_email($_POST["receiver"]); + $sendtoid = $_POST["receiver"]; } if (strlen($sendto)) @@ -446,7 +447,7 @@ if ($_GET["action"] == 'create') $num = $db->num_rows(); if ($num) { - $obj = $db->fetch_object(0); + $obj = $db->fetch_object(); $soc = new Societe($db); $soc->fetch($obj->idp); @@ -483,7 +484,7 @@ if ($_GET["action"] == 'create') $i = 0; while ($i < $num) { - $objp = $db->fetch_object($i); + $objp = $db->fetch_object(); $conds[$objp->rowid]=$objp->libelle; $i++; } @@ -544,7 +545,7 @@ if ($_GET["action"] == 'create') $num = $db->num_rows(); $i = 0; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $opt .= "\n"; $i++; } @@ -601,7 +602,7 @@ if ($_GET["action"] == 'create') print ''; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); print "\n"; $i++; } @@ -643,7 +644,7 @@ if ($_GET["action"] == 'create') $var=True; while ($i < $num) { - $objp = $db->fetch_object($i); + $objp = $db->fetch_object(); $var=!$var; print "\n"; print ''; @@ -662,7 +663,7 @@ if ($_GET["action"] == 'create') $i = 0; while ($i < $num) { - $objp = $db->fetch_object($i); + $objp = $db->fetch_object(); $var=!$var; print "\n"; print ''; @@ -705,7 +706,7 @@ if ($_GET["action"] == 'create') $var=True; while ($i < $num) { - $objp = $db->fetch_object($i); + $objp = $db->fetch_object(); $var=!$var; print "\n"; print ''; @@ -853,7 +854,7 @@ else $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $var=!$var; print ""; if ($objp->fk_product > 0) @@ -1229,7 +1230,7 @@ else $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $var=!$var; print ""; print ''; @@ -1276,12 +1277,18 @@ else */ if ($_GET["action"] == 'presend') { + print_titre("Envoyer la facture par mail"); + + $langs->load("other"); + $replytoname = $user->fullname; $from_name = $replytoname; $replytomail = $user->email; $from_mail = $replytomail; + $form = new Form($db); + print "\n"; print ''; print ''; @@ -1289,34 +1296,42 @@ else print ''; print '
'; - print_titre("Envoyer la facture par mail"); - print "
Comptes courantsBanqueNuméroSoldeClos
'.$obj->nom.''.price($obj->total).'
'.$obj->lib.'
Factures founisseurs
facid\">$objp->facnumber"; diff --git a/htdocs/compta/config.php b/htdocs/compta/config.php index 332aab6e6d1..986baf93da1 100644 --- a/htdocs/compta/config.php +++ b/htdocs/compta/config.php @@ -66,7 +66,7 @@ if ($action == 'create') { if ($num > 0) { $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $var=!$var; print "
'.dolibarr_print_date($objp->dd).'
rowid\">".stripslashes($objp->prenom)."rowid\">".stripslashes($objp->nom)."rowid\">".stripslashes($objp->societe)."rowid\">".stripslashes($objp->prenom)."rowid\">".stripslashes($objp->nom)."rowid\">".stripslashes($objp->societe)."rowid\">".strftime("%d %B %Y",$objp->datedon)."$objp->projet'.price($objp->amount).' 
[$objp->ref]'.$objp->product.'
 '.$objp->product.'
[$objp->ref]'.$objp->product.'
"; print ''.img_file().''; @@ -947,7 +948,7 @@ else $var=True; while ($i < $num_lignes) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $var=!$var; print "
'.$objp->id.'
"; - print ""; - print ""; - print '"; + // From + print "
Expéditeur$from_name$from_mail  
Répondre à$replytoname$replytomail  
Destinataire'; - - $form = new Form($db); - $form->select_array("destinataire",$soc->contact_email_array()); - print " ou email\">
"; + print ""; + print ""; + print "
".$langs->trans("MailFrom")."$from_name".($from_mail?" <$from_mail>":"")."
".$langs->trans("MailReply")."$replytoname".($replytomail?" <$replytomail>":""); + print "
"; + + // To + print ""; + print '"; - print '"; - - print "
'.$langs->trans("MailTo").''; + $form->select_array("receiver",$soc->contact_email_array()); + print " ".$langs->trans("or")." email\">
Message'; - print "

\n"; + // Topic + Message + $defaultmessage="Veuillez trouver ci-joint la facture $fac->ref\n\nCordialement\n\n"; + $form->mail_topicmessagefile(0,1,0,$defaultmessage); - print "
trans("Send")."\">
\n"; + print "
trans("Send")."\">
\n"; + + print "\n"; } if ($_GET["action"] == 'prerelance') { + print_titre("Envoyer une relance par mail"); + + $langs->load("other"); + $replytoname = $user->fullname; $from_name = $replytoname; $replytomail = $user->email; $from_mail = $replytomail; + $form = new Form($db); + print "
\n"; print ''; print ''; @@ -1324,24 +1339,26 @@ else print ''; print '
'; - print_titre("Envoyer une relance par mail"); - print ""; - print ""; - print ""; - print '"; print "\n"; @@ -1501,7 +1518,7 @@ else while ($i < min($num,$limit)) { - $objp = $db->fetch_object($i); + $objp = $db->fetch_object(); $var=!$var; print ""; diff --git a/htdocs/compta/facture/facture-rec.class.php b/htdocs/compta/facture/facture-rec.class.php index 162a26cb6f4..e0bc25fc1fa 100644 --- a/htdocs/compta/facture/facture-rec.class.php +++ b/htdocs/compta/facture/facture-rec.class.php @@ -154,7 +154,7 @@ class FactureRec { if ($this->db->num_rows()) { - $obj = $this->db->fetch_object(0); + $obj = $this->db->fetch_object(); $this->id = $rowid; $this->datep = $obj->dp; @@ -199,7 +199,7 @@ class FactureRec while ($i < $num) { - $objp = $this->db->fetch_object($i); + $objp = $this->db->fetch_object($result); $faclig = new FactureLigne($this->db); $faclig->produit_id = $objp->fk_product; $faclig->desc = stripslashes($objp->description); @@ -333,7 +333,7 @@ class FactureRec $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(); @@ -467,7 +467,7 @@ class FactureRec $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; diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index fa71ebfffe9..df6336fc0c9 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -164,7 +164,7 @@ if ($_GET["action"] == 'create') $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); if ($objp->fk_product > 0) { @@ -435,7 +435,7 @@ else $var=True; while ($i < min($num,$limit)) { - $objp = $db->fetch_object($i); + $objp = $db->fetch_object(); $var=!$var; print ""; diff --git a/htdocs/compta/fiche.php b/htdocs/compta/fiche.php index 2899dc3ad83..69406756c0f 100644 --- a/htdocs/compta/fiche.php +++ b/htdocs/compta/fiche.php @@ -125,7 +125,7 @@ if ($mode == 'search') { if ( $db->num_rows() == 1) { - $obj = $db->fetch_object(0); + $obj = $db->fetch_object(); $socid = $obj->idp; } $db->free(); @@ -260,7 +260,7 @@ if ($socid > 0) while ($i < $num && $i < 5) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $var=!$var; print ""; print "\n"; @@ -306,7 +306,7 @@ if ($socid > 0) } while ($i < $num && $i < 5) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); $tag = !$tag; print ""; print ''; @@ -388,7 +388,7 @@ if ($socid > 0) $var=1; while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object($result); $var = !$var; print ""; @@ -449,7 +449,7 @@ if ($socid > 0) while ($i < $num) { $var = !$var; - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); print ""; if ($oldyear == strftime("%Y",$obj->da) ) { diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 68ac9ee5fd6..ee38a3c42f2 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -109,7 +109,7 @@ if ($conf->facture->enabled) $var = True; while ($i < $num && $i < 20) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); $var=!$var; print ''; @@ -151,7 +151,7 @@ if ($user->societe_id == 0) $var = True; while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); $var = !$var; print ""; print ''; @@ -191,7 +191,7 @@ if ( $db->query($sql) ) $var = True; while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); $var = !$var; print ""; print ''; @@ -237,7 +237,7 @@ if ($user->comm > 0 && $conf->commercial->enabled ) while ($i < $num) { $var=!$var; - $obj = $db->fetch_object($i); + $obj = $db->fetch_object(); print ""; print ''; @@ -279,7 +279,7 @@ if ($conf->facture->enabled) $total = $totalam = 0; while ($i < $num && $i < 20) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); $var=!$var; print ''; @@ -313,7 +313,7 @@ if ( $result ) $i = 0; while ($i < $db->num_rows() ) { - $obj = $db->fetch_object($i); + $obj = $db->fetch_object(); $var=!$var; print ""; @@ -345,7 +345,7 @@ if ($user->societe_id == 0) $num = $db->num_rows(); if ($num) { - print '
Expéditeur$from_name$from_mail  
Répondre à$replytoname$replytomail  
Destinataire'; + // From + print ""; + print ""; + print ""; + print "
".$langs->trans("MailFrom")."$from_name".($from_mail?" <$from_mail>":"")."
".$langs->trans("MailReply")."$replytoname".($replytomail?" <$replytomail>":""); + print "
"; + + // To + print ""; + print '"; - $form = new Form($db); - $form->select_array("destinataire",$soc->contact_email_array()); - print " ou email\">"; - - print '"; - - print "
'.$langs->trans("MailTo").''; + $form->select_array("receiver",$soc->contact_email_array()); + print " ".$langs->trans("or")." email\">
'.$langs->trans("Message").''; - print "

\n"; - - print "
trans("Send")."\">
\n"; + // Affiche la partie mail topic + message + file + $defaultmessage="Nous apportons à votre connaissance que la facture ".$fac->ref." ne semble toujours pas avoir été réglée. La voici donc, pour rappel, en pièce jointe.\n\nCordialement\n\n"; + $form->mail_topicmessagefile(0,1,0,$defaultmessage); + + print "
trans("Send")."\">
\n"; + + print "fetch_object( $i); + $objp = $db->fetch_object(); $var=!$var; print "
propalid\">$objp->ref
facid\">$objp->facnumber
'.$obj->title.'
'.img_file().' '; print ''.$obj->facnumber.'
'.$obj->libelle.'
'.$obj->nom.'
rowid\">".img_file().""; print " rowid\">$obj->ref'.$obj->nom.'
'.img_file().''; print ' '.$obj->facnumber.'
".strftime("%d %b %Y",$obj->da)."$obj->libelle $obj->label
'; + print '
'; print ''; print "\n"; $i = 0; @@ -353,7 +353,7 @@ if ($user->societe_id == 0) $total = $totalam = 0; while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); $var = !$var; print ''; diff --git a/htdocs/compta/ligne.php b/htdocs/compta/ligne.php index 9d2f269a591..b00e6c29208 100644 --- a/htdocs/compta/ligne.php +++ b/htdocs/compta/ligne.php @@ -30,7 +30,7 @@ if ( $db->query($sql) ) { $i = 0; $options = ""; while ($i < $num) { - $obj = $db->fetch_object($i); + $obj = $db->fetch_object(); $options .= "\n"; $i++; } $db->free(); @@ -99,7 +99,7 @@ if ($action == 'create') { if ($num > 0) { $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); $var=!$var; print ""; diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 34f7dd628c7..0a2c08f92c7 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -146,7 +146,7 @@ if ($_GET["action"] == 'create') $num = $db->num_rows(); if ($num) { - $obj = $db->fetch_object( 0); + $obj = $db->fetch_object($result); $total = $obj->total; @@ -179,7 +179,7 @@ if ($_GET["action"] == 'create') $i = 0; while ($i < $num) { - $objopt = $db->fetch_object( $i); + $objopt = $db->fetch_object($result); print "\n"; $i++; } @@ -203,7 +203,7 @@ if ($_GET["action"] == 'create') $i = 0; while ($i < $num) { - $objopt = $db->fetch_object( $i); + $objopt = $db->fetch_object($result); print '
Factures fournisseurs à payerMontant TTC
'.img_file().''; print ' '.$obj->facnumber.'
'; - print ''; + print '
'; print ''; print ''; print ''; @@ -252,7 +252,7 @@ if ($_GET["action"] == 'create') while ($i < $num) { - $objp = $db->fetch_object($i); + $objp = $db->fetch_object(); $var=!$var; print ""; @@ -363,7 +363,7 @@ if ($action == '') print_barre_liste("Paiements", $page, "paiement.php","",$sortfield,$sortorder,'',$num); - print '
FactureDateMontant TTC
'; + print '
'; print ''; print ""; print ""; @@ -375,7 +375,7 @@ if ($action == '') while ($i < min($num,$limit)) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $var=!$var; print ""; print "\n"; diff --git a/htdocs/compta/paiement/fiche.php b/htdocs/compta/paiement/fiche.php index c4eeb0e8a52..a2726db4af6 100644 --- a/htdocs/compta/paiement/fiche.php +++ b/htdocs/compta/paiement/fiche.php @@ -123,7 +123,7 @@ if ($db->query($sql)) while ($i < $num) { - $objp = $db->fetch_object($i); + $objp = $db->fetch_object(); $var=!$var; print ""; diff --git a/htdocs/compta/paiement/liste.php b/htdocs/compta/paiement/liste.php index fe5198d116b..943b01918f7 100644 --- a/htdocs/compta/paiement/liste.php +++ b/htdocs/compta/paiement/liste.php @@ -65,17 +65,17 @@ if ($result) print_barre_liste("Paiements reçus", $page, "liste.php","",$sortfield,$sortorder,'',$num); - print '
FactureDate
facid\">$objp->facnumber
'; + print '
'; print ''; print ''; + print ''; print ""; print "\n"; while ($i < min($num,$limit)) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); $var=!$var; print ""; print '
Date'; print_liste_field_titre($langs->trans("Type"),"liste.php","c.libelle","",""); - print 'Montant'.$langs->trans("Amount").' 
'; diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index 00457d0b090..aaab7c7b750 100755 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -193,7 +193,7 @@ if ($_GET["action"] == 'create') $i = 0; while ($i < $num) { - $objopt = $db->fetch_object( $i); + $objopt = $db->fetch_object($result); print "\n"; $i++; } @@ -216,7 +216,7 @@ if ($_GET["action"] == 'create') $i = 0; while ($i < $num) { - $objopt = $db->fetch_object( $i); + $objopt = $db->fetch_object($result); print '
'; - print ''; + print '
'; print ''; print ''; print ''; diff --git a/htdocs/compta/pmt.php b/htdocs/compta/pmt.php index 83d07c3d211..ff10ab332e6 100644 --- a/htdocs/compta/pmt.php +++ b/htdocs/compta/pmt.php @@ -52,12 +52,10 @@ $result = $db->query($sql); if ($result) { - - - print "
ChargeDate échéanceMontant TTC
"; + print "
"; print ""; print ""; - print ""; + print ""; print "\n"; $bc[0]="bgcolor=\"#90c090\""; @@ -67,16 +65,16 @@ if ($result) { $i = 0; $num = $db->num_rows(); while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object($result); $var=!$var; - print ""; + print ""; - print "\n"; - print "\n"; + print "\n"; + print "\n"; - print "\n"; + print "\n"; $i++; diff --git a/htdocs/compta/pointmort.php b/htdocs/compta/pointmort.php index 2382bd2f7c9..4878b92835a 100644 --- a/htdocs/compta/pointmort.php +++ b/htdocs/compta/pointmort.php @@ -30,7 +30,7 @@ function pt ($db, $sql) { $total = 0 ; $month = 1 ; while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object($result); $ca[$obj->dm] = $obj->sum; @@ -51,7 +51,7 @@ function pm ($db) { $month = 1 ; while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object($result); $ca[$obj->dm] = $obj->amount; diff --git a/htdocs/compta/propal.php b/htdocs/compta/propal.php index 7ff03899606..2405491e20c 100644 --- a/htdocs/compta/propal.php +++ b/htdocs/compta/propal.php @@ -115,7 +115,7 @@ if ($_GET["propalid"]) $result = $db->query($sql); if ( $result ) { - $obj = $db->fetch_object( 0 ); + $obj = $db->fetch_object($result); if ($db->num_rows()) { @@ -233,7 +233,7 @@ if ($_GET["propalid"]) $var=True; while ($i < $num_fac_asso) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $var=!$var; print ""; print "\n"; print ''; @@ -343,7 +343,7 @@ if ($_GET["propalid"]) $i = 0; while ($i < $num) { - $objp = $db->fetch_object($i); + $objp = $db->fetch_object(); $var=!$var; print "\n"; print ''; @@ -474,7 +474,7 @@ if ($_GET["propalid"]) while ($i < min($num, $limit)) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $var=!$var; print ""; diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 0f64f7e05b5..f4a512ab3ea 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -73,7 +73,7 @@ if ($result) { if ($num > 0) { $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); $var=!$var; print ""; @@ -114,7 +114,7 @@ if ($result) { if ($num > 0) { $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); $var=!$var; print ""; @@ -155,7 +155,7 @@ if ( $db->query($sql) ) { $i = 0; while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); $total = $total - $obj->amount; $subtotal = $subtotal + $obj->amount; @@ -195,7 +195,7 @@ if ( $db->query($sql) ) { $i = 0; while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); $total = $total - $obj->amount; $subtotal = $subtotal + $obj->amount; diff --git a/htdocs/compta/sociales/charges.php b/htdocs/compta/sociales/charges.php index dafa3d6eed2..244a8f4b96c 100644 --- a/htdocs/compta/sociales/charges.php +++ b/htdocs/compta/sociales/charges.php @@ -122,7 +122,7 @@ if ($chid > 0) $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); $var=!$var; print "\n"; diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index ce6abecd383..f3a23f803ea 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -141,7 +141,7 @@ if ($user->rights->compta->charges->creer) { while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); print '"; diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index 61b0a35935f..8ea19b3a436 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -55,7 +55,7 @@ if ($result) { if ($db->num_rows() > 0) { - $objp = $db->fetch_object(0); + $objp = $db->fetch_object($result); $catotal = $objp->ca; } } @@ -84,7 +84,7 @@ if ($result) if ($num > 0) { $i = 0; - print "

".$langs->trans("Month")."Montant".$langs->trans("Amount")."
".strftime("%Y %B",$obj->dm)."$obj->amount".strftime("%Y %B",$obj->dm)."$obj->amount
facid\">$objp->facnumber"; @@ -323,7 +323,7 @@ if ($_GET["propalid"]) $var=True; while ($i < $num) { - $objp = $db->fetch_object($i); + $objp = $db->fetch_object(); $var=!$var; print "
[$objp->ref]'.$objp->product.'
 '.$objp->product.'
 
 
"; print dolibarr_print_date($objp->dp)."
"; + print "

"; print ""; print ""; print ''; @@ -92,7 +92,7 @@ if ($result) $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); $var=!$var; print ""; diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index 965dc30c366..d26a1baf508 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -55,7 +55,7 @@ if ($result) { if ($db->num_rows() > 0) { - $objp = $db->fetch_object(0); + $objp = $db->fetch_object($result); $catotal = $objp->ca; } } @@ -95,7 +95,7 @@ if ($result) $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); $var=!$var; print ""; diff --git a/htdocs/compta/stats/comp.php b/htdocs/compta/stats/comp.php index 01d3b63e9b5..e23dd5a5ef8 100644 --- a/htdocs/compta/stats/comp.php +++ b/htdocs/compta/stats/comp.php @@ -44,7 +44,7 @@ function propals ($db, $year, $month) { $oldstatut = -1; $subtotal = 0; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); if ($objp->statut <> $oldstatut ) { $oldstatut = $objp->statut; @@ -127,7 +127,7 @@ function factures ($db, $year, $month, $paye) { $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); $var=!$var; print ""; print "\n"; @@ -181,7 +181,7 @@ function pt ($db, $sql, $year) { $month = 1 ; while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object($result); $var=!$var; if ($obj->dm > $month ) { diff --git a/htdocs/compta/stats/cumul.php b/htdocs/compta/stats/cumul.php index 22b98eaef02..fed12e5c24f 100644 --- a/htdocs/compta/stats/cumul.php +++ b/htdocs/compta/stats/cumul.php @@ -101,7 +101,7 @@ function pt ($db, $sql, $date) $var=True; while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object($result); $var=!$var; $total = $total + $obj->amount; print ""; diff --git a/htdocs/compta/stats/exercices.php b/htdocs/compta/stats/exercices.php index 068e4ea88be..18f8b83ffb7 100644 --- a/htdocs/compta/stats/exercices.php +++ b/htdocs/compta/stats/exercices.php @@ -71,7 +71,7 @@ function factures ($db, $year, $month, $paye) print "\n"; $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); $var=!$var; print ""; print "\n"; @@ -118,7 +118,7 @@ function pt ($db, $sql, $year) { $month = 1 ; while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object($result); $var=!$var; if ($obj->dm > $month ) { diff --git a/htdocs/compta/stats/prev.php b/htdocs/compta/stats/prev.php index 5c4c0b94764..12321b83716 100644 --- a/htdocs/compta/stats/prev.php +++ b/htdocs/compta/stats/prev.php @@ -35,10 +35,11 @@ function pt ($db, $sql, $title) { global $bc; global $langs; - print '
UtilisateurMontantPourcentage
idp\">$objp->nom
idp\">$objp->nom
'; + print '
'; print ''; - print ""; - print ""; + print ""; + print ""; + print "\n"; $result = $db->query($sql); if ($result) @@ -46,17 +47,16 @@ function pt ($db, $sql, $title) { $num = $db->num_rows(); $i = 0; $total = 0 ; - print "\n"; $var=True; while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object($result); $var=!$var; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; - print "\n"; + print "\n"; $total = $total + $obj->amount; $i++; } @@ -66,10 +66,10 @@ function pt ($db, $sql, $title) { } else { - print ""; + dolibarr_print_error($db); } - print "
$titleMontant$titleMontant
'.$obj->dm.''.price($obj->amount).'
'.$obj->dm.''.price($obj->amount).'
".$db->error() . "
"; + print "
"; } /* diff --git a/htdocs/compta/tva.php b/htdocs/compta/tva.php index f5f89a05c96..fced5772b01 100644 --- a/htdocs/compta/tva.php +++ b/htdocs/compta/tva.php @@ -36,7 +36,7 @@ function pt ($db, $sql, $date) { if ($result) { $num = $db->num_rows(); $i = 0; $total = 0 ; - print "

"; + print "
"; print ""; print ""; print ""; @@ -44,7 +44,7 @@ function pt ($db, $sql, $date) { print "\n"; $var=True; while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object($result); $var=!$var; print ""; print "\n"; diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index b4cbf343e0e..b3b8f2edaf5 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -36,7 +36,7 @@ function tva_coll($db, $y,$m) { $result = $db->query($sql); if ($result) { - $obj = $db->fetch_object ( 0 ); + $obj = $db->fetch_object($result); return $obj->amount; } } @@ -54,7 +54,7 @@ function tva_paye($db, $y,$m) $result = $db->query($sql); if ($result) { - $obj = $db->fetch_object ( 0 ); + $obj = $db->fetch_object($result); return $obj->amount; } } @@ -75,7 +75,7 @@ function pt ($db, $sql, $date) { print "\n"; $var=True; while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object($result); $var=!$var; print ""; print "\n"; diff --git a/htdocs/compta/tva/reglement.php b/htdocs/compta/tva/reglement.php index 55e2d639393..ac04c0b66bb 100644 --- a/htdocs/compta/tva/reglement.php +++ b/htdocs/compta/tva/reglement.php @@ -44,7 +44,7 @@ if ($result) $i = 0; $total = 0 ; print '
'; - print '
$dateMontant
$obj->dm
$obj->dm
'; + print '
'; print ''; print ""; print ""; @@ -53,7 +53,7 @@ if ($result) $var=1; while ($i < $num) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object($result); $var=!$var; print ""; print "\n"; diff --git a/htdocs/compta/voyage/bilan.php b/htdocs/compta/voyage/bilan.php index 891aa4c9596..37340742531 100644 --- a/htdocs/compta/voyage/bilan.php +++ b/htdocs/compta/voyage/bilan.php @@ -61,7 +61,7 @@ if ($result) { $i = 0; $options = ""; while ($i < $num) { - $obj = $db->fetch_object($i); + $obj = $db->fetch_object($result); $options .= "\n"; $i++; } $db->free(); @@ -80,7 +80,7 @@ if ($result) { $cartes= array(); $i = 0; while ($i < $num) { - $obj = $db->fetch_object($i); + $obj = $db->fetch_object($result); $cartes[$i] = $obj->rowid; $i++; } @@ -128,7 +128,7 @@ for ($j = 0 ; $j < sizeof($cartes) ; $j++) { $total_reduc = 0; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); $total = $total + $objp->amount; $total_reduc = $total_reduc + $objp->reduction; $time = time(); diff --git a/htdocs/compta/voyage/index.php b/htdocs/compta/voyage/index.php index d596e68bcc1..bc5c0dfce73 100644 --- a/htdocs/compta/voyage/index.php +++ b/htdocs/compta/voyage/index.php @@ -60,7 +60,7 @@ if ($result) { $i = 0; $options = ""; while ($i < $num) { - $obj = $db->fetch_object($i); + $obj = $db->fetch_object($result); $options .= "\n"; $i++; } $db->free(); @@ -93,7 +93,7 @@ if ($result) { $sep = 0; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); $total = $total + $objp->amount; $time = time(); diff --git a/htdocs/compta/voyage/reduc.class.php b/htdocs/compta/voyage/reduc.class.php index b81f6bf3bef..6bc47b570c3 100644 --- a/htdocs/compta/voyage/reduc.class.php +++ b/htdocs/compta/voyage/reduc.class.php @@ -42,7 +42,7 @@ class Reduc { if ($result) { if ($this->db->num_rows()) { - $obj = $this->db->fetch_object( 0); + $obj = $this->db->fetch_object($result); $this->id = $obj->rowid; $this->price = $obj->amount; diff --git a/htdocs/compta/voyage/reduc.php b/htdocs/compta/voyage/reduc.php index e399599cbe7..e305d05fb06 100644 --- a/htdocs/compta/voyage/reduc.php +++ b/htdocs/compta/voyage/reduc.php @@ -46,7 +46,7 @@ if ($result) { $sep = 0; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); $total = $total + $objp->amount; $time = time(); diff --git a/htdocs/contact/index.php b/htdocs/contact/index.php index 4e1e8d813ff..ee8929a2acb 100644 --- a/htdocs/contact/index.php +++ b/htdocs/contact/index.php @@ -148,7 +148,7 @@ if ($result) { $sortorder="DESC"; } - print '

".$langs->trans("Date")."".$langs->trans("Amount")."
".dolibarr_print_date($obj->dm)."
'; + print '
'; print ''; - print ""; + print ""; print '"; print "\n"; diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 3af96eb685a..d4843e809d9 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -110,7 +110,7 @@ if ( $db->query($sql) ) $var=True; while ($i < min($num,$limit)) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); $var=!$var; print ""; print ""; if ($objp->fk_product > 0) { @@ -258,7 +258,7 @@ if ($_GET["id"] > 0) $var=True; while ($i < $num) { - $obja = $db->fetch_object( $i); + $obja = $db->fetch_object($result); print ""; print ''; print "\n"; @@ -302,7 +302,7 @@ if ($_GET["id"] > 0) if ($num) { - print '
'; print_liste_field_titre($langs->trans("Lastname"),"index.php","lower(p.name)", $begin); print ""; @@ -173,7 +173,7 @@ if ($result) $var=True; while ($i < min($num,$limit)) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object($result); $var=!$var; @@ -183,7 +183,7 @@ if ($result) print ''; print img_file(); print ' '.$obj->name.'$obj->firstname$obj->firstname'; if ($obj->nom) @@ -225,8 +225,7 @@ if ($result) } else { - print $db->error(); - print "
".$sql; + dolibarr_print_error($db); } $db->close(); diff --git a/htdocs/contrat/contrat.class.php b/htdocs/contrat/contrat.class.php index 5383da7f0af..49a59d0f172 100644 --- a/htdocs/contrat/contrat.class.php +++ b/htdocs/contrat/contrat.class.php @@ -185,7 +185,7 @@ class Contrat while ($i < $num) { - $objp = $this->db->fetch_object($i); + $objp = $this->db->fetch_object(); $prowid[$i] = $objp->rowid; $fdrowid[$i] = $objp->fdrowid; $i++; diff --git a/htdocs/contrat/enservice.php b/htdocs/contrat/enservice.php index 99f58fbaf8b..4980b144de0 100644 --- a/htdocs/contrat/enservice.php +++ b/htdocs/contrat/enservice.php @@ -84,7 +84,7 @@ if ( $db->query($sql) ) $var=True; while ($i < min($num,$limit)) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object(); $var=!$var; print "
cid\">$obj->label
cid\">"; diff --git a/htdocs/domain/index.php b/htdocs/domain/index.php index 684190b5d4e..505ff4b6a30 100644 --- a/htdocs/domain/index.php +++ b/htdocs/domain/index.php @@ -63,10 +63,10 @@ if ($result) { print "
"; print ""; - print ""; + print "
"; print ""; print ''; - print ""; + print ''; print ""; print "\n"; @@ -78,7 +78,7 @@ if ($result) { $sep = 0; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); $total = $total + $objp->amount; $time = time(); @@ -88,7 +88,7 @@ if ($result) { print ""; - print ''; + print ''; print ""; @@ -97,12 +97,10 @@ if ($result) { } $db->free(); - - print "
Date'.$langs->trans("Description").'Montant'.$langs->trans("Amount").'Réduction
$objp->labelwww.'.$objp->label.'www.'.$objp->label.'
"; -} else { - print "

".$db->error(); +} else { + dolibarr_print_error($db); } diff --git a/htdocs/expedition/commande.php b/htdocs/expedition/commande.php index f1606bbe770..4f9d0618fae 100644 --- a/htdocs/expedition/commande.php +++ b/htdocs/expedition/commande.php @@ -156,7 +156,7 @@ if ($_GET["id"] > 0) $reste_a_livrer = array(); while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); print "

'.$obja->label.''.$obja->entrepot.'Stock : '.$obja->reel.'
'; + print '
'; print ''; print ''; print ''; @@ -313,7 +313,7 @@ if ($_GET["id"] > 0) $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); print ""; if ($objp->fk_product > 0) { diff --git a/htdocs/expedition/expedition.class.php b/htdocs/expedition/expedition.class.php index b4e376b225d..e65614c241f 100644 --- a/htdocs/expedition/expedition.class.php +++ b/htdocs/expedition/expedition.class.php @@ -246,7 +246,7 @@ class Expedition while($i < $num) { $mouvS = new MouvementStock($this->db); - $obj = $this->db->fetch_object($i); + $obj = $this->db->fetch_object(); $mouvS->livraison($user, $obj->fk_product, $this->entrepot_id, $obj->qty, 0); $i++; } diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index ac7116995f3..3521e4183c0 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -377,7 +377,7 @@ else $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); print ""; if ($objp->fk_product > 0) { @@ -459,7 +459,7 @@ else $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); print ""; if ($objp->fk_product > 0) { @@ -521,7 +521,7 @@ else $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object($result); $var=!$var; print ""; print "\n"; diff --git a/htdocs/expedition/index.php b/htdocs/expedition/index.php index 8b3b3702c74..6a41333ae56 100644 --- a/htdocs/expedition/index.php +++ b/htdocs/expedition/index.php @@ -68,7 +68,7 @@ if ( $db->query($sql) ) while ($i < $num) { $var=!$var; - $obj = $db->fetch_object($i); + $obj = $db->fetch_object(); print ""; print ''; print ''; @@ -104,7 +104,7 @@ if ( $db->query($sql) ) while ($i < $num) { $var=!$var; - $obj = $db->fetch_object($i); + $obj = $db->fetch_object(); print ""; print ''; @@ -146,7 +146,7 @@ if ( $db->query($sql) ) while ($i < $num) { $var=!$var; - $obj = $db->fetch_object($i); + $obj = $db->fetch_object(); print ""; print ''; @@ -182,7 +182,7 @@ if ( $db->query($sql) ) while ($i < $num) { $var=!$var; - $obj = $db->fetch_object($i); + $obj = $db->fetch_object(); print ""; print ''; diff --git a/htdocs/expedition/liste.php b/htdocs/expedition/liste.php index 0e040385057..6d1680a7222 100644 --- a/htdocs/expedition/liste.php +++ b/htdocs/expedition/liste.php @@ -100,7 +100,7 @@ if ( $db->query($sql) ) while ($i < min($num,$limit)) { - $objp = $db->fetch_object( $i); + $objp = $db->fetch_object(); $var=!$var; print "";
'.$langs->trans("Description").'Quan. livrée
".strftime("%d %B %Y",$objp->da)."
rowid\">$obj->ref'.$obj->nom.''.$obj->commande_ref.'
rowid\">".img_file()." "; print "rowid\">$obj->ref'.$obj->nom.'
rowid\">".img_file()." "; print "rowid\">$obj->ref'.$obj->nom.'
rowid\">".img_file()." "; print "rowid\">$obj->ref'.$obj->nom.'