From 9ca9f0d4000ac42e3097833b5a1730d1f7288a46 Mon Sep 17 00:00:00 2001
From: "s.pongratz" <s.pongratz@adito.de>
Date: Mon, 13 Jul 2020 15:44:27 +0200
Subject: [PATCH] =?UTF-8?q?#1060544-VergabeBerechtigung=20Doku=20hinzugef?=
 =?UTF-8?q?=C3=BCgt?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../documentation.adoc                        | 20 +++++++++++++++++--
 .../permissiondealer_type/valueProcess.js     |  8 +++++---
 2 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/entity/PermissionCalendar_entity/documentation.adoc b/entity/PermissionCalendar_entity/documentation.adoc
index 74fe5d0df0..1c79842cd4 100644
--- a/entity/PermissionCalendar_entity/documentation.adoc
+++ b/entity/PermissionCalendar_entity/documentation.adoc
@@ -1,5 +1,21 @@
 =PermissionCalendar_entity
 
-This Entity is to set Permissions for a Employee of another Employee or Department. Important is that in the `PermissionCalendarEdit_view` the `PERMISSIONPROCURER` gets Rights from the chosen `PERMISSIONDEALER`.
+This Entity is to set Permissions for a Employee or a Department of another Employee or Department. 
+Important is that in the `PermissionCalendarEdit_view` the `PERMISSIONPROCURER` gets Rights from the chosen `PERMISSIONDEALER`.
 
-If you execute a add-Action over the own Filter-View, the current registered User is chosen as `PERMISSIONPROCURER`.
\ No newline at end of file
+If you execute a add-Action over the own of the Filter-Views, you can add a new Permission.
+
+== Consumer of the Provider
+
+if you want to integrate one of the Filter-Views, you have to set the right parameter:
+
+- If you want to show the `PermissionCalendarFilter_view`, you have to set the `PermissionDeler_param`
+- If you want to show the `PermissionCalendarFilterReverse_view`, you have to set the `PermissionProcurer_param`
+
+
+Note: Always set the whole and not the short UID of the Employee. This is need for determining the type.
+
+
+== Relational entities
+
+Employee_entity
\ No newline at end of file
diff --git a/entity/PermissionCalendar_entity/entityfields/permissiondealer_type/valueProcess.js b/entity/PermissionCalendar_entity/entityfields/permissiondealer_type/valueProcess.js
index de18eafdc4..1138eceb87 100644
--- a/entity/PermissionCalendar_entity/entityfields/permissiondealer_type/valueProcess.js
+++ b/entity/PermissionCalendar_entity/entityfields/permissiondealer_type/valueProcess.js
@@ -4,12 +4,14 @@ import("system.result");
 import("system.vars");
 
 
-let permissionProcurerType = vars.get("$param.PermissionDealerType_param");
+let permissionDealerType  = vars.get("$param.PermissionDealerType_param");
 
 if(vars.get("$this.value") == null && vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) 
 {
-    if (permissionProcurerType)
-        result.string(permissionProcurerType);
+    if (permissionDealerType)
+        // if there would add a new Permission Dealer the Dealer Type will be handed over by the Action
+        result.string(permissionDealerType); 
     else
+        // if there would add a new Permission Procurer the Deler Type has to get
         result.string(PermissionCalendar.getObjectType(vars.get("$param.PermissionDealer_param")));
 }
\ No newline at end of file
-- 
GitLab