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

Loghistory: bugfixes

parent 2e1b7243
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,7 @@ import("Attribute_lib");
import("Contact_lib");
import("AddressEntity_lib");
import("Util_lib");
import("KeywordRegistry_basic");
function LogHistoryExecutor(pTable, pUser, pColumns, pNewValues, pOldValues, pTimeStamp, pAction, pIdValue)
{
......@@ -42,8 +43,7 @@ LogHistoryExecutor.prototype.execute = function ()
var references = {};
var columnStructure = {};
var primaryKey = "";
var tolog = false;
var somethingTolog = false;
var structure = project.getAliasDefinitionStructure(this.structureDefinitionAlias, this.affectedTable);
if (structure)
......@@ -59,11 +59,11 @@ LogHistoryExecutor.prototype.execute = function ()
if (columnStructure[column].primaryKey)
primaryKey = column;
if (columnStructure[column].log)
tolog = true;
somethingTolog = true;
}
}
if (!tolog)
if (!somethingTolog)
return null;
var idvalue = this.idValue;
......@@ -167,8 +167,8 @@ LogHistoryExecutor.prototype.execute = function ()
if (description.length > 0)
{
if (this.sqlAction == 'I') description = translate.withArguments("%0 added.", [description.join(", ")], this.translationLanguage);
if (this.sqlAction == 'U') description = translate.withArguments("%0 modified.", [description.join(", ")], this.translationLanguage);
if (this.sqlAction == 'D') description = translate.withArguments("%0 deleted.", [description.join(", ")], this.translationLanguage);
else if (this.sqlAction == 'U') description = translate.withArguments("%0 modified.", [description.join(", ")], this.translationLanguage);
else if (this.sqlAction == 'D') description = translate.withArguments("%0 deleted.", [description.join(", ")], this.translationLanguage);
for (index in references)
{
if (references[index].id != "")
......@@ -223,11 +223,13 @@ LogHistoryExecutor.prototype._getDataForExtras = function(pId, pValues)
var data = [];
if (this.affectedTable == "AB_ATTRIBUTERELATION")
{
data[0] = AttributeUtil.getFullAttributeName(pId);
data[1] = AttributeRelationUtils.selectAttributeValue(pId, pValues, true);
if (this.affectedTable == "COMMUNICATION")
}
else if (this.affectedTable == "COMMUNICATION")
{
data[0] = KeywordUtils.getResolvedTitleSqlPart("MediumOrgPers", pId, false);
data[0] = KeywordUtils.getViewValue($KeywordRegistry.communicationMedium(), pId);
data[1] = pValues["ADDR"];
}
return data;
......@@ -278,16 +280,15 @@ LogHistoryExecutor._getFormattedValue = function (pDescription, pValue, pLocale)
else if (pDescription.translate4Log != null && pDescription.translate4Log != "")
{
var params = {
rowId: this.idValue
,
value: pValue.toString()
,
rowId: this.idValue,
value: pValue.toString(),
action: this.sqlAction
};
pValue = process.executeScript("LogHistoryExecutor._getFormattedValue ", pDescription.translate4Log, params);
}
else if (pDescription.columnType == String(SQLTYPES.TIMESTAMP)) pValue = datetime.toDate(pValue, translate.text("dd.MM.yyyy", pLocale), "Europe/Berlin");//TODO: timezone?
else if (pDescription.columnType == String(SQLTYPES.TIMESTAMP))
pValue = datetime.toDate(pValue, translate.text("dd.MM.yyyy", pLocale), "Europe/Berlin");//TODO: timezone?
else if (pDescription.autoMapTrueFalse4Log)
{
switch (pValue.toLowerCase())
......
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