Added tag modification from the user interface

This commit is contained in:
Frederic Guillot
2016-06-24 22:10:14 -04:00
parent cead21691e
commit ce367a24fc
18 changed files with 527 additions and 2 deletions

View File

@@ -93,6 +93,29 @@ class TagModel extends Base
->findOneColumn('id');
}
/**
* Return true if the tag exists
*
* @access public
* @param integer $project_id
* @param string $tag
* @param integer $tag_id
* @return boolean
*/
public function exists($project_id, $tag, $tag_id = 0)
{
return $this->db
->table(self::TABLE)
->neq('id', $tag_id)
->beginOr()
->eq('project_id', 0)
->eq('project_id', $project_id)
->closeOr()
->ilike('name', $tag)
->asc('project_id')
->exists();
}
/**
* Return tag id and create a new tag if necessary
*