From 414ab39d30eeae0b8f6a8f8abe192ed4fa1e571c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Sep 2013 02:37:11 +0200 Subject: [PATCH] Fix: bug detected with phpunit --- htdocs/contact/class/contact.class.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index cbd4cf122f4..ae167593a52 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -726,7 +726,7 @@ class Contact extends CommonObject if (! $error) { // Remove category - $sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_contact WHERE fk_socpeople = ".$rowid; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_contact WHERE fk_socpeople = ".$this->id; dol_syslog(get_class($this)."::delete sql=".$sql); $resql=$this->db->query($sql); if (! $resql) @@ -734,8 +734,7 @@ class Contact extends CommonObject $error++; $this->error .= $this->db->lasterror(); $errorflag=-1; - dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR); - + dol_syslog(get_class($this)."::delete error ".$errorflag." ".$this->error, LOG_ERR); } } @@ -916,7 +915,7 @@ class Contact extends CommonObject { return $this->LibStatut($this->statut,$mode); } - + function getLibStatutcontact() { return $this->LibStatutcontact($this->statut); @@ -975,7 +974,7 @@ class Contact extends CommonObject elseif ($statut==4) return ''.$langs->trans('StatusContactValidatedShort').' '.img_picto($langs->trans('StatusContactValidatedShort'),'statut4'); elseif ($statut==5) return ''.$langs->trans('StatusContactValidatedShort').' '.img_picto($langs->trans('StatusContactValidatedShort'),'statut5'); } - + } function LibStatutcontact($statut) @@ -1051,7 +1050,7 @@ class Contact extends CommonObject $this->socid = $socids[$socid]; $this->statut=1; } - + /** * Change status of a user *