示例#1
0
文件: Note.php 项目: ksecor/civicrm
 /**
  * This function sets the default values for the form. Note that in edit/view mode
  * the default values are retrieved from the database
  * 
  * @access public
  * @return None
  */
 function setDefaultValues()
 {
     $defaults = array();
     if ($this->_action & CRM_Core_Action::UPDATE) {
         if (isset($this->_id)) {
             $defaults['note'] = CRM_Core_BAO_Note::getNoteText($this->_id);
             $defaults['subject'] = CRM_Core_BAO_Note::getNoteSubject($this->_id);
         }
     }
     return $defaults;
 }
 /**
  * This function sets the default values for the form. Note that in edit/view mode
  * the default values are retrieved from the database
  *
  * @access public
  *
  * @return None
  */
 function setDefaultValues()
 {
     $defaults = array();
     if ($this->_action & CRM_Core_Action::UPDATE) {
         if (isset($this->_id)) {
             $params['id'] = $this->_id;
             CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_Note', $params, $defaults);
         }
         if ($defaults['entity_table'] == 'civicrm_note') {
             $defaults['parent_id'] = $defaults['entity_id'];
         }
     } elseif ($this->_action & CRM_Core_Action::ADD && $this->_parentId) {
         $defaults['parent_id'] = $this->_parentId;
         $defaults['subject'] = 'Re: ' . CRM_Core_BAO_Note::getNoteSubject($this->_parentId);
     }
     return $defaults;
 }