Merge remote-tracking branch 'upstream/4.4' into 4.4-master-2014-02-03-14-48-25
[civicrm-core.git] / CRM / Logging / ReportSummary.php
index fcd11ce94521ae7abe996981e0d221960e5a954e..f72ee2ef1fea75473cc2a6ba0e0919e056c77b55 100644 (file)
@@ -230,15 +230,15 @@ class CRM_Logging_ReportSummary extends CRM_Report_Form {
     $rows = array();
 
     $tempColumns = "id int(10)";
-    if (CRM_Utils_Array::value('log_action', $this->_params['fields'])) {
+    if (!empty($this->_params['fields']['log_action'])) {
       $tempColumns .= ", log_action varchar(64)";
     }
     $tempColumns .= ", log_type varchar(64), log_user_id int(10), log_date timestamp";
-    if (CRM_Utils_Array::value('altered_contact', $this->_params['fields'])) {
+    if (!empty($this->_params['fields']['altered_contact'])) {
       $tempColumns .= ", altered_contact varchar(128)";
     }
     $tempColumns .= ", altered_contact_id int(10), log_conn_id int(11), is_deleted tinyint(4)";
-    if (CRM_Utils_Array::value('display_name', $this->_params['fields'])) {
+    if (!empty($this->_params['fields']['display_name'])) {
       $tempColumns .= ", display_name varchar(128)";
     }
 
@@ -336,7 +336,7 @@ ORDER BY log_civicrm_entity_log_date DESC {$this->_limit}";
   }
 
   function getLogType($entity) {
-    if (CRM_Utils_Array::value('log_type', $this->_logTables[$entity])) {
+    if (!empty($this->_logTables[$entity]['log_type'])) {
       return $this->_logTables[$entity]['log_type'];
     }
     $logType = ucfirst(substr($entity, strrpos($entity, '_') + 1));
@@ -344,9 +344,9 @@ ORDER BY log_civicrm_entity_log_date DESC {$this->_limit}";
   }
 
   function getEntityValue($id, $entity, $logDate) {
-    if (CRM_Utils_Array::value('bracket_info', $this->_logTables[$entity])) {
-      if (CRM_Utils_Array::value('entity_column', $this->_logTables[$entity]['bracket_info'])) {
-        $logTable = CRM_Utils_Array::value('table_name', $this->_logTables[$entity]) ? $this->_logTables[$entity]['table_name'] : $entity;
+    if (!empty($this->_logTables[$entity]['bracket_info'])) {
+      if (!empty($this->_logTables[$entity]['bracket_info']['entity_column'])) {
+        $logTable = !empty($this->_logTables[$entity]['table_name']) ? $this->_logTables[$entity]['table_name'] : $entity;
         $sql = "
 SELECT {$this->_logTables[$entity]['bracket_info']['entity_column']}
   FROM `{$this->loggingDB}`.{$logTable}
@@ -389,7 +389,7 @@ WHERE  log_date <= %1 AND id = %2 ORDER BY log_date DESC LIMIT 1";
   }
 
   function getEntityAction($id, $connId, $entity, $oldAction) {
-    if (CRM_Utils_Array::value('action_column', $this->_logTables[$entity])) {
+    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'),