本文整理汇总了PHP中CRM_Contact_BAO_Contact::allowEditSubtype方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contact_BAO_Contact::allowEditSubtype方法的具体用法?PHP CRM_Contact_BAO_Contact::allowEditSubtype怎么用?PHP CRM_Contact_BAO_Contact::allowEditSubtype使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Contact_BAO_Contact
的用法示例。
在下文中一共展示了CRM_Contact_BAO_Contact::allowEditSubtype方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildQuickForm
/**
* Function to actually build the form
*
* @return None
* @access public
*/
public function buildQuickForm()
{
//load form for child blocks
if ($this->_addBlockName) {
require_once str_replace('_', DIRECTORY_SEPARATOR, "CRM_Contact_Form_Edit_" . $this->_addBlockName) . ".php";
return eval('CRM_Contact_Form_Edit_' . $this->_addBlockName . '::buildQuickForm( $this );');
}
//build contact type specific fields
require_once str_replace('_', DIRECTORY_SEPARATOR, "CRM_Contact_Form_Edit_" . $this->_contactType) . ".php";
eval('CRM_Contact_Form_Edit_' . $this->_contactType . '::buildQuickForm( $this, $this->_action );');
// subtype is a common field. lets keep it here
require_once 'CRM/Contact/BAO/ContactType.php';
$subtypes = CRM_Contact_BAO_ContactType::subTypePairs($this->_contactType);
if (!empty($subtypes)) {
$subtypeElem =& $this->addElement('select', 'contact_sub_type', ts('Subtype'), array('' => '') + $subtypes);
}
$allowEditSubType = true;
if ($this->_contactId) {
$allowEditSubType = CRM_Contact_BAO_Contact::allowEditSubtype($this->_contactId, $this->_contactSubType, $this->_groupTree);
}
$this->assign('allowEditSubType', $allowEditSubType);
// build edit blocks ( custom data, demographics, communication preference, notes, tags and groups )
foreach ($this->_editOptions as $name => $label) {
if ($name == 'Address') {
$this->_blocks['Address'] = $this->_editOptions['Address'];
continue;
}
require_once str_replace('_', DIRECTORY_SEPARATOR, "CRM_Contact_Form_Edit_" . $name) . ".php";
eval('CRM_Contact_Form_Edit_' . $name . '::buildQuickForm( $this );');
}
// build location blocks.
CRM_Contact_Form_Location::buildQuickForm($this);
// add the dedupe button
$this->addElement('submit', $this->_dedupeButtonName, ts('Check for Matching Contact(s)'));
$this->addElement('submit', $this->_duplicateButtonName, ts('Save Matching Contact'));
$this->addElement('submit', $this->getButtonName('next', 'sharedHouseholdDuplicate'), ts('Save With Duplicate Household'));
$this->addButtons(array(array('type' => 'upload', 'name' => ts('Save'), 'subName' => 'view', 'isDefault' => true), array('type' => 'upload', 'name' => ts('Save and New'), 'subName' => 'new'), array('type' => 'cancel', 'name' => ts('Cancel'))));
}