Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export - add tests out header output, move phone_type_id to metadata #12587

Merged
merged 2 commits into from
Aug 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CRM/Core/DAO/Phone.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Core/Phone.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:661faad4886dd1a40784d465b906f447)
* (GenCodeChecksum:22802e5d7d8dfce93626004aaf6cd2e2)
*/

/**
Expand Down Expand Up @@ -258,6 +258,10 @@ public static function &fields() {
'type' => CRM_Utils_Type::T_INT,
'title' => ts('Phone Type'),
'description' => 'Which type of phone does this number belongs.',
'export' => TRUE,
'where' => 'civicrm_phone.phone_type_id',
'headerPattern' => '',
'dataPattern' => '',
'table_name' => 'civicrm_phone',
'entity' => 'Phone',
'bao' => 'CRM_Core_BAO_Phone',
Expand Down
13 changes: 4 additions & 9 deletions CRM/Export/BAO/Export.php
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ public static function exportComponents(
}
else {
// return tableName and sqlColumns in test context
return array($exportTempTable, $sqlColumns);
return array($exportTempTable, $sqlColumns, $headerRows);
}

// delete the export temp table and component table
Expand Down Expand Up @@ -1414,20 +1414,15 @@ public static function componentPaymentFields() {
public static function setHeaderRows($field, $headerRows, $sqlColumns, $processor, $value, $phoneTypes, $imProviders, $relationQuery) {

$queryFields = $processor->getQueryFields();
// Split campaign into 2 fields for id and title
if (substr($field, -14) == 'campaign_title') {
$headerRows[] = ts('Campaign Title');
}
elseif (substr($field, -11) == 'campaign_id') {
if (substr($field, -11) == 'campaign_id') {
// @todo - set this correctly in the xml rather than here.
$headerRows[] = ts('Campaign ID');
}
elseif (isset($queryFields[$field]['title'])) {
$headerRows[] = $queryFields[$field]['title'];
}
elseif ($field == 'phone_type_id') {
$headerRows[] = ts('Phone Type');
}
elseif ($field == 'provider_id') {
// @todo - set this correctly in the xml rather than here.
$headerRows[] = ts('IM Service Provider');
}
elseif ($processor->isRelationshipTypeKey($field)) {
Expand Down
Loading