+--------------------------------------------------------------------+
| CiviCRM version 5 |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| CiviCRM version 5 |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
// used for redirect back to contact summary
$this->cid = CRM_Utils_Request::retrieve('cid', 'Integer');
// used for redirect back to contact summary
$this->cid = CRM_Utils_Request::retrieve('cid', 'Integer');
'table' => 'log_civicrm_note',
'join' => "entity_log_civireport.entity_id = fk_table.id AND entity_log_civireport.entity_table = 'civicrm_note'",
'table' => 'log_civicrm_note',
'join' => "entity_log_civireport.entity_id = fk_table.id AND entity_log_civireport.entity_table = 'civicrm_note'",
'entity_column' => 'group_id',
'table' => 'log_civicrm_group',
'column' => 'title',
'entity_column' => 'group_id',
'table' => 'log_civicrm_group',
'column' => 'title',
'entity_column' => 'tag_id',
'table' => 'log_civicrm_tag',
'column' => 'name',
'entity_column' => 'tag_id',
'table' => 'log_civicrm_tag',
'column' => 'name',
'entity_column' => 'relationship_type_id',
'table' => 'log_civicrm_relationship_type',
'column' => 'label_a_b',
'entity_column' => 'relationship_type_id',
'table' => 'log_civicrm_relationship_type',
'column' => 'label_a_b',
'fk' => 'contact_id',
'table_name' => 'log_civicrm_activity_contact',
'log_type' => 'Activity',
'field' => 'activity_id',
'fk' => 'contact_id',
'table_name' => 'log_civicrm_activity_contact',
'log_type' => 'Activity',
'field' => 'activity_id',
'table' => 'log_civicrm_activity',
'join' => 'extra_table.id = entity_log_civireport.activity_id',
'table' => 'log_civicrm_activity',
'join' => 'extra_table.id = entity_log_civireport.activity_id',
'entity_column' => 'activity_type_id',
'options' => CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE),
'lookup_table' => 'log_civicrm_activity',
'entity_column' => 'activity_type_id',
'options' => CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE),
'lookup_table' => 'log_civicrm_activity',
'table' => 'log_civicrm_case_contact',
'join' => 'entity_log_civireport.id = fk_table.case_id',
'table' => 'log_civicrm_case_contact',
'join' => 'entity_log_civireport.id = fk_table.case_id',
'entity_column' => 'case_type_id',
'options' => CRM_Case_BAO_Case::buildOptions('case_type_id', 'search'),
'entity_column' => 'case_type_id',
'options' => CRM_Case_BAO_Case::buildOptions('case_type_id', 'search'),
$logging = new CRM_Logging_Schema();
// build _logTables for contact custom tables
$customTables = $logging->entityCustomDataLogTables('Contact');
foreach ($customTables as $table) {
$logging = new CRM_Logging_Schema();
// build _logTables for contact custom tables
$customTables = $logging->entityCustomDataLogTables('Contact');
foreach ($customTables as $table) {
}
// build _logTables for address custom tables
$customTables = $logging->entityCustomDataLogTables('Address');
foreach ($customTables as $table) {
}
// build _logTables for address custom tables
$customTables = $logging->entityCustomDataLogTables('Address');
foreach ($customTables as $table) {
// fk_table
'table' => 'log_civicrm_address',
'join' => 'entity_log_civireport.entity_id = fk_table.id',
// fk_table
'table' => 'log_civicrm_address',
'join' => 'entity_log_civireport.entity_id = fk_table.id',
public function where() {
// reset where clause as its called multiple times, every time insert sql is built.
public function where() {
// reset where clause as its called multiple times, every time insert sql is built.
FROM `{$this->loggingDB}`.{$logTable}
WHERE log_date <= %1 AND id = %2 ORDER BY log_date DESC LIMIT 1";
FROM `{$this->loggingDB}`.{$logTable}
WHERE log_date <= %1 AND id = %2 ORDER BY log_date DESC LIMIT 1";
SELECT {$this->_logTables[$entity]['bracket_info']['column']}
FROM `{$this->loggingDB}`.{$this->_logTables[$entity]['bracket_info']['table']}
WHERE log_date <= %1 AND id = %2 ORDER BY log_date DESC LIMIT 1";
SELECT {$this->_logTables[$entity]['bracket_info']['column']}
FROM `{$this->loggingDB}`.{$this->_logTables[$entity]['bracket_info']['table']}
WHERE log_date <= %1 AND id = %2 ORDER BY log_date DESC LIMIT 1";
- return CRM_Core_DAO::singleValueQuery($sql, array(
- 1 => array(CRM_Utils_Date::isoToMysql($logDate), 'Timestamp'),
- 2 => array($entityID, 'Integer'),
- ));
+ return CRM_Core_DAO::singleValueQuery($sql, [
+ 1 => [CRM_Utils_Date::isoToMysql($logDate), 'Timestamp'],
+ 2 => [$entityID, 'Integer'],
+ ]);
public function getEntityAction($id, $connId, $entity, $oldAction) {
if (!empty($this->_logTables[$entity]['action_column'])) {
$sql = "select {$this->_logTables[$entity]['action_column']} from `{$this->loggingDB}`.{$entity} where id = %1 AND log_conn_id = %2";
public function getEntityAction($id, $connId, $entity, $oldAction) {
if (!empty($this->_logTables[$entity]['action_column'])) {
$sql = "select {$this->_logTables[$entity]['action_column']} from `{$this->loggingDB}`.{$entity} where id = %1 AND log_conn_id = %2";
- $newAction = CRM_Core_DAO::singleValueQuery($sql, array(
- 1 => array($id, 'Integer'),
- 2 => array($connId, 'String'),
- ));
+ $newAction = CRM_Core_DAO::singleValueQuery($sql, [
+ 1 => [$id, 'Integer'],
+ 2 => [$connId, 'String'],
+ ]);
$sql = "SELECT DISTINCT log_type FROM civicrm_temp_civireport_logsummary";
$dao = CRM_Core_DAO::executeQuery($sql);
$this->addToDeveloperTab($sql);
$sql = "SELECT DISTINCT log_type FROM civicrm_temp_civireport_logsummary";
$dao = CRM_Core_DAO::executeQuery($sql);
$this->addToDeveloperTab($sql);
while ($dao->fetch()) {
$type = $this->getLogType($dao->log_type);
if (!array_key_exists($type, $replaceWith)) {
while ($dao->fetch()) {
$type = $this->getLogType($dao->log_type);
if (!array_key_exists($type, $replaceWith)) {
{$this->_limit} ";
$sql = str_replace('modified_contact_civireport.display_name', 'entity_log_civireport.altered_contact', $sql);
$sql = str_replace('modified_contact_civireport.id', 'entity_log_civireport.altered_contact_id', $sql);
{$this->_limit} ";
$sql = str_replace('modified_contact_civireport.display_name', 'entity_log_civireport.altered_contact', $sql);
$sql = str_replace('modified_contact_civireport.id', 'entity_log_civireport.altered_contact_id', $sql);
'modified_contact_civireport.',
'altered_by_contact_civireport.',
'modified_contact_civireport.',
'altered_by_contact_civireport.',