本文整理汇总了PHP中CRM_Core_BAO_CustomGroup::getMultipleFieldGroup方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_BAO_CustomGroup::getMultipleFieldGroup方法的具体用法?PHP CRM_Core_BAO_CustomGroup::getMultipleFieldGroup怎么用?PHP CRM_Core_BAO_CustomGroup::getMultipleFieldGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_BAO_CustomGroup
的用法示例。
在下文中一共展示了CRM_Core_BAO_CustomGroup::getMultipleFieldGroup方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildQuickForm
/**
* Build the form object.
*
* @return void
*/
public function buildQuickForm()
{
parent::buildQuickForm();
$multipleCustomData = CRM_Core_BAO_CustomGroup::getMultipleFieldGroup();
$this->add('select', 'multipleCustomData', ts('Multi-value Custom Data'), array('' => ts('- select -')) + $multipleCustomData, TRUE);
$this->addContactTypeSelector();
}
示例2: buildQuickForm
/**
* Function to actually build the form
*
* @return void
* @access public
*/
public function buildQuickForm()
{
$multipleCustomData = CRM_Core_BAO_CustomGroup::getMultipleFieldGroup();
$this->add('select', 'multipleCustomData', ts('Multi-value Custom Data'), array('' => ts('- select -')) + $multipleCustomData, TRUE);
//Setting Upload File Size
$config = CRM_Core_Config::singleton();
if ($config->maxImportFileSize >= 8388608) {
$uploadFileSize = 8388608;
} else {
$uploadFileSize = $config->maxImportFileSize;
}
$uploadSize = round($uploadFileSize / (1024 * 1024), 2);
$this->assign('uploadSize', $uploadSize);
$this->add('file', 'uploadFile', ts('Import Data File'), 'size=30 maxlength=255', TRUE);
$this->addRule('uploadFile', ts('A valid file must be uploaded.'), 'uploadedfile');
$this->addRule('uploadFile', ts('File size should be less than %1 MBytes (%2 bytes)', array(1 => $uploadSize, 2 => $uploadFileSize)), 'maxfilesize', $uploadFileSize);
$this->setMaxFileSize($uploadFileSize);
$this->addRule('uploadFile', ts('Input file must be in CSV format'), 'utf8File');
$this->addElement('checkbox', 'skipColumnHeader', ts('First row contains column headers'));
//get the saved mapping details
$mappingArray = CRM_Core_BAO_Mapping::getMappings(CRM_Core_OptionGroup::getValue('mapping_type', 'Import Multi value custom data', 'name'));
$this->assign('savedMapping', $mappingArray);
$this->add('select', 'savedMapping', ts('Mapping Option'), array('' => ts('- select -')) + $mappingArray);
if ($loadeMapping = $this->get('loadedMapping')) {
$this->assign('loadedMapping', $loadeMapping);
$this->setDefaults(array('savedMapping' => $loadeMapping));
}
//contact types option
$contactOptions = array();
if (CRM_Contact_BAO_ContactType::isActive('Individual')) {
$contactOptions[] = $this->createElement('radio', NULL, NULL, ts('Individual'), CRM_Import_Parser::CONTACT_INDIVIDUAL);
}
if (CRM_Contact_BAO_ContactType::isActive('Household')) {
$contactOptions[] = $this->createElement('radio', NULL, NULL, ts('Household'), CRM_Import_Parser::CONTACT_HOUSEHOLD);
}
if (CRM_Contact_BAO_ContactType::isActive('Organization')) {
$contactOptions[] = $this->createElement('radio', NULL, NULL, ts('Organization'), CRM_Import_Parser::CONTACT_ORGANIZATION);
}
$this->addGroup($contactOptions, 'contactType', ts('Contact Type'));
$this->setDefaults(array('contactType' => CRM_Import_Parser::CONTACT_INDIVIDUAL));
//build date formats
CRM_Core_Form_Date::buildAllowedDateFormats($this);
$this->addButtons(array(array('type' => 'upload', 'name' => ts('Continue >>'), 'spacing' => ' ', 'isDefault' => TRUE), array('type' => 'cancel', 'name' => ts('Cancel'))));
}
示例3: hrui_civicrm_navigationMenu
function hrui_civicrm_navigationMenu(&$params)
{
$maxKey = max(array_keys($params));
$jobNavId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Navigation', 'jobImport', 'id', 'name');
$contactNavId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Navigation', 'Contacts', 'id', 'name');
if ($jobNavId) {
$i = 1;
// Degrade gracefully on 4.4
if (is_callable(array('CRM_Core_BAO_CustomGroup', 'getMultipleFieldGroup'))) {
// Get the maximum key of $params
$multipleCustomData = CRM_Core_BAO_CustomGroup::getMultipleFieldGroup();
$multiValuedData[$maxKey + 1] = array('attributes' => array('label' => ts('Jobs'), 'name' => 'jobs', 'url' => 'civicrm/job/import', 'permission' => 'access HRJobs', 'operator' => null, 'separator' => null, 'parentID' => $jobNavId, 'navID' => $maxKey + 1, 'weight' => 1, 'active' => 1));
foreach ($multipleCustomData as $key => $value) {
$i++;
$i = $maxKey + $i;
$multiValuedData[$i] = array('attributes' => array('label' => $value, 'name' => $value, 'url' => 'civicrm/import/custom?reset=1&id=' . $key, 'permission' => 'access HRJobs', 'operator' => null, 'separator' => null, 'parentID' => $jobNavId, 'navID' => $i, 'active' => 1), 'child' => null);
}
$params[$contactNavId]['child'][$jobNavId]['child'] = $multiValuedData;
}
}
}