'key', 'type' => 'string', 'content' => 'longstring', 'issue' => 'int' ); public $links = array( 'issue' => 'IssueReport' ); public static function types($key=null){ $types = array( TYPE_COMMENT => array('label' => 'Commentaire','icon' => 'fas fa-comment','color' => '#cecece'), TYPE_STATE => array('label' => 'Changement d\'état','icon' => 'fas fa-comment','color' => '#cecece'), TYPE_ASSIGNATION => array('label' => 'Nouvelle assignation','icon' => 'fas fa-comment','color' => '#cecece'), TYPE_TAG => array('label' => 'Modification tags','icon' => 'fas fa-comment','color' => '#cecece'), ); $default = array('label' => ' - ','icon' => 'fas fa-comment','color' => '#cecece'); if(!isset($key)) return $types; return isset($types[$key]) ? $types[$key] : $default; } public function dir($relativePath = false){ return ($relativePath ? '' : File::dir()).'issue'.SLASH.'attachments'.SLASH.$this->id; } public function remove(){ self::deleteById($this->id); //supression des pieces jointes if(file_exists($this->dir())) delete_folder_tree($this->dir(),true); } } ?>