Skip to content
Snippets Groups Projects
Commit 985826e6 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix: Fetch of third party and contact for action

parent 07b08d07
Branches
Tags
No related merge requests found
......@@ -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;
......
......@@ -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
......
......@@ -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;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment