本文整理汇总了PHP中CRM_Contribute_BAO_Contribution::exportableFields方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contribute_BAO_Contribution::exportableFields方法的具体用法?PHP CRM_Contribute_BAO_Contribution::exportableFields怎么用?PHP CRM_Contribute_BAO_Contribution::exportableFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Contribute_BAO_Contribution
的用法示例。
在下文中一共展示了CRM_Contribute_BAO_Contribution::exportableFields方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
/**
* Function get the import/export fields for contribution
*
* @return array
* self::$_contributionFields associative array of contribution fields
*/
public static function &getFields()
{
if (!self::$_contributionFields) {
self::$_contributionFields = array();
$fields = CRM_Contribute_BAO_Contribution::exportableFields();
unset($fields['contribution_contact_id']);
self::$_contributionFields = $fields;
}
return self::$_contributionFields;
}
示例2: array
/**
* Function get the import/export fields for contribution
*
* @return array self::$_contributionFields associative array of contribution fields
* @static
*/
static function &getFields()
{
if (!self::$_contributionFields) {
self::$_contributionFields = array();
require_once 'CRM/Contribute/BAO/Contribution.php';
$fields =& CRM_Contribute_BAO_Contribution::exportableFields();
unset($fields['contribution_contact_id']);
self::$_contributionFields = $fields;
}
return self::$_contributionFields;
}
示例3: array
/**
* Function get the import/export fields for contribution
*
* @return array self::$_contributionFields associative array of contribution fields
* @static
*/
static function &getFields()
{
if (!self::$_contributionFields) {
self::$_contributionFields = array();
require_once 'CRM/Contribute/BAO/Contribution.php';
$fields =& CRM_Contribute_BAO_Contribution::exportableFields();
// add field to get recur_id
$fields['contribution_recur_id'] = array('name' => 'contribution_recur_id', 'title' => ts('Recurring Contributions ID'), 'where' => 'civicrm_contribution.contribution_recur_id');
$fields['contribution_note'] = array('name' => 'contribution_note', 'title' => ts('Contribution Note'));
unset($fields['contribution_contact_id']);
self::$_contributionFields = $fields;
}
return self::$_contributionFields;
}
示例4: _buildContributionTokens
protected static function _buildContributionTokens()
{
$key = 'contribution';
if (self::$_tokens[$key] == NULL) {
self::$_tokens[$key] = array_keys(array_merge(CRM_Contribute_BAO_Contribution::exportableFields('All'), array('campaign', 'financial_type')));
}
}
示例5: CRM_Contact_BAO_Query
/**
* class constructor which also does all the work
*
* @param array $params
* @param array $returnProperties
* @param array $fields
* @param boolean $includeContactIds
* @param boolean $strict
* @param boolean $mode - mode the search is operating on
*
* @return Object
* @access public
*/
function CRM_Contact_BAO_Query($params = null, $returnProperties = null, $fields = null, $includeContactIds = false, $strict = false, $mode = 1)
{
require_once 'CRM/Contact/BAO/Contact.php';
//CRM_Core_Error::debug( 'params', $params );
//CRM_Core_Error::debug( 'post', $_POST );
$this->_params =& $params;
if (empty($returnProperties)) {
$this->_returnProperties =& CRM_Contact_BAO_Query::defaultReturnProperties($mode);
} else {
$this->_returnProperties =& $returnProperties;
}
$this->_includeContactIds = $includeContactIds;
$this->_strict = $strict;
$this->_mode = $mode;
if ($fields) {
$this->_fields =& $fields;
$this->_search = false;
} else {
require_once 'CRM/Contact/BAO/Contact.php';
$this->_fields = CRM_Contact_BAO_Contact::exportableFields('All', false, true);
require_once 'CRM/Contribute/BAO/Contribution.php';
$fields = CRM_Contribute_BAO_Contribution::exportableFields();
unset($fields['contact_id']);
unset($fields['note']);
$this->_fields = array_merge($this->_fields, $fields);
}
// basically do all the work once, and then reuse it
$this->initialize();
// CRM_Core_Error::debug( 'q', $this );
}
示例6: buildMappingForm
/**
* Build the mapping form.
*
* @param CRM_Core_Form $form
* @param string $mappingType
* (Export/Import/Search Builder).
* @param int $mappingId
* @param int $columnNo
* @param int $blockCount
* (no of blocks shown).
* @param NULL $exportMode
*
* @return void
*/
public static function buildMappingForm(&$form, $mappingType = 'Export', $mappingId = NULL, $columnNo, $blockCount = 3, $exportMode = NULL)
{
if ($mappingType == 'Export') {
$name = "Map";
$columnCount = array('1' => $columnNo);
} elseif ($mappingType == 'Search Builder') {
$name = "Builder";
$columnCount = $columnNo;
}
//get the saved mapping details
if ($mappingType == 'Export') {
$form->applyFilter('saveMappingName', 'trim');
//to save the current mappings
if (!isset($mappingId)) {
$saveDetailsName = ts('Save this field mapping');
$form->add('text', 'saveMappingName', ts('Name'));
$form->add('text', 'saveMappingDesc', ts('Description'));
} else {
$form->assign('loadedMapping', $mappingId);
$params = array('id' => $mappingId);
$temp = array();
$mappingDetails = CRM_Core_BAO_Mapping::retrieve($params, $temp);
$form->assign('savedName', $mappingDetails->name);
$form->add('hidden', 'mappingId', $mappingId);
$form->addElement('checkbox', 'updateMapping', ts('Update this field mapping'), NULL);
$saveDetailsName = ts('Save as a new field mapping');
$form->add('text', 'saveMappingName', ts('Name'));
$form->add('text', 'saveMappingDesc', ts('Description'));
}
$form->addElement('checkbox', 'saveMapping', $saveDetailsName, NULL, array('onclick' => "showSaveDetails(this)"));
$form->addFormRule(array('CRM_Export_Form_Map', 'formRule'), $form->get('mappingTypeId'));
} elseif ($mappingType == 'Search Builder') {
$form->addElement('submit', 'addBlock', ts('Also include contacts where'), array('class' => 'submit-link'));
}
$defaults = array();
$hasLocationTypes = array();
$hasRelationTypes = array();
$fields = array();
if ($mappingType == 'Export') {
$required = TRUE;
} elseif ($mappingType == 'Search Builder') {
$required = FALSE;
}
$contactType = array('Individual', 'Household', 'Organization');
foreach ($contactType as $value) {
$contactFields = CRM_Contact_BAO_Contact::exportableFields($value, FALSE, $required);
$contactFields = array_merge($contactFields, CRM_Contact_BAO_Query_Hook::singleton()->getFields());
// exclude the address options disabled in the Address Settings
$fields[$value] = CRM_Core_BAO_Address::validateAddressOptions($contactFields);
ksort($fields[$value]);
if ($mappingType == 'Export') {
$relationships = array();
$relationshipTypes = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, NULL, NULL, $value);
asort($relationshipTypes);
foreach ($relationshipTypes as $key => $var) {
list($type) = explode('_', $key);
$relationships[$key]['title'] = $var;
$relationships[$key]['headerPattern'] = '/' . preg_quote($var, '/') . '/';
$relationships[$key]['export'] = TRUE;
$relationships[$key]['relationship_type_id'] = $type;
$relationships[$key]['related'] = TRUE;
$relationships[$key]['hasRelationType'] = 1;
}
if (!empty($relationships)) {
$fields[$value] = array_merge($fields[$value], array('related' => array('title' => ts('- related contact info -'))), $relationships);
}
}
}
//get the current employer for mapping.
if ($required) {
$fields['Individual']['current_employer']['title'] = ts('Current Employer');
}
// add component fields
$compArray = array();
//we need to unset groups, tags, notes for component export
if ($exportMode != CRM_Export_Form_Select::CONTACT_EXPORT) {
foreach (array('groups', 'tags', 'notes') as $value) {
unset($fields['Individual'][$value]);
unset($fields['Household'][$value]);
unset($fields['Organization'][$value]);
}
}
if ($mappingType == 'Search Builder') {
//build the common contact fields array.
$fields['Contact'] = array();
foreach ($fields['Individual'] as $key => $value) {
//.........这里部分代码省略.........