/**
  * Get project forms that are in relation with this message
  *
  * @param void
  * @return array
  */
 function getRelatedForms()
 {
     if (is_null($this->related_forms)) {
         $this->related_forms = ProjectForms::findAll(array('conditions' => '`action` = ' . DB::escape(ProjectForm::ADD_COMMENT_ACTION) . ' AND `in_object_id` = ' . DB::escape($this->getId()), 'order' => '`order`'));
         // findAll
     }
     // if
     return $this->related_forms;
 }
Example #2
0
 /**
  * Return only visible project forms
  *
  * @param void
  * @return null
  */
 function getVisibleForms($only_enabled = false)
 {
     $conditions = '`project_id` = ' . DB::escape($this->getId());
     if ($only_enabled) {
         $conditions .= ' AND `is_enabled` = ' . DB::escape(true);
     }
     // if
     return ProjectForms::findAll(array('conditions' => $conditions, 'order' => '`order`'));
     // findAll
 }
 /**
  * Get project forms that are in relation with this message
  *
  * @param void
  * @return array
  */
 function getRelatedForms()
 {
     trace(__FILE__, 'getRelatedForms()');
     if (!plugin_active('form')) {
         return null;
     }
     if (is_null($this->related_forms)) {
         $this->related_forms = ProjectForms::findAll(array('conditions' => '`action` = ' . DB::escape(ProjectForm::ADD_COMMENT_ACTION) . ' AND `in_object_id` = ' . DB::escape($this->getId()), 'order' => '`order`'));
         // findAll
     }
     // if
     return $this->related_forms;
 }