From bc2342e9a4aeae2992721ea58ca52981253b9b78 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@destailleur.fr>
Date: Mon, 24 Oct 2016 17:37:39 +0200
Subject: [PATCH] Fix bad link

---
 htdocs/core/lib/project.lib.php    | 2 +-
 htdocs/projet/class/task.class.php | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php
index cb78502f78f..d009ac793a0 100644
--- a/htdocs/core/lib/project.lib.php
+++ b/htdocs/core/lib/project.lib.php
@@ -840,7 +840,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
 				{
 				    // Thirdparty
 				    print '<td class="nowrap">';
-				    $thirdpartystatic->id=$lines[$i]->socid;
+				    $thirdpartystatic->id=$lines[$i]->thirdparty_id;
 				    $thirdpartystatic->name=$lines[$i]->thirdparty_name;
 				    print $thirdpartystatic->getNomUrl(1, 'project', 10);
 				    print '</td>';
diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php
index f9220b6e555..e5b7a3f3031 100644
--- a/htdocs/projet/class/task.class.php
+++ b/htdocs/projet/class/task.class.php
@@ -575,7 +575,7 @@ class Task extends CommonObject
         $sql = "SELECT p.rowid as projectid, p.ref, p.title as plabel, p.public, p.fk_statut as projectstatus,";
         $sql.= " t.rowid as taskid, t.ref as taskref, t.label, t.description, t.fk_task_parent, t.duration_effective, t.progress, t.fk_statut as status,";
         $sql.= " t.dateo as date_start, t.datee as date_end, t.planned_workload, t.rang,";
-        $sql.= " s.nom as thirdparty_name";
+        $sql.= " s.rowid as thirdparty_id, s.nom as thirdparty_name";
         $sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
         $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON p.fk_soc = s.rowid";
         if ($mode == 0)
@@ -692,6 +692,7 @@ class Task extends CommonObject
                     $tasks[$i]->date_end		= $this->db->jdate($obj->date_end);
                     $tasks[$i]->rang	   		= $obj->rang;
                     
+                    $tasks[$i]->thirdparty_id	= $obj->thirdparty_id;
                     $tasks[$i]->thirdparty_name	= $obj->thirdparty_name;
                 }
 
-- 
GitLab