Skip to content

Commit

Permalink
object tasks: priority is fetch but not updated and others... (#29340)
Browse files Browse the repository at this point in the history
* priority is fetch but not updated and others...

* insert too
  • Loading branch information
rycks committed Apr 13, 2024
1 parent 22244a9 commit 2a93168
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions htdocs/projet/class/task.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ public function create($user, $notrigger = 0)
$sql .= ", datee";
$sql .= ", planned_workload";
$sql .= ", progress";
$sql .= ", priority";
$sql .= ") VALUES (";
$sql .= ((int) $conf->entity);
$sql .= ", ".((int) $this->fk_project);
Expand All @@ -185,6 +186,7 @@ public function create($user, $notrigger = 0)
$sql .= ", ".($this->date_end ? "'".$this->db->idate($this->date_end)."'" : 'null');
$sql .= ", ".(($this->planned_workload != '' && $this->planned_workload >= 0) ? $this->planned_workload : 'null');
$sql .= ", ".(($this->progress != '' && $this->progress >= 0) ? $this->progress : 'null');
$sql .= ", ".(($this->priority != '' && $this->priority >= 0) ? $this->priority : 'null');
$sql .= ")";

$this->db->begin();
Expand Down Expand Up @@ -383,6 +385,7 @@ public function update($user = null, $notrigger = 0)
$sql .= " datee=".($this->date_end != '' ? "'".$this->db->idate($this->date_end)."'" : 'null').",";
$sql .= " progress=".(($this->progress != '' && $this->progress >= 0) ? $this->progress : 'null').",";
$sql .= " rang=".((!empty($this->rang)) ? $this->rang : "0");
$sql .= " priority=".((!empty($this->priority)) ? $this->priority : "0");
$sql .= " WHERE rowid=".((int) $this->id);

$this->db->begin();
Expand Down Expand Up @@ -751,6 +754,7 @@ public function initAsSpecimen()
$this->duration_effective = '';
$this->fk_user_creat = null;
$this->progress = '25';
$this->priority = 0;
$this->fk_statut = null;
$this->note = 'This is a specimen task not';
}
Expand Down Expand Up @@ -790,7 +794,7 @@ public function getTasksArray($usert = null, $userp = null, $projectid = 0, $soc
}
$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.fk_statut as status,";
$sql .= " t.dateo as date_start, t.datee as date_end, t.planned_workload, t.rang,";
$sql .= " t.dateo as date_start, t.datee as date_end, t.planned_workload, t.rang, t.priority";
$sql .= " t.description, ";
$sql .= " s.rowid as thirdparty_id, s.nom as thirdparty_name, s.email as thirdparty_email,";
$sql .= " p.fk_opp_status, p.opp_amount, p.opp_percent, p.budget_amount";
Expand Down Expand Up @@ -896,7 +900,7 @@ public function getTasksArray($usert = null, $userp = null, $projectid = 0, $soc
$sql .= " GROUP BY p.rowid, p.ref, p.title, p.public, p.fk_statut, p.usage_bill_time,";
$sql .= " t.datec, t.dateo, t.datee, t.tms,";
$sql .= " t.rowid, t.ref, t.label, t.description, t.fk_task_parent, t.duration_effective, t.progress, t.fk_statut,";
$sql .= " t.dateo, t.datee, t.planned_workload, t.rang,";
$sql .= " t.dateo, t.datee, t.planned_workload, t.rang, t.priority";
$sql .= " t.description, ";
$sql .= " s.rowid, s.nom, s.email,";
$sql .= " p.fk_opp_status, p.opp_amount, p.opp_percent, p.budget_amount";
Expand Down Expand Up @@ -971,6 +975,7 @@ public function getTasksArray($usert = null, $userp = null, $projectid = 0, $soc
$tasks[$i]->date_start = $this->db->jdate($obj->date_start);
$tasks[$i]->date_end = $this->db->jdate($obj->date_end);
$tasks[$i]->rang = $obj->rang;
$tasks[$i]->priority = $obj->priority;

$tasks[$i]->socid = $obj->thirdparty_id; // For backward compatibility
$tasks[$i]->thirdparty_id = $obj->thirdparty_id;
Expand Down Expand Up @@ -1712,6 +1717,7 @@ public function createFromClone(User $user, $fromid, $project_id, $parent_task_i
$clone_task->date_c = $datec;
$clone_task->planned_workload = $origin_task->planned_workload;
$clone_task->rang = $origin_task->rang;
$clone_task->priority = $origin_task->priority;

//Manage Task Date
if ($clone_change_dt) {
Expand Down

0 comments on commit 2a93168

Please sign in to comment.