protected $tables = array();
protected $interval = '10 SECOND';
+ protected $altered_name;
+ protected $altered_by;
+ protected $altered_by_id;
+
// detail/summary report ids
protected $detail;
protected $summary;
$this->cid = CRM_Utils_Request::retrieve('cid', 'Integer', CRM_Core_DAO::$_nullObject);
$this->raw = CRM_Utils_Request::retrieve('raw', 'Boolean', CRM_Core_DAO::$_nullObject);
+ $this->altered_name = CRM_Utils_Request::retrieve('alteredName', 'String', CRM_Core_DAO::$_nullObject);
+ $this->altered_by = CRM_Utils_Request::retrieve('alteredBy', 'String', CRM_Core_DAO::$_nullObject);
+ $this->altered_by_id = CRM_Utils_Request::retrieve('alteredById', 'Integer', CRM_Core_DAO::$_nullObject);
+
parent::__construct();
CRM_Utils_System::resetBreadCrumb();
2 => array($this->log_date, 'String'),
);
- // let the template know who updated whom when
- $dao = CRM_Core_DAO::executeQuery($this->whoWhomWhenSql(), $params);
- if ($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('whom_url', CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$this->cid}"));
+ $this->assign('who_url', CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$this->altered_by_id}"));
+ $this->assign('whom_name', $this->altered_name);
+ $this->assign('who_name', $this->altered_by);
+
$this->assign('log_date', CRM_Utils_Date::mysqlToIso($this->log_date));
$q = "reset=1&log_conn_id={$this->log_conn_id}&log_date={$this->log_date}";
$this->assign('revertURL', CRM_Report_Utils_Report::getNextUrl($this->detail, "$q&revert=1", FALSE, TRUE));
$this->assign('revertConfirm', ts('Are you sure you want to revert all these changes?'));
}
-
- // redefine this accordingly in ancestors for buildQuickForm()’s sake
- protected function whoWhomWhenSql() {}
}
$this->assign('backURL', CRM_Report_Utils_Report::getNextUrl('logging/contact/summary', 'reset=1', FALSE, TRUE));
}
}
-
- protected function whoWhomWhenSql() {
- return "
- SELECT who.id who_id, who.display_name who_name, whom.id whom_id, whom.display_name whom_name, l.is_deleted
- FROM `{$this->db}`.log_civicrm_contact l
- JOIN civicrm_contact who ON (l.log_user_id = who.id)
- JOIN civicrm_contact whom ON (l.id = whom.id)
- WHERE log_action = 'Update' AND log_conn_id = %1 AND log_date = %2 ORDER BY log_date DESC LIMIT 1
- ";
- }
}
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);
// link back to summary report
$this->assign('backURL', CRM_Report_Utils_Report::getNextUrl('logging/contribute/summary', 'reset=1', FALSE, TRUE));
}
-
- protected function whoWhomWhenSql() {
- return "
- SELECT who.id who_id, who.display_name who_name, whom.id whom_id, whom.display_name whom_name
- FROM `{$this->db}`.log_civicrm_contribution l
- LEFT JOIN civicrm_contact who ON (l.log_user_id = who.id)
- LEFT JOIN civicrm_contact whom ON (l.contact_id = whom.id)
- WHERE log_action = 'Update' AND log_conn_id = %1 AND log_date = %2 ORDER BY log_date DESC LIMIT 1
- ";
- }
}