Fix dates being inserted into the audit trail
This commit is contained in:
parent
bc6299e5cf
commit
ea8b89ac04
@ -3,12 +3,19 @@
|
|||||||
namespace DataAccess\AuditTrail;
|
namespace DataAccess\AuditTrail;
|
||||||
|
|
||||||
|
|
||||||
|
use BusinessLogic\DateTimeHelpers;
|
||||||
|
use BusinessLogic\Helpers;
|
||||||
use DataAccess\CommonDao;
|
use DataAccess\CommonDao;
|
||||||
|
|
||||||
class AuditTrailGateway extends CommonDao {
|
class AuditTrailGateway extends CommonDao {
|
||||||
function insertAuditTrailRecord($entityId, $entityType, $languageKey, $date, $replacementValues, $heskSettings) {
|
function insertAuditTrailRecord($entityId, $entityType, $languageKey, $date, $replacementValues, $heskSettings) {
|
||||||
$this->init();
|
$this->init();
|
||||||
|
|
||||||
|
$oldTimeFormat = $heskSettings['timeformat'];
|
||||||
|
$heskSettings['timeformat'] = 'Y-m-d H:i:s';
|
||||||
|
$date = DateTimeHelpers::heskDate($heskSettings);
|
||||||
|
|
||||||
|
|
||||||
hesk_dbQuery("INSERT INTO `" . hesk_dbEscape($heskSettings['db_pfix']) . "audit_trail` (`entity_id`, `entity_type`,
|
hesk_dbQuery("INSERT INTO `" . hesk_dbEscape($heskSettings['db_pfix']) . "audit_trail` (`entity_id`, `entity_type`,
|
||||||
`language_key`, `date`) VALUES (" . intval($entityId) . ", '" . hesk_dbEscape($entityType) . "',
|
`language_key`, `date`) VALUES (" . intval($entityId) . ", '" . hesk_dbEscape($entityType) . "',
|
||||||
'" . hesk_dbEscape($languageKey) . "', '" . hesk_dbEscape($date) . "')");
|
'" . hesk_dbEscape($languageKey) . "', '" . hesk_dbEscape($date) . "')");
|
||||||
@ -20,6 +27,7 @@ class AuditTrailGateway extends CommonDao {
|
|||||||
(`audit_trail_id`, `replacement_index`, `replacement_value`) VALUES (" . intval($auditId) . ",
|
(`audit_trail_id`, `replacement_index`, `replacement_value`) VALUES (" . intval($auditId) . ",
|
||||||
" . intval($replacementIndex) . ", '" . hesk_dbEscape($replacementValue) . "')");
|
" . intval($replacementIndex) . ", '" . hesk_dbEscape($replacementValue) . "')");
|
||||||
}
|
}
|
||||||
|
$heskSettings['timeformat'] = $oldTimeFormat;
|
||||||
|
|
||||||
$this->close();
|
$this->close();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user