/** * Add link fields to the row. * * Function adds the _link & _hover fields to the row. * * @param array $row * @param string $baseUrl * @param string $linkText * @param string $value * @param string $fieldName * @param string $tablePrefix * @param string $fieldLabel * * @return mixed */ protected function addLinkToRow(&$row, $baseUrl, $linkText, $value, $fieldName, $tablePrefix, $fieldLabel) { $criteriaQueryParams = CRM_Report_Utils_Report::getPreviewCriteriaQueryParams($this->_defaults, $this->_params); $url = CRM_Report_Utils_Report::getNextUrl($baseUrl, "reset=1&force=1&{$criteriaQueryParams}&" . $fieldName . "_op=in&{$fieldName}_value={$value}", $this->_absoluteUrl, $this->_id); $row["{$tablePrefix}_{$fieldName}_link"] = $url; $row["{$tablePrefix}_{$fieldName}_hover"] = ts("%1 for this %2.", array(1 => $linkText, 2 => $fieldLabel)); }
function alterDisplayAddressFields(&$row, &$rows, &$rowNum, $baseUrl, $urltxt) { $criteriaQueryParams = CRM_Report_Utils_Report::getPreviewCriteriaQueryParams($this->_defaults, $this->_params); $entryFound = FALSE; // handle country if (array_key_exists('civicrm_address_country_id', $row)) { if ($value = $row['civicrm_address_country_id']) { $rows[$rowNum]['civicrm_address_country_id'] = CRM_Core_PseudoConstant::country($value, FALSE); $url = CRM_Report_Utils_Report::getNextUrl($baseUrl, "reset=1&force=1&{$criteriaQueryParams}&" . "country_id_op=in&country_id_value={$value}", $this->_absoluteUrl, $this->_id); $rows[$rowNum]['civicrm_address_country_id_link'] = $url; $rows[$rowNum]['civicrm_address_country_id_hover'] = ts("%1 for this country.", array(1 => $urltxt)); } $entryFound = TRUE; } if (array_key_exists('civicrm_address_county_id', $row)) { if ($value = $row['civicrm_address_county_id']) { $rows[$rowNum]['civicrm_address_county_id'] = CRM_Core_PseudoConstant::county($value, FALSE); $url = CRM_Report_Utils_Report::getNextUrl($baseUrl, "reset=1&force=1&{$criteriaQueryParams}&" . "county_id_op=in&county_id_value={$value}", $this->_absoluteUrl, $this->_id); $rows[$rowNum]['civicrm_address_county_id_link'] = $url; $rows[$rowNum]['civicrm_address_county_id_hover'] = ts("%1 for this county.", array(1 => $urltxt)); } $entryFound = TRUE; } // handle state province if (array_key_exists('civicrm_address_state_province_id', $row)) { if ($value = $row['civicrm_address_state_province_id']) { $rows[$rowNum]['civicrm_address_state_province_id'] = CRM_Core_PseudoConstant::stateProvince($value, FALSE); $url = CRM_Report_Utils_Report::getNextUrl($baseUrl, "reset=1&force=1&{$criteriaQueryParams}&state_province_id_op=in&state_province_id_value={$value}", $this->_absoluteUrl, $this->_id); $rows[$rowNum]['civicrm_address_state_province_id_link'] = $url; $rows[$rowNum]['civicrm_address_state_province_id_hover'] = ts("%1 for this state.", array(1 => $urltxt)); } $entryFound = TRUE; } return $entryFound; }