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


PHP CRM_PCP_BAO_PCP::buildPCPForm方法代碼示例

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


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

示例1: buildQuickForm

 /**
  * Build the form object.
  *
  * @return void
  */
 public function buildQuickForm()
 {
     CRM_PCP_BAO_PCP::buildPCPForm($this);
     $this->addElement('checkbox', 'pcp_active', ts('Enable Personal Campaign Pages? (for this event)'), NULL, array('onclick' => "return showHideByValue('pcp_active',true,'pcpFields','table-row','radio',false);"));
     $this->add('select', 'target_entity_type', ts('Campaign Type'), array('' => ts('- select -'), 'event' => ts('Event'), 'contribute' => ts('Contribution')), NULL, array('onchange' => "return showHideByValue('target_entity_type','contribute','pcpDetailFields','block','select',false);"));
     $this->add('select', 'target_entity_id', ts('Online Contribution Page'), array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::contributionPage());
     parent::buildQuickForm();
     // If at least one PCP has been created, don't allow changing the target
     $pcpBlock = new CRM_PCP_DAO_PCPBlock();
     $pcpBlock->entity_table = 'civicrm_event';
     $pcpBlock->entity_id = $this->_id;
     $pcpBlock->find(TRUE);
     if (!empty($pcpBlock->id) && CRM_PCP_BAO_PCP::getPcpBlockInUse($pcpBlock->id)) {
         foreach (array('target_entity_type', 'target_entity_id') as $element_name) {
             $element = $this->getElement($element_name);
             $element->freeze();
         }
     }
     $this->addFormRule(array('CRM_PCP_Form_Event', 'formRule'), $this);
 }
開發者ID:kidaa30,項目名稱:yes,代碼行數:25,代碼來源:Event.php

示例2: buildQuickForm

 /**
  * Function to build the form
  *
  * @return void
  * @access public
  */
 public function buildQuickForm()
 {
     CRM_PCP_BAO_PCP::buildPCPForm($this);
     $this->addElement('checkbox', 'pcp_active', ts('Enable Personal Campaign Pages? (for this contribution page)'), NULL, array('onclick' => "return showHideByValue('pcp_active',true,'pcpFields','table-row','radio',false);"));
     parent::buildQuickForm();
     $this->addFormRule(array('CRM_PCP_Form_Contribute', 'formRule'), $this);
 }
開發者ID:archcidburnziso,項目名稱:civicrm-core,代碼行數:13,代碼來源:Contribute.php


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