From 2538097a81a849524ae7cdc95c28d7cd8a7698aa Mon Sep 17 00:00:00 2001 From: "s.pongratz" <s.pongratz@adito.de> Date: Mon, 5 Oct 2020 16:52:18 +0200 Subject: [PATCH] =?UTF-8?q?#1066308-KontaktDelete=20Links=20L=C3=B6schen?= =?UTF-8?q?=20und=20360=C2=B0Objects=20Deny?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../participantsdbrecordcontainer/conditionProcess.js | 3 ++- entity/Person_entity/grantDeleteProcess.js | 2 ++ entity/Person_entity/recordcontainers/db/onDBDelete.js | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/conditionProcess.js b/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/conditionProcess.js index b3b5019620..67d5159a7b 100644 --- a/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/conditionProcess.js +++ b/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/conditionProcess.js @@ -4,6 +4,7 @@ import("system.vars"); var condition = newWhere() .andIfSet("CAMPAIGNPARTICIPANT.CAMPAIGN_ID", "$param.CampaignId_param") - .andIfSet("CAMPAIGNPARTICIPANT.CAMPAIGNSTEP_ID", "$param.CampaignStepId_param"); + .andIfSet("CAMPAIGNPARTICIPANT.CAMPAIGNSTEP_ID", "$param.CampaignStepId_param") + .andIfSet("CAMPAIGNPARTICIPANT.CONTACT_ID", "$param.ContactId_param"); result.string(condition.toString()); diff --git a/entity/Person_entity/grantDeleteProcess.js b/entity/Person_entity/grantDeleteProcess.js index 88573c89e8..876b00bdb6 100644 --- a/entity/Person_entity/grantDeleteProcess.js +++ b/entity/Person_entity/grantDeleteProcess.js @@ -28,6 +28,8 @@ if(personCount == 1) .andNoEntityRows("Offer_entity", "ContactOffers", {ContactId_param : contactId}) //Offers .andNoEntityRows("Contract_entity", "Contracts", {ContactId_param : contactId}) //Contracts .andNoEntityRows("ObjectTree_entity", "TreeProvider", {ObjectIds_param : JSON.stringify([contactId, vars.get("$field.PERSON_ID")]), ObjectTypes_param : JSON.stringify([currentContext, "PrivatePerson"])}) + .andNoEntityRows("CampaignParticipant_entity", "CampaignParticipantsProvider", {ContactId_param : contactId}) + .andNoEntityRows("Order_entity", "OrderProvider", {ContactId_param : contactId}) .validate(); } else if (personCount == 0) //special case in QuickEntry where it should be possible to remove a new Person that is not saved in the db yet diff --git a/entity/Person_entity/recordcontainers/db/onDBDelete.js b/entity/Person_entity/recordcontainers/db/onDBDelete.js index aed5eceb44..56d4461823 100644 --- a/entity/Person_entity/recordcontainers/db/onDBDelete.js +++ b/entity/Person_entity/recordcontainers/db/onDBDelete.js @@ -14,5 +14,9 @@ new AttributeRelationQuery(contactId, null, ContextUtils.getCurrentContextId()) newWhere("COMMUNICATION.CONTACT_ID", contactId).deleteData(); newWhere("ADDRESS.CONTACT_ID", contactId).deleteData(); newWhere("COMMRESTRICTION.CONTACT_ID", contactId).deleteData(); +newWhere("AB_APPOINTMENTLINK.OBJECT_TYPE", "Person") +.and("AB_APPOINTMENTLINK.OBJECT_ROWID", contactId).deleteData(); +newWhere("AB_ATTRIBUTERELATION.OBJECT_TYPE", "Person") +.and("AB_ATTRIBUTERELATION.OBJECT_ROWID", contactId).deleteData(); WorkflowSignalSender.deleted(); \ No newline at end of file -- GitLab