Commit c1e7c642 authored by sluc23's avatar sluc23

show disabled campaigns in red in parent class

parent 5bd0ac47
......@@ -559,6 +559,38 @@ class CRM_Reportplus_Form extends CRM_Report_Form {
parent::limit($rowCount);
}
/**
* Alter display of rows.
*
* Iterate through the rows retrieved via SQL and make changes for display purposes,
* such as rendering contacts as links.
*
* @param array $rows
* Rows generated by SQL, with an array for each row.
*/
public function alterDisplay(&$rows) {
$entryFound = FALSE;
foreach ($rows as $rowNum => $row) {
// If using campaigns, convert campaign_id to campaign title
if (array_key_exists('civicrm_contribution_campaign_id', $row)) {
if ($value = $row['civicrm_contribution_campaign_id']) {
if (array_key_exists($value, $this->_disabledCampaigns)) {
$rows[$rowNum]['civicrm_contribution_campaign_id'] = '<font color="#FF0000">' . $this->_disabledCampaigns[$value] . '</font>';
}
else{
$rows[$rowNum]['civicrm_contribution_campaign_id'] = $this->_activeCampaigns[$value];
}
}
$entryFound = TRUE;
}
// skip looking further in rows, if first row itself doesn't
// have the column we need
if (!$entryFound) {
break;
}
}
}
/**
* Override to set pager with limit is 10
* @param int $rowCount
......
......@@ -608,6 +608,8 @@ UNION ALL
* Rows generated by SQL, with an array for each row.
*/
public function alterDisplay(&$rows) {
parent::alterDisplay($rows);
$checkList = array();
$entryFound = FALSE;
$display_flag = $prev_cid = $cid = 0;
......@@ -708,14 +710,6 @@ UNION ALL
$entryFound = TRUE;
}
// convert campaign_id to campaign title
if (array_key_exists('civicrm_contribution_campaign_id', $row)) {
if ($value = $row['civicrm_contribution_campaign_id']) {
$rows[$rowNum]['civicrm_contribution_campaign_id'] = $this->_activeCampaigns[$value];
$entryFound = TRUE;
}
}
// soft credits
if (array_key_exists('civicrm_contribution_soft_credits', $row) &&
'Contribution' ==
......
......@@ -324,6 +324,8 @@ class CRM_Reportplus_Form_Member_Detail extends CRM_Reportplus_Form {
* Rows generated by SQL, with an array for each row.
*/
public function alterDisplay(&$rows) {
parent::alterDisplay($rows);
$entryFound = FALSE;
$checkList = array();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment