本文整理汇总了PHP中CRM_Report_Utils_Report::getNextUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Report_Utils_Report::getNextUrl方法的具体用法?PHP CRM_Report_Utils_Report::getNextUrl怎么用?PHP CRM_Report_Utils_Report::getNextUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Report_Utils_Report
的用法示例。
在下文中一共展示了CRM_Report_Utils_Report::getNextUrl方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: alterDisplay
function alterDisplay(&$rows)
{
// cache for id → is_deleted mapping
$isDeleted = array();
foreach ($rows as &$row) {
if (!isset($isDeleted[$row['log_civicrm_contact_id']])) {
$isDeleted[$row['log_civicrm_contact_id']] = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $row['log_civicrm_contact_id'], 'is_deleted') !== '0';
}
if (!$isDeleted[$row['log_civicrm_contact_id']]) {
$row['log_civicrm_contact_altered_contact_link'] = CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $row['log_civicrm_contact_id']);
$row['log_civicrm_contact_altered_contact_hover'] = ts("Go to contact summary");
}
$row['civicrm_contact_altered_by_link'] = CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $row['log_civicrm_contact_log_user_id']);
$row['civicrm_contact_altered_by_hover'] = ts("Go to contact summary");
if ($row['log_civicrm_contact_is_deleted'] and $row['log_civicrm_contact_log_action'] == 'Update') {
$row['log_civicrm_contact_log_action'] = ts('Delete (to trash)');
}
if ($row['log_civicrm_contact_log_action'] == 'Update') {
$q = "reset=1&log_conn_id={$row['log_civicrm_contact_log_conn_id']}&log_date={$row['log_civicrm_contact_log_date']}";
$url = CRM_Report_Utils_Report::getNextUrl('logging/contact/detail', $q, false, true);
$row['log_civicrm_contact_log_action_link'] = $url;
$row['log_civicrm_contact_log_action_hover'] = ts("View details for this update");
$row['log_civicrm_contact_log_action'] = '<div class="icon details-icon"></div> ' . ts('Update');
}
unset($row['log_civicrm_contact_log_user_id']);
unset($row['log_civicrm_contact_log_conn_id']);
}
}
示例2: buildRows
function buildRows($sql, &$rows)
{
// safeguard for when there aren’t any log entries yet
if (!$this->log_conn_id or !$this->log_date) {
return;
}
$params = array(1 => array($this->log_conn_id, 'Integer'), 2 => array($this->log_date, 'String'));
// let the template know who updated whom when
$sql = "\n SELECT who.id who_id, who.display_name who_name, whom.id whom_id, whom.display_name whom_name, l.is_deleted\n FROM `{$this->loggingDB}`.log_civicrm_contact l\n JOIN civicrm_contact who ON (l.log_user_id = who.id)\n JOIN civicrm_contact whom ON (l.id = whom.id)\n WHERE log_action = 'Update' AND log_conn_id = %1 AND log_date = %2 ORDER BY log_date DESC LIMIT 1\n ";
$dao =& CRM_Core_DAO::executeQuery($sql, $params);
$dao->fetch();
$this->assign('who_url', CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$dao->who_id}"));
$this->assign('whom_url', CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$dao->whom_id}"));
$this->assign('who_name', $dao->who_name);
$this->assign('whom_name', $dao->whom_name);
$this->assign('log_date', $this->log_date);
// link back to summary report
require_once 'CRM/Report/Utils/Report.php';
$this->assign('summaryReportURL', CRM_Report_Utils_Report::getNextUrl('logging/contact/summary', 'reset=1', false, true));
$rows = $this->diffsInTable('log_civicrm_contact');
// add custom data changes
$dao = CRM_Core_DAO::executeQuery("SHOW TABLES FROM `{$this->loggingDB}` LIKE 'log_civicrm_value_%'");
while ($dao->fetch()) {
$table = $dao->toValue("Tables_in_{$this->loggingDB}_(log_civicrm_value_%)");
$rows = array_merge($rows, $this->diffsInTable($table));
}
}
示例3: alterDisplay
/**
* 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)
{
// cache for id → is_deleted mapping
$isDeleted = array();
foreach ($rows as &$row) {
if (!isset($isDeleted[$row['civicrm_contact_is_deleted']])) {
$isDeleted[$row['civicrm_contact_is_deleted']] = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $row['civicrm_contact_altered_contact_id'], 'is_deleted') !== '0';
}
if (!$isDeleted[$row['civicrm_contact_is_deleted']]) {
$row['civicrm_contact_altered_contact_display_name_link'] = CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $row['log_civicrm_contribution_contact_id']);
$row['civicrm_contact_altered_contact_display_name_hover'] = ts('Go to contact summary');
}
$row['civicrm_contact_altered_by_display_name_link'] = CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $row['log_civicrm_contribution_log_user_id']);
$row['civicrm_contact_altered_by_display_name_hover'] = ts('Go to contact summary');
if ($row['civicrm_contact_altered_contact_is_deleted'] and $row['log_civicrm_contribution_log_action'] == 'Update') {
$row['log_civicrm_contribution_log_action'] = ts('Delete');
}
if ($row['log_civicrm_contribution_log_action'] == 'Update') {
$q = "reset=1&log_conn_id={$row['log_civicrm_contribution_log_conn_id']}&log_date={$row['log_civicrm_contribution_log_date']}";
if ($this->cid) {
$q .= '&cid=' . $this->cid;
}
$url = CRM_Report_Utils_Report::getNextUrl('logging/contribute/detail', $q, FALSE, TRUE);
$row['log_civicrm_contribution_log_action_link'] = $url;
$row['log_civicrm_contribution_log_action_hover'] = ts('View details for this update');
$row['log_civicrm_contribution_log_action'] = '<div class="icon ui-icon-zoomin"></div> ' . ts('Update');
}
unset($row['log_civicrm_contribute_log_user_id']);
unset($row['log_civicrm_contribute_log_conn_id']);
}
}
示例4: buildQuickForm
function buildQuickForm()
{
parent::buildQuickForm();
if ($this->cid) {
// link back to contact summary
$this->assign('backURL', CRM_Utils_System::url('civicrm/contact/view', "reset=1&selectedChild=log&cid={$this->cid}", FALSE, NULL, FALSE));
$this->assign('revertURL', self::$_template->get_template_vars('revertURL') . "&cid={$this->cid}");
} else {
// link back to summary report
$this->assign('backURL', CRM_Report_Utils_Report::getNextUrl('logging/contact/summary', 'reset=1', FALSE, TRUE));
}
}
示例5: alterDisplay
function alterDisplay(&$rows)
{
// cache for id → is_deleted mapping
$isDeleted = array();
$newRows = array();
foreach ($rows as $key => &$row) {
if (!isset($isDeleted[$row['log_civicrm_entity_altered_contact_id']])) {
$isDeleted[$row['log_civicrm_entity_altered_contact_id']] = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $row['log_civicrm_entity_altered_contact_id'], 'is_deleted') !== '0';
}
if (!$isDeleted[$row['log_civicrm_entity_altered_contact_id']]) {
$row['log_civicrm_entity_altered_contact_link'] = CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $row['log_civicrm_entity_altered_contact_id']);
$row['log_civicrm_entity_altered_contact_hover'] = ts("Go to contact summary");
$entity = $this->getEntityValue($row['log_civicrm_entity_id'], $row['log_civicrm_entity_log_type']);
if ($entity) {
$row['log_civicrm_entity_altered_contact'] = $row['log_civicrm_entity_altered_contact'] . " [{$entity}]";
}
}
$row['altered_by_contact_display_name_link'] = CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $row['log_civicrm_entity_log_user_id']);
$row['altered_by_contact_display_name_hover'] = ts("Go to contact summary");
if ($row['log_civicrm_entity_is_deleted'] and $row['log_civicrm_entity_log_action'] == 'Update') {
$row['log_civicrm_entity_log_action'] = ts('Delete (to trash)');
}
if ('Contact' == CRM_Utils_Array::value('log_type', $this->_logTables[$row['log_civicrm_entity_log_type']]) && $row['log_civicrm_entity_log_action'] == 'Insert') {
$row['log_civicrm_entity_log_action'] = ts('Update');
}
if ($newAction = $this->getEntityAction($row['log_civicrm_entity_id'], $row['log_civicrm_entity_log_conn_id'], $row['log_civicrm_entity_log_type'])) {
$row['log_civicrm_entity_log_action'] = $newAction;
}
$row['log_civicrm_entity_log_type'] = $this->getLogType($row['log_civicrm_entity_log_type']);
if ($row['log_civicrm_entity_log_action'] == 'Update') {
$q = "reset=1&log_conn_id={$row['log_civicrm_entity_log_conn_id']}&log_date={$row['log_civicrm_entity_log_date']}";
if ($this->cid) {
$q .= '&cid=' . $this->cid;
}
$url = CRM_Report_Utils_Report::getNextUrl('logging/contact/detail', $q, FALSE, TRUE);
$row['log_civicrm_entity_log_action_link'] = $url;
$row['log_civicrm_entity_log_action_hover'] = ts("View details for this update");
$row['log_civicrm_entity_log_action'] = '<div class="icon details-icon"></div> ' . ts('Update');
}
$date = CRM_Utils_Date::isoToMysql($row['log_civicrm_entity_log_date']);
$key = $date . '_' . $row['log_civicrm_entity_log_type'] . '_' . $row['log_civicrm_entity_log_conn_id'] . '_' . $row['log_civicrm_entity_log_user_id'];
$newRows[$key] = $row;
unset($row['log_civicrm_entity_log_user_id']);
unset($row['log_civicrm_entity_log_conn_id']);
}
krsort($newRows);
$rows = $newRows;
}
示例6: addLinkToRow
/**
* 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));
}
示例7: alterDisplay
function alterDisplay(&$rows)
{
// custom code to alter rows
$entryFound = FALSE;
$dispname_flag = $phone_flag = $email_flag = 0;
$prev_email = $prev_dispname = $prev_phone = NULL;
foreach ($rows as $rowNum => $row) {
// Link constituent (contributor) to contribution detail
if (array_key_exists('civicrm_contact_display_name_constituent', $row) && array_key_exists('civicrm_contact_id_constituent', $row)) {
$url = CRM_Report_Utils_Report::getNextUrl('contribute/detail', 'reset=1&force=1&id_op=eq&id_value=' . $row['civicrm_contact_id_constituent'], $this->_absoluteUrl, $this->_id, $this->_drilldownReport);
$rows[$rowNum]['civicrm_contact_display_name_constituent_link'] = $url;
$rows[$rowNum]['civicrm_contact_display_name_constituent_hover'] = ts('List all direct contribution(s) from this contact.');
$entryFound = TRUE;
}
// convert soft credit contact name to link
if (array_key_exists('civicrm_contact_display_name_creditor', $row) && !empty($rows[$rowNum]['civicrm_contact_display_name_creditor']) && array_key_exists('civicrm_contact_id_creditor', $row)) {
$url = CRM_Utils_System::url("civicrm/contact/view", 'reset=1&cid=' . $row['civicrm_contact_id_creditor'], $this->_absoluteUrl);
$rows[$rowNum]['civicrm_contact_display_name_creditor_link'] = $url;
$rows[$rowNum]['civicrm_contact_display_name_creditor_hover'] = ts("view contact summary");
}
// make subtotals look nicer
if (array_key_exists('civicrm_contact_id_constituent', $row) && !$row['civicrm_contact_id_constituent']) {
$this->fixSubTotalDisplay($rows[$rowNum], $this->_statFields);
$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;
}
}
//convert soft_credit_type_id into label
if (array_key_exists('civicrm_contribution_soft_soft_credit_type_id', $rows[$rowNum])) {
$rows[$rowNum]['civicrm_contribution_soft_soft_credit_type_id'] = CRM_Core_OptionGroup::getLabel('soft_credit_type', $row['civicrm_contribution_soft_soft_credit_type_id']);
}
// skip looking further in rows, if first row itself doesn't
// have the column we need
if (!$entryFound) {
break;
}
}
$this->removeDuplicates($rows);
}
示例8: alterDisplay
/**
* 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;
$checkList = array();
foreach ($rows as $rowNum => $row) {
if (!empty($this->_noRepeats) && $this->_outputMode != 'csv') {
// not repeat contact display names if it matches with the one
// in previous row
$repeatFound = FALSE;
foreach ($row as $colName => $colVal) {
if (!empty($checkList[$colName]) && is_array($checkList[$colName]) && in_array($colVal, $checkList[$colName])) {
$rows[$rowNum][$colName] = "";
$repeatFound = TRUE;
}
if (in_array($colName, $this->_noRepeats)) {
$checkList[$colName][] = $colVal;
}
}
}
//handle the Membership Type Ids
if (array_key_exists('civicrm_membership_membership_type_id', $row)) {
if ($value = $row['civicrm_membership_membership_type_id']) {
$rows[$rowNum]['civicrm_membership_membership_type_id'] = CRM_Member_PseudoConstant::membershipType($value, FALSE);
}
$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);
}
$entryFound = TRUE;
}
// 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);
}
$entryFound = TRUE;
}
// convert display name to links
if (array_key_exists('civicrm_contact_sort_name', $row) && array_key_exists('civicrm_contact_id', $row)) {
$url = CRM_Report_Utils_Report::getNextUrl('member/detail', 'reset=1&force=1&id_op=eq&id_value=' . $row['civicrm_contact_id'], $this->_absoluteUrl, $this->_id, $this->_drilldownReport);
$rows[$rowNum]['civicrm_contact_sort_name_link'] = $url;
$rows[$rowNum]['civicrm_contact_sort_name_hover'] = ts("View Membership Detail for this Contact.");
}
// If using campaigns, convert campaign_id to campaign title
if (array_key_exists('civicrm_membership_campaign_id', $row)) {
if ($value = $row['civicrm_membership_campaign_id']) {
$rows[$rowNum]['civicrm_membership_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;
}
}
}
示例9: alterDisplay
/**
* 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;
$eventType = CRM_Core_OptionGroup::values('event_type');
foreach ($rows as $rowNum => $row) {
// convert sort name to links
if (array_key_exists('civicrm_contact_sort_name', $row) && array_key_exists('civicrm_contact_id', $row)) {
if ($value = $row['civicrm_contact_sort_name']) {
$url = CRM_Utils_System::url("civicrm/contact/view", 'reset=1&cid=' . $row['civicrm_contact_id'], $this->_absoluteUrl);
$rows[$rowNum]['civicrm_contact_sort_name_link'] = $url;
$rows[$rowNum]['civicrm_contact_sort_name_hover'] = ts("View Contact Summary for this Contact.");
}
$entryFound = TRUE;
}
// convert participant ID to links
if (array_key_exists('civicrm_participant_participant_id', $row) && array_key_exists('civicrm_contact_id', $row)) {
if ($value = $row['civicrm_participant_participant_id']) {
$url = CRM_Utils_System::url("civicrm/contact/view/participant", 'reset=1&id=' . $row['civicrm_participant_participant_id'] . '&cid=' . $row['civicrm_contact_id'] . '&action=view&context=participant', $this->_absoluteUrl);
$rows[$rowNum]['civicrm_participant_participant_id_link'] = $url;
$rows[$rowNum]['civicrm_participant_participant_id_hover'] = ts("View Participant Record for this Contact.");
}
$entryFound = TRUE;
}
// convert event name to links
if (array_key_exists('civicrm_participant_event_id', $row)) {
if ($value = $row['civicrm_participant_event_id']) {
$rows[$rowNum]['civicrm_participant_event_id'] = CRM_Event_PseudoConstant::event($value, FALSE);
$url = CRM_Report_Utils_Report::getNextUrl('event/Income', 'reset=1&force=1&event_id_op=eq&event_id_value=' . $value, $this->_absoluteUrl, $this->_id, $this->_drilldownReport);
$rows[$rowNum]['civicrm_participant_event_id_link'] = $url;
$rows[$rowNum]['civicrm_participant_event_id_hover'] = ts("View Event Income Details for this Event");
}
$entryFound = TRUE;
}
// handle event type id
if (array_key_exists('civicrm_event_event_type_id', $row)) {
if ($value = $row['civicrm_event_event_type_id']) {
$rows[$rowNum]['civicrm_event_event_type_id'] = $eventType[$value];
}
$entryFound = TRUE;
}
// handle participant status id
if (array_key_exists('civicrm_participant_status_id', $row)) {
if ($value = $row['civicrm_participant_status_id']) {
$rows[$rowNum]['civicrm_participant_status_id'] = CRM_Event_PseudoConstant::participantStatus($value, FALSE);
}
$entryFound = TRUE;
}
// handle participant role id
if (array_key_exists('civicrm_participant_role_id', $row)) {
if ($value = $row['civicrm_participant_role_id']) {
$roles = explode(CRM_Core_DAO::VALUE_SEPARATOR, $value);
$value = array();
foreach ($roles as $role) {
$value[$role] = CRM_Event_PseudoConstant::participantRole($role, FALSE);
}
$rows[$rowNum]['civicrm_participant_role_id'] = implode(', ', $value);
}
$entryFound = TRUE;
}
//handle gender
if (array_key_exists('civicrm_contact_gender_id', $row)) {
if ($value = $row['civicrm_contact_gender_id']) {
$gender = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id');
$rows[$rowNum]['civicrm_contact_gender_id'] = $gender[$value];
}
$entryFound = TRUE;
}
// display birthday in the configured custom format
if (array_key_exists('civicrm_contact_birth_date', $row)) {
$birthDate = $row['civicrm_contact_birth_date'];
if ($birthDate) {
$rows[$rowNum]['civicrm_contact_birth_date'] = CRM_Utils_Date::customFormat($birthDate, '%Y%m%d');
}
$entryFound = TRUE;
}
// skip looking further in rows, if first row itself doesn't
// have the column we need
if (!$entryFound) {
break;
}
}
}
示例10: alterDisplay
/**
* @param $rows
*/
function alterDisplay(&$rows)
{
// custom code to alter rows
$entryFound = FALSE;
foreach ($rows as $rowNum => $row) {
// make count columns point to detail report
// convert sort name to links
if (array_key_exists('civicrm_contact_sort_name', $row) && array_key_exists('civicrm_contact_id', $row)) {
$url = CRM_Report_Utils_Report::getNextUrl('contact/detail', 'reset=1&force=1&id_op=eq&id_value=' . $row['civicrm_contact_id'], $this->_absoluteUrl, $this->_id, $this->_drilldownReport);
$rows[$rowNum]['civicrm_contact_sort_name_link'] = $url;
$rows[$rowNum]['civicrm_contact_sort_name_hover'] = ts("View Constituent Detail Report for this contact.");
$entryFound = TRUE;
}
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);
}
$entryFound = TRUE;
}
// skip looking further in rows, if first row itself doesn't
// have the column we need
if (!$entryFound) {
break;
}
}
}
示例11: alterDisplay
function alterDisplay(&$rows)
{
// custom code to alter rows
$checkList = array();
$entryFound = false;
$display_flag = $prev_cid = $cid = 0;
$contributionTypes = CRM_Contribute_PseudoConstant::contributionType();
foreach ($rows as $rowNum => $row) {
if (!empty($this->_noRepeats) && $this->_outputMode != 'csv') {
// don't repeat contact details if its same as the previous row
if (array_key_exists('civicrm_contact_id', $row)) {
if ($cid = $row['civicrm_contact_id']) {
if ($rowNum == 0) {
$prev_cid = $cid;
} else {
if ($prev_cid == $cid) {
$display_flag = 1;
$prev_cid = $cid;
} else {
$display_flag = 0;
$prev_cid = $cid;
}
}
if ($display_flag) {
foreach ($row as $colName => $colVal) {
if (in_array($colName, $this->_noRepeats)) {
unset($rows[$rowNum][$colName]);
}
}
}
$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('contribute/detail', "reset=1&force=1&" . "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("List all contribution(s) for this State.");
}
$entryFound = true;
}
// 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('contribute/detail', "reset=1&force=1&" . "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("List all contribution(s) for this Country.");
}
$entryFound = true;
}
// convert display name to links
if (array_key_exists('civicrm_contact_display_name', $row) && CRM_Utils_Array::value('civicrm_contact_display_name', $rows[$rowNum]) && array_key_exists('civicrm_contact_id', $row)) {
$url = CRM_Utils_System::url("civicrm/contact/view", 'reset=1&cid=' . $row['civicrm_contact_id'], $this->_absoluteUrl);
$rows[$rowNum]['civicrm_contact_display_name_link'] = $url;
$rows[$rowNum]['civicrm_contact_display_name_hover'] = ts("View Contact Summary for this Contact.");
}
if ($value = CRM_Utils_Array::value('civicrm_contribution_contribution_type_id', $row)) {
$rows[$rowNum]['civicrm_contribution_contribution_type_id'] = $contributionTypes[$value];
$entryFound = true;
}
// skip looking further in rows, if first row itself doesn't
// have the column we need
if (!$entryFound) {
break;
}
$lastKey = $rowNum;
}
}
示例12: alterDisplay
function alterDisplay(&$rows)
{
// custom code to alter rows
$entryFound = FALSE;
foreach ($rows as $rowNum => $row) {
//Convert Display name into link
if (array_key_exists('civicrm_contact_sort_name', $row) && array_key_exists('civicrm_contribution_contact_id', $row)) {
$url = CRM_Report_Utils_Report::getNextUrl('contribute/detail', 'reset=1&force=1&id_op=eq&id_value=' . $row['civicrm_contribution_contact_id'], $this->_absoluteUrl, $this->_id, $this->_drilldownReport);
$rows[$rowNum]['civicrm_contact_sort_name_link'] = $url;
$rows[$rowNum]['civicrm_contact_sort_name_hover'] = ts("View Contribution Details for this Contact.");
$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;
}
}
$entryFound = $this->alterDisplayAddressFields($row, $rows, $rowNum, 'contribute/detail', 'List all contribution(s)') ? TRUE : $entryFound;
// skip looking further in rows, if first row itself doesn't
// have the column we need
if (!$entryFound) {
break;
}
}
}
示例13: alterDisplay
/**
* @param $rows
*/
function alterDisplay(&$rows)
{
// cache for id → is_deleted mapping
$isDeleted = array();
$newRows = array();
foreach ($rows as $key => &$row) {
if (!isset($isDeleted[$row['log_civicrm_entity_altered_contact_id']])) {
$isDeleted[$row['log_civicrm_entity_altered_contact_id']] = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $row['log_civicrm_entity_altered_contact_id'], 'is_deleted') !== '0';
}
if (!empty($row['log_civicrm_entity_altered_contact']) && !$isDeleted[$row['log_civicrm_entity_altered_contact_id']]) {
$row['log_civicrm_entity_altered_contact_link'] = CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $row['log_civicrm_entity_altered_contact_id']);
$row['log_civicrm_entity_altered_contact_hover'] = ts("Go to contact summary");
$entity = $this->getEntityValue($row['log_civicrm_entity_id'], $row['log_civicrm_entity_log_type'], $row['log_civicrm_entity_log_date']);
if ($entity) {
$row['log_civicrm_entity_altered_contact'] = $row['log_civicrm_entity_altered_contact'] . " [{$entity}]";
}
}
$row['altered_by_contact_display_name_link'] = CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $row['log_civicrm_entity_log_user_id']);
$row['altered_by_contact_display_name_hover'] = ts("Go to contact summary");
if ($row['log_civicrm_entity_is_deleted'] and 'Update' == CRM_Utils_Array::value('log_civicrm_entity_log_action', $row)) {
$row['log_civicrm_entity_log_action'] = ts('Delete (to trash)');
}
if ('Contact' == CRM_Utils_Array::value('log_type', $this->_logTables[$row['log_civicrm_entity_log_type']]) && CRM_Utils_Array::value('log_civicrm_entity_log_action', $row) == 'Insert') {
$row['log_civicrm_entity_log_action'] = ts('Update');
}
if ($newAction = $this->getEntityAction($row['log_civicrm_entity_id'], $row['log_civicrm_entity_log_conn_id'], $row['log_civicrm_entity_log_type'], CRM_Utils_Array::value('log_civicrm_entity_log_action', $row))) {
$row['log_civicrm_entity_log_action'] = $newAction;
}
$row['log_civicrm_entity_log_type'] = $this->getLogType($row['log_civicrm_entity_log_type']);
$date = CRM_Utils_Date::isoToMysql($row['log_civicrm_entity_log_date']);
if ('Update' == CRM_Utils_Array::value('log_civicrm_entity_log_action', $row)) {
$q = "reset=1&log_conn_id={$row['log_civicrm_entity_log_conn_id']}&log_date=" . $date;
if ($this->cid) {
$q .= '&cid=' . $this->cid;
}
$q .= !empty($row['log_civicrm_entity_altered_contact']) ? '&alteredName=' . $row['log_civicrm_entity_altered_contact'] : '';
$q .= !empty($row['altered_by_contact_display_name']) ? '&alteredBy=' . $row['altered_by_contact_display_name'] : '';
$q .= !empty($row['log_civicrm_entity_log_user_id']) ? '&alteredById=' . $row['log_civicrm_entity_log_user_id'] : '';
$url1 = CRM_Report_Utils_Report::getNextUrl('logging/contact/detail', "{$q}&snippet=4§ion=2&layout=overlay", FALSE, TRUE);
$url2 = CRM_Report_Utils_Report::getNextUrl('logging/contact/detail', "{$q}§ion=2", FALSE, TRUE);
$row['log_civicrm_entity_log_action'] = "<a href='{$url1}' class='crm-summary-link'><div class='icon details-icon'></div></a> <a title='View details for this update' href='{$url2}'>" . ts('Update') . '</a>';
}
$key = $date . '_' . $row['log_civicrm_entity_log_type'] . '_' . $row['log_civicrm_entity_log_conn_id'] . '_' . $row['log_civicrm_entity_log_user_id'] . '_' . $row['log_civicrm_entity_altered_contact_id'];
$newRows[$key] = $row;
unset($row['log_civicrm_entity_log_user_id']);
unset($row['log_civicrm_entity_log_conn_id']);
}
krsort($newRows);
$rows = $newRows;
}
示例14: alterDisplay
/**
* Create links to detailed report for various numbers
* (non-PHPdoc)
* @see CRM_Extendedreport_Form_Report_Contribute_ContributionAggregates::alterDisplay()
*/
function alterDisplay(&$rows)
{
foreach ($rows as &$row) {
$availableKpi = array_flip($this->_kpiDescriptors);
//kpiName looks like 'total_amount__individual'
$kpiName = $availableKpi[$row['description']];
$kpiDetails = explode('__', $kpiName);
if ($this->_kpiSpecs[$kpiDetails[0]]['type'] == CRM_Utils_Type::T_MONEY) {
$row['this_year'] = CRM_Utils_Money::format($row['this_year']);
$row['last_year'] = CRM_Utils_Money::format($row['last_year']);
}
if ($row['percent_change'] == 0 && $row['this_year'] != $row['last_year']) {
$row['percent_change'] = 'n/a';
} else {
$row['percent_change'] = $row['percent_change'] . '%';
}
if (!$this->_kpiSpecs[$kpiDetails[0]]['link_status']) {
// spec specifies no link
continue;
}
// we are dealing with rows not columns so this differs from parent approach
$queryURL = "reset=1&force=1";
foreach ($this->_potentialCriteria as $criterion) {
if (empty($this->_params[$criterion])) {
continue;
}
$criterionValue = is_array($this->_params[$criterion]) ? implode(',', $this->_params[$criterion]) : $this->_params[$criterion];
$queryURL .= "&{$criterion}=" . $criterionValue;
}
if (!empty($kpiDetails[1])) {
// we are going to do some extra handling in case of unexpected case for contact type
$contactTypes = $this->getContactTypeOptions();
$contactTypes = array_keys($contactTypes);
$lcKey = array_search(strtolower($kpiDetails[1]), array_map('strtolower', $contactTypes));
$contactType = $contactTypes[$lcKey];
$queryURL .= "&contact_type_value=" . $contactType . "&contact_type_op=in";
}
$years = array(0 => 'this_year', 1 => 'last_year');
foreach ($years as $interval => $year) {
$queryURLYear = "&comparison_date_from=" . date('YmdHis', strtotime($this->_ranges['interval_' . $interval]['comparison_from_date'])) . "&comparison_date_to=" . date('YmdHis', strtotime($this->_ranges['interval_' . $interval]['comparison_to_date'])) . "&receive_date_from=" . date('YmdHis', strtotime($this->_ranges['interval_' . $interval]['from_date'])) . "&receive_date_to=" . date('YmdHis', strtotime($this->_ranges['interval_' . $interval]['to_date']));
$url = CRM_Report_Utils_Report::getNextUrl('contribute/aggregatedetails', $queryURL . "&behaviour_type_value=" . $this->_kpiSpecs[$kpiDetails[0]]['link_status'] . $queryURLYear, $this->_absoluteUrl, NULL, $this->_drilldownReport);
$row[$year . '_link'] = $url;
}
}
parent::alterDisplay($rows);
}
示例15: alterDisplay
/**
* 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)
{
if (is_array($rows)) {
$eventType = CRM_Core_OptionGroup::values('event_type');
foreach ($rows as $rowNum => $row) {
if (array_key_exists('totalAmount', $row) && array_key_exists('currency', $row)) {
$rows[$rowNum]['totalAmount'] = CRM_Utils_Money::format($rows[$rowNum]['totalAmount'], $rows[$rowNum]['currency']);
}
if (array_key_exists('civicrm_event_title', $row)) {
if ($value = $row['civicrm_event_id']) {
//CRM_Event_PseudoConstant::event( $value, false );
$url = CRM_Report_Utils_Report::getNextUrl('event/income', 'reset=1&force=1&id_op=in&id_value=' . $value, $this->_absoluteUrl, $this->_id, $this->_drilldownReport);
$rows[$rowNum]['civicrm_event_title_link'] = $url;
$rows[$rowNum]['civicrm_event_title_hover'] = ts('View Event Income For this Event');
}
}
//handle event type
if (array_key_exists('civicrm_event_event_type_id', $row)) {
if ($value = $row['civicrm_event_event_type_id']) {
$rows[$rowNum]['civicrm_event_event_type_id'] = $eventType[$value];
}
}
}
}
}