4 +--------------------------------------------------------------------+
5 | CiviCRM version 4.5 |
6 +--------------------------------------------------------------------+
7 | Copyright CiviCRM LLC (c) 2004-2014 |
8 +--------------------------------------------------------------------+
9 | This file is a part of CiviCRM. |
11 | CiviCRM is free software; you can copy, modify, and distribute it |
12 | under the terms of the GNU Affero General Public License |
13 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
15 | CiviCRM is distributed in the hope that it will be useful, but |
16 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. |
20 | You should have received a copy of the GNU Affero General Public |
21 | License and the CiviCRM Licensing Exception along |
22 | with this program; if not, contact CiviCRM LLC |
23 | at info[AT]civicrm[DOT]org. If you have questions about the |
24 | GNU Affero General Public License or the licensing of CiviCRM, |
25 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
26 +--------------------------------------------------------------------+
32 * @copyright CiviCRM LLC (c) 2004-2014
36 class CRM_Report_Form_Contribute_History
extends CRM_Report_Form
{
37 // Primary Contacts count limitCONSTROW_COUNT_LIMIT = 10;
39 protected $_addressField = FALSE;
40 protected $_emailField = FALSE;
41 protected $_phoneField = FALSE;
42 protected $_relationshipColumns = array();
44 protected $_customGroupExtends = array('Contribution');
46 protected $_referenceYear = array(
50 protected $_yearStatisticsFrom = '';
52 protected $_yearStatisticsTo = '';
60 function __construct() {
62 $date = CRM_Core_SelectValues
::date('custom', NULL, $yearsInPast, 0);
63 $count = $date['maxYear'];
64 $optionYear = array('' => ts('- select -'));
66 $this->_yearStatisticsFrom
= $date['minYear'];
67 $this->_yearStatisticsTo
= $date['maxYear'];
69 while ($date['minYear'] <= $count) {
70 $optionYear[$date['minYear']] = $date['minYear'];
74 $relationTypeOp = array();
75 $relationshipTypes = CRM_Core_PseudoConstant
::relationshipType();
76 foreach ($relationshipTypes as $rid => $rtype) {
77 if ($rtype['label_a_b'] != $rtype['label_b_a']) {
78 $relationTypeOp[$rid] = "{$rtype['label_a_b']}/{$rtype['label_b_a']}";
81 $relationTypeOp[$rid] = $rtype['label_a_b'];
85 $this->_columns
= array(
86 'civicrm_contact' => array(
87 'dao' => 'CRM_Contact_DAO_Contact',
90 'title' => ts('Contact Name'),
100 'contact_type' => array(
101 'title' => ts('Contact Type'),
103 'contact_sub_type' => array(
104 'title' => ts('Contact Subtype'),
107 'grouping' => 'contact-fields',
109 'sort_name' => array('title' => ts('Contact Name')),
111 'title' => ts('Contact ID'),
112 'no_display' => TRUE,
116 'civicrm_email' => array(
117 'dao' => 'CRM_Core_DAO_Email',
120 'title' => ts('Email'),
124 'grouping' => 'contact-fields',
126 'civicrm_phone' => array(
127 'dao' => 'CRM_Core_DAO_Phone',
130 'title' => ts('Phone'),
134 'grouping' => 'contact-fields',
136 ) +
$this->addAddressFields(FALSE, FALSE, FALSE, array()) +
array(
137 'civicrm_relationship' => array(
138 'dao' => 'CRM_Contact_DAO_Relationship',
140 'relationship_type_id' => array(
141 'title' => ts('Relationship Type'),
144 'contact_id_a' => array('no_display' => TRUE),
145 'contact_id_b' => array('no_display' => TRUE),
148 'relationship_type_id' => array(
149 'title' => ts('Relationship Type'),
150 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
151 'options' => $relationTypeOp,
152 'type' => CRM_Utils_Type
::T_STRING
,
157 'civicrm_contribution' => array(
158 'dao' => 'CRM_Contribute_DAO_Contribution',
160 'total_amount' => array(
161 'title' => ts('Amount Statistics'),
164 'no_display' => TRUE,
165 'statistics' => array('sum' => ts('Aggregate Amount')),
167 'receive_date' => array(
170 'no_display' => TRUE,
173 'grouping' => 'contri-fields',
175 'this_year' => array(
176 'title' => ts('This Year'),
177 'operatorType' => CRM_Report_Form
::OP_SELECT
,
178 'options' => $optionYear,
181 'other_year' => array(
182 'title' => ts('Other Years'),
183 'operatorType' => CRM_Report_Form
::OP_SELECT
,
184 'options' => $optionYear,
187 'receive_date' => array('operatorType' => CRM_Report_Form
::OP_DATE
),
188 'contribution_status_id' => array(
189 'title' => ts('Contribution Status'),
190 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
191 'options' => CRM_Contribute_PseudoConstant
::contributionStatus(),
192 'default' => array(1),
194 'financial_type_id' => array(
195 'title' => ts('Financial Type'),
196 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
197 'options' => CRM_Contribute_PseudoConstant
::financialType(),
199 'total_amount' => array(
200 'title' => ts('Contribution Amount'),
202 'total_sum' => array(
203 'title' => ts('Aggregate Amount'),
204 'type' => CRM_Report_Form
::OP_INT
,
205 'dbAlias' => 'civicrm_contribution_total_amount_sum',
212 $this->_columns
['civicrm_contribution']['fields']['civicrm_upto_' .
213 $this->_yearStatisticsFrom
] = array(
214 'title' => ts('Up To %1 Donation', array(1 => $this->_yearStatisticsFrom
)),
216 'type' => CRM_Utils_Type
::T_MONEY
,
217 'is_statistics' => TRUE,
220 $yearConter = $this->_yearStatisticsFrom
;
222 while ($yearConter <= $this->_yearStatisticsTo
) {
223 $this->_columns
['civicrm_contribution']['fields'][$yearConter] = array(
224 'title' => ts('%1 Donation', array(1 => $yearConter)),
226 'type' => CRM_Utils_Type
::T_MONEY
,
227 'is_statistics' => TRUE,
232 $this->_columns
['civicrm_contribution']['fields']['aggregate_amount'] = array(
233 'title' => ts('Aggregate Amount'),
234 'type' => CRM_Utils_Type
::T_MONEY
,
235 'is_statistics' => TRUE,
238 $this->_groupFilter
= TRUE;
239 $this->_tagFilter
= TRUE;
240 parent
::__construct();
243 function preProcess() {
244 parent
::preProcess();
249 $this->_columnHeaders
= array();
251 foreach ($this->_columns
as $tableName => $table) {
252 if (array_key_exists('fields', $table)) {
253 foreach ($table['fields'] as $fieldName => $field) {
255 if (!empty($field['required']) ||
256 !empty($this->_params
['fields'][$fieldName])
258 if ($tableName == 'civicrm_address') {
259 $this->_addressField
= TRUE;
261 if ($tableName == 'civicrm_email') {
262 $this->_emailField
= TRUE;
264 if ($tableName == 'civicrm_phone') {
265 $this->_phoneField
= TRUE;
267 if ($tableName == 'civicrm_relationship') {
268 $this->_relationshipColumns
["{$tableName}_{$fieldName}"] = "{$field['dbAlias']} as {$tableName}_{$fieldName}";
269 $this->_columnHeaders
["{$tableName}_{$fieldName}"]['type'] = CRM_Utils_Array
::value('type', $field);
270 $this->_columnHeaders
["{$tableName}_{$fieldName}"]['title'] = $field['title'];
274 if (!empty($field['is_statistics'])) {
275 $this->_columnHeaders
[$fieldName]['type'] = $field['type'];
276 $this->_columnHeaders
[$fieldName]['title'] = $field['title'];
279 elseif ($fieldName == 'receive_date') {
280 if ((CRM_Utils_Array
::value('this_year_op', $this->_params
) ==
281 'fiscal' && !empty($this->_params
['this_year_value'])) ||
282 (CRM_Utils_Array
::value('other_year_op', $this->_params
==
283 'fiscal') && !empty($this->_params
['other_year_value']))
285 $select[] = self
::fiscalYearOffset($field['dbAlias']) .
286 " as {$tableName}_{$fieldName}";
289 $select[] = " YEAR(" . $field['dbAlias'] . ")" .
290 " as {$tableName}_{$fieldName}";
293 elseif ($fieldName == 'total_amount') {
294 $select[] = "SUM({$field['dbAlias']}) as {$tableName}_{$fieldName}";
297 $select[] = "{$field['dbAlias']} as {$tableName}_{$fieldName}";
298 $this->_columnHeaders
["{$tableName}_{$fieldName}"]['type'] = CRM_Utils_Array
::value('type', $field);
299 $this->_columnHeaders
["{$tableName}_{$fieldName}"]['title'] = $field['title'];
301 if (!empty($field['no_display'])) {
302 $this->_columnHeaders
["{$tableName}_{$fieldName}"]['no_display'] = TRUE;
309 $this->_select
= "SELECT " . implode(', ', $select) . " ";
314 FROM civicrm_contact {$this->_aliases['civicrm_contact']}
315 INNER JOIN civicrm_contribution {$this->_aliases['civicrm_contribution']}
316 ON {$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_contribution']}.contact_id AND
317 {$this->_aliases['civicrm_contribution']}.is_test = 0 ";
319 if ($this->_emailField
) {
320 $this->_from
.= " LEFT JOIN civicrm_email {$this->_aliases['civicrm_email']}
321 ON ({$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_email']}.contact_id AND
322 {$this->_aliases['civicrm_email']}.is_primary = 1) ";
325 if ($this->_phoneField
) {
326 $this->_from
.= " LEFT JOIN civicrm_phone {$this->_aliases['civicrm_phone']}
327 ON ({$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_phone']}.contact_id AND
328 {$this->_aliases['civicrm_phone']}.is_primary = 1) ";
331 $relContacAlias = 'contact_relationship';
332 $this->_relationshipFrom
= " INNER JOIN civicrm_relationship {$this->_aliases['civicrm_relationship']}
333 ON (({$this->_aliases['civicrm_relationship']}.contact_id_a = {$relContacAlias}.id OR {$this->_aliases['civicrm_relationship']}.contact_id_b = {$relContacAlias}.id ) AND {$this->_aliases['civicrm_relationship']}.is_active = 1) ";
335 if ($this->_addressField
) {
337 LEFT JOIN civicrm_address {$this->_aliases['civicrm_address']}
338 ON {$this->_aliases['civicrm_contact']}.id =
339 {$this->_aliases['civicrm_address']}.contact_id AND
340 {$this->_aliases['civicrm_address']}.is_primary = 1\n";
345 $whereClauses = $havingClauses = $relationshipWhere = array();
346 $this->_relationshipWhere
= '';
347 $this->_statusClause
= '';
349 foreach ($this->_columns
as $tableName => $table) {
350 if (array_key_exists('filters', $table)) {
351 foreach ($table['filters'] as $fieldName => $field) {
353 if ($fieldName == 'this_year' ||
$fieldName == 'other_year') {
356 elseif (CRM_Utils_Array
::value('type', $field) &
357 CRM_Utils_Type
::T_DATE
359 $relative = CRM_Utils_Array
::value("{$fieldName}_relative", $this->_params
);
360 $from = CRM_Utils_Array
::value("{$fieldName}_from", $this->_params
);
361 $to = CRM_Utils_Array
::value("{$fieldName}_to", $this->_params
);
363 $clause = $this->dateClause($field['name'], $relative, $from, $to, $field['type']);
366 $op = CRM_Utils_Array
::value("{$fieldName}_op", $this->_params
);
368 $clause = $this->whereClause($field,
370 CRM_Utils_Array
::value("{$fieldName}_value", $this->_params
),
371 CRM_Utils_Array
::value("{$fieldName}_min", $this->_params
),
372 CRM_Utils_Array
::value("{$fieldName}_max", $this->_params
)
377 if (!empty($clause)) {
378 if ($tableName == 'civicrm_relationship') {
379 $relationshipWhere[] = $clause;
383 if ($fieldName == 'contribution_status_id') {
384 $this->_statusClause
= " AND " . $clause;
387 if (!empty($field['having'])) {
388 $havingClauses[] = $clause;
391 $whereClauses[] = $clause;
398 if (empty($whereClauses)) {
399 $this->_where
= "WHERE ( 1 ) ";
403 $this->_where
= "WHERE " . implode(' AND ', $whereClauses);
406 if ($this->_aclWhere
) {
407 $this->_where
.= " AND {$this->_aclWhere} ";
410 if (!empty($havingClauses)) {
411 // use this clause to construct group by clause.
412 $this->_having
= "HAVING " . implode(' AND ', $havingClauses);
415 if (!empty($relationshipWhere)) {
416 $this->_relationshipWhere
= ' AND ' .
417 implode(' AND ', $relationshipWhere);
422 $this->_groupBy
= "GROUP BY {$this->_aliases['civicrm_contribution']}.contact_id, YEAR({$this->_aliases['civicrm_contribution']}.receive_date)";
425 //Override to set limit is 10
427 * @param int $rowCount
429 function limit($rowCount = self
::ROW_COUNT_LIMIT
) {
430 parent
::limit($rowCount);
433 //Override to set pager with limit is 10
435 * @param int $rowCount
437 function setPager($rowCount = self
::ROW_COUNT_LIMIT
) {
438 parent
::setPager($rowCount);
446 function statistics(&$rows) {
447 $statistics = parent
::statistics($rows);
449 foreach ($rows as $rownum => $row) {
450 if (is_numeric($rownum)) {
454 $statistics['counts']['rowCount'] = array(
455 'title' => ts('Primary Contact(s) Listed'),
459 if ($this->_rowsFound
&& ($this->_rowsFound
> $count)) {
460 $statistics['counts']['rowsFound'] = array(
461 'title' => ts('Total Primary Contact(s)'),
462 'value' => $this->_rowsFound
,
476 static function formRule($fields, $files, $self) {
478 if (!empty($fields['this_year_value']) &&
479 !empty($fields['other_year_value']) &&
480 ($fields['this_year_value'] == $fields['other_year_value'])
482 $errors['other_year_value'] = ts("Value for filters 'This Year' and 'Other Years' can not be same.");
487 function postProcess() {
488 // get ready with post process params
489 $this->beginPostProcess();
490 $this->fixReportParams();
492 $this->buildACLClause($this->_aliases
['civicrm_contact']);
496 $this->customDataFrom();
502 // build array of result based on column headers. This method also allows
503 // modifying column headers before using it to build result set i.e $rows.
504 $this->buildRows($sql, $rows);
506 // format result set.
507 $this->formatDisplay($rows, FALSE);
509 // assign variables to templates
510 $this->doTemplateAssignment($rows);
512 // do print / pdf / instance stuff if needed
513 $this->endPostProcess($rows);
516 function fixReportParams() {
517 if (!empty($this->_params
['this_year_value'])) {
518 $this->_referenceYear
['this_year'] = $this->_params
['this_year_value'];
520 if (!empty($this->_params
['other_year_value'])) {
521 $this->_referenceYear
['other_year'] = $this->_params
['other_year_value'];
528 function buildRows($sql, &$rows) {
529 $contactIds = array();
533 if (!empty($this->_referenceYear
['other_year'])) {
534 (CRM_Utils_Array
::value('other_year_op', $this->_params
) ==
535 'calendar') ?
$other_receive_date = 'YEAR (contri.receive_date)' : $other_receive_date = self
::fiscalYearOffset('contri.receive_date');
536 $addWhere .= " AND {$this->_aliases['civicrm_contact']}.id NOT IN ( SELECT DISTINCT cont.id FROM civicrm_contact cont, civicrm_contribution contri WHERE cont.id = contri.contact_id AND {$other_receive_date} = {$this->_referenceYear['other_year']} AND contri.is_test = 0 ) ";
538 if (!empty($this->_referenceYear
['this_year'])) {
539 (CRM_Utils_Array
::value('this_year_op', $this->_params
) ==
540 'calendar') ?
$receive_date = 'YEAR (contri.receive_date)' : $receive_date = self
::fiscalYearOffset('contri.receive_date');
541 $addWhere .= " AND {$this->_aliases['civicrm_contact']}.id IN ( SELECT DISTINCT cont.id FROM civicrm_contact cont, civicrm_contribution contri WHERE cont.id = contri.contact_id AND {$receive_date} = {$this->_referenceYear['this_year']} AND contri.is_test = 0 ) ";
544 $getContacts = "SELECT SQL_CALC_FOUND_ROWS {$this->_aliases['civicrm_contact']}.id as cid, SUM({$this->_aliases['civicrm_contribution']}.total_amount) as civicrm_contribution_total_amount_sum {$this->_from} {$this->_where} {$addWhere} GROUP BY {$this->_aliases['civicrm_contact']}.id {$this->_having} {$this->_limit}";
546 $dao = CRM_Core_DAO
::executeQuery($getContacts);
548 while ($dao->fetch()) {
549 $contactIds[] = $dao->cid
;
554 $relationshipRows = array();
555 if (empty($contactIds)) {
559 $primaryContributions = $this->buildContributionRows($contactIds);
561 list($relationshipRows, $relatedContactIds) = $this->buildRelationshipRows($contactIds);
563 if (empty($relatedContactIds)) {
564 $rows = $primaryContributions;
568 $relatedContributions = $this->buildContributionRows($relatedContactIds);
570 $summaryYears = array();
571 $summaryYears[] = "civicrm_upto_{$this->_yearStatisticsFrom}";
572 $yearConter = $this->_yearStatisticsFrom
;
574 while ($yearConter <= $this->_yearStatisticsTo
) {
575 $summaryYears[] = $yearConter;
578 $summaryYears[] = 'aggregate_amount';
580 foreach ($primaryContributions as $cid => $primaryRow) {
582 if (!isset($relationshipRows[$cid])) {
587 $total['civicrm_contact_sort_name'] = ts('Total');
588 foreach ($summaryYears as $year) {
589 $total[$year] = CRM_Utils_Array
::value($year, $primaryRow, 0);
592 $relatedContact = FALSE;
594 foreach ($relationshipRows[$cid] as $relcid => $relRow) {
595 if (!isset($relatedContributions[$relcid])) {
598 $relatedContact = TRUE;
599 $relatedRow = $relatedContributions[$relcid];
600 foreach ($summaryYears as $year) {
601 $total[$year] +
= CRM_Utils_Array
::value($year, $relatedRow, 0);
604 foreach (array_keys($this->_relationshipColumns
) as $col) {
605 if (!empty($relRow[$col])) {
606 $relatedRow[$col] = $relRow[$col];
609 $rows["{$cid}_{$relcid}"] = $relatedRow;
611 if ($relatedContact) {
612 $rows["{$cid}_total"] = $total;
613 $rows["{$cid}_bank"] = array('civicrm_contact_sort_name' => ' ');
623 function buildContributionRows($contactIds) {
625 if (empty($contactIds)) {
630 "{$this->_select} {$this->_from} WHERE {$this->_aliases['civicrm_contact']}.id IN (" .
631 implode(',', $contactIds) .
632 ") AND {$this->_aliases['civicrm_contribution']}.is_test = 0 {$this->_statusClause} {$this->_groupBy} ";
634 $dao = CRM_Core_DAO
::executeQuery($sqlContribution);
635 $contributionSum = 0;
637 while ($dao->fetch()) {
638 if (!$dao->civicrm_contact_id
) {
642 foreach ($this->_columnHeaders
as $key => $value) {
643 if (property_exists($dao, $key)) {
644 $rows[$dao->civicrm_contact_id
][$key] = $dao->$key;
647 if ($dao->civicrm_contribution_receive_date
) {
648 if ($dao->civicrm_contribution_receive_date
>
649 $this->_yearStatisticsFrom
651 $rows[$dao->civicrm_contact_id
][$dao->civicrm_contribution_receive_date
] = $dao->civicrm_contribution_total_amount
;
654 if (!isset($rows[$dao->civicrm_contact_id
]["civicrm_upto_{$this->_yearStatisticsFrom}"])) {
655 $rows[$dao->civicrm_contact_id
]["civicrm_upto_{$this->_yearStatisticsFrom}"] = 0;
658 $rows[$dao->civicrm_contact_id
]["civicrm_upto_{$this->_yearStatisticsFrom}"] +
= $dao->civicrm_contribution_total_amount
;
662 if (!isset($rows[$dao->civicrm_contact_id
]['aggregate_amount'])) {
663 $rows[$dao->civicrm_contact_id
]['aggregate_amount'] = 0;
665 $rows[$dao->civicrm_contact_id
]['aggregate_amount'] +
= $dao->civicrm_contribution_total_amount
;
676 function buildRelationshipRows($contactIds) {
677 $relationshipRows = $relatedContactIds = array();
678 if (empty($contactIds)) {
679 return array($relationshipRows, $relatedContactIds);
682 $relContactAlias = 'contact_relationship';
684 if (!empty($this->_relationshipColumns
)) {
685 $addRelSelect = ', ' . implode(', ', $this->_relationshipColumns
);
688 "SELECT {$this->_aliases['civicrm_relationship']}.relationship_type_id as relationship_type_id, {$this->_aliases['civicrm_relationship']}.contact_id_a as contact_id_a, {$this->_aliases['civicrm_relationship']}.contact_id_b as contact_id_b {$addRelSelect} FROM civicrm_contact {$relContactAlias} {$this->_relationshipFrom} WHERE {$relContactAlias}.id IN (" .
689 implode(',', $contactIds) .
690 ") AND {$this->_aliases['civicrm_relationship']}.is_active = 1 {$this->_relationshipWhere} GROUP BY {$this->_aliases['civicrm_relationship']}.contact_id_a, {$this->_aliases['civicrm_relationship']}.contact_id_b";
691 $relationshipTypes = CRM_Core_PseudoConstant
::relationshipType();
693 $dao = CRM_Core_DAO
::executeQuery($sqlRelationship);
694 while ($dao->fetch()) {
696 foreach (array_keys($this->_relationshipColumns
) as $rel_column) {
697 $row[$rel_column] = $dao->$rel_column;
699 if (in_array($dao->contact_id_a
, $contactIds)) {
700 $row['civicrm_relationship_relationship_type_id'] = $relationshipTypes[$dao->relationship_type_id
]['label_a_b'];
701 $row['civicrm_relationship_contact_id'] = $dao->contact_id_b
;
702 $relationshipRows[$dao->contact_id_a
][$dao->contact_id_b
] = $row;
703 $relatedContactIds[$dao->contact_id_b
] = $dao->contact_id_b
;
705 if (in_array($dao->contact_id_b
, $contactIds)) {
706 $row['civicrm_relationship_contact_id'] = $dao->contact_id_a
;
707 $row['civicrm_relationship_relationship_type_id'] = $relationshipTypes[$dao->relationship_type_id
]['label_b_a'];
708 $relationshipRows[$dao->contact_id_b
][$dao->contact_id_a
] = $row;
709 $relatedContactIds[$dao->contact_id_a
] = $dao->contact_id_a
;
713 return array($relationshipRows, $relatedContactIds);
716 // Override "This Year" $op options
718 * @param string $type
719 * @param null $fieldName
723 function getOperationPair($type = "string", $fieldName = NULL) {
724 if ($fieldName == 'this_year' ||
$fieldName == 'other_year') {
726 'calendar' => ts('Is Calendar Year'),
727 'fiscal' => ts('Fiscal Year Starting')
730 return parent
::getOperationPair($type, $fieldName);
736 function alterDisplay(&$rows) {
742 $last_primary = NULL;
743 foreach ($rows as $rowNum => $row) {
744 // Highlight primary contact and amount row
745 if (is_numeric($rowNum) ||
746 ($last_primary && ($rowNum == "{$last_primary}_total"))
748 if (is_numeric($rowNum)) {
749 $last_primary = $rowNum;
751 foreach ($row as $key => $value) {
752 if ($key == 'civicrm_contact_id') {
760 if ($last_primary && ($rowNum == "{$last_primary}_total")) {
761 $value = CRM_Utils_Money
::format($value, ' ');
763 $row[$key] = '<strong>' . $value . '</strong>';
765 $rows[$rowNum] = $row;
768 // Convert Display name into link
769 if (!empty($row['civicrm_contact_sort_name']) &&
770 !empty($row['civicrm_contact_id'])
772 $url = CRM_Report_Utils_Report
::getNextUrl('contribute/detail',
773 'reset=1&force=1&id_op=eq&id_value=' . $row['civicrm_contact_id'],
774 $this->_absoluteUrl
, $this->_id
776 $rows[$rowNum]['civicrm_contact_sort_name_link'] = $url;
777 $rows[$rowNum]['civicrm_contact_sort_name_hover'] = ts("View Contribution Details for this Contact.");