diff --git a/entity/PermissionCalendar_entity/documentation.adoc b/entity/PermissionCalendar_entity/documentation.adoc index 74fe5d0df0a48d7408b5f9124f70fd94f5ef438d..1c79842cd4a0d40d8bb415ae413ed6eeb80f71ce 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 de18eafdc483197e7e50910ce5cc6d01fdaba400..1138eceb8719e0a176c8706b64a0260d43247272 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