예제 #1
0
 /**
  * @see ProjectInterface::get_sub_folder()
  * @param integer $folder_id Folder-ID
  * @param integer $gid 
  * @param integer $status_id
  * @return string Sub-Folder-Path
  */
 public function get_sub_folder($gid, $status_id)
 {
     if ($this->project_id and $this->project) {
         if (is_numeric($gid) and is_numeric($status_id)) {
             $folder_id = ProjectStatusFolder::get_folder_by_project_id_and_project_status_id($this->project_id, $status_id);
             $folder = Folder::get_instance($folder_id);
             $project_template = new ProjectTemplate($this->project->get_template_id());
             $attribute_array = $project_template->get_gid_attributes($gid, $status_id);
             if ($attribute_array['folder']) {
                 $folder_name = strtolower(trim($attribute_array['folder']));
                 $folder_name = str_replace(" ", "-", $folder_name);
                 $folder_path = new Path($folder->get_path());
                 $folder_path->add_element($folder_name);
                 return Folder::get_folder_by_path($folder_path->get_path_string());
             } else {
                 return null;
             }
         } else {
             return null;
         }
     } else {
         return null;
     }
 }
예제 #2
0
 /**
  * @see ProjectItemInterface::is_classified()
  * @return bool
  */
 public function is_classified()
 {
     if ($this->project and $this->status_id and is_numeric($this->gid)) {
         $project_template = new ProjectTemplate($this->project->get_template_id());
         if (is_array($attribute_array = $project_template->get_gid_attributes($this->gid, $this->status_id))) {
             if ($attribute_array['class']) {
                 if ($attribute_array['classify'] == "force") {
                     return $attribute_array['class'];
                 } else {
                     return false;
                 }
             } else {
                 return false;
             }
         } else {
             return false;
         }
     } else {
         return false;
     }
 }