diff --git a/htdocs/facture.class.php3 b/htdocs/facture.class.php3 index b5d5b4162c9..28efec8bc78 100644 --- a/htdocs/facture.class.php3 +++ b/htdocs/facture.class.php3 @@ -289,7 +289,7 @@ class Facture $mesg = "La facture ".$this->ref." a été validée.\n"; $notify = New Notify($this->db); - $notify->send($action_notify, $mesg, $filepdf); + $notify->send($action_notify, $this->socidp, $mesg, $filepdf); return $result; } diff --git a/htdocs/fichinter/fichinter.class.php3 b/htdocs/fichinter/fichinter.class.php3 index 0841be22307..029d69243ee 100644 --- a/htdocs/fichinter/fichinter.class.php3 +++ b/htdocs/fichinter/fichinter.class.php3 @@ -215,7 +215,7 @@ class Fichinter $mesg = "La fiche d'intervention ".$this->ref." a été validée.\n"; $notify = New Notify($this->db); - $notify->send($action_notify, $mesg, $filepdf); + $notify->send($action_notify, $this->societe_id, $mesg, $filepdf); return 1; } diff --git a/htdocs/notify.class.php b/htdocs/notify.class.php index fc3ff00355d..c575838f6ac 100644 --- a/htdocs/notify.class.php +++ b/htdocs/notify.class.php @@ -43,12 +43,13 @@ class Notify * * */ - Function send($action, $texte, $file="") + Function send($action, $socid, $texte, $file="") { $sql = "SELECT s.nom, c.email, c.idp, c.name, c.firstname, a.titre,n.rowid"; $sql .= " FROM llx_socpeople as c, llx_action_def as a, llx_notify_def as n, llx_societe as s"; $sql .= " WHERE n.fk_contact = c.idp AND a.rowid = n.fk_action"; $sql .= " AND n.fk_soc = s.idp AND n.fk_action = ".$action; + $sql .= " AND s.idp = ".$socid; $result = $this->db->query($sql); if ($result)