Exemple #1
0
 /**
  * This function sets the default values for the form. Note that in edit/view mode
  * the default values are retrieved from the database
  * 
  * @param null
  * 
  * @return array   array of default values
  * @access public
  */
 function setDefaultValues()
 {
     $defaults = array('is_active' => true);
     if ($this->_sid) {
         $params = array('id' => $this->_sid);
         CRM_Price_BAO_Set::retrieve($params, $defaults);
         $extends = explode(CRM_Core_DAO::VALUE_SEPARATOR, $defaults['extends']);
         unset($defaults['extends']);
         foreach ($extends as $compId) {
             $defaults['extends'][$compId] = 1;
         }
     }
     return $defaults;
 }
Exemple #2
0
 /**
  * This function sets the default values for the form. Note that in edit/view mode
  * the default values are retrieved from the database
  * 
  * @param null
  * 
  * @return array   array of default values
  * @access public
  */
 function setDefaultValues()
 {
     $defaults = array();
     if (isset($this->_sid)) {
         $params = array('id' => $this->_sid);
         CRM_Price_BAO_Set::retrieve($params, $defaults);
         $extends = explode(',', $defaults['extends']);
         unset($defaults['extends']);
         foreach ($extends as $v) {
             $defaults['extends'][$v] = 1;
         }
     } else {
         $defaults['is_active'] = 1;
     }
     return $defaults;
 }