本文整理汇总了PHP中CRM_PCP_BAO_PCP::getPcpBlockInUse方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_PCP_BAO_PCP::getPcpBlockInUse方法的具体用法?PHP CRM_PCP_BAO_PCP::getPcpBlockInUse怎么用?PHP CRM_PCP_BAO_PCP::getPcpBlockInUse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_PCP_BAO_PCP
的用法示例。
在下文中一共展示了CRM_PCP_BAO_PCP::getPcpBlockInUse方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}