+--------------------------------------------------------------------+
| CiviCRM version 5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2018 |
+ | Copyright CiviCRM LLC (c) 2004-2019 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2018
+ * @copyright CiviCRM LLC (c) 2004-2019
*/
class CRM_Logging_ReportDetail extends CRM_Report_Form {
protected $cid;
protected $log_conn_id;
protected $log_date;
protected $raw;
- protected $tables = array();
+ protected $tables = [];
protected $interval = '10 SECOND';
protected $altered_name;
protected $altered_by;
protected $altered_by_id;
- // detail/summary report ids
+ /**
+ * detail/summary report ids
+ * @var int
+ */
protected $detail;
protected $summary;
*
* @var array
*/
- protected $diffs = array();
+ protected $diffs = [];
/**
* Don't display the Add these contacts to Group button.
parent::__construct();
CRM_Utils_System::resetBreadCrumb();
- $breadcrumb = array(
- array(
+ $breadcrumb = [
+ [
'title' => ts('Home'),
'url' => CRM_Utils_System::url(),
- ),
- array(
+ ],
+ [
'title' => ts('CiviCRM'),
'url' => CRM_Utils_System::url('civicrm', 'reset=1'),
- ),
- array(
+ ],
+ [
'title' => ts('View Contact'),
'url' => CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$this->cid}"),
- ),
- array(
+ ],
+ [
'title' => ts('Search Results'),
'url' => CRM_Utils_System::url('civicrm/contact/search', "force=1"),
- ),
- );
+ ],
+ ];
CRM_Utils_System::appendBreadCrumb($breadcrumb);
if (CRM_Utils_Request::retrieve('revert', 'Boolean')) {
$this->revert();
}
- $this->_columnHeaders = array(
- 'field' => array('title' => ts('Field')),
- 'from' => array('title' => ts('Changed From')),
- 'to' => array('title' => ts('Changed To')),
- );
+ $this->_columnHeaders = [
+ 'field' => ['title' => ts('Field')],
+ 'from' => ['title' => ts('Changed From')],
+ 'to' => ['title' => ts('Changed To')],
+ ];
}
/**
protected function convertDiffsToRows() {
// return early if nothing found
if (empty($this->diffs)) {
- return array();
+ return [];
}
// populate $rows with only the differences between $changed and $original (skipping certain columns and NULL ↔ empty changes unless raw requested)
- $skipped = array('id');
+ $skipped = ['id'];
foreach ($this->diffs as $diff) {
$table = $diff['table'];
if (empty($metadata[$table])) {
list($metadata[$table]['titles'], $metadata[$table]['values']) = $this->differ->titlesAndValuesForTable($table, $diff['log_date']);
}
- $values = CRM_Utils_Array::value('values', $metadata[$diff['table']], array());
+ $values = CRM_Utils_Array::value('values', $metadata[$diff['table']], []);
$titles = $metadata[$diff['table']]['titles'];
$field = $diff['field'];
$from = $diff['from'];
(substr($to, 0, 1) == CRM_Core_DAO::VALUE_SEPARATOR &&
substr($to, -1, 1) == CRM_Core_DAO::VALUE_SEPARATOR)
) {
- $froms = $tos = array();
+ $froms = $tos = [];
foreach (explode(CRM_Core_DAO::VALUE_SEPARATOR, trim($from, CRM_Core_DAO::VALUE_SEPARATOR)) as $val) {
$froms[] = CRM_Utils_Array::value($val, $values[$field]);
}
}
}
- $rows[] = array('field' => $field . " (id: {$diff['id']})", 'from' => $from, 'to' => $to);
+ $rows[] = ['field' => $field . " (id: {$diff['id']})", 'from' => $from, 'to' => $to];
}
return $rows;
$this->diffs = $this->getAllContactChangesForConnection();
}
-
/**
* Get an array of changes made in the mysql connection.
*
*/
public function getAllContactChangesForConnection() {
if (empty($this->log_conn_id)) {
- return array();
+ return [];
}
$this->setDiffer();
try {