Add drag and drop to change column positions

This commit is contained in:
Frederic Guillot
2016-02-20 11:24:43 -05:00
parent 2d27c36a71
commit c8c1242c26
13 changed files with 226 additions and 64 deletions

View File

@@ -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
*