Add the possibility to make tags global from project settings

This commit is contained in:
Timo
2020-02-11 04:48:51 +01:00
committed by GitHub
parent f3945471b5
commit 2c98be3ead
6 changed files with 63 additions and 5 deletions

View File

@@ -160,12 +160,20 @@ class TagModel extends Base
* @param string $tag
* @return bool
*/
public function update($tag_id, $tag, $color_id = null)
public function update($tag_id, $tag, $color_id = null, $project_id = null)
{
return $this->db->table(self::TABLE)->eq('id', $tag_id)->update(array(
'name' => $tag,
'color_id' => $color_id,
));
if($project_id !== null){
return $this->db->table(self::TABLE)->eq('id', $tag_id)->update(array(
'name' => $tag,
'color_id' => $color_id,
'project_id' => $project_id
));
} else {
return $this->db->table(self::TABLE)->eq('id', $tag_id)->update(array(
'name' => $tag,
'color_id' => $color_id
));
}
}
/**