Fix dates being inserted into the audit trail

master^2
Mike Koch 6 years ago
parent bc6299e5cf
commit ea8b89ac04
No known key found for this signature in database
GPG Key ID: 9BA5D7F8391455ED

@ -3,12 +3,19 @@
namespace DataAccess\AuditTrail;
use BusinessLogic\DateTimeHelpers;
use BusinessLogic\Helpers;
use DataAccess\CommonDao;
class AuditTrailGateway extends CommonDao {
function insertAuditTrailRecord($entityId, $entityType, $languageKey, $date, $replacementValues, $heskSettings) {
$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`,
`language_key`, `date`) VALUES (" . intval($entityId) . ", '" . hesk_dbEscape($entityType) . "',
'" . hesk_dbEscape($languageKey) . "', '" . hesk_dbEscape($date) . "')");
@ -20,6 +27,7 @@ class AuditTrailGateway extends CommonDao {
(`audit_trail_id`, `replacement_index`, `replacement_value`) VALUES (" . intval($auditId) . ",
" . intval($replacementIndex) . ", '" . hesk_dbEscape($replacementValue) . "')");
}
$heskSettings['timeformat'] = $oldTimeFormat;
$this->close();

Loading…
Cancel
Save