Add drag and drop to change column positions
This commit is contained in:
@@ -262,27 +262,6 @@ class Subtask extends Base
|
||||
return $this->db->table(self::TABLE)->eq('task_id', $task_id)->update(array('status' => self::STATUS_DONE));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get subtasks with consecutive positions
|
||||
*
|
||||
* If you remove a subtask, the positions are not anymore consecutives
|
||||
*
|
||||
* @access public
|
||||
* @param integer $task_id
|
||||
* @return array
|
||||
*/
|
||||
public function getNormalizedPositions($task_id)
|
||||
{
|
||||
$subtasks = $this->db->hashtable(self::TABLE)->eq('task_id', $task_id)->asc('position')->getAll('id', 'position');
|
||||
$position = 1;
|
||||
|
||||
foreach ($subtasks as $subtask_id => $subtask_position) {
|
||||
$subtasks[$subtask_id] = $position++;
|
||||
}
|
||||
|
||||
return $subtasks;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save subtask position
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user