diff --git a/htdocs/actioncomm.class.php b/htdocs/actioncomm.class.php index 0fb6256f8bcceae094ecff802177f41819887474..999fa6ef5a3fc6155a3a0021c8236cd770769ece 100644 --- a/htdocs/actioncomm.class.php +++ b/htdocs/actioncomm.class.php @@ -244,7 +244,7 @@ class ActionComm $this->datem = $obj->datem; $this->note =$obj->note; $this->percentage =$obj->percentage; - $this->societe->id = $obj->fk_soc; + $this->author->id = $obj->fk_user_author; $this->usermod->id = $obj->fk_user_mod; @@ -252,6 +252,7 @@ class ActionComm $this->userdone->id = $obj->fk_user_done; $this->priority = $obj->priority; + $this->societe->id = $obj->fk_soc; $this->contact->id = $obj->fk_contact; $this->fk_facture = $obj->fk_facture; diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index f29d61ad4b3aaf16ba2ba2117686ed38acd71a52..ccc5533a2da9670c886813a642252091e67f1d46 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -565,14 +565,25 @@ if ($_GET["id"]) $act = new ActionComm($db); $result=$act->fetch($_GET["id"]); - //print $result."ee".$act->userdone->id."ee"; - $result=$act->societe->fetch($act->societe->id); + + $societe = new Societe($db); + if ($act->societe->id) + { + $result=$societe->fetch($act->societe->id); + } + $act->societe = $societe; + if ($act->author->id > 0) $res=$act->author->fetch(); // Le parametre est le login, hors seul l'id est charge. if ($act->usermod->id > 0) $res=$act->usermod->fetch(); if ($act->usertodo->id > 0) $res=$act->usertodo->fetch(); if ($act->userdone->id > 0) $res=$act->userdone->fetch(); - $res=$act->contact->fetch($act->contact->id); + $contact = new Contact($db); + if ($act->contact->id) + { + $result=$contact->fetch($act->contact->id,$user); + } + $act->contact = $contact; /* * Affichage onglets diff --git a/htdocs/contact.class.php b/htdocs/contact.class.php index f12f8acd9149d0b2c2174ea56d5584b4dcd2baca..74ca09a0667969f348dcc2445d87c3db744a8991 100644 --- a/htdocs/contact.class.php +++ b/htdocs/contact.class.php @@ -443,8 +443,8 @@ class Contact extends CommonObject } else { - dolibarr_syslog("Error in Contact::fetch() selectuser sql=$sql"); - $this->error="Error in Contact::fetch() selectuser - ".$this->db->error()." - ".$sql; + $this->error=$this->db->error(); + dolibarr_syslog("Contact::fetch ".$this->error, LOG_ERR); return -1; } @@ -453,7 +453,7 @@ class Contact extends CommonObject { $sql = "SELECT fk_user"; $sql .= " FROM ".MAIN_DB_PREFIX."user_alert"; - $sql .= " WHERE fk_user = $user->id AND fk_contact = ".$id; + $sql .= " WHERE fk_user = ".$user->id." AND fk_contact = ".$id; $resql=$this->db->query($sql); if ($resql) @@ -468,8 +468,8 @@ class Contact extends CommonObject } else { - dolibarr_syslog("Error in Contact::fetch() selectuseralert sql=$sql"); - $this->error="Error in Contact::fetch() selectuseralert - ".$this->db->error()." - ".$sql; + $this->error=$this->db->error(); + dolibarr_syslog("Contact::fetch ".$this->error, LOG_ERR); return -1; } } @@ -484,8 +484,8 @@ class Contact extends CommonObject } else { - dolibarr_syslog("Error in Contact::fetch() selectsocpeople sql=$sql"); - $this->error="Error in Contact::fetch() selectsocpeople - ".$this->db->error()." - ".$sql; + $this->error=$this->db->error(); + dolibarr_syslog("Contact::fetch ".$this->error, LOG_ERR); return -1; } }