Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
7e9e8871 | 4 | | CiviCRM version 4.7 | |
6a488035 | 5 | +--------------------------------------------------------------------+ |
e7112fa7 | 6 | | Copyright CiviCRM LLC (c) 2004-2015 | |
6a488035 TO |
7 | +--------------------------------------------------------------------+ |
8 | | This file is a part of CiviCRM. | | |
9 | | | | |
10 | | CiviCRM is free software; you can copy, modify, and distribute it | | |
11 | | under the terms of the GNU Affero General Public License | | |
12 | | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | | |
13 | | | | |
14 | | CiviCRM is distributed in the hope that it will be useful, but | | |
15 | | WITHOUT ANY WARRANTY; without even the implied warranty of | | |
16 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | | |
17 | | See the GNU Affero General Public License for more details. | | |
18 | | | | |
19 | | You should have received a copy of the GNU Affero General Public | | |
20 | | License and the CiviCRM Licensing Exception along | | |
21 | | with this program; if not, contact CiviCRM LLC | | |
22 | | at info[AT]civicrm[DOT]org. If you have questions about the | | |
23 | | GNU Affero General Public License or the licensing of CiviCRM, | | |
24 | | see the CiviCRM license FAQ at http://civicrm.org/licensing | | |
25 | +--------------------------------------------------------------------+ | |
d25dd0ee | 26 | */ |
6a488035 TO |
27 | |
28 | /** | |
29 | * | |
30 | * @package CRM | |
e7112fa7 | 31 | * @copyright CiviCRM LLC (c) 2004-2015 |
6a488035 | 32 | * $Id$ |
6a488035 TO |
33 | */ |
34 | class CRM_Logging_ReportSummary extends CRM_Report_Form { | |
35 | protected $cid; | |
36 | ||
37 | protected $_logTables = array(); | |
38 | ||
39 | protected $loggingDB; | |
40 | ||
e0ef6999 | 41 | /** |
2fb1dd66 | 42 | * Class constructor. |
e0ef6999 | 43 | */ |
00be9182 | 44 | public function __construct() { |
694e78fd DS |
45 | // don’t display the ‘Add these Contacts to Group’ button |
46 | $this->_add2groupSupported = FALSE; | |
47 | ||
48 | $dsn = defined('CIVICRM_LOGGING_DSN') ? DB::parseDSN(CIVICRM_LOGGING_DSN) : DB::parseDSN(CIVICRM_DSN); | |
49 | $this->loggingDB = $dsn['database']; | |
50 | ||
51 | // used for redirect back to contact summary | |
52 | $this->cid = CRM_Utils_Request::retrieve('cid', 'Integer', CRM_Core_DAO::$_nullObject); | |
53 | ||
cbb9666e | 54 | $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); |
55 | $sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts); | |
56 | $assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts); | |
57 | $targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts); | |
58 | ||
ae5ffbb7 TO |
59 | $this->_logTables = array( |
60 | 'log_civicrm_contact' => array( | |
61 | 'fk' => 'id', | |
62 | ), | |
63 | 'log_civicrm_email' => array( | |
64 | 'fk' => 'contact_id', | |
65 | 'log_type' => 'Contact', | |
66 | ), | |
67 | 'log_civicrm_phone' => array( | |
68 | 'fk' => 'contact_id', | |
69 | 'log_type' => 'Contact', | |
70 | ), | |
71 | 'log_civicrm_address' => array( | |
72 | 'fk' => 'contact_id', | |
73 | 'log_type' => 'Contact', | |
74 | ), | |
75 | 'log_civicrm_note' => array( | |
76 | 'fk' => 'entity_id', | |
77 | 'entity_table' => TRUE, | |
78 | 'bracket_info' => array( | |
79 | 'table' => 'log_civicrm_note', | |
80 | 'column' => 'subject', | |
cbb9666e | 81 | ), |
ae5ffbb7 TO |
82 | ), |
83 | 'log_civicrm_note_comment' => array( | |
84 | 'fk' => 'entity_id', | |
85 | 'table_name' => 'log_civicrm_note', | |
86 | 'joins' => array( | |
87 | 'table' => 'log_civicrm_note', | |
88 | 'join' => "entity_log_civireport.entity_id = fk_table.id AND entity_log_civireport.entity_table = 'civicrm_note'", | |
cbb9666e | 89 | ), |
ae5ffbb7 TO |
90 | 'entity_table' => TRUE, |
91 | 'bracket_info' => array( | |
92 | 'table' => 'log_civicrm_note', | |
93 | 'column' => 'subject', | |
cbb9666e | 94 | ), |
ae5ffbb7 TO |
95 | ), |
96 | 'log_civicrm_group_contact' => array( | |
97 | 'fk' => 'contact_id', | |
98 | 'bracket_info' => array( | |
99 | 'entity_column' => 'group_id', | |
100 | 'table' => 'log_civicrm_group', | |
101 | 'column' => 'title', | |
cbb9666e | 102 | ), |
ae5ffbb7 TO |
103 | 'action_column' => 'status', |
104 | 'log_type' => 'Group', | |
105 | ), | |
106 | 'log_civicrm_entity_tag' => array( | |
107 | 'fk' => 'entity_id', | |
108 | 'bracket_info' => array( | |
109 | 'entity_column' => 'tag_id', | |
110 | 'table' => 'log_civicrm_tag', | |
111 | 'column' => 'name', | |
cbb9666e | 112 | ), |
ae5ffbb7 TO |
113 | 'entity_table' => TRUE, |
114 | ), | |
115 | 'log_civicrm_relationship' => array( | |
116 | 'fk' => 'contact_id_a', | |
117 | 'bracket_info' => array( | |
118 | 'entity_column' => 'relationship_type_id', | |
119 | 'table' => 'log_civicrm_relationship_type', | |
120 | 'column' => 'label_a_b', | |
cbb9666e | 121 | ), |
ae5ffbb7 TO |
122 | ), |
123 | 'log_civicrm_activity_for_target' => array( | |
124 | 'fk' => 'contact_id', | |
125 | 'table_name' => 'log_civicrm_activity', | |
126 | 'joins' => array( | |
127 | 'table' => 'log_civicrm_activity_contact', | |
128 | 'join' => "(entity_log_civireport.id = fk_table.activity_id AND fk_table.record_type_id = {$targetID})", | |
cbb9666e | 129 | ), |
ae5ffbb7 TO |
130 | 'bracket_info' => array( |
131 | 'entity_column' => 'activity_type_id', | |
132 | 'options' => CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE), | |
cbb9666e | 133 | ), |
ae5ffbb7 TO |
134 | 'log_type' => 'Activity', |
135 | ), | |
136 | 'log_civicrm_activity_for_assignee' => array( | |
137 | 'fk' => 'contact_id', | |
138 | 'table_name' => 'log_civicrm_activity', | |
139 | 'joins' => array( | |
140 | 'table' => 'log_civicrm_activity_contact', | |
141 | 'join' => "entity_log_civireport.id = fk_table.activity_id AND fk_table.record_type_id = {$assigneeID}", | |
cbb9666e | 142 | ), |
ae5ffbb7 TO |
143 | 'bracket_info' => array( |
144 | 'entity_column' => 'activity_type_id', | |
145 | 'options' => CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE), | |
cbb9666e | 146 | ), |
ae5ffbb7 TO |
147 | 'log_type' => 'Activity', |
148 | ), | |
149 | 'log_civicrm_activity_for_source' => array( | |
150 | 'fk' => 'contact_id', | |
151 | 'table_name' => 'log_civicrm_activity', | |
152 | 'joins' => array( | |
153 | 'table' => 'log_civicrm_activity_contact', | |
154 | 'join' => "entity_log_civireport.id = fk_table.activity_id AND fk_table.record_type_id = {$sourceID}", | |
cbb9666e | 155 | ), |
ae5ffbb7 TO |
156 | 'bracket_info' => array( |
157 | 'entity_column' => 'activity_type_id', | |
158 | 'options' => CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE), | |
cbb9666e | 159 | ), |
ae5ffbb7 TO |
160 | 'log_type' => 'Activity', |
161 | ), | |
162 | 'log_civicrm_case' => array( | |
163 | 'fk' => 'contact_id', | |
164 | 'joins' => array( | |
165 | 'table' => 'log_civicrm_case_contact', | |
166 | 'join' => 'entity_log_civireport.id = fk_table.case_id', | |
cbb9666e | 167 | ), |
ae5ffbb7 TO |
168 | 'bracket_info' => array( |
169 | 'entity_column' => 'case_type_id', | |
7a5c0c6c | 170 | 'options' => CRM_Case_BAO_Case::buildOptions('case_type_id', 'search'), |
ae5ffbb7 TO |
171 | ), |
172 | ), | |
173 | ); | |
6a488035 | 174 | |
ae5ffbb7 | 175 | $logging = new CRM_Logging_Schema(); |
694e78fd DS |
176 | |
177 | // build _logTables for contact custom tables | |
178 | $customTables = $logging->entityCustomDataLogTables('Contact'); | |
6a488035 | 179 | foreach ($customTables as $table) { |
9d72cede EM |
180 | $this->_logTables[$table] = array( |
181 | 'fk' => 'entity_id', | |
21dfd5f5 | 182 | 'log_type' => 'Contact', |
9d72cede | 183 | ); |
6a488035 TO |
184 | } |
185 | ||
694e78fd DS |
186 | // build _logTables for address custom tables |
187 | $customTables = $logging->entityCustomDataLogTables('Address'); | |
188 | foreach ($customTables as $table) { | |
ae5ffbb7 | 189 | $this->_logTables[$table] = array( |
2fb1dd66 EM |
190 | // For join of fk_table with contact table. |
191 | 'fk' => 'contact_id', | |
ae5ffbb7 | 192 | 'joins' => array( |
2fb1dd66 EM |
193 | // fk_table |
194 | 'table' => 'log_civicrm_address', | |
ae5ffbb7 TO |
195 | 'join' => 'entity_log_civireport.entity_id = fk_table.id', |
196 | ), | |
197 | 'log_type' => 'Contact', | |
198 | ); | |
694e78fd DS |
199 | } |
200 | ||
2fb1dd66 | 201 | // Allow log tables to be extended via report hooks. |
6b4b11c4 | 202 | CRM_Report_BAO_Hook::singleton()->alterLogTables($this, $this->_logTables); |
c3e3dd65 | 203 | |
6a488035 TO |
204 | parent::__construct(); |
205 | } | |
206 | ||
00be9182 | 207 | public function groupBy() { |
6a488035 TO |
208 | $this->_groupBy = 'GROUP BY entity_log_civireport.log_conn_id, entity_log_civireport.log_user_id, EXTRACT(DAY_MICROSECOND FROM entity_log_civireport.log_date), entity_log_civireport.id'; |
209 | } | |
210 | ||
00be9182 | 211 | public function select() { |
6a488035 TO |
212 | $select = array(); |
213 | $this->_columnHeaders = array(); | |
214 | foreach ($this->_columns as $tableName => $table) { | |
215 | if (array_key_exists('fields', $table)) { | |
216 | foreach ($table['fields'] as $fieldName => $field) { | |
9d72cede EM |
217 | if (CRM_Utils_Array::value('required', $field) or |
218 | CRM_Utils_Array::value($fieldName, $this->_params['fields']) | |
219 | ) { | |
6a488035 TO |
220 | $select[] = "{$field['dbAlias']} as {$tableName}_{$fieldName}"; |
221 | $this->_columnHeaders["{$tableName}_{$fieldName}"]['type'] = CRM_Utils_Array::value('type', $field); | |
222 | $this->_columnHeaders["{$tableName}_{$fieldName}"]['no_display'] = CRM_Utils_Array::value('no_display', $field); | |
223 | $this->_columnHeaders["{$tableName}_{$fieldName}"]['title'] = CRM_Utils_Array::value('title', $field); | |
224 | } | |
225 | } | |
226 | } | |
227 | } | |
228 | $this->_select = 'SELECT ' . implode(', ', $select) . ' '; | |
229 | } | |
230 | ||
00be9182 | 231 | public function where() { |
8c544cd2 DS |
232 | // reset where clause as its called multiple times, every time insert sql is built. |
233 | $this->_whereClauses = array(); | |
42047ce4 | 234 | |
6a488035 TO |
235 | parent::where(); |
236 | $this->_where .= " AND (entity_log_civireport.log_action != 'Initialization')"; | |
237 | } | |
238 | ||
00be9182 | 239 | public function postProcess() { |
6a488035 TO |
240 | $this->beginPostProcess(); |
241 | $rows = array(); | |
eea16664 | 242 | |
9c097caf | 243 | $tempColumns = "id int(10)"; |
a7488080 | 244 | if (!empty($this->_params['fields']['log_action'])) { |
9c097caf DS |
245 | $tempColumns .= ", log_action varchar(64)"; |
246 | } | |
247 | $tempColumns .= ", log_type varchar(64), log_user_id int(10), log_date timestamp"; | |
a7488080 | 248 | if (!empty($this->_params['fields']['altered_contact'])) { |
9c097caf DS |
249 | $tempColumns .= ", altered_contact varchar(128)"; |
250 | } | |
251 | $tempColumns .= ", altered_contact_id int(10), log_conn_id int(11), is_deleted tinyint(4)"; | |
a7488080 | 252 | if (!empty($this->_params['fields']['display_name'])) { |
9c097caf DS |
253 | $tempColumns .= ", display_name varchar(128)"; |
254 | } | |
255 | ||
6a488035 | 256 | // temp table to hold all altered contact-ids |
9c097caf | 257 | $sql = "CREATE TEMPORARY TABLE civicrm_temp_civireport_logsummary ( {$tempColumns} ) ENGINE=HEAP"; |
6a488035 TO |
258 | CRM_Core_DAO::executeQuery($sql); |
259 | ||
260 | $logDateClause = $this->dateClause('log_date', | |
cbb9666e | 261 | CRM_Utils_Array::value("log_date_relative", $this->_params), |
262 | CRM_Utils_Array::value("log_date_from", $this->_params), | |
263 | CRM_Utils_Array::value("log_date_to", $this->_params), | |
6a488035 TO |
264 | CRM_Utils_Type::T_DATE, |
265 | CRM_Utils_Array::value("log_date_from_time", $this->_params), | |
cbb9666e | 266 | CRM_Utils_Array::value("log_date_to_time", $this->_params)); |
267 | $logDateClause = $logDateClause ? "AND {$logDateClause}" : NULL; | |
6a488035 TO |
268 | |
269 | $logTypes = CRM_Utils_Array::value('log_type_value', $this->_params); | |
270 | unset($this->_params['log_type_value']); | |
cbb9666e | 271 | if (empty($logTypes)) { |
272 | foreach (array_keys($this->_logTables) as $table) { | |
6a488035 TO |
273 | $type = $this->getLogType($table); |
274 | $logTypes[$type] = $type; | |
275 | } | |
276 | } | |
277 | ||
798878cc DS |
278 | $logTypeTableClause = '(1)'; |
279 | if ($logTypeTableValue = CRM_Utils_Array::value("log_type_table_value", $this->_params)) { | |
cbb9666e | 280 | $logTypeTableClause = $this->whereClause($this->_columns['log_civicrm_entity']['filters']['log_type_table'], |
281 | $this->_params['log_type_table_op'], $logTypeTableValue, NULL, NULL); | |
798878cc DS |
282 | unset($this->_params['log_type_table_value']); |
283 | } | |
cbb9666e | 284 | |
285 | foreach ($this->_logTables as $entity => $detail) { | |
6a488035 | 286 | if ((in_array($this->getLogType($entity), $logTypes) && |
cbb9666e | 287 | CRM_Utils_Array::value('log_type_op', $this->_params) == 'in') || |
6a488035 | 288 | (!in_array($this->getLogType($entity), $logTypes) && |
cbb9666e | 289 | CRM_Utils_Array::value('log_type_op', $this->_params) == 'notin') |
290 | ) { | |
291 | $this->from($entity); | |
292 | $sql = $this->buildQuery(FALSE); | |
6a488035 TO |
293 | $sql = str_replace("entity_log_civireport.log_type as", "'{$entity}' as", $sql); |
294 | $sql = "INSERT IGNORE INTO civicrm_temp_civireport_logsummary {$sql}"; | |
295 | CRM_Core_DAO::executeQuery($sql); | |
296 | } | |
297 | } | |
298 | ||
9a2a98cd DS |
299 | // add computed log_type column so that we can do a group by after that, which will help |
300 | // alterDisplay() counts sync with pager counts | |
301 | $sql = "SELECT DISTINCT log_type FROM civicrm_temp_civireport_logsummary"; | |
302 | $dao = CRM_Core_DAO::executeQuery($sql); | |
303 | $replaceWith = array(); | |
cbb9666e | 304 | while ($dao->fetch()) { |
9a2a98cd | 305 | $type = $this->getLogType($dao->log_type); |
cbb9666e | 306 | if (!array_key_exists($type, $replaceWith)) { |
9a2a98cd | 307 | $replaceWith[$type] = array(); |
cbb9666e | 308 | } |
9a2a98cd DS |
309 | $replaceWith[$type][] = $dao->log_type; |
310 | } | |
311 | foreach ($replaceWith as $type => $tables) { | |
312 | if (!empty($tables)) { | |
313 | $replaceWith[$type] = implode("','", $tables); | |
314 | } | |
315 | } | |
2efcf0c2 | 316 | |
9a2a98cd DS |
317 | $sql = "ALTER TABLE civicrm_temp_civireport_logsummary ADD COLUMN log_civicrm_entity_log_type_label varchar(64)"; |
318 | CRM_Core_DAO::executeQuery($sql); | |
319 | foreach ($replaceWith as $type => $in) { | |
320 | $sql = "UPDATE civicrm_temp_civireport_logsummary SET log_civicrm_entity_log_type_label='{$type}', log_date=log_date WHERE log_type IN('$in')"; | |
321 | CRM_Core_DAO::executeQuery($sql); | |
322 | } | |
323 | ||
324 | // note the group by columns are same as that used in alterDisplay as $newRows - $key | |
6a488035 TO |
325 | $this->limit(); |
326 | $sql = "{$this->_select} | |
327 | FROM civicrm_temp_civireport_logsummary entity_log_civireport | |
798878cc | 328 | WHERE {$logTypeTableClause} |
9a2a98cd DS |
329 | GROUP BY log_civicrm_entity_log_date, log_civicrm_entity_log_type_label, log_civicrm_entity_log_conn_id, log_civicrm_entity_log_user_id, log_civicrm_entity_altered_contact_id |
330 | ORDER BY log_civicrm_entity_log_date DESC {$this->_limit}"; | |
cbb9666e | 331 | $sql = str_replace('modified_contact_civireport.display_name', 'entity_log_civireport.altered_contact', $sql); |
332 | $sql = str_replace('modified_contact_civireport.id', 'entity_log_civireport.altered_contact_id', $sql); | |
333 | $sql = str_replace(array( | |
334 | 'modified_contact_civireport.', | |
21dfd5f5 | 335 | 'altered_by_contact_civireport.', |
cbb9666e | 336 | ), 'entity_log_civireport.', $sql); |
6a488035 TO |
337 | $this->buildRows($sql, $rows); |
338 | ||
339 | // format result set. | |
340 | $this->formatDisplay($rows); | |
341 | ||
342 | // assign variables to templates | |
343 | $this->doTemplateAssignment($rows); | |
344 | ||
345 | // do print / pdf / instance stuff if needed | |
346 | $this->endPostProcess($rows); | |
347 | } | |
348 | ||
e0ef6999 | 349 | /** |
2fb1dd66 EM |
350 | * Get log type. |
351 | * | |
352 | * @param string $entity | |
e0ef6999 EM |
353 | * |
354 | * @return string | |
355 | */ | |
00be9182 | 356 | public function getLogType($entity) { |
a7488080 | 357 | if (!empty($this->_logTables[$entity]['log_type'])) { |
6a488035 TO |
358 | return $this->_logTables[$entity]['log_type']; |
359 | } | |
360 | $logType = ucfirst(substr($entity, strrpos($entity, '_') + 1)); | |
361 | return $logType; | |
362 | } | |
363 | ||
e0ef6999 | 364 | /** |
2fb1dd66 EM |
365 | * Get entity value. |
366 | * | |
100fef9d | 367 | * @param int $id |
e0ef6999 EM |
368 | * @param $entity |
369 | * @param $logDate | |
370 | * | |
371 | * @return mixed|null|string | |
372 | */ | |
00be9182 | 373 | public function getEntityValue($id, $entity, $logDate) { |
a7488080 CW |
374 | if (!empty($this->_logTables[$entity]['bracket_info'])) { |
375 | if (!empty($this->_logTables[$entity]['bracket_info']['entity_column'])) { | |
0d8afee2 | 376 | $logTable = !empty($this->_logTables[$entity]['table_name']) ? $this->_logTables[$entity]['table_name'] : $entity; |
6a488035 | 377 | $sql = " |
eea16664 | 378 | SELECT {$this->_logTables[$entity]['bracket_info']['entity_column']} |
379 | FROM `{$this->loggingDB}`.{$logTable} | |
6a488035 | 380 | WHERE log_date <= %1 AND id = %2 ORDER BY log_date DESC LIMIT 1"; |
cbb9666e | 381 | $entityID = CRM_Core_DAO::singleValueQuery($sql, array( |
382 | 1 => array( | |
383 | CRM_Utils_Date::isoToMysql($logDate), | |
21dfd5f5 | 384 | 'Timestamp', |
cbb9666e | 385 | ), |
21dfd5f5 | 386 | 2 => array($id, 'Integer'), |
cbb9666e | 387 | )); |
388 | } | |
389 | else { | |
6a488035 TO |
390 | $entityID = $id; |
391 | } | |
392 | ||
9d72cede EM |
393 | if ($entityID && $logDate && |
394 | array_key_exists('table', $this->_logTables[$entity]['bracket_info']) | |
395 | ) { | |
6a488035 | 396 | $sql = " |
eea16664 | 397 | SELECT {$this->_logTables[$entity]['bracket_info']['column']} |
398 | FROM `{$this->loggingDB}`.{$this->_logTables[$entity]['bracket_info']['table']} | |
6a488035 | 399 | WHERE log_date <= %1 AND id = %2 ORDER BY log_date DESC LIMIT 1"; |
cbb9666e | 400 | return CRM_Core_DAO::singleValueQuery($sql, array( |
401 | 1 => array(CRM_Utils_Date::isoToMysql($logDate), 'Timestamp'), | |
21dfd5f5 | 402 | 2 => array($entityID, 'Integer'), |
cbb9666e | 403 | )); |
404 | } | |
405 | else { | |
9d72cede EM |
406 | if (array_key_exists('options', $this->_logTables[$entity]['bracket_info']) && |
407 | $entityID | |
408 | ) { | |
cbb9666e | 409 | return CRM_Utils_Array::value($entityID, $this->_logTables[$entity]['bracket_info']['options']); |
410 | } | |
6a488035 TO |
411 | } |
412 | } | |
cbb9666e | 413 | return NULL; |
6a488035 TO |
414 | } |
415 | ||
e0ef6999 | 416 | /** |
2fb1dd66 EM |
417 | * Get entity action. |
418 | * | |
100fef9d CW |
419 | * @param int $id |
420 | * @param int $connId | |
e0ef6999 EM |
421 | * @param $entity |
422 | * @param $oldAction | |
423 | * | |
424 | * @return null|string | |
425 | */ | |
00be9182 | 426 | public function getEntityAction($id, $connId, $entity, $oldAction) { |
a7488080 | 427 | if (!empty($this->_logTables[$entity]['action_column'])) { |
6a488035 | 428 | $sql = "select {$this->_logTables[$entity]['action_column']} from `{$this->loggingDB}`.{$entity} where id = %1 AND log_conn_id = %2"; |
cbb9666e | 429 | $newAction = CRM_Core_DAO::singleValueQuery($sql, array( |
430 | 1 => array($id, 'Integer'), | |
21dfd5f5 | 431 | 2 => array($connId, 'Integer'), |
cbb9666e | 432 | )); |
6a488035 TO |
433 | |
434 | switch ($entity) { | |
cbb9666e | 435 | case 'log_civicrm_group_contact': |
436 | if ($oldAction !== 'Update') { | |
437 | $newAction = $oldAction; | |
438 | } | |
439 | if ($oldAction == 'Insert') { | |
440 | $newAction = 'Added'; | |
441 | } | |
442 | break; | |
6a488035 TO |
443 | } |
444 | return $newAction; | |
445 | } | |
cbb9666e | 446 | return NULL; |
6a488035 | 447 | } |
96025800 | 448 | |
6a488035 | 449 | } |