From 64ddc9c9ae15acb2ee0077ac9b4af60586723c52 Mon Sep 17 00:00:00 2001 From: evarisk-micka Date: Fri, 9 Feb 2024 16:42:07 +0100 Subject: [PATCH] FIX select fk_statut as status and fill both with obj->status --- htdocs/projet/class/task.class.php | 11 +++++++---- htdocs/projet/tasks/list.php | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index f0c29d303530f..e1a0d183b19b8 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -370,7 +370,7 @@ public function fetch($id, $ref = '', $loadparentdata = 0) $sql .= " t.datee as date_end,"; $sql .= " t.fk_user_creat,"; $sql .= " t.fk_user_valid,"; - $sql .= " t.status,"; + $sql .= " t.fk_status as status,"; $sql .= " t.progress,"; $sql .= " t.budget_amount,"; $sql .= " t.priority,"; @@ -415,6 +415,7 @@ public function fetch($id, $ref = '', $loadparentdata = 0) $this->date_end = $this->db->jdate($obj->date_end); $this->fk_user_creat = $obj->fk_user_creat; $this->fk_user_valid = $obj->fk_user_valid; + $this->fk_statut = $obj->status; $this->status = $obj->status; $this->progress = $obj->progress; $this->budget_amount = $obj->budget_amount; @@ -960,7 +961,7 @@ public function getTasksArray($usert = null, $userp = null, $projectid = 0, $soc $sql .= " DISTINCT"; // We may get several time the same record if user has several roles on same project/task } $sql .= " p.rowid as projectid, p.ref, p.title as plabel, p.public, p.fk_statut as projectstatus, p.usage_bill_time,"; - $sql .= " t.rowid as taskid, t.ref as taskref, t.label, t.description, t.fk_task_parent, t.duration_effective, t.progress, t.status as status,"; + $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 .= " t.description, "; $sql .= " t.budget_amount, "; @@ -1154,7 +1155,8 @@ public function getTasksArray($usert = null, $userp = null, $projectid = 0, $soc } $tasks[$i]->progress = $obj->progress; - $tasks[$i]->status = $obj->status; + $tasks[$i]->fk_statut = $obj->status; + $tasks[$i]->status = $obj->status; $tasks[$i]->public = $obj->public; $tasks[$i]->date_start = $this->db->jdate($obj->date_start); $tasks[$i]->date_end = $this->db->jdate($obj->date_end); @@ -2316,7 +2318,7 @@ public function load_board($user) // List of tasks (does not care about permissions. Filtering will be done later) $sql = "SELECT p.rowid as projectid, p.fk_statut as projectstatus,"; - $sql .= " t.rowid as taskid, t.progress as progress, t.status as status,"; + $sql .= " t.rowid as taskid, t.progress as progress, t.fk_statut as status,"; $sql .= " t.dateo as date_start, t.datee as date_end"; $sql .= " FROM ".MAIN_DB_PREFIX."projet as p"; //$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid"; @@ -2355,6 +2357,7 @@ public function load_board($user) $task_static->projectstatus = $obj->projectstatus; $task_static->progress = $obj->progress; + $task_static->fk_statut = $obj->status; $task_static->status = $obj->status; $task_static->date_start = $this->db->jdate($obj->date_start); $task_static->date_end = $this->db->jdate($obj->date_end); diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 1c2c5056b2b4e..048ee9734cde8 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -346,7 +346,7 @@ $sql = "SELECT ".$distinct." p.rowid as projectid, p.ref as projectref, p.title as projecttitle, p.fk_statut as projectstatus, p.datee as projectdatee, p.fk_opp_status, p.public, p.fk_user_creat as projectusercreate, p.usage_bill_time,"; $sql .= " s.nom as name, s.name_alias as alias, s.rowid as socid,"; $sql .= " t.datec as date_creation, t.dateo as date_start, t.datee as date_end, t.tms as date_update,"; -$sql .= " t.rowid as id, t.ref, t.label, t.planned_workload, t.duration_effective, t.progress, t.status,"; +$sql .= " t.rowid as id, t.ref, t.label, t.planned_workload, t.duration_effective, t.progress, t.fk_statut as status,"; $sql .= " t.description, t.fk_task_parent"; $sql .= " ,t.budget_amount"; // Add sum fields