diff --git a/entity/BulkMailRecipient_entity/BulkMailRecipient_entity.aod b/entity/BulkMailRecipient_entity/BulkMailRecipient_entity.aod index 3257dcb0779635192ed5000254ba9bd2f19e2639..b78cdfe935376658f7b54e432843a021c161595c 100644 --- a/entity/BulkMailRecipient_entity/BulkMailRecipient_entity.aod +++ b/entity/BulkMailRecipient_entity/BulkMailRecipient_entity.aod @@ -188,6 +188,7 @@ <name>ExcludeCommunicationRejecting_param</name> <valueProcess>%aditoprj%/entity/BulkMailRecipient_entity/entityfields/recipientstobemailed/children/excludecommunicationrejecting_param/valueProcess.js</valueProcess> <expose v="false" /> + <title></title> </entityParameter> </children> </entityProvider> diff --git a/entity/CampaignAddParticipants_entity/entityfields/campaignstep_id/onValidation.js b/entity/CampaignAddParticipants_entity/entityfields/campaignstep_id/onValidation.js index 29f8f42cc56cd1e466728103419fe1cc5a893226..9767998d73621627977f7032ebf94d92f3ac544e 100644 --- a/entity/CampaignAddParticipants_entity/entityfields/campaignstep_id/onValidation.js +++ b/entity/CampaignAddParticipants_entity/entityfields/campaignstep_id/onValidation.js @@ -11,7 +11,7 @@ var maxCount = vars.get("$field.campaignStepMaxParticipantCount"); var isUpdate = Utils.toBoolean(vars.get("$param.isUpdate_param")); if (vars.get("$field.CAMPAIGN_ID")){ - var currentCount = CampaignUtils.getParticipantCountForStep(vars.get("$field.CAMPAIGNSTEP_ID"),vars.get("$field.CAMPAIGN_ID")); + var currentCount = parseInt(CampaignUtils.getParticipantCountForStep(vars.get("$field.CAMPAIGNSTEP_ID"),vars.get("$field.CAMPAIGN_ID"))); if ( (validCount+currentCount) > maxCount) result.string(translate.text("Not enough room in campaignstep")); diff --git a/entity/CampaignParticipant_entity/CampaignParticipant_entity.aod b/entity/CampaignParticipant_entity/CampaignParticipant_entity.aod index b32ed04cf46fd53a43f0bdd72acdf1c67b9e2731..7f9346cc2d57a6e3eba0f70aa8c2bdd96968eb7f 100644 --- a/entity/CampaignParticipant_entity/CampaignParticipant_entity.aod +++ b/entity/CampaignParticipant_entity/CampaignParticipant_entity.aod @@ -103,6 +103,7 @@ <state>READONLY</state> <stateProcess>%aditoprj%/entity/CampaignParticipant_entity/entityfields/contact_id/stateProcess.js</stateProcess> <displayValueProcess>%aditoprj%/entity/CampaignParticipant_entity/entityfields/contact_id/displayValueProcess.js</displayValueProcess> + <onValidation>%aditoprj%/entity/CampaignParticipant_entity/entityfields/contact_id/onValidation.js</onValidation> </entityField> <entityField> <name>DATE_NEW</name> diff --git a/entity/CampaignParticipant_entity/entityfields/contact_id/onValidation.js b/entity/CampaignParticipant_entity/entityfields/contact_id/onValidation.js new file mode 100644 index 0000000000000000000000000000000000000000..6be2052997ff4d0cd3999bdc62ac2814b43f206e --- /dev/null +++ b/entity/CampaignParticipant_entity/entityfields/contact_id/onValidation.js @@ -0,0 +1,17 @@ +import("system.translate"); +import("system.result"); +import("system.neon"); +import("system.vars"); +import("Sql_lib"); + +if (vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW && vars.get("$local.value") && vars.get("$field.CAMPAIGN_ID")) +{ + var isParticipant= newSelect(["CONTACT_ID"]) + .from("CAMPAIGNPARTICIPANT") + .where("CAMPAIGNPARTICIPANT.CAMPAIGN_ID", vars.get("$field.CAMPAIGN_ID")) + .and("CAMPAIGNPARTICIPANT.CONTACT_ID",vars.get("$local.value")) + .cell(); + if (isParticipant){ + result.string(translate.text("Chosen record is already in the campaign")); + } +} \ No newline at end of file diff --git a/entity/CampaignParticipant_entity/entityfields/contact_id/stateProcess.js b/entity/CampaignParticipant_entity/entityfields/contact_id/stateProcess.js index aefbe65aa0e63f246ad293afa03a021aa57679af..1d20f9f105caff1beea424c6752b7e54f3aae850 100644 --- a/entity/CampaignParticipant_entity/entityfields/contact_id/stateProcess.js +++ b/entity/CampaignParticipant_entity/entityfields/contact_id/stateProcess.js @@ -2,7 +2,7 @@ import("system.result"); import("system.neon"); import("system.vars"); -if(vars.exists("$param.ContactId_param") && vars.get("$param.ContactId_param")) +if(vars.exists("$param.ContactId_param") && vars.get("$param.ContactId_param") || vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_EDIT) //A contact has been provided. Show it in readonly. fieldState = neon.COMPONENTSTATE_READONLY; else diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index 21ed6ae8fee0d4042b96695882e0e90b79d3a419..22bff7f58fb0fa66f668be352de5c6b5404749c0 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -435,6 +435,10 @@ <key>Claim task</key> <value>Aufgabe annehmen</value> </entry> + <entry> + <key>Chosen record is already in the campaign</key> + <value>Ausgewählter Datensatz befindet sich bereits in der Kampagne</value> + </entry> <entry> <key>Finished tasks</key> <value>Abgeschlossene Aufgaben</value>