diff --git a/entity/LogHistory_entity/LogHistory_entity.aod b/entity/LogHistory_entity/LogHistory_entity.aod index 8d799f883d67f8f65178df4f36f2758fe7ae47f0..d1a9470c67a8c537429b7c93c6001e6c644f861d 100644 --- a/entity/LogHistory_entity/LogHistory_entity.aod +++ b/entity/LogHistory_entity/LogHistory_entity.aod @@ -12,7 +12,7 @@ </entityProvider> <entityField> <name>DATE_NEW</name> - <title>Änderungsdatum</title> + <title>Date</title> <contentType>DATE</contentType> <resolution>SECOND</resolution> <outputFormat></outputFormat> @@ -21,13 +21,13 @@ </entityField> <entityField> <name>USER_NEW</name> - <title>Benutzer</title> + <title>User</title> <mandatory v="true" /> <groupable v="true" /> </entityField> <entityField> <name>DESCRIPTION</name> - <title>Beschreibung</title> + <title>Description</title> <contentType>TEXT</contentType> <mandatory v="true" /> </entityField> diff --git a/entity/LogHistory_entity/recordcontainers/jdito/contentProcess.js b/entity/LogHistory_entity/recordcontainers/jdito/contentProcess.js index ee5db9ec132e63beebe18fd363bcf6fc7ee823df..089be1779e505513066b27516052f5f5194a77b3 100644 --- a/entity/LogHistory_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/LogHistory_entity/recordcontainers/jdito/contentProcess.js @@ -37,11 +37,17 @@ var data = db.table(dataQuery); var resultData = _groupData(data); result.object(resultData); + +//helper functions: + +//creates an identifier for grouping flat table data function _makeGroupingIdentifier(pDatetime, pUser) { + //no need to translate the datepattern since this is only used for internal checks and is never displayed to the user return JSON.stringify({d: datetime.toDate(pDatetime, "yyyy-MM-dd HH:mm"), u: pUser}); } +//reduce flat talbe data to grouped data. Content is grouped by the "groupingIdentifier" which is generated with "_makeGroupingIdentifier" function _groupData(pData) { if ( pData.length == 0 ) @@ -50,22 +56,22 @@ function _groupData(pData) var res = []; var logDatetime, logUser, logDesc; [logDatetime, logUser, logDesc] = pData[0]; - var groupingIdentifier = _makeGroupingIdentifier(logDatetime, logUser); - var logUid = groupingIdentifier;//maybe add more? + var previousGroupingIdentifier = _makeGroupingIdentifier(logDatetime, logUser); + var logUid = previousGroupingIdentifier;//maybe add more information? But for not thats okay for ( var i = 1; i < pData.length; i++ ) { - if ( groupingIdentifier == _makeGroupingIdentifier(pData[i][0], pData[i][1]) ) + if (previousGroupingIdentifier == _makeGroupingIdentifier(pData[i][0], pData[i][1]) ) { - if ( logDesc != pData[i][2]) + if (logDesc != pData[i][2]) logDesc = pData[i][2] + "\n" + logDesc; } else { res.push([logUid, logDatetime, logUser, logDesc]); [logDatetime, logUser, logDesc] = pData[i]; - groupingIdentifier = _makeGroupingIdentifier(logDatetime, logUser); - logUid = groupingIdentifier; + previousGroupingIdentifier = _makeGroupingIdentifier(logDatetime, logUser); + logUid = previousGroupingIdentifier; } } res.push([logUid, logDatetime, logUser, logDesc]); @@ -73,6 +79,7 @@ function _groupData(pData) return res; } +//converts the very dynamic talbeName-condition to a SqlCondition function _getTableNameCondition() { var tableNameCond = SqlCondition.begin(); @@ -82,8 +89,8 @@ function _getTableNameCondition() var _getCond = function(pDefinition) { var resCond = SqlCondition.begin(); - pDefinition.tableNames.forEach(function(e){ - resCond.orPrepare("AB_LOGHISTORY.TABLENAME", e); + pDefinition.tableNames.forEach(function(elem){ + resCond.orPrepare("AB_LOGHISTORY.TABLENAME", elem); }); resCond = SqlCondition.begin().andSqlCondition(resCond).andPrepare("AB_LOGHISTORY.TABLENAMEID", pDefinition.id); diff --git a/neonView/PersonMain_view/PersonMain_view.aod b/neonView/PersonMain_view/PersonMain_view.aod index d22a45b9161db329757b958774982d420edd8970..c839e4c1dfff64a863a8d0c23a7b39dc6dba8a11 100644 --- a/neonView/PersonMain_view/PersonMain_view.aod +++ b/neonView/PersonMain_view/PersonMain_view.aod @@ -39,16 +39,6 @@ <entityField>ObjectTrees</entityField> <view>ObjectTreeFilter_view</view> </neonViewReference> - <neonViewReference> - <name>5754fc3a-c81c-42ba-90ea-2859b10bb391</name> - <entityField>LogHistoryConsumer</entityField> - <view>LogHistoryFilter_view</view> - </neonViewReference> - <neonViewReference> - <name>be48c6fe-1837-4c40-aef1-130fc1a5c544</name> - <entityField>Attributes</entityField> - <view>AttributeRelationFilter_view</view> - </neonViewReference> <neonViewReference> <name>cf989bf6-3e49-44fc-ba98-322aae377da3</name> <entityField>AttributeTree</entityField> @@ -59,5 +49,10 @@ <entityField>OtherContacts</entityField> <view>ContactList_view</view> </neonViewReference> + <neonViewReference> + <name>5754fc3a-c81c-42ba-90ea-2859b10bb391</name> + <entityField>LogHistoryConsumer</entityField> + <view>LogHistoryFilter_view</view> + </neonViewReference> </children> </neonView>