<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 5 |
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2019 |
- +--------------------------------------------------------------------+
- | This file is a part of CiviCRM. |
- | |
- | CiviCRM is free software; you can copy, modify, and distribute it |
- | under the terms of the GNU Affero General Public License |
- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
- | |
- | CiviCRM is distributed in the hope that it will be useful, but |
- | WITHOUT ANY WARRANTY; without even the implied warranty of |
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
- | See the GNU Affero General Public License for more details. |
+ | Copyright CiviCRM LLC. All rights reserved. |
| |
- | You should have received a copy of the GNU Affero General Public |
- | License and the CiviCRM Licensing Exception along |
- | with this program; if not, contact CiviCRM LLC |
- | at info[AT]civicrm[DOT]org. If you have questions about the |
- | GNU Affero General Public License or the licensing of CiviCRM, |
- | see the CiviCRM license FAQ at http://civicrm.org/licensing |
+ | This work is published under the GNU AGPLv3 license with some |
+ | permitted exceptions and without any warranty. For full license |
+ | and copyright information, see https://civicrm.org/licensing |
+--------------------------------------------------------------------+
*/
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2019
+ * @copyright CiviCRM LLC https://civicrm.org/licensing
*/
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 {