projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #9769 from scardinius/crm-19958
[civicrm-core.git]
/
api
/
v3
/
Logging.php
diff --git
a/api/v3/Logging.php
b/api/v3/Logging.php
index c1a9010a777c08386c2da2c993cbea127b118863..3287b8794f675febda5dc29548e21dbcc7077f8f 100644
(file)
--- a/
api/v3/Logging.php
+++ b/
api/v3/Logging.php
@@
-44,7
+44,8
@@
function civicrm_api3_logging_revert($params) {
$schema = new CRM_Logging_Schema();
$reverter = new CRM_Logging_Reverter($params['log_conn_id'], CRM_Utils_Array::value('log_date', $params));
function civicrm_api3_logging_revert($params) {
$schema = new CRM_Logging_Schema();
$reverter = new CRM_Logging_Reverter($params['log_conn_id'], CRM_Utils_Array::value('log_date', $params));
- $reverter->calculateDiffsFromLogConnAndDate($schema->getLogTablesForContact());
+ $tables = !empty($params['tables']) ? (array) $params['tables'] : $schema->getLogTablesForContact();
+ $reverter->calculateDiffsFromLogConnAndDate($tables);
$reverter->revert();
return civicrm_api3_create_success(1);
}
$reverter->revert();
return civicrm_api3_create_success(1);
}
@@
-73,6
+74,12
@@
function _civicrm_api3_logging_revert_spec(&$params) {
'api.default' => '10 SECOND',
'description' => ts('Used when log_date is passed in'),
);
'api.default' => '10 SECOND',
'description' => ts('Used when log_date is passed in'),
);
+
+ $params['tables'] = array(
+ 'title' => ts('Tables to revert'),
+ 'type' => CRM_Utils_Type::T_STRING,
+ 'description' => ts('Tables to revert, if not set all contact-referring entities will be reverted'),
+ );
}
/**
}
/**
@@
-89,7
+96,8
@@
function civicrm_api3_logging_get($params) {
$schema = new CRM_Logging_Schema();
$interval = (empty($params['log_date'])) ? NULL : $params['interval'];
$differ = new CRM_Logging_Differ($params['log_conn_id'], CRM_Utils_Array::value('log_date', $params), $interval);
$schema = new CRM_Logging_Schema();
$interval = (empty($params['log_date'])) ? NULL : $params['interval'];
$differ = new CRM_Logging_Differ($params['log_conn_id'], CRM_Utils_Array::value('log_date', $params), $interval);
- return civicrm_api3_create_success($differ->getAllChangesForConnection($schema->getLogTablesForContact()));
+ $tables = !empty($params['tables']) ? (array) $params['tables'] : $schema->getLogTablesForContact();
+ return civicrm_api3_create_success($differ->getAllChangesForConnection($tables));
}
/**
}
/**
@@
-116,4
+124,9
@@
function _civicrm_api3_logging_get_spec(&$params) {
'api.default' => '10 SECOND',
'description' => ts('Used when log_date is passed in'),
);
'api.default' => '10 SECOND',
'description' => ts('Used when log_date is passed in'),
);
+ $params['tables'] = array(
+ 'title' => ts('Tables to query'),
+ 'type' => CRM_Utils_Type::T_STRING,
+ 'description' => ts('Tables to query, if not set all contact-referring entities will be queried'),
+ );
}
}