From 2e6be78e78a64a2879338b256769b61907859f15 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 18 Aug 2005 18:03:53 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20L'information=20contact=20facturation=20?= =?UTF-8?q?affich=E9e=20=E9tait=20toujours=20=E0=20Oui?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/contact.class.php | 5 +++-- htdocs/contact/fiche.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/contact.class.php b/htdocs/contact.class.php index 29e8bfb0b7e..1881b5a0086 100644 --- a/htdocs/contact.class.php +++ b/htdocs/contact.class.php @@ -511,14 +511,15 @@ class Contact } - $sql = "SELECT count(*) "; + $sql = "SELECT count(*) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."contact_facture"; $sql .= " WHERE fk_contact = ". $id; $resql=$this->db->query($sql); if ($resql) { - if ($this->db->num_rows($resql)) + $obj=$this->db->fetch_object($resql); + if ($obj->nb) { $this->facturation = 1; } diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index e45456f79fa..985de580acb 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -413,7 +413,7 @@ else print ''; print ''.$langs->trans("BillingContact").''; - print $langs->trans($yesno[$contact->facturation]); + print yn($contact->facturation); print ''; print "";