diff --git a/entity/VisitPlanEmployeeWeek_entity/VisitPlanEmployeeWeek_entity.aod b/entity/VisitPlanEmployeeWeek_entity/VisitPlanEmployeeWeek_entity.aod index 531c1918d2452b84b8a0548b723dc849f0906793..07aec7a83567bdc4da88ef38b7106019e9e07bd1 100644 --- a/entity/VisitPlanEmployeeWeek_entity/VisitPlanEmployeeWeek_entity.aod +++ b/entity/VisitPlanEmployeeWeek_entity/VisitPlanEmployeeWeek_entity.aod @@ -4,6 +4,7 @@ <majorModelMode>DISTRIBUTED</majorModelMode> <documentation>%aditoprj%/entity/VisitPlanEmployeeWeek_entity/documentation.adoc</documentation> <title>Visitplan Weekly Overview</title> + <grantDeleteProcess>%aditoprj%/entity/VisitPlanEmployeeWeek_entity/grantDeleteProcess.js</grantDeleteProcess> <iconId>VAADIN:CAR</iconId> <image>VAADIN:CAR</image> <recordContainer>db</recordContainer> diff --git a/entity/VisitPlanEmployeeWeek_entity/grantDeleteProcess.js b/entity/VisitPlanEmployeeWeek_entity/grantDeleteProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..c5a2db6695f758cd88f0ac2e599d418c292f2ac4 --- /dev/null +++ b/entity/VisitPlanEmployeeWeek_entity/grantDeleteProcess.js @@ -0,0 +1,10 @@ +import("system.vars"); +import("system.result"); +import("Entity_lib"); + +var id = vars.get("$field.VISITPLANEMPLOYEEWEEKID") +var canDelete = new HasLinkedObjectTester() + .andNoEntityRows("VisitPlanEntry_entity", "Entries", {Entries_param : id}) + .validate(); + +result.string(canDelete) \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/recordcontainers/jdito/onDelete.js b/entity/VisitPlanEntry_entity/recordcontainers/jdito/onDelete.js index 053a7f39e023be7246f83d5c5a43be027a45f283..a507271c6792ee838fad76db423cae2fb2209c8b 100644 --- a/entity/VisitPlanEntry_entity/recordcontainers/jdito/onDelete.js +++ b/entity/VisitPlanEntry_entity/recordcontainers/jdito/onDelete.js @@ -1,6 +1,16 @@ +import("system.vars"); +import("Calendar_lib"); import("system.neon"); import("Sql_lib"); import("system.db"); +var id = vars.get("$field.APPOINTMENT_ID") //deletes appointmententries (+ the linked Objects) if an appointment has been made + +new SqlBuilder(SqlUtils.getSystemAlias()).whereIfSet("ASYS_CALENDARBACKEND.ELEMENTUID", id) + .deleteData(); + +newWhereIfSet("AB_APPOINTMENTLINK.APPOINTMENT_ID", id) + .deleteData(); + newWhereIfSet("VISITPLANENTRY.VISITPLANENTRYID", "$field.UID") .deleteData(); \ No newline at end of file diff --git a/neonView/VisitPlanEmployeeWeekPreview_view/VisitPlanEmployeeWeekPreview_view.aod b/neonView/VisitPlanEmployeeWeekPreview_view/VisitPlanEmployeeWeekPreview_view.aod index 7c1d4abf3b4166c10b31c6b3caed3362dff0bba5..7e053c7391add6378ede3a38de3bba9cfb51a644 100644 --- a/neonView/VisitPlanEmployeeWeekPreview_view/VisitPlanEmployeeWeekPreview_view.aod +++ b/neonView/VisitPlanEmployeeWeekPreview_view/VisitPlanEmployeeWeekPreview_view.aod @@ -4,7 +4,6 @@ <majorModelMode>DISTRIBUTED</majorModelMode> <size>SMALL</size> <isOverlay v="false" /> - <overlayOrientation>PORTRAIT</overlayOrientation> <layout> <headerFooterLayout> <name>layout</name>