/** * View details of a note * * @return void * @access public */ function view() { $note = new CRM_Core_DAO_Note(); $note->id = $this->_id; if ($note->find(true)) { $values = array(); CRM_Core_DAO::storeValues($note, $values); $values['privacy'] = CRM_Core_OptionGroup::optionLabel('note_privacy', $values['privacy']); $this->assign('note', $values); } $comments = CRM_Core_BAO_Note::getNoteTree($values['id'], 1); if (!empty($comments)) { $this->assign('comments', $comments); } }
/** * View details of a note * * @return void * @access public */ function view() { $note = new CRM_Core_DAO_Note(); $note->id = $this->_id; if ($note->find(TRUE)) { $values = array(); CRM_Core_DAO::storeValues($note, $values); $values['privacy'] = CRM_Core_OptionGroup::optionLabel('note_privacy', $values['privacy']); $this->assign('note', $values); } $comments = CRM_Core_BAO_Note::getNoteTree($values['id'], 1); if (!empty($comments)) { $this->assign('comments', $comments); } // add attachments part $currentAttachmentInfo = CRM_Core_BAO_File::getEntityFile('civicrm_note', $this->_id); $this->assign('currentAttachmentInfo', $currentAttachmentInfo); }
/** * Get all descendents of given note * * @param array $params Associative array; only required 'id' parameter is used * * @return array Nested associative array beginning with direct children of given note. */ function &civicrm_api3_note_tree_get($params) { civicrm_api3_verify_mandatory($params, NULL, array('id')); if (!is_numeric($params['id'])) { return civicrm_api3_create_error(ts("Invalid note ID")); } if (!isset($params['max_depth'])) { $params['max_depth'] = 0; } if (!isset($params['snippet'])) { $params['snippet'] = FALSE; } $noteTree = CRM_Core_BAO_Note::getNoteTree($params['id'], $params['max_depth'], $params['snippet']); return civicrm_api3_create_success($noteTree, $params); }
/** * Get all descendents of given note * * @param array $params Associative array; only required 'id' parameter is used * * @return array Nested associative array beginning with direct children of given note. */ function &civicrm_note_tree_get(&$params) { if (empty($params)) { return civicrm_create_error(ts('No input parameters present')); } if (!is_array($params)) { return civicrm_create_error(ts('Input parameters is not an array')); } if (!isset($params['id'])) { return civicrm_create_error('Required parameter ("id") missing.'); } if (!is_numeric($params['id'])) { return civicrm_create_error(ts("Invalid note ID")); } if (!isset($params['max_depth'])) { $params['max_depth'] = 0; } if (!isset($params['snippet'])) { $params['snippet'] = FALSE; } $noteTree = CRM_Core_BAO_Note::getNoteTree($params['id'], $params['max_depth'], $params['snippet']); return $noteTree; }