Skip to content

Commit

Permalink
FIX select fk_statut as status and fill both with obj->status
Browse files Browse the repository at this point in the history
  • Loading branch information
evarisk-micka committed Feb 9, 2024
1 parent 8e58b45 commit 516a479
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions htdocs/projet/class/task.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,";
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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, ";
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 516a479

Please sign in to comment.