3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2014 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
31 * @copyright CiviCRM LLC (c) 2004-2014
35 class CRM_Report_Form_Event_ParticipantListing
extends CRM_Report_Form_Event
{
37 protected $_summary = NULL;
39 protected $_contribField = FALSE;
40 protected $_lineitemField = FALSE;
41 protected $_groupFilter = TRUE;
42 protected $_tagFilter = TRUE;
43 protected $activeCampaigns;
45 protected $_customGroupExtends = array(
52 public $_drilldownReport = array('event/income' => 'Link to Detail Report');
58 public function __construct() {
59 $this->_autoIncludeIndexedFieldsAsOrderBys
= 1;
61 // Check if CiviCampaign is a) enabled and b) has active campaigns
62 $config = CRM_Core_Config
::singleton();
63 $campaignEnabled = in_array("CiviCampaign", $config->enableComponents
);
64 if ($campaignEnabled) {
65 $getCampaigns = CRM_Campaign_BAO_Campaign
::getPermissionedCampaigns(NULL, NULL, TRUE, FALSE, TRUE);
66 $this->activeCampaigns
= $getCampaigns['campaigns'];
67 asort($this->activeCampaigns
);
70 $this->_columns
= array(
71 'civicrm_contact' => array(
72 'dao' => 'CRM_Contact_DAO_Contact',
74 'sort_name_linked' => array(
75 'title' => ts('Participant Name'),
78 'dbAlias' => 'contact_civireport.sort_name',
80 'first_name' => array(
81 'title' => ts('First Name'),
84 'title' => ts('Last Name'),
91 'title' => ts('Gender'),
93 'birth_date' => array(
94 'title' => ts('Birth Date'),
98 'dbAlias' => 'TIMESTAMPDIFF(YEAR, contact_civireport.birth_date, CURDATE())',
100 'age_at_event' => array(
101 'title' => ts('Age at Event'),
102 'dbAlias' => 'TIMESTAMPDIFF(YEAR, contact_civireport.birth_date, event_civireport.start_date)',
104 'employer_id' => array(
105 'title' => ts('Organization'),
108 'grouping' => 'contact-fields',
109 'order_bys' => array(
110 'sort_name' => array(
111 'title' => ts('Last Name, First Name'),
113 'default_weight' => '0',
114 'default_order' => 'ASC',
116 'gender_id' => array(
117 'name' => 'gender_id',
118 'title' => ts('Gender'),
120 'birth_date' => array(
121 'name' => 'birth_date',
122 'title' => ts('Birth Date'),
124 'age_at_event' => array(
125 'name' => 'age_at_event',
126 'title' => ts('Age at Event'),
130 'sort_name' => array(
131 'title' => ts('Participant Name'),
132 'operator' => 'like',
134 'gender_id' => array(
135 'title' => ts('Gender'),
136 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
137 'options' => CRM_Core_PseudoConstant
::get('CRM_Contact_DAO_Contact', 'gender_id'),
139 'birth_date' => array(
140 'title' => 'Birth Date',
141 'operatorType' => CRM_Report_Form
::OP_DATE
,
142 'type' => CRM_Utils_Type
::T_DATE
,
146 'civicrm_email' => array(
147 'dao' => 'CRM_Core_DAO_Email',
150 'title' => ts('Email'),
154 'grouping' => 'contact-fields',
157 'title' => ts('Participant E-mail'),
158 'operator' => 'like',
162 'civicrm_address' => array(
163 'dao' => 'CRM_Core_DAO_Address',
165 'street_address' => NULL,
167 'postal_code' => NULL,
168 'state_province_id' => array(
169 'title' => ts('State/Province'),
171 'country_id' => array(
172 'title' => ts('Country'),
175 'grouping' => 'contact-fields',
177 'civicrm_participant' => array(
178 'dao' => 'CRM_Event_DAO_Participant',
180 'participant_id' => array('title' => 'Participant ID'),
181 'participant_record' => array(
183 'no_display' => TRUE,
188 'type' => CRM_Utils_Type
::T_STRING
,
190 'status_id' => array(
191 'title' => ts('Status'),
195 'title' => ts('Role'),
198 'fee_currency' => array(
200 'no_display' => TRUE,
202 'participant_fee_level' => NULL,
203 'participant_fee_amount' => NULL,
204 'participant_register_date' => array('title' => ts('Registration Date')),
206 'grouping' => 'event-fields',
209 'name' => 'event_id',
210 'title' => ts('Event'),
211 'operatorType' => CRM_Report_Form
::OP_ENTITYREF
,
212 'type' => CRM_Utils_Type
::T_INT
,
213 'attributes' => array(
215 'select' => array('minimumInputLength' => 0),
219 'name' => 'status_id',
220 'title' => ts('Participant Status'),
221 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
222 'options' => CRM_Event_PseudoConstant
::participantStatus(NULL, NULL, 'label'),
226 'title' => ts('Participant Role'),
227 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
228 'options' => CRM_Event_PseudoConstant
::participantRole(),
230 'participant_register_date' => array(
231 'title' => 'Registration Date',
232 'operatorType' => CRM_Report_Form
::OP_DATE
,
234 'fee_currency' => array(
235 'title' => ts('Fee Currency'),
236 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
237 'options' => CRM_Core_OptionGroup
::values('currencies_enabled'),
239 'type' => CRM_Utils_Type
::T_STRING
,
243 'order_bys' => array(
244 'participant_register_date' => array(
245 'title' => ts('Registration Date'),
246 'default_weight' => '1',
247 'default_order' => 'ASC',
250 'title' => ts('Event'),
251 'default_weight' => '1',
252 'default_order' => 'ASC',
256 'civicrm_phone' => array(
257 'dao' => 'CRM_Core_DAO_Phone',
260 'title' => ts('Phone'),
265 'grouping' => 'contact-fields',
267 'civicrm_event' => array(
268 'dao' => 'CRM_Event_DAO_Event',
270 'event_type_id' => array('title' => ts('Event Type')),
271 'event_start_date' => array('title' => ts('Event Start Date')),
273 'grouping' => 'event-fields',
276 'name' => 'event_type_id',
277 'title' => ts('Event Type'),
278 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
279 'options' => CRM_Core_OptionGroup
::values('event_type'),
281 'event_start_date' => array(
282 'title' => ts('Event Start Date'),
283 'operatorType' => CRM_Report_Form
::OP_DATE
,
286 'order_bys' => array(
287 'event_type_id' => array(
288 'title' => ts('Event Type'),
289 'default_weight' => '2',
290 'default_order' => 'ASC',
294 'civicrm_contribution' => array(
295 'dao' => 'CRM_Contribute_DAO_Contribution',
297 'contribution_id' => array(
299 'no_display' => TRUE,
301 'csv_display' => TRUE,
302 'title' => ts('Contribution ID'),
304 'financial_type_id' => array('title' => ts('Financial Type')),
305 'receive_date' => array('title' => ts('Payment Date')),
306 'contribution_status_id' => array('title' => ts('Contribution Status')),
307 'payment_instrument_id' => array('title' => ts('Payment Type')),
308 'contribution_source' => array(
310 'title' => ts('Contribution Source'),
314 'no_display' => TRUE,
317 'fee_amount' => array('title' => ts('Transaction Fee')),
318 'net_amount' => NULL,
320 'grouping' => 'contrib-fields',
322 'receive_date' => array(
323 'title' => 'Payment Date',
324 'operatorType' => CRM_Report_Form
::OP_DATE
,
326 'financial_type_id' => array(
327 'title' => ts('Financial Type'),
328 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
329 'options' => CRM_Contribute_PseudoConstant
::financialType(),
332 'title' => ts('Contribution Currency'),
333 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
334 'options' => CRM_Core_OptionGroup
::values('currencies_enabled'),
336 'type' => CRM_Utils_Type
::T_STRING
,
338 'payment_instrument_id' => array(
339 'title' => ts('Payment Type'),
340 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
341 'options' => CRM_Contribute_PseudoConstant
::paymentInstrument(),
343 'contribution_status_id' => array(
344 'title' => ts('Contribution Status'),
345 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
346 'options' => CRM_Contribute_PseudoConstant
::contributionStatus(),
351 'civicrm_line_item' => array(
352 'dao' => 'CRM_Price_DAO_LineItem',
353 'grouping' => 'priceset-fields',
355 'price_field_value_id' => array(
356 'name' => 'price_field_value_id',
357 'title' => ts('Fee Level'),
358 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
359 'options' => $this->getPriceLevels(),
365 $this->_options
= array(
366 'blank_column_begin' => array(
367 'title' => ts('Blank column at the Begining'),
368 'type' => 'checkbox',
370 'blank_column_end' => array(
371 'title' => ts('Blank column at the End'),
382 // If we have active campaigns add those elements to both the fields and filters
383 if ($campaignEnabled && !empty($this->activeCampaigns
)) {
384 $this->_columns
['civicrm_participant']['fields']['campaign_id'] = array(
385 'title' => ts('Campaign'),
386 'default' => 'false',
388 $this->_columns
['civicrm_participant']['filters']['campaign_id'] = array(
389 'title' => ts('Campaign'),
390 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
391 'options' => $this->activeCampaigns
,
393 $this->_columns
['civicrm_participant']['order_bys']['campaign_id'] = array(
394 'title' => ts('Campaign'),
398 $this->_currencyColumn
= 'civicrm_participant_fee_currency';
399 parent
::__construct();
403 * Searches database for priceset values.
407 public function getPriceLevels() {
409 SELECT CONCAT(cv.label, ' (', ps.title, ')') label, cv.id
410 FROM civicrm_price_field_value cv
411 LEFT JOIN civicrm_price_field cf
412 ON cv.price_field_id = cf.id
413 LEFT JOIN civicrm_price_set_entity ce
414 ON ce.price_set_id = cf.price_set_id
415 LEFT JOIN civicrm_price_set ps
416 ON ce.price_set_id = ps.id
417 WHERE ce.entity_table = 'civicrm_event'
420 $dao = CRM_Core_DAO
::executeQuery($query);
422 while ($dao->fetch()) {
423 $elements[$dao->id
] = "$dao->label\n";
429 public function preProcess() {
430 parent
::preProcess();
433 public function select() {
435 $this->_columnHeaders
= array();
437 //add blank column at the Start
438 if (array_key_exists('options', $this->_params
) &&
439 !empty($this->_params
['options']['blank_column_begin'])
441 $select[] = " '' as blankColumnBegin";
442 $this->_columnHeaders
['blankColumnBegin']['title'] = '_ _ _ _';
444 foreach ($this->_columns
as $tableName => $table) {
445 if ($tableName == 'civicrm_line_item') {
446 $this->_lineitemField
= TRUE;
448 if (array_key_exists('fields', $table)) {
449 foreach ($table['fields'] as $fieldName => $field) {
450 if (!empty($field['required']) ||
451 !empty($this->_params
['fields'][$fieldName])
453 if ($tableName == 'civicrm_contribution') {
454 $this->_contribField
= TRUE;
457 $alias = "{$tableName}_{$fieldName}";
458 $select[] = "{$field['dbAlias']} as $alias";
459 $this->_columnHeaders
["{$tableName}_{$fieldName}"]['type'] = CRM_Utils_Array
::value('type', $field);
460 $this->_columnHeaders
["{$tableName}_{$fieldName}"]['no_display'] = CRM_Utils_Array
::value('no_display', $field);
461 $this->_columnHeaders
["{$tableName}_{$fieldName}"]['title'] = CRM_Utils_Array
::value('title', $field);
462 $this->_selectAliases
[] = $alias;
467 //add blank column at the end
468 $blankcols = CRM_Utils_Array
::value('blank_column_end', $this->_params
);
470 for ($i = 1; $i <= $blankcols; $i++
) {
471 $select[] = " '' as blankColumnEnd_{$i}";
472 $this->_columnHeaders
["blank_{$i}"]['title'] = "_ _ _ _";
476 $this->_select
= "SELECT " . implode(', ', $select) . " ";
486 public static function formRule($fields, $files, $self) {
487 $errors = $grouping = array();
491 public function from() {
493 FROM civicrm_participant {$this->_aliases['civicrm_participant']}
494 LEFT JOIN civicrm_event {$this->_aliases['civicrm_event']}
495 ON ({$this->_aliases['civicrm_event']}.id = {$this->_aliases['civicrm_participant']}.event_id ) AND
496 {$this->_aliases['civicrm_event']}.is_template = 0
497 LEFT JOIN civicrm_contact {$this->_aliases['civicrm_contact']}
498 ON ({$this->_aliases['civicrm_participant']}.contact_id = {$this->_aliases['civicrm_contact']}.id )
500 LEFT JOIN civicrm_address {$this->_aliases['civicrm_address']}
501 ON {$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_address']}.contact_id AND
502 {$this->_aliases['civicrm_address']}.is_primary = 1
503 LEFT JOIN civicrm_email {$this->_aliases['civicrm_email']}
504 ON ({$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_email']}.contact_id AND
505 {$this->_aliases['civicrm_email']}.is_primary = 1)
506 LEFT JOIN civicrm_phone {$this->_aliases['civicrm_phone']}
507 ON {$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_phone']}.contact_id AND
508 {$this->_aliases['civicrm_phone']}.is_primary = 1
510 if ($this->_contribField
) {
512 LEFT JOIN civicrm_participant_payment pp
513 ON ({$this->_aliases['civicrm_participant']}.id = pp.participant_id)
514 LEFT JOIN civicrm_contribution {$this->_aliases['civicrm_contribution']}
515 ON (pp.contribution_id = {$this->_aliases['civicrm_contribution']}.id)
518 if ($this->_lineitemField
) {
520 LEFT JOIN civicrm_line_item line_item_civireport
521 ON line_item_civireport.entity_table = 'civicrm_participant' AND
522 line_item_civireport.entity_id = {$this->_aliases['civicrm_participant']}.id
527 public function where() {
529 foreach ($this->_columns
as $tableName => $table) {
530 if (array_key_exists('filters', $table)) {
531 foreach ($table['filters'] as $fieldName => $field) {
534 if (CRM_Utils_Array
::value('type', $field) & CRM_Utils_Type
::T_DATE
) {
535 $relative = CRM_Utils_Array
::value("{$fieldName}_relative", $this->_params
);
536 $from = CRM_Utils_Array
::value("{$fieldName}_from", $this->_params
);
537 $to = CRM_Utils_Array
::value("{$fieldName}_to", $this->_params
);
539 if ($relative ||
$from ||
$to) {
540 $clause = $this->dateClause($field['name'], $relative, $from, $to, $field['type']);
544 $op = CRM_Utils_Array
::value("{$fieldName}_op", $this->_params
);
546 if ($fieldName == 'rid') {
547 $value = CRM_Utils_Array
::value("{$fieldName}_value", $this->_params
);
548 if (!empty($value)) {
549 $clause = "( {$field['dbAlias']} REGEXP '[[:<:]]" .
550 implode('[[:>:]]|[[:<:]]', $value) . "[[:>:]]' )";
556 $clause = $this->whereClause($field,
558 CRM_Utils_Array
::value("{$fieldName}_value", $this->_params
),
559 CRM_Utils_Array
::value("{$fieldName}_min", $this->_params
),
560 CRM_Utils_Array
::value("{$fieldName}_max", $this->_params
)
565 if (!empty($clause)) {
566 $clauses[] = $clause;
571 if (empty($clauses)) {
572 $this->_where
= "WHERE {$this->_aliases['civicrm_participant']}.is_test = 0 ";
575 $this->_where
= "WHERE {$this->_aliases['civicrm_participant']}.is_test = 0 AND " .
576 implode(' AND ', $clauses);
578 if ($this->_aclWhere
) {
579 $this->_where
.= " AND {$this->_aclWhere} ";
583 public function groupBy() {
584 $this->_groupBy
= "GROUP BY {$this->_aliases['civicrm_participant']}.id";
587 public function postProcess() {
589 // get ready with post process params
590 $this->beginPostProcess();
592 // get the acl clauses built before we assemble the query
593 $this->buildACLClause($this->_aliases
['civicrm_contact']);
595 $sql = $this->buildQuery(TRUE);
597 // build array of result based on column headers. This method also allows
598 // modifying column headers before using it to build result set i.e $rows.
600 $this->buildRows($sql, $rows);
602 // format result set.
603 $this->formatDisplay($rows);
605 // assign variables to templates
606 $this->doTemplateAssignment($rows);
608 // do print / pdf / instance stuff if needed
609 $this->endPostProcess($rows);
620 private function _initBasicRow(&$rows, &$entryFound, $row, $rowId, $rowNum, $types) {
621 if (!array_key_exists($rowId, $row)) {
625 $value = $row[$rowId];
627 $rows[$rowNum][$rowId] = $types[$value];
633 * Alter display of rows.
635 * Iterate through the rows retrieved via SQL and make changes for display purposes,
636 * such as rendering contacts as links.
639 * Rows generated by SQL, with an array for each row.
641 public function alterDisplay(&$rows) {
643 $eventType = CRM_Core_OptionGroup
::values('event_type');
645 $financialTypes = CRM_Contribute_PseudoConstant
::financialType();
646 $contributionStatus = CRM_Contribute_PseudoConstant
::contributionStatus();
647 $paymentInstruments = CRM_Contribute_PseudoConstant
::paymentInstrument();
648 $genders = CRM_Core_PseudoConstant
::get('CRM_Contact_DAO_Contact', 'gender_id', array('localize' => TRUE));
650 foreach ($rows as $rowNum => $row) {
651 // make count columns point to detail report
652 // convert display name to links
653 if (array_key_exists('civicrm_participant_event_id', $row)) {
654 $eventId = $row['civicrm_participant_event_id'];
656 $rows[$rowNum]['civicrm_participant_event_id'] = CRM_Event_PseudoConstant
::event($eventId, FALSE);
658 $url = CRM_Report_Utils_Report
::getNextUrl('event/income',
659 'reset=1&force=1&id_op=in&id_value=' . $eventId,
660 $this->_absoluteUrl
, $this->_id
, $this->_drilldownReport
662 $rows[$rowNum]['civicrm_participant_event_id_link'] = $url;
663 $rows[$rowNum]['civicrm_participant_event_id_hover'] = ts("View Event Income Details for this Event");
668 // handle event type id
669 $this->_initBasicRow($rows, $entryFound, $row, 'civicrm_event_event_type_id', $rowNum, $eventType);
671 // handle participant status id
672 if (array_key_exists('civicrm_participant_status_id', $row)) {
673 $statusId = $row['civicrm_participant_status_id'];
675 $rows[$rowNum]['civicrm_participant_status_id'] = CRM_Event_PseudoConstant
::participantStatus($statusId, FALSE, 'label');
680 // handle participant role id
681 if (array_key_exists('civicrm_participant_role_id', $row)) {
682 $roleId = $row['civicrm_participant_role_id'];
684 $roles = explode(CRM_Core_DAO
::VALUE_SEPARATOR
, $roleId);
686 foreach ($roles as $role) {
687 $roleId[$role] = CRM_Event_PseudoConstant
::participantRole($role, FALSE);
689 $rows[$rowNum]['civicrm_participant_role_id'] = implode(', ', $roleId);
694 // Handel value seperator in Fee Level
695 if (array_key_exists('civicrm_participant_participant_fee_level', $row)) {
696 $feeLevel = $row['civicrm_participant_participant_fee_level'];
698 CRM_Event_BAO_Participant
::fixEventLevel($feeLevel);
699 $rows[$rowNum]['civicrm_participant_participant_fee_level'] = $feeLevel;
704 // Convert display name to link
705 $displayName = CRM_Utils_Array
::value('civicrm_contact_sort_name_linked', $row);
706 $cid = CRM_Utils_Array
::value('civicrm_contact_id', $row);
707 $id = CRM_Utils_Array
::value('civicrm_participant_participant_record', $row);
709 if ($displayName && $cid && $id) {
710 $url = CRM_Report_Utils_Report
::getNextUrl('contact/detail',
711 "reset=1&force=1&id_op=eq&id_value=$cid",
712 $this->_absoluteUrl
, $this->_id
, $this->_drilldownReport
715 $viewUrl = CRM_Utils_System
::url("civicrm/contact/view/participant",
716 "reset=1&id=$id&cid=$cid&action=view&context=participant"
719 $contactTitle = ts('View Contact Details');
720 $participantTitle = ts('View Participant Record');
722 $rows[$rowNum]['civicrm_contact_sort_name_linked'] = "<a title='$contactTitle' href=$url>$displayName</a>";
723 if ($this->_outputMode
!== 'csv') {
724 $rows[$rowNum]['civicrm_contact_sort_name_linked'] .=
725 "<span style='float: right;'><a title='$participantTitle' href=$viewUrl>" .
726 ts('View') . "</a></span>";
732 if (array_key_exists('civicrm_address_country_id', $row)) {
733 $countryId = $row['civicrm_address_country_id'];
735 $rows[$rowNum]['civicrm_address_country_id'] = CRM_Core_PseudoConstant
::country($countryId, TRUE);
740 // Handle state/province id
741 if (array_key_exists('civicrm_address_state_province_id', $row)) {
742 $provinceId = $row['civicrm_address_state_province_id'];
744 $rows[$rowNum]['civicrm_address_state_province_id'] = CRM_Core_PseudoConstant
::stateProvince($provinceId, TRUE);
749 // Handle employer id
750 if (array_key_exists('civicrm_contact_employer_id', $row)) {
751 $employerId = $row['civicrm_contact_employer_id'];
753 $rows[$rowNum]['civicrm_contact_employer_id'] = CRM_Contact_BAO_Contact
::displayName($employerId);
754 $url = CRM_Utils_System
::url('civicrm/contact/view',
755 'reset=1&cid=' . $employerId, $this->_absoluteUrl
757 $rows[$rowNum]['civicrm_contact_employer_id_link'] = $url;
758 $rows[$rowNum]['civicrm_contact_employer_id_hover'] = ts('View Contact Summary for this Contact.');
762 // Convert campaign_id to campaign title
763 $this->_initBasicRow($rows, $entryFound, $row, 'civicrm_participant_campaign_id', $rowNum, $this->activeCampaigns
);
765 // handle contribution status
766 $this->_initBasicRow($rows, $entryFound, $row, 'civicrm_contribution_contribution_status_id', $rowNum, $contributionStatus);
768 // handle payment instrument
769 $this->_initBasicRow($rows, $entryFound, $row, 'civicrm_contribution_payment_instrument_id', $rowNum, $paymentInstruments);
771 // handle financial type
772 $this->_initBasicRow($rows, $entryFound, $row, 'civicrm_contribution_financial_type_id', $rowNum, $financialTypes);
775 $this->_initBasicRow($rows, $entryFound, $row, 'civicrm_contact_gender_id', $rowNum, $genders);
777 // display birthday in the configured custom format
778 if (array_key_exists('civicrm_contact_birth_date', $row)) {
779 $birthDate = $row['civicrm_contact_birth_date'];
781 $rows[$rowNum]['civicrm_contact_birth_date'] = CRM_Utils_Date
::customFormat($birthDate, '%Y%m%d');
786 // skip looking further in rows, if first row itself doesn't
787 // have the column we need