3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
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-2015
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 $_balance = FALSE;
44 protected $activeCampaigns;
46 protected $_customGroupExtends = array(
53 public $_drilldownReport = array('event/income' => 'Link to Detail Report');
59 public function __construct() {
60 $this->_autoIncludeIndexedFieldsAsOrderBys
= 1;
62 // Check if CiviCampaign is a) enabled and b) has active campaigns
63 $config = CRM_Core_Config
::singleton();
64 $campaignEnabled = in_array("CiviCampaign", $config->enableComponents
);
65 if ($campaignEnabled) {
66 $getCampaigns = CRM_Campaign_BAO_Campaign
::getPermissionedCampaigns(NULL, NULL, TRUE, FALSE, TRUE);
67 $this->activeCampaigns
= $getCampaigns['campaigns'];
68 asort($this->activeCampaigns
);
71 $this->_columns
= array(
72 'civicrm_contact' => array(
73 'dao' => 'CRM_Contact_DAO_Contact',
74 'fields' => array_merge(array(
75 // CRM-17115 - to avoid changing report output at this stage re-instate
76 // old field name for sort name
77 'sort_name_linked' => array(
78 'title' => ts('Participant Name'),
81 'dbAlias' => 'contact_civireport.sort_name',
83 $this->getBasicContactFields(),
85 'age_at_event' => array(
86 'title' => ts('Age at Event'),
87 'dbAlias' => 'TIMESTAMPDIFF(YEAR, contact_civireport.birth_date, event_civireport.start_date)',
91 'grouping' => 'contact-fields',
94 'title' => ts('Last Name, First Name'),
96 'default_weight' => '0',
97 'default_order' => 'ASC',
99 'first_name' => array(
100 'name' => 'first_name',
101 'title' => ts('First Name'),
103 'gender_id' => array(
104 'name' => 'gender_id',
105 'title' => ts('Gender'),
107 'birth_date' => array(
108 'name' => 'birth_date',
109 'title' => ts('Birth Date'),
111 'age_at_event' => array(
112 'name' => 'age_at_event',
113 'title' => ts('Age at Event'),
115 'contact_type' => array(
116 'title' => ts('Contact Type'),
118 'contact_sub_type' => array(
119 'title' => ts('Contact Subtype'),
123 'sort_name' => array(
124 'title' => ts('Participant Name'),
125 'operator' => 'like',
127 'gender_id' => array(
128 'title' => ts('Gender'),
129 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
130 'options' => CRM_Core_PseudoConstant
::get('CRM_Contact_DAO_Contact', 'gender_id'),
132 'birth_date' => array(
133 'title' => ts('Birth Date'),
134 'operatorType' => CRM_Report_Form
::OP_DATE
,
136 'contact_type' => array(
137 'title' => ts('Contact Type'),
139 'contact_sub_type' => array(
140 'title' => ts('Contact Subtype'),
144 'civicrm_email' => array(
145 'dao' => 'CRM_Core_DAO_Email',
148 'title' => ts('Email'),
152 'grouping' => 'contact-fields',
155 'title' => ts('Participant E-mail'),
156 'operator' => 'like',
160 'civicrm_address' => array(
161 'dao' => 'CRM_Core_DAO_Address',
163 'street_address' => NULL,
165 'postal_code' => NULL,
166 'state_province_id' => array(
167 'title' => ts('State/Province'),
169 'country_id' => array(
170 'title' => ts('Country'),
173 'grouping' => 'contact-fields',
175 'civicrm_participant' => array(
176 'dao' => 'CRM_Event_DAO_Participant',
178 'participant_id' => array('title' => 'Participant ID'),
179 'participant_record' => array(
181 'no_display' => TRUE,
186 'type' => CRM_Utils_Type
::T_STRING
,
188 'status_id' => array(
189 'title' => ts('Status'),
193 'title' => ts('Role'),
196 'fee_currency' => array(
198 'no_display' => TRUE,
200 'participant_fee_level' => NULL,
201 'participant_fee_amount' => NULL,
202 'participant_register_date' => array('title' => ts('Registration Date')),
203 'total_paid' => array(
204 'title' => ts('Total Paid'),
205 'dbAlias' => 'SUM(ft.total_amount)',
209 'title' => ts('Balance'),
210 'dbAlias' => 'participant_civireport.fee_amount - SUM(ft.total_amount)',
214 'grouping' => 'event-fields',
217 'name' => 'event_id',
218 'title' => ts('Event'),
219 'operatorType' => CRM_Report_Form
::OP_ENTITYREF
,
220 'type' => CRM_Utils_Type
::T_INT
,
221 'attributes' => array(
223 'select' => array('minimumInputLength' => 0),
227 'name' => 'status_id',
228 'title' => ts('Participant Status'),
229 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
230 'options' => CRM_Event_PseudoConstant
::participantStatus(NULL, NULL, 'label'),
234 'title' => ts('Participant Role'),
235 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
236 'options' => CRM_Event_PseudoConstant
::participantRole(),
238 'participant_register_date' => array(
239 'title' => 'Registration Date',
240 'operatorType' => CRM_Report_Form
::OP_DATE
,
242 'fee_currency' => array(
243 'title' => ts('Fee Currency'),
244 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
245 'options' => CRM_Core_OptionGroup
::values('currencies_enabled'),
247 'type' => CRM_Utils_Type
::T_STRING
,
251 'order_bys' => array(
252 'participant_register_date' => array(
253 'title' => ts('Registration Date'),
254 'default_weight' => '1',
255 'default_order' => 'ASC',
258 'title' => ts('Event'),
259 'default_weight' => '1',
260 'default_order' => 'ASC',
264 'civicrm_phone' => array(
265 'dao' => 'CRM_Core_DAO_Phone',
268 'title' => ts('Phone'),
273 'grouping' => 'contact-fields',
275 'civicrm_event' => array(
276 'dao' => 'CRM_Event_DAO_Event',
278 'event_type_id' => array('title' => ts('Event Type')),
279 'event_start_date' => array('title' => ts('Event Start Date')),
281 'grouping' => 'event-fields',
284 'name' => 'event_type_id',
285 'title' => ts('Event Type'),
286 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
287 'options' => CRM_Core_OptionGroup
::values('event_type'),
289 'event_start_date' => array(
290 'title' => ts('Event Start Date'),
291 'operatorType' => CRM_Report_Form
::OP_DATE
,
294 'order_bys' => array(
295 'event_type_id' => array(
296 'title' => ts('Event Type'),
297 'default_weight' => '2',
298 'default_order' => 'ASC',
300 'event_start_date' => array(
301 'title' => ts('Event Start Date'),
305 'civicrm_contribution' => array(
306 'dao' => 'CRM_Contribute_DAO_Contribution',
308 'contribution_id' => array(
310 'no_display' => TRUE,
312 'csv_display' => TRUE,
313 'title' => ts('Contribution ID'),
315 'financial_type_id' => array('title' => ts('Financial Type')),
316 'receive_date' => array('title' => ts('Payment Date')),
317 'contribution_status_id' => array('title' => ts('Contribution Status')),
318 'payment_instrument_id' => array('title' => ts('Payment Type')),
319 'contribution_source' => array(
321 'title' => ts('Contribution Source'),
325 'no_display' => TRUE,
328 'fee_amount' => array('title' => ts('Transaction Fee')),
329 'net_amount' => NULL,
331 'grouping' => 'contrib-fields',
333 'receive_date' => array(
334 'title' => 'Payment Date',
335 'operatorType' => CRM_Report_Form
::OP_DATE
,
337 'financial_type_id' => array(
338 'title' => ts('Financial Type'),
339 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
340 'options' => CRM_Contribute_PseudoConstant
::financialType(),
343 'title' => ts('Contribution Currency'),
344 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
345 'options' => CRM_Core_OptionGroup
::values('currencies_enabled'),
347 'type' => CRM_Utils_Type
::T_STRING
,
349 'payment_instrument_id' => array(
350 'title' => ts('Payment Type'),
351 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
352 'options' => CRM_Contribute_PseudoConstant
::paymentInstrument(),
354 'contribution_status_id' => array(
355 'title' => ts('Contribution Status'),
356 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
357 'options' => CRM_Contribute_PseudoConstant
::contributionStatus(),
362 'civicrm_line_item' => array(
363 'dao' => 'CRM_Price_DAO_LineItem',
364 'grouping' => 'priceset-fields',
366 'price_field_value_id' => array(
367 'name' => 'price_field_value_id',
368 'title' => ts('Fee Level'),
369 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
370 'options' => $this->getPriceLevels(),
376 $this->_options
= array(
377 'blank_column_begin' => array(
378 'title' => ts('Blank column at the Begining'),
379 'type' => 'checkbox',
381 'blank_column_end' => array(
382 'title' => ts('Blank column at the End'),
393 // CRM-17115 avoid duplication of sort_name - would be better to standardise name
394 // & behaviour across reports but trying for no change at this point.
395 $this->_columns
['civicrm_contact']['fields']['sort_name']['no_display'] = TRUE;
397 // If we have active campaigns add those elements to both the fields and filters
398 if ($campaignEnabled && !empty($this->activeCampaigns
)) {
399 $this->_columns
['civicrm_participant']['fields']['campaign_id'] = array(
400 'title' => ts('Campaign'),
401 'default' => 'false',
403 $this->_columns
['civicrm_participant']['filters']['campaign_id'] = array(
404 'title' => ts('Campaign'),
405 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
406 'options' => $this->activeCampaigns
,
408 $this->_columns
['civicrm_participant']['order_bys']['campaign_id'] = array(
409 'title' => ts('Campaign'),
413 $this->_currencyColumn
= 'civicrm_participant_fee_currency';
414 parent
::__construct();
418 * Searches database for priceset values.
422 public function getPriceLevels() {
424 SELECT CONCAT(cv.label, ' (', ps.title, ')') label, cv.id
425 FROM civicrm_price_field_value cv
426 LEFT JOIN civicrm_price_field cf
427 ON cv.price_field_id = cf.id
428 LEFT JOIN civicrm_price_set_entity ce
429 ON ce.price_set_id = cf.price_set_id
430 LEFT JOIN civicrm_price_set ps
431 ON ce.price_set_id = ps.id
432 WHERE ce.entity_table = 'civicrm_event'
435 $dao = CRM_Core_DAO
::executeQuery($query);
437 while ($dao->fetch()) {
438 $elements[$dao->id
] = "$dao->label\n";
444 public function preProcess() {
445 parent
::preProcess();
448 public function select() {
450 $this->_columnHeaders
= array();
452 //add blank column at the Start
453 if (array_key_exists('options', $this->_params
) &&
454 !empty($this->_params
['options']['blank_column_begin'])
456 $select[] = " '' as blankColumnBegin";
457 $this->_columnHeaders
['blankColumnBegin']['title'] = '_ _ _ _';
459 foreach ($this->_columns
as $tableName => $table) {
460 if ($tableName == 'civicrm_line_item') {
461 $this->_lineitemField
= TRUE;
463 if (array_key_exists('fields', $table)) {
464 foreach ($table['fields'] as $fieldName => $field) {
465 if (!empty($field['required']) ||
466 !empty($this->_params
['fields'][$fieldName])
468 if ($tableName == 'civicrm_contribution') {
469 $this->_contribField
= TRUE;
471 if ($fieldName == 'total_paid' ||
$fieldName == 'balance') {
472 $this->_balance
= TRUE;
474 $alias = "{$tableName}_{$fieldName}";
475 $select[] = "{$field['dbAlias']} as $alias";
476 $this->_columnHeaders
["{$tableName}_{$fieldName}"]['type'] = CRM_Utils_Array
::value('type', $field);
477 $this->_columnHeaders
["{$tableName}_{$fieldName}"]['no_display'] = CRM_Utils_Array
::value('no_display', $field);
478 $this->_columnHeaders
["{$tableName}_{$fieldName}"]['title'] = CRM_Utils_Array
::value('title', $field);
479 $this->_selectAliases
[] = $alias;
484 //add blank column at the end
485 $blankcols = CRM_Utils_Array
::value('blank_column_end', $this->_params
);
487 for ($i = 1; $i <= $blankcols; $i++
) {
488 $select[] = " '' as blankColumnEnd_{$i}";
489 $this->_columnHeaders
["blank_{$i}"]['title'] = "_ _ _ _";
493 $this->_select
= "SELECT " . implode(', ', $select) . " ";
503 public static function formRule($fields, $files, $self) {
504 $errors = $grouping = array();
508 public function from() {
510 FROM civicrm_participant {$this->_aliases['civicrm_participant']}
511 LEFT JOIN civicrm_event {$this->_aliases['civicrm_event']}
512 ON ({$this->_aliases['civicrm_event']}.id = {$this->_aliases['civicrm_participant']}.event_id ) AND
513 {$this->_aliases['civicrm_event']}.is_template = 0
514 LEFT JOIN civicrm_contact {$this->_aliases['civicrm_contact']}
515 ON ({$this->_aliases['civicrm_participant']}.contact_id = {$this->_aliases['civicrm_contact']}.id )
517 LEFT JOIN civicrm_address {$this->_aliases['civicrm_address']}
518 ON {$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_address']}.contact_id AND
519 {$this->_aliases['civicrm_address']}.is_primary = 1
520 LEFT JOIN civicrm_email {$this->_aliases['civicrm_email']}
521 ON ({$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_email']}.contact_id AND
522 {$this->_aliases['civicrm_email']}.is_primary = 1)
523 LEFT JOIN civicrm_phone {$this->_aliases['civicrm_phone']}
524 ON {$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_phone']}.contact_id AND
525 {$this->_aliases['civicrm_phone']}.is_primary = 1
527 if ($this->_contribField
) {
529 LEFT JOIN civicrm_participant_payment pp
530 ON ({$this->_aliases['civicrm_participant']}.id = pp.participant_id)
531 LEFT JOIN civicrm_contribution {$this->_aliases['civicrm_contribution']}
532 ON (pp.contribution_id = {$this->_aliases['civicrm_contribution']}.id)
535 if ($this->_lineitemField
) {
537 LEFT JOIN civicrm_line_item line_item_civireport
538 ON line_item_civireport.entity_table = 'civicrm_participant' AND
539 line_item_civireport.entity_id = {$this->_aliases['civicrm_participant']}.id AND
540 line_item_civireport.qty > 0
543 if ($this->_balance
) {
545 LEFT JOIN civicrm_entity_financial_trxn eft
546 ON (eft.entity_id = {$this->_aliases['civicrm_contribution']}.id)
547 LEFT JOIN civicrm_financial_account fa
548 ON (fa.account_type_code = 'AR')
549 LEFT JOIN civicrm_financial_trxn ft
550 ON (ft.id = eft.financial_trxn_id AND eft.entity_table = 'civicrm_contribution') AND
551 (ft.to_financial_account_id != fa.id)
556 public function where() {
558 foreach ($this->_columns
as $tableName => $table) {
559 if (array_key_exists('filters', $table)) {
560 foreach ($table['filters'] as $fieldName => $field) {
563 if (CRM_Utils_Array
::value('type', $field) & CRM_Utils_Type
::T_DATE
) {
564 $relative = CRM_Utils_Array
::value("{$fieldName}_relative", $this->_params
);
565 $from = CRM_Utils_Array
::value("{$fieldName}_from", $this->_params
);
566 $to = CRM_Utils_Array
::value("{$fieldName}_to", $this->_params
);
568 if ($relative ||
$from ||
$to) {
569 $clause = $this->dateClause($field['name'], $relative, $from, $to, $field['type']);
573 $op = CRM_Utils_Array
::value("{$fieldName}_op", $this->_params
);
575 if ($fieldName == 'rid') {
576 $value = CRM_Utils_Array
::value("{$fieldName}_value", $this->_params
);
577 if (!empty($value)) {
579 if ($op == 'notin') {
583 $regexp = "[[:cntrl:]]*" . implode('[[:>:]]*|[[:<:]]*', $value) . "[[:cntrl:]]*";
584 $clause = "{$field['dbAlias']} {$operator} REGEXP '{$regexp}'";
590 $clause = $this->whereClause($field,
592 CRM_Utils_Array
::value("{$fieldName}_value", $this->_params
),
593 CRM_Utils_Array
::value("{$fieldName}_min", $this->_params
),
594 CRM_Utils_Array
::value("{$fieldName}_max", $this->_params
)
599 if (!empty($clause)) {
600 $clauses[] = $clause;
605 if (empty($clauses)) {
606 $this->_where
= "WHERE {$this->_aliases['civicrm_participant']}.is_test = 0 ";
609 $this->_where
= "WHERE {$this->_aliases['civicrm_participant']}.is_test = 0 AND " .
610 implode(' AND ', $clauses);
612 if ($this->_aclWhere
) {
613 $this->_where
.= " AND {$this->_aclWhere} ";
617 public function groupBy() {
618 $this->_groupBy
= "GROUP BY {$this->_aliases['civicrm_participant']}.id";
621 public function postProcess() {
623 // get ready with post process params
624 $this->beginPostProcess();
626 // get the acl clauses built before we assemble the query
627 $this->buildACLClause($this->_aliases
['civicrm_contact']);
629 $sql = $this->buildQuery(TRUE);
631 // build array of result based on column headers. This method also allows
632 // modifying column headers before using it to build result set i.e $rows.
634 $this->buildRows($sql, $rows);
636 // format result set.
637 $this->formatDisplay($rows);
639 // assign variables to templates
640 $this->doTemplateAssignment($rows);
642 // do print / pdf / instance stuff if needed
643 $this->endPostProcess($rows);
656 private function _initBasicRow(&$rows, &$entryFound, $row, $rowId, $rowNum, $types) {
657 if (!array_key_exists($rowId, $row)) {
661 $value = $row[$rowId];
663 $rows[$rowNum][$rowId] = $types[$value];
669 * Alter display of rows.
671 * Iterate through the rows retrieved via SQL and make changes for display purposes,
672 * such as rendering contacts as links.
675 * Rows generated by SQL, with an array for each row.
677 public function alterDisplay(&$rows) {
679 $eventType = CRM_Core_OptionGroup
::values('event_type');
681 $financialTypes = CRM_Contribute_PseudoConstant
::financialType();
682 $contributionStatus = CRM_Contribute_PseudoConstant
::contributionStatus();
683 $paymentInstruments = CRM_Contribute_PseudoConstant
::paymentInstrument();
685 foreach ($rows as $rowNum => $row) {
686 // make count columns point to detail report
687 // convert display name to links
688 if (array_key_exists('civicrm_participant_event_id', $row)) {
689 $eventId = $row['civicrm_participant_event_id'];
691 $rows[$rowNum]['civicrm_participant_event_id'] = CRM_Event_PseudoConstant
::event($eventId, FALSE);
693 $url = CRM_Report_Utils_Report
::getNextUrl('event/income',
694 'reset=1&force=1&id_op=in&id_value=' . $eventId,
695 $this->_absoluteUrl
, $this->_id
, $this->_drilldownReport
697 $rows[$rowNum]['civicrm_participant_event_id_link'] = $url;
698 $rows[$rowNum]['civicrm_participant_event_id_hover'] = ts("View Event Income Details for this Event");
703 // handle event type id
704 $this->_initBasicRow($rows, $entryFound, $row, 'civicrm_event_event_type_id', $rowNum, $eventType);
706 // handle participant status id
707 if (array_key_exists('civicrm_participant_status_id', $row)) {
708 $statusId = $row['civicrm_participant_status_id'];
710 $rows[$rowNum]['civicrm_participant_status_id'] = CRM_Event_PseudoConstant
::participantStatus($statusId, FALSE, 'label');
715 // handle participant role id
716 if (array_key_exists('civicrm_participant_role_id', $row)) {
717 $roleId = $row['civicrm_participant_role_id'];
719 $roles = explode(CRM_Core_DAO
::VALUE_SEPARATOR
, $roleId);
721 foreach ($roles as $role) {
722 $roleId[$role] = CRM_Event_PseudoConstant
::participantRole($role, FALSE);
724 $rows[$rowNum]['civicrm_participant_role_id'] = implode(', ', $roleId);
729 // Handel value seperator in Fee Level
730 if (array_key_exists('civicrm_participant_participant_fee_level', $row)) {
731 $feeLevel = $row['civicrm_participant_participant_fee_level'];
733 CRM_Event_BAO_Participant
::fixEventLevel($feeLevel);
734 $rows[$rowNum]['civicrm_participant_participant_fee_level'] = $feeLevel;
739 // Convert display name to link
740 $displayName = CRM_Utils_Array
::value('civicrm_contact_sort_name_linked', $row);
741 $cid = CRM_Utils_Array
::value('civicrm_contact_id', $row);
742 $id = CRM_Utils_Array
::value('civicrm_participant_participant_record', $row);
744 if ($displayName && $cid && $id) {
745 $url = CRM_Report_Utils_Report
::getNextUrl('contact/detail',
746 "reset=1&force=1&id_op=eq&id_value=$cid",
747 $this->_absoluteUrl
, $this->_id
, $this->_drilldownReport
750 $viewUrl = CRM_Utils_System
::url("civicrm/contact/view/participant",
751 "reset=1&id=$id&cid=$cid&action=view&context=participant"
754 $contactTitle = ts('View Contact Details');
755 $participantTitle = ts('View Participant Record');
757 $rows[$rowNum]['civicrm_contact_sort_name_linked'] = "<a title='$contactTitle' href=$url>$displayName</a>";
758 if ($this->_outputMode
!== 'csv') {
759 $rows[$rowNum]['civicrm_contact_sort_name_linked'] .=
760 "<span style='float: right;'><a title='$participantTitle' href=$viewUrl>" .
761 ts('View') . "</a></span>";
767 if (array_key_exists('civicrm_address_country_id', $row)) {
768 $countryId = $row['civicrm_address_country_id'];
770 $rows[$rowNum]['civicrm_address_country_id'] = CRM_Core_PseudoConstant
::country($countryId, TRUE);
775 // Handle state/province id
776 if (array_key_exists('civicrm_address_state_province_id', $row)) {
777 $provinceId = $row['civicrm_address_state_province_id'];
779 $rows[$rowNum]['civicrm_address_state_province_id'] = CRM_Core_PseudoConstant
::stateProvince($provinceId, TRUE);
784 // Handle employer id
785 if (array_key_exists('civicrm_contact_employer_id', $row)) {
786 $employerId = $row['civicrm_contact_employer_id'];
788 $rows[$rowNum]['civicrm_contact_employer_id'] = CRM_Contact_BAO_Contact
::displayName($employerId);
789 $url = CRM_Utils_System
::url('civicrm/contact/view',
790 'reset=1&cid=' . $employerId, $this->_absoluteUrl
792 $rows[$rowNum]['civicrm_contact_employer_id_link'] = $url;
793 $rows[$rowNum]['civicrm_contact_employer_id_hover'] = ts('View Contact Summary for this Contact.');
797 // Convert campaign_id to campaign title
798 $this->_initBasicRow($rows, $entryFound, $row, 'civicrm_participant_campaign_id', $rowNum, $this->activeCampaigns
);
800 // handle contribution status
801 $this->_initBasicRow($rows, $entryFound, $row, 'civicrm_contribution_contribution_status_id', $rowNum, $contributionStatus);
803 // handle payment instrument
804 $this->_initBasicRow($rows, $entryFound, $row, 'civicrm_contribution_payment_instrument_id', $rowNum, $paymentInstruments);
806 // handle financial type
807 $this->_initBasicRow($rows, $entryFound, $row, 'civicrm_contribution_financial_type_id', $rowNum, $financialTypes);
809 $entryFound = $this->alterDisplayContactFields($row, $rows, $rowNum, 'event/participantListing', 'View Event Income Details') ?
TRUE : $entryFound;
811 // display birthday in the configured custom format
812 if (array_key_exists('civicrm_contact_birth_date', $row)) {
813 $birthDate = $row['civicrm_contact_birth_date'];
815 $rows[$rowNum]['civicrm_contact_birth_date'] = CRM_Utils_Date
::customFormat($birthDate, '%Y%m%d');
820 // skip looking further in rows, if first row itself doesn't
821 // have the column we need