Handle tags and tasks move/duplication to another project

This commit is contained in:
Frederic Guillot
2016-07-02 14:44:26 -04:00
parent 853189a43f
commit 3fcc0cb918
19 changed files with 1121 additions and 777 deletions

View File

@@ -19,6 +19,23 @@ class TaskTagModel extends Base
*/
const TABLE = 'task_has_tags';
/**
* Get all tags not available in a project
*
* @access public
* @param integer $task_id
* @param integer $project_id
* @return array
*/
public function getTagIdsByTaskNotAvailableInProject($task_id, $project_id)
{
return $this->db->table(TagModel::TABLE)
->eq(self::TABLE.'.task_id', $task_id)
->notIn(TagModel::TABLE.'.project_id', array(0, $project_id))
->join(self::TABLE, 'tag_id', 'id')
->findAllByColumn(TagModel::TABLE.'.id');
}
/**
* Get all tags associated to a task
*