當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CRM_Core_Form::setDefaultValues方法代碼示例

本文整理匯總了PHP中CRM_Core_Form::setDefaultValues方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_Core_Form::setDefaultValues方法的具體用法?PHP CRM_Core_Form::setDefaultValues怎麽用?PHP CRM_Core_Form::setDefaultValues使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CRM_Core_Form的用法示例。


在下文中一共展示了CRM_Core_Form::setDefaultValues方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setDefaultValues

 function setDefaultValues()
 {
     $defaults = parent::setDefaultValues();
     $group = "CiviCRM Mobile";
     $defaults['ind_profile_id'] = CRM_Core_BAO_Setting::getItem($group, 'ind_profile_id');
     $defaults['org_profile_id'] = CRM_Core_BAO_Setting::getItem($group, 'org_profile_id');
     $defaults['house_profile_id'] = CRM_Core_BAO_Setting::getItem($group, 'house_profile_id');
     return $defaults;
 }
開發者ID:jagrutiP,項目名稱:com.webaccessglobal.module.civimobile,代碼行數:9,代碼來源:Settings.php

示例2: setDefaultValues

 public function setDefaultValues()
 {
     $defaults = parent::setDefaultValues();
     if ($this->id) {
         $config = CRM_Chapters_AutomatchConfig::singelton();
         $sql = "SELECT id, `" . $config->getMatchTypeField('column_name') . "` AS `type`, `" . $config->getCountryField('column_name') . "` AS `country`, `" . $config->getZipCodeRangeFromField('column_name') . "` AS `zipcode_from`, `" . $config->getZipCodeRangeToField('column_name') . "` AS `zipcode_to` FROM `" . $config->getCustomGroup('table_name') . "` WHERE id = %1";
         $params[1] = array($this->id, 'Integer');
         $dao = CRM_Core_DAO::executeQuery($sql, $params);
         if ($dao->fetch()) {
             $defaults['type'] = $dao->type;
             $defaults['country'] = $dao->country;
             $defaults['zipcode_from'] = $dao->zipcode_from;
             $defaults['zipcode_to'] = $dao->zipcode_to;
         }
     }
     return $defaults;
 }
開發者ID:CiviCooP,項目名稱:net.emphanos.iida.chapters,代碼行數:17,代碼來源:AutomatchChapters.php

示例3: setDefaultValues

 function setDefaultValues()
 {
     $defaults = array();
     $defaults = parent::setDefaultValues();
     if ($this->_action & CRM_Core_Action::DELETE) {
         return $defaults;
     }
     $params['id'] = $this->_id;
     if ($this->_noteId) {
         $defaults['note'] = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Note', $this->_noteId, 'note');
     }
     if ($this->_id) {
         CRM_Grant_BAO_Grant::retrieve($params, $defaults);
         // fix the display of the monetary value, CRM-4038
         require_once 'CRM/Utils/Money.php';
         if (isset($defaults['amount_total'])) {
             $defaults['amount_total'] = CRM_Utils_Money::format($defaults['amount_total'], null, '%a');
         }
         if (isset($defaults['amount_requested'])) {
             $defaults['amount_requested'] = CRM_Utils_Money::format($defaults['amount_requested'], null, '%a');
         }
         if (isset($defaults['amount_granted'])) {
             $defaults['amount_granted'] = CRM_Utils_Money::format($defaults['amount_granted'], null, '%a');
         }
         $dates = array('application_received_date', 'decision_date', 'money_transfer_date', 'grant_due_date');
         foreach ($dates as $key) {
             if (CRM_Utils_Array::value($key, $defaults)) {
                 list($defaults[$key]) = CRM_Utils_Date::setDateDefaults($defaults[$key]);
             }
         }
     } else {
         require_once 'CRM/Utils/Date.php';
         list($defaults['application_received_date']) = CRM_Utils_Date::setDateDefaults();
     }
     // custom data set defaults
     $defaults += CRM_Custom_Form_Customdata::setDefaultValues($this);
     return $defaults;
 }
開發者ID:hampelm,項目名稱:Ginsberg-CiviDemo,代碼行數:38,代碼來源:Grant.php

示例4: setDefaultValues

 function setDefaultValues()
 {
     $defaults = parent::setDefaultValues();
     $custom = sumfields_get_custom_field_definitions();
     $active_fields = sumfields_get_setting('active_fields', array());
     $active_fundraising_fields = array();
     $active_membership_fields = array();
     $active_event_standard_fields = array();
     $active_event_turnout_fields = array();
     while (list($field, $field_info) = each($custom['fields'])) {
         if (in_array($field, $active_fields)) {
             if ($field_info['display'] == 'fundraising') {
                 $active_fundraising_fields[] = $field;
             } elseif ($field_info['display'] == 'membership') {
                 $active_membership_fields[] = $field;
             } elseif ($field_info['display'] == 'event_standard') {
                 $active_event_standard_fields[] = $field;
             } elseif ($field_info['display'] == 'event_turnout') {
                 $active_event_turnout_fields[] = $field;
             }
         }
     }
     $defaults['active_fundraising_fields'] = $this->array_to_options($active_fundraising_fields);
     $defaults['active_membership_fields'] = $this->array_to_options($active_membership_fields);
     $defaults['active_event_standard_fields'] = $this->array_to_options($active_event_standard_fields);
     $defaults['active_event_turnout_fields'] = $this->array_to_options($active_event_turnout_fields);
     $defaults['active_fields'] = $this->array_to_options(sumfields_get_setting('active_fields', array()));
     $defaults['financial_type_ids'] = $this->array_to_options(sumfields_get_setting('financial_type_ids', array()));
     $defaults['membership_financial_type_ids'] = $this->array_to_options(sumfields_get_setting('membership_financial_type_ids', array()));
     $defaults['event_type_ids'] = $this->array_to_options(sumfields_get_setting('event_type_ids', array()));
     $defaults['participant_status_ids'] = $this->array_to_options(sumfields_get_setting('participant_status_ids', array()));
     $defaults['participant_noshow_status_ids'] = $this->array_to_options(sumfields_get_setting('participant_noshow_status_ids', array()));
     $defaults['when_to_apply_change'] = 'via_cron';
     return $defaults;
 }
開發者ID:bkaless,項目名稱:net.ourpowerbase.sumfields,代碼行數:35,代碼來源:SumFields.php

示例5: setDefaultValues

 /**
  * @return array
  */
 public function setDefaultValues()
 {
     if ($this->_cdType) {
         return CRM_Custom_Form_CustomData::setDefaultValues($this);
     }
     $defaults = parent::setDefaultValues();
     if ($this->_action & CRM_Core_Action::DELETE) {
         return $defaults;
     }
     $params['id'] = $this->_id;
     if ($this->_noteId) {
         $defaults['note'] = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Note', $this->_noteId, 'note');
     }
     if ($this->_id) {
         CRM_Grant_BAO_Grant::retrieve($params, $defaults);
         // fix the display of the monetary value, CRM-4038
         if (isset($defaults['amount_total'])) {
             $defaults['amount_total'] = CRM_Utils_Money::format($defaults['amount_total'], NULL, '%a');
         }
         if (isset($defaults['amount_requested'])) {
             $defaults['amount_requested'] = CRM_Utils_Money::format($defaults['amount_requested'], NULL, '%a');
         }
         if (isset($defaults['amount_granted'])) {
             $defaults['amount_granted'] = CRM_Utils_Money::format($defaults['amount_granted'], NULL, '%a');
         }
         $dates = array('application_received_date', 'decision_date', 'money_transfer_date', 'grant_due_date');
         foreach ($dates as $key) {
             if (!empty($defaults[$key])) {
                 list($defaults[$key]) = CRM_Utils_Date::setDateDefaults($defaults[$key]);
             }
         }
     } else {
         list($defaults['application_received_date']) = CRM_Utils_Date::setDateDefaults();
     }
     return $defaults;
 }
開發者ID:vakeesan26,項目名稱:civicrm-core,代碼行數:39,代碼來源:Grant.php


注:本文中的CRM_Core_Form::setDefaultValues方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。