diff --git a/aliasDefinition/Data_alias/Data_alias.aod b/aliasDefinition/Data_alias/Data_alias.aod index 71ea6d2aaff1d10d4f97eddc8741d9fc69fa84d2..1595c4e91442b961ad70fbeb4977a22a81ed74b4 100644 --- a/aliasDefinition/Data_alias/Data_alias.aod +++ b/aliasDefinition/Data_alias/Data_alias.aod @@ -3818,6 +3818,11 @@ <global v="false" /> <property v="true" /> </customBooleanProperty> + <customStringProperty> + <name>keyword</name> + <global v="false" /> + <property>ActivityDirection</property> + </customStringProperty> </customProperties> </entityFieldDb> <entityFieldDb> @@ -3852,7 +3857,7 @@ <isUnique v="false" /> <index v="true" /> <documentation></documentation> - <title>Entry date</title> + <title>Entrydate</title> <description></description> <customProperties> <customBooleanProperty> @@ -3881,6 +3886,11 @@ <global v="false" /> <property v="true" /> </customBooleanProperty> + <customJDitoProperty> + <name>translate4Log</name> + <global v="false" /> + <property>%aditoprj%/aliasDefinition/Data_alias/aliasdefinitionsub/entitygroup/entities/activity/entityfields/info/customproperties/translate4log/property.js</property> + </customJDitoProperty> </customProperties> </entityFieldDb> <entityFieldDb> @@ -3916,6 +3926,11 @@ <global v="false" /> <property v="true" /> </customBooleanProperty> + <customStringProperty> + <name>keyword</name> + <global v="false" /> + <property>ActivityCategory</property> + </customStringProperty> </customProperties> </entityFieldDb> <entityFieldDb> @@ -4035,6 +4050,11 @@ <global v="false" /> <property v="true" /> </customBooleanProperty> + <customJDitoProperty> + <name>translate4Log</name> + <global v="false" /> + <property>%aditoprj%/aliasDefinition/Data_alias/aliasdefinitionsub/entitygroup/entities/activity/entityfields/responsible/customproperties/translate4log/property.js</property> + </customJDitoProperty> </customProperties> </entityFieldDb> </entityFields> diff --git a/aliasDefinition/Data_alias/aliasdefinitionsub/entitygroup/entities/activity/entityfields/info/customproperties/translate4log/property.js b/aliasDefinition/Data_alias/aliasdefinitionsub/entitygroup/entities/activity/entityfields/info/customproperties/translate4log/property.js new file mode 100644 index 0000000000000000000000000000000000000000..abc63572fd79ad6f74ed2c55b7263bff15a04f05 --- /dev/null +++ b/aliasDefinition/Data_alias/aliasdefinitionsub/entitygroup/entities/activity/entityfields/info/customproperties/translate4log/property.js @@ -0,0 +1,9 @@ +import("system.result"); +import("system.text"); +import("Loghistory_lib"); + +var params = Translate4LogParams.load(); +var htmlText = params.value; +var plainText = text.html2text(htmlText); + +result.string(plainText); \ No newline at end of file diff --git a/aliasDefinition/Data_alias/aliasdefinitionsub/entitygroup/entities/activity/entityfields/responsible/customproperties/translate4log/property.js b/aliasDefinition/Data_alias/aliasdefinitionsub/entitygroup/entities/activity/entityfields/responsible/customproperties/translate4log/property.js new file mode 100644 index 0000000000000000000000000000000000000000..f35d37ab09f059046b3b6f3d672cf01c66fe58c4 --- /dev/null +++ b/aliasDefinition/Data_alias/aliasdefinitionsub/entitygroup/entities/activity/entityfields/responsible/customproperties/translate4log/property.js @@ -0,0 +1,7 @@ +import("Contact_lib"); +import("system.result"); +import("Loghistory_lib"); + +var params = Translate4LogParams.load(); +var res = ContactUtils.getFullTitleByContactId(params.value); +result.string(res); \ No newline at end of file diff --git a/entity/Activity_entity/Activity_entity.aod b/entity/Activity_entity/Activity_entity.aod index 8eecae85e57b0a83f212eb0adf960919973ae870..04c3abf8855ce3067ccc0dbf4196f71f197fb2e0 100644 --- a/entity/Activity_entity/Activity_entity.aod +++ b/entity/Activity_entity/Activity_entity.aod @@ -563,6 +563,20 @@ <expose v="true" /> <description>Links that will be inserted, required in QuickEntry</description> </entityParameter> + <entityConsumer> + <name>LogHistories</name> + <dependency> + <name>dependency</name> + <entityName>LogHistory_entity</entityName> + <fieldName>LogHistoryProvider</fieldName> + </dependency> + <children> + <entityParameter> + <name>tablenames_param</name> + <valueProcess>%aditoprj%/entity/Activity_entity/entityfields/loghistories/children/tablenames_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> </entityFields> <recordContainers> <dbRecordContainer> diff --git a/entity/Activity_entity/entityfields/loghistories/children/tablenames_param/valueProcess.js b/entity/Activity_entity/entityfields/loghistories/children/tablenames_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..540ffa373e968dfaef6a1cf591218be6700dd665 --- /dev/null +++ b/entity/Activity_entity/entityfields/loghistories/children/tablenames_param/valueProcess.js @@ -0,0 +1,13 @@ +import("system.vars"); +import("system.result"); +import("Context_lib"); + +var res = [ + { + id: vars.get("$field.ACTIVITYID"), + tableNames: ["ACTIVITY", "AB_ATTRIBUTERELATION"] + } +]; + +res = JSON.stringify(res);//currently only strings can be passed as param +result.object(res); \ No newline at end of file diff --git a/entity/LogHistory_entity/LogHistory_entity.aod b/entity/LogHistory_entity/LogHistory_entity.aod index a743c374a247c6bfde6ca4acad135ddc461702d2..57a390307c081da794032a6718d5018c5ec0f41f 100644 --- a/entity/LogHistory_entity/LogHistory_entity.aod +++ b/entity/LogHistory_entity/LogHistory_entity.aod @@ -105,6 +105,12 @@ <fieldName>LogHistoryC</fieldName> <isConsumer v="false" /> </entityDependency> + <entityDependency> + <name>3426c963-c46f-48a1-96e8-8176b5b093c4</name> + <entityName>Activity_entity</entityName> + <fieldName>LogHistories</fieldName> + <isConsumer v="false" /> + </entityDependency> </dependencies> </entityProvider> <entityParameter> diff --git a/neonView/ActivityMain_view/ActivityMain_view.aod b/neonView/ActivityMain_view/ActivityMain_view.aod index 3918cf6567e7281732a23608a441abdb1955fe08..c8f30a095aed70f70b999257681ef3fd6d8cbb59 100644 --- a/neonView/ActivityMain_view/ActivityMain_view.aod +++ b/neonView/ActivityMain_view/ActivityMain_view.aod @@ -34,5 +34,10 @@ <entityField>Documents</entityField> <view>DocumentFilter_view</view> </neonViewReference> + <neonViewReference> + <name>8b6d9b7d-588e-481b-84ac-a3f918b266dc</name> + <entityField>LogHistories</entityField> + <view>LogHistoryFilter_view</view> + </neonViewReference> </children> </neonView> diff --git a/process/Loghistory_lib/process.js b/process/Loghistory_lib/process.js index 25076ed2e6a598d6239a765a27428dc3c671d005..57832021be702f364f574831b37f6600a1cb3db0 100644 --- a/process/Loghistory_lib/process.js +++ b/process/Loghistory_lib/process.js @@ -126,7 +126,10 @@ LogHistoryExecutor.prototype.execute = function () { idvalue = newvalues[conf.IDs[0]]; var data = this._getDataForExtras(newvalues[conf.IDs[1]], newvalues); - description.push(translate.withArguments("%0 \"%1\"", [conf.Description + " " + data[0] + ":", data[1]], this.translationLanguage)); + if (data[1]) + description.push(translate.withArguments("%0 \"%1\"", [conf.Description + " " + data[0] + ":", data[1]], this.translationLanguage)); + else //this may happen for Attributes of type VOID (=attributes that have no values, compareable to "tags") + description.push(conf.Description + " " + data[0]); } if (this.sqlAction == 'U') { @@ -143,7 +146,7 @@ LogHistoryExecutor.prototype.execute = function () else description.push(translate.withArguments("%0 from \"%1\" to %2 \"%3\"", [conf.Description + " " + olddata[0], olddata[1], conf.Description + " " + newdata[0] , newdata[1]], this.translationLanguage)); } - else if(this.affectedTable == "COMMUNICATION" && olddata[0] != newdata[0])//fyi: no change of the "Standard"-flag will be logged + else if(olddata[0] != newdata[0])//fyi: no change of the "Standard"-flag will be logged { description.push(translate.withArguments("%0 from \"%1\" to \"%2\"", [conf.Description, olddata[0], newdata[0]], this.translationLanguage)); } @@ -181,15 +184,19 @@ LogHistoryExecutor.prototype.execute = function () 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.oldValues[i] == "[CLOB]" || this.oldValues[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].trim() == "[CLOB]" || this.oldValues[i] == "") description.push(translate.withArguments("%0 \"%1\"", [logfieldTitle + ":", this.newValues[i]], this.translationLanguage)); else description.push(translate.withArguments("%0 from \"%1\" to \"%2\"", [logfieldTitle + ":", this.oldValues[i], this.newValues[i]], this.translationLanguage)); } - if (this.sqlAction == 'I' && this.newValues[i] != "" && this.newValues[i] != "[CLOB]") + //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].trim() != "[CLOB]") description.push(logfieldTitle + ": \"" + this.newValues[i] + "\""); - if (this.sqlAction == 'D' && this.oldValues[i] != "" && this.oldValues[i] != "[CLOB]") + //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].trim() != "[CLOB]") description.push(logfieldTitle + ": \"" + this.oldValues[i] + "\""); } }