X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FLogging%2FReportDetail.php;h=f2a6196faf532fcee52c03be32caec55b6b875db;hb=2ba0ddf506ff7ba31635bd58f3d80dbcd7eb3a5e;hp=5a8e09b3af4eddbe821cbc7114a566021ec542ac;hpb=87d422669cee2e65706fe72821613ad846cd0adb;p=civicrm-core.git diff --git a/CRM/Logging/ReportDetail.php b/CRM/Logging/ReportDetail.php index 5a8e09b3af..f2a6196faf 100644 --- a/CRM/Logging/ReportDetail.php +++ b/CRM/Logging/ReportDetail.php @@ -1,7 +1,7 @@ _add2groupSupported = FALSE; @@ -60,28 +59,35 @@ class CRM_Logging_ReportDetail extends CRM_Report_Form { $this->db = $dsn['database']; $this->log_conn_id = CRM_Utils_Request::retrieve('log_conn_id', 'Integer', CRM_Core_DAO::$_nullObject); - $this->log_date = CRM_Utils_Request::retrieve('log_date', 'String', CRM_Core_DAO::$_nullObject); - $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->log_date = CRM_Utils_Request::retrieve('log_date', 'String', CRM_Core_DAO::$_nullObject); + $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_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(); - $breadcrumb = + $breadcrumb = array( + array( + '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( - array('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")), - ); + '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', CRM_Core_DAO::$_nullObject)) { @@ -98,7 +104,7 @@ class CRM_Logging_ReportDetail extends CRM_Report_Form { // make sure the report works even without the params if (!$this->log_conn_id or !$this->log_date) { - $dao = new CRM_Core_DAO; + $dao = new CRM_Core_DAO(); $dao->query("SELECT log_conn_id, log_date FROM `{$this->db}`.log_{$this->tables[0]} WHERE log_action = 'Update' ORDER BY log_date DESC LIMIT 1"); $dao->fetch(); $this->log_conn_id = $dao->log_conn_id; @@ -115,13 +121,14 @@ class CRM_Logging_ReportDetail extends CRM_Report_Form { /** * @param bool $applyLimit */ - function buildQuery($applyLimit = TRUE) {} + public function buildQuery($applyLimit = TRUE) { + } /** * @param $sql * @param $rows */ - function buildRows($sql, &$rows) { + public function buildRows($sql, &$rows) { // safeguard for when there aren’t any log entries yet if (!$this->log_conn_id or !$this->log_date) { return; @@ -160,8 +167,8 @@ class CRM_Logging_ReportDetail extends CRM_Report_Form { $skipped = array('contact_id', 'entity_id', 'id'); foreach ($diffs as $diff) { $field = $diff['field']; - $from = $diff['from']; - $to = $diff['to']; + $from = $diff['from']; + $to = $diff['to']; if ($this->raw) { $field = "$table.$field"; @@ -179,7 +186,8 @@ class CRM_Logging_ReportDetail extends CRM_Report_Form { if ((substr($from, 0, 1) == CRM_Core_DAO::VALUE_SEPARATOR && substr($from, -1, 1) == CRM_Core_DAO::VALUE_SEPARATOR) || (substr($to, 0, 1) == CRM_Core_DAO::VALUE_SEPARATOR && - substr($to, -1, 1) == CRM_Core_DAO::VALUE_SEPARATOR)) { + substr($to, -1, 1) == CRM_Core_DAO::VALUE_SEPARATOR) + ) { $froms = $tos = array(); foreach (explode(CRM_Core_DAO::VALUE_SEPARATOR, trim($from, CRM_Core_DAO::VALUE_SEPARATOR)) as $val) { $froms[] = CRM_Utils_Array::value($val, $values[$field]); @@ -188,7 +196,7 @@ class CRM_Logging_ReportDetail extends CRM_Report_Form { $tos[] = CRM_Utils_Array::value($val, $values[$field]); } $from = implode(', ', array_filter($froms)); - $to = implode(', ', array_filter($tos)); + $to = implode(', ', array_filter($tos)); } if (isset($values[$field][$from])) { @@ -214,7 +222,7 @@ class CRM_Logging_ReportDetail extends CRM_Report_Form { return $rows; } - function buildQuickForm() { + public function buildQuickForm() { parent::buildQuickForm(); $params = array( @@ -223,9 +231,9 @@ class CRM_Logging_ReportDetail extends CRM_Report_Form { ); $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('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('who_name', $this->altered_by); $this->assign('log_date', CRM_Utils_Date::mysqlToIso($this->log_date)); @@ -233,5 +241,5 @@ class CRM_Logging_ReportDetail extends CRM_Report_Form { $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?')); } -} +}