Sort columns by due date
This commit is contained in:
@@ -61,6 +61,23 @@ class TaskReorderModel extends Base
|
||||
$this->db->closeTransaction();
|
||||
}
|
||||
|
||||
public function reorderByDueDate($projectID, $swimlaneID, $columnID, $direction)
|
||||
{
|
||||
$this->db->startTransaction();
|
||||
|
||||
$taskIDs = $this->db->table(TaskModel::TABLE)
|
||||
->eq('project_id', $projectID)
|
||||
->eq('swimlane_id', $swimlaneID)
|
||||
->eq('column_id', $columnID)
|
||||
->orderBy('date_due', $direction)
|
||||
->asc('id')
|
||||
->findAllByColumn('id');
|
||||
|
||||
$this->reorderTasks($taskIDs);
|
||||
|
||||
$this->db->closeTransaction();
|
||||
}
|
||||
|
||||
protected function reorderTasks(array $taskIDs)
|
||||
{
|
||||
$i = 1;
|
||||
|
||||
Reference in New Issue
Block a user