Skip to content
Snippets Groups Projects
Commit 86af3cb1 authored by Johannes Goderbauer's avatar Johannes Goderbauer
Browse files

Merge branch '#1053365-LogHistory' into '2020.1'

#1053365-LogHistory verwendung einer anderen Variable

See merge request xrm/basic!264
parents ebf66f14 201c84a8
No related branches found
No related tags found
No related merge requests found
......@@ -109,12 +109,13 @@ LogHistoryExecutor.prototype.execute = function ()
IDs: ["OBJECT_ROWID", "AB_ATTRIBUTE_ID"],
Description: translate.text("Attribute", this.translationLanguage)
};
var oldvalues = {};
var newvalues = {};
if (extra[this.affectedTable])
{
var conf = extra[this.affectedTable];
var oldvalues = {};
var newvalues = {};
for(i = 0; i < this.columns.length; i++ )
{
......@@ -179,27 +180,27 @@ LogHistoryExecutor.prototype.execute = function ()
if (logfield && logfield.log)
{
if (this.sqlAction != 'I' && this.oldValues[i] != "")
this.oldValues[i] = this._getFormattedValue(this.columns[i], logfield, this.oldValues[i]);
oldvalues[i] = this._getFormattedValue(this.columns[i], logfield, this.oldValues[i]);
if (this.sqlAction != 'D' && this.newValues[i] != "")
this.newValues[i] = this._getFormattedValue(this.columns[i], logfield, this.newValues[i]);
newvalues[i] = this._getFormattedValue(this.columns[i], logfield, this.newValues[i]);
var logfieldTitle = (logfield.title ? translate.text(logfield.title, this.translationLanguage) : translate.text("Value", this.translationLanguage));
if (this.sqlAction == 'U' && this.oldValues[i] != this.newValues[i])
if (this.sqlAction == 'U' && oldvalues[i] != newvalues[i])
{
//TODO: CLOB-check should be done by viewing the structure column type
//use .trim() for "[CLOB]" check because in some case the value "[CLOB]\n" my be given
if (this.oldValues[i] != null && (this.oldValues[i].trim() == "[CLOB]" || this.oldValues[i].trim() == ""))
description.push(translate.withArguments("%0 \"%1\"", [logfieldTitle + ":", this.newValues[i]], this.translationLanguage));
if (oldvalues[i] != null && (oldvalues[i].trim() == "[CLOB]" || oldvalues[i].trim() == ""))
description.push(translate.withArguments("%0 \"%1\"", [logfieldTitle + ":", newvalues[i]], this.translationLanguage));
else
description.push(translate.withArguments("%0 from \"%1\" to \"%2\"", [logfieldTitle + ":", this.oldValues[i], this.newValues[i]], this.translationLanguage));
description.push(translate.withArguments("%0 from \"%1\" to \"%2\"", [logfieldTitle + ":", oldvalues[i], newvalues[i]], this.translationLanguage));
}
//use .trim() for "[CLOB]" check because in some case the value "[CLOB]\n" my be given
if (this.sqlAction == 'I' && this.newValues[i] != "" && this.newValues[i] != null && this.newValues[i].trim() != "[CLOB]")
description.push(logfieldTitle + ": \"" + this.newValues[i] + "\"");
if (this.sqlAction == 'I' && newvalues[i] != "" && newvalues[i] != null && newvalues[i].trim() != "[CLOB]")
description.push(logfieldTitle + ": \"" + newvalues[i] + "\"");
//use .trim() for "[CLOB]" check because in some case the value "[CLOB]\n" my be given
if (this.sqlAction == 'D' && this.oldValues[i] != "" && this.oldValues[i] != null && this.oldValues[i].trim() != "[CLOB]")
description.push(logfieldTitle + ": \"" + this.oldValues[i] + "\"");
if (this.sqlAction == 'D' && oldvalues[i] != "" && oldvalues[i] != null && oldvalues[i].trim() != "[CLOB]")
description.push(logfieldTitle + ": \"" + oldvalues[i] + "\"");
}
}
if (this.sqlAction == "U")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment