|
|
|
@ -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();
|
|
|
|
|
|
|
|
|
|