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

Loghistory: preview

parent d6813068
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.3.4" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.4"> <entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.3.4" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.4">
<name>LogHistory_entity</name> <name>LogHistory_entity</name>
<majorModelMode>DISTRIBUTED</majorModelMode> <majorModelMode>DISTRIBUTED</majorModelMode>
<title>LogHistory</title> <title>Log</title>
<iconId>NEON:HISTORY</iconId> <iconId>NEON:HISTORY</iconId>
<imageProcess>%aditoprj%/entity/LogHistory_entity/imageProcess.js</imageProcess> <imageProcess>%aditoprj%/entity/LogHistory_entity/imageProcess.js</imageProcess>
<titlePlural>Logs</titlePlural> <titlePlural>Logs</titlePlural>
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<entityField> <entityField>
<name>DESCRIPTION</name> <name>DESCRIPTION</name>
<title>Description</title> <title>Description</title>
<contentType>TEXT</contentType> <contentType>LONG_TEXT</contentType>
<mandatory v="true" /> <mandatory v="true" />
</entityField> </entityField>
<entityProvider> <entityProvider>
......
import("system.eMath");
import("Util_lib"); import("Util_lib");
import("system.datetime"); import("system.datetime");
import("system.result"); import("system.result");
...@@ -10,26 +11,32 @@ import("system.db"); ...@@ -10,26 +11,32 @@ import("system.db");
var recordCond = SqlCondition.begin(); var recordCond = SqlCondition.begin();
//condition for only one/some selected records (maybe needed later for preview, etc.) //condition for only one/some selected records
//since this a unique ID it's perfectly fine to filter only for the IDs and ignore other filters //since this NOT (!) a unique ID we need to filter with all the other filters (via params) too
if (vars.exists("$local.idvalues") && vars.get("$local.idvalues")) if (vars.exists("$local.idvalues"))
{ {
recordCond.and(" AB_LOGHISTORY.AB_LOGHISTORYID in ('" + vars.get("$local.idvalues").join("','") + "')"); var semiId = vars.get("$local.idvalues");//this not really an ID, it's an object that contain the grouped content fields
} if (semiId)
else
{
//condition for restricting the loghistory to some specific tables (e.g. only contact-related tables) and a specific ID
var tableNameCond = _getTableNameCondition();
recordCond.andSqlCondition(tableNameCond);
//user defined filter
if (vars.exists("$local.filter") && vars.get("$local.filter"))
{ {
var filter = vars.get("$local.filter"); var groupingInfo = JSON.parse(semiId);
recordCond.andSqlCondition((JditoFilterUtils.getSqlCondition(filter, "AB_LOGHISTORY"))); recordCond.andPrepare("AB_LOGHISTORY.USER_NEW", groupingInfo.u);
var dateFilterValue = datetime.toLong(groupingInfo.d, "yyyy-MM-dd HH:mm");
recordCond.andPrepare("AB_LOGHISTORY.DATE_NEW", dateFilterValue, "# >= ?");
recordCond.andPrepare("AB_LOGHISTORY.DATE_NEW", eMath.addInt(dateFilterValue, datetime.ONE_MINUTE), "# < ?");
} }
} }
//condition for restricting the loghistory to some specific tables (e.g. only contact-related tables) and a specific ID
var tableNameCond = _getTableNameCondition();
recordCond.andSqlCondition(tableNameCond);
//user defined filter
if (vars.exists("$local.filter") && vars.get("$local.filter"))
{
var filter = vars.get("$local.filter");
recordCond.andSqlCondition((JditoFilterUtils.getSqlCondition(filter, "AB_LOGHISTORY")));
}
var dataQuery = recordCond.buildSql("select AB_LOGHISTORY.DATE_NEW, AB_LOGHISTORY.USER_NEW, AB_LOGHISTORY.DESCRIPTION \n\ var dataQuery = recordCond.buildSql("select AB_LOGHISTORY.DATE_NEW, AB_LOGHISTORY.USER_NEW, AB_LOGHISTORY.DESCRIPTION \n\
from AB_LOGHISTORY ", "1 = 2", "order by DATE_NEW desc, USER_NEW asc"); from AB_LOGHISTORY ", "1 = 2", "order by DATE_NEW desc, USER_NEW asc");
...@@ -44,6 +51,7 @@ result.object(resultData); ...@@ -44,6 +51,7 @@ result.object(resultData);
function _makeGroupingIdentifier(pDatetime, pUser) 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 //no need to translate the datepattern since this is only used for internal checks and is never displayed to the user
//since this is also [part of] the ID keep it very short
return JSON.stringify({d: datetime.toDate(pDatetime, "yyyy-MM-dd HH:mm"), u: pUser}); return JSON.stringify({d: datetime.toDate(pDatetime, "yyyy-MM-dd HH:mm"), u: pUser});
} }
......
...@@ -4,11 +4,16 @@ ...@@ -4,11 +4,16 @@
<title>LogHistory</title> <title>LogHistory</title>
<majorModelMode>DISTRIBUTED</majorModelMode> <majorModelMode>DISTRIBUTED</majorModelMode>
<filterview>LogHistoryFilter_view</filterview> <filterview>LogHistoryFilter_view</filterview>
<preview>LogHistoryPreview_view</preview>
<entity>LogHistory_entity</entity> <entity>LogHistory_entity</entity>
<references> <references>
<neonViewReference> <neonViewReference>
<name>76df2f61-4176-4648-81c7-33da90b76967</name> <name>76df2f61-4176-4648-81c7-33da90b76967</name>
<view>LogHistoryFilter_view</view> <view>LogHistoryFilter_view</view>
</neonViewReference> </neonViewReference>
<neonViewReference>
<name>32181ad2-2766-4d52-a04b-4b74bcbd2453</name>
<view>LogHistoryPreview_view</view>
</neonViewReference>
</references> </references>
</neonContext> </neonContext>
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> <neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1">
<name>AppointmentPreview_view</name> <name>AppointmentPreview_view</name>
<majorModelMode>DISTRIBUTED</majorModelMode> <majorModelMode>DISTRIBUTED</majorModelMode>
<documentation>%aditoprj%/neonView/AppointmentPreview_view/documentation.adoc</documentation> <documentation>%aditoprj%/neonView/AppointmentPreview_view/documentation.adoc</documentation>
<layout> <layout>
<headerFooterLayout> <headerFooterLayout>
<name>layout</name> <name>layout</name>
</headerFooterLayout> </headerFooterLayout>
</layout> </layout>
<children> <children>
<appointmentPreviewViewTemplate> <appointmentPreviewViewTemplate>
<name>Appointments</name> <name>Appointments</name>
<summaryField>SUMMARY</summaryField> <summaryField>SUMMARY</summaryField>
<descriptionField>DESCRIPTION</descriptionField> <descriptionField>DESCRIPTION</descriptionField>
<beginField>BEGIN</beginField> <beginField>BEGIN</beginField>
<endField>END</endField> <endField>END</endField>
<periodField>STARTEND</periodField> <periodField>STARTEND</periodField>
<attendeesField>ATTENDEES</attendeesField> <attendeesField>ATTENDEES</attendeesField>
<privateField>CLASSIFICATION</privateField> <privateField>CLASSIFICATION</privateField>
<transparencyField>TRANSPARENCY</transparencyField> <transparencyField>TRANSPARENCY</transparencyField>
<statusField>STATUS</statusField> <statusField>STATUS</statusField>
<locationField>LOCATION</locationField> <locationField>LOCATION</locationField>
<linkField>LINKS</linkField> <linkField>LINKS</linkField>
<organizerField>ORGANIZER</organizerField> <organizerField>ORGANIZER</organizerField>
<categoriesField>CATEGORIES</categoriesField> <categoriesField>CATEGORIES</categoriesField>
<favoriteActionGroup1>PartStatActionGroup</favoriteActionGroup1> <favoriteActionGroup1>PartStatActionGroup</favoriteActionGroup1>
<entityField>#ENTITY</entityField> <entityField>#ENTITY</entityField>
</appointmentPreviewViewTemplate> </appointmentPreviewViewTemplate>
<neonViewReference> </children>
<name>be0befe0-4b29-4c23-924a-0167240d2b54</name> </neonView>
<entityField>AppointmentLinks</entityField>
<view>AppointmentLinkFilter_view</view>
</neonViewReference>
</children>
</neonView>
<?xml version="1.0" encoding="UTF-8"?>
<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1">
<name>LogHistoryPreview_view</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<layout>
<headerFooterLayout>
<name>layout</name>
<header>head</header>
</headerFooterLayout>
</layout>
<children>
<cardViewTemplate>
<name>head</name>
<subtitleField>DATE_NEW</subtitleField>
<descriptionField>USER_NEW</descriptionField>
<entityField>#ENTITY</entityField>
</cardViewTemplate>
<genericViewTemplate>
<name>text</name>
<hideLabels v="true" />
<entityField>#ENTITY</entityField>
<fields>
<entityFieldLink>
<name>f8d426d2-6e87-4c8c-90c1-8af65b24a90f</name>
<entityField>DESCRIPTION</entityField>
</entityFieldLink>
</fields>
</genericViewTemplate>
</children>
</neonView>
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> <neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1">
<name>PersonPreview_view</name> <name>PersonPreview_view</name>
<majorModelMode>DISTRIBUTED</majorModelMode> <majorModelMode>DISTRIBUTED</majorModelMode>
<layout> <layout>
<headerFooterLayout> <headerFooterLayout>
<name>layout</name> <name>layout</name>
<header>Header</header> <header>Header</header>
</headerFooterLayout> </headerFooterLayout>
</layout> </layout>
<children> <children>
<cardViewTemplate> <cardViewTemplate>
<name>Header</name> <name>Header</name>
<iconField>PICTURE</iconField> <iconField>PICTURE</iconField>
<titleField>FULL_NAME_fieldGroup</titleField> <titleField>FULL_NAME_fieldGroup</titleField>
<descriptionField>ORGANISATION_ID</descriptionField> <descriptionField>ORGANISATION_ID</descriptionField>
<favoriteAction1>newActivity</favoriteAction1> <favoriteAction1>newActivity</favoriteAction1>
<entityField>#ENTITY</entityField> <entityField>#ENTITY</entityField>
</cardViewTemplate> </cardViewTemplate>
<neonViewReference> <neonViewReference>
<name>5a1b7683-2fec-4763-9b45-e4c7a18d70fd</name> <name>5a1b7683-2fec-4763-9b45-e4c7a18d70fd</name>
<entityField>Communications</entityField> <entityField>Communications</entityField>
<view>CommunicationList_view</view> <view>CommunicationList_view</view>
</neonViewReference> </neonViewReference>
<neonViewReference> <neonViewReference>
<name>4c4b1e66-fdc2-469c-a553-244b6dbffbe0</name> <name>4c4b1e66-fdc2-469c-a553-244b6dbffbe0</name>
<entityField>PersAddresses</entityField> <entityField>PersAddresses</entityField>
<view>AddressList_view</view> <view>AddressList_view</view>
</neonViewReference> </neonViewReference>
<neonViewReference> <neonViewReference>
<name>38bd1cc7-8b75-4755-8bb2-0177f02bbef5</name> <name>38bd1cc7-8b75-4755-8bb2-0177f02bbef5</name>
<entityField>OrgAddresses</entityField> <entityField>OrgAddresses</entityField>
<view>AddressList_view</view> <view>AddressList_view</view>
</neonViewReference> </neonViewReference>
<genericViewTemplate> <genericViewTemplate>
<name>Info</name> <name>Info</name>
<showDrawer v="true" /> <showDrawer v="true" />
<entityField>#ENTITY</entityField> <entityField>#ENTITY</entityField>
<fields> <fields>
<entityFieldLink> <entityFieldLink>
<name>b1fae414-9818-48ff-8774-c310caf34d79</name> <name>f9875d78-3d72-47d3-b729-9cf80d236f6e</name>
<entityField>SALUTATION</entityField> <entityField>GENDER</entityField>
</entityFieldLink> </entityFieldLink>
<entityFieldLink> <entityFieldLink>
<name>c12f22ff-3536-45b6-b26f-1d8de6b5aea0</name> <name>5d4e0828-b7fe-4f54-a47a-f9b5838fb1ae</name>
<entityField>TITLE</entityField> <entityField>DATEOFBIRTH</entityField>
</entityFieldLink> </entityFieldLink>
<entityFieldLink> <entityFieldLink>
<name>f9875d78-3d72-47d3-b729-9cf80d236f6e</name> <name>3aa3e89b-91ce-4607-8d76-53ee309a688f</name>
<entityField>GENDER</entityField> <entityField>LANGUAGE</entityField>
</entityFieldLink> </entityFieldLink>
<entityFieldLink> <entityFieldLink>
<name>5d4e0828-b7fe-4f54-a47a-f9b5838fb1ae</name> <name>278c4e64-6f0f-4ea9-b683-75f272a6c088</name>
<entityField>DATEOFBIRTH</entityField> <entityField>STATUS</entityField>
</entityFieldLink> </entityFieldLink>
<entityFieldLink> <entityFieldLink>
<name>3aa3e89b-91ce-4607-8d76-53ee309a688f</name> <name>8ca0067d-4bfa-45b6-89e8-5c58c4e0d6ec</name>
<entityField>LANGUAGE</entityField> <entityField>DEPARTMENT</entityField>
</entityFieldLink> </entityFieldLink>
<entityFieldLink> <entityFieldLink>
<name>278c4e64-6f0f-4ea9-b683-75f272a6c088</name> <name>99904332-fa07-411f-b9e8-7d0ae6918aa6</name>
<entityField>STATUS</entityField> <entityField>CONTACTROLE</entityField>
</entityFieldLink> </entityFieldLink>
<entityFieldLink> <entityFieldLink>
<name>8ca0067d-4bfa-45b6-89e8-5c58c4e0d6ec</name> <name>d5cc98c9-9483-4c2d-b0f3-69e25a0474f3</name>
<entityField>DEPARTMENT</entityField> <entityField>POSITION</entityField>
</entityFieldLink> </entityFieldLink>
<entityFieldLink> </fields>
<name>99904332-fa07-411f-b9e8-7d0ae6918aa6</name> </genericViewTemplate>
<entityField>CONTACTROLE</entityField> </children>
</entityFieldLink> </neonView>
<entityFieldLink>
<name>d5cc98c9-9483-4c2d-b0f3-69e25a0474f3</name>
<entityField>POSITION</entityField>
</entityFieldLink>
</fields>
</genericViewTemplate>
</children>
</neonView>
...@@ -201,9 +201,9 @@ LogHistoryExecutor.prototype.execute = function () ...@@ -201,9 +201,9 @@ LogHistoryExecutor.prototype.execute = function ()
if (description.length > 0) if (description.length > 0)
{ {
if (this.sqlAction == 'I') description = translate.withArguments("%0 added.", [description.join(", ")], this.translationLanguage); if (this.sqlAction == 'I') description = translate.withArguments("%0 added.", [description.join(",\n")], this.translationLanguage);
else if (this.sqlAction == 'U') description = translate.withArguments("%0 modified.", [description.join(", ")], this.translationLanguage); else if (this.sqlAction == 'U') description = translate.withArguments("%0 modified.", [description.join(",\n")], this.translationLanguage);
else if (this.sqlAction == 'D') description = translate.withArguments("%0 deleted.", [description.join(", ")], this.translationLanguage); else if (this.sqlAction == 'D') description = translate.withArguments("%0 deleted.", [description.join(",\n")], this.translationLanguage);
for (index in references) for (index in references)
{ {
if (references[index].id != "") if (references[index].id != "")
......
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