From 69a20e95f8521579fe4a36adc252a5098bddb47a Mon Sep 17 00:00:00 2001
From: Tobias Feldmann <t.feldmann@adito.de>
Date: Mon, 19 Nov 2018 13:58:22 +0100
Subject: [PATCH] Groupable fields in History_entity

---
 entity/History_entity/History_entity.aod      |  4 ++++
 .../entityfields/icon/valueProcess.js         | 20 ++++++++++++++++++-
 .../HistoryFilter_view/HistoryFilter_view.aod |  5 +++--
 3 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/entity/History_entity/History_entity.aod b/entity/History_entity/History_entity.aod
index 28ac88a64b..e55567e1bc 100644
--- a/entity/History_entity/History_entity.aod
+++ b/entity/History_entity/History_entity.aod
@@ -19,6 +19,7 @@
       <columnName>DIRECTION</columnName>
       <caption>Direction</caption>
       <possibleItemsProcess>%aditoprj%/entity/History_entity/entityfields/direction/possibleItemsProcess.js</possibleItemsProcess>
+      <groupable v="true" />
     </entityField>
     <entityField>
       <name>ENTRYDATE</name>
@@ -28,6 +29,7 @@
       <contentType>DATE</contentType>
       <resolution>DAY</resolution>
       <mandatory v="true" />
+      <groupable v="true" />
     </entityField>
     <entityField>
       <name>HISTORYID</name>
@@ -49,6 +51,7 @@
       <caption>Medium</caption>
       <mandatory v="false" />
       <possibleItemsProcess>%aditoprj%/entity/History_entity/entityfields/medium/possibleItemsProcess.js</possibleItemsProcess>
+      <groupable v="true" />
     </entityField>
     <entityField>
       <name>SUBJECT</name>
@@ -56,6 +59,7 @@
       <columnName>SUBJECT</columnName>
       <caption>Subject</caption>
       <mandatory v="true" />
+      <groupable v="true" />
     </entityField>
     <entityIncomingField>
       <name>OrgHistory_dfi</name>
diff --git a/entity/History_entity/entityfields/icon/valueProcess.js b/entity/History_entity/entityfields/icon/valueProcess.js
index 4d1c6b169d..1b79490f99 100644
--- a/entity/History_entity/entityfields/icon/valueProcess.js
+++ b/entity/History_entity/entityfields/icon/valueProcess.js
@@ -2,4 +2,22 @@ import("system.vars");
 import("system.result");
 import("system.neon");
 
-result.string("NEON:HISTORY");
\ No newline at end of file
+var medium = vars.getString("$field.MEDIUM");
+
+switch (medium) {
+    case "0":
+        result.string("VAADIN:PHONE"); 
+        break;
+    case "1":
+        result.string("VAADIN:AT"); 
+        break;
+    case "2":
+        result.string("VAADIN:PHONE"); 
+        break; 
+    case "3":
+        result.string("VAADIN:LINK"); 
+        break;           
+    default:
+        result.string("NEON:HISTORY");
+        break;
+}
\ No newline at end of file
diff --git a/neonView/HistoryFilter_view/HistoryFilter_view.aod b/neonView/HistoryFilter_view/HistoryFilter_view.aod
index 03685f5f1a..94f0658346 100644
--- a/neonView/HistoryFilter_view/HistoryFilter_view.aod
+++ b/neonView/HistoryFilter_view/HistoryFilter_view.aod
@@ -47,8 +47,9 @@
       <entityField>#ENTITY</entityField>
     </timelineViewTemplate>
     <treetableViewTemplate>
-      <name>Treetable</name>
-      <descriptionField>SUBJECT</descriptionField>
+      <name>Treetable_template</name>
+      <titleField>SUBJECT</titleField>
+      <descriptionField>INFO</descriptionField>
       <iconField>ICON</iconField>
       <entityField>#ENTITY</entityField>
     </treetableViewTemplate>
-- 
GitLab