diff --git a/entity/BulkMailAddRecipients_entity/BulkMailAddRecipients_entity.aod b/entity/BulkMailAddRecipients_entity/BulkMailAddRecipients_entity.aod index e75ed952327e55f4b5e62fd7d5ffc4c90ba2d144..31597bcc5def3fd33b8cc6f0935c888a02631e08 100644 --- a/entity/BulkMailAddRecipients_entity/BulkMailAddRecipients_entity.aod +++ b/entity/BulkMailAddRecipients_entity/BulkMailAddRecipients_entity.aod @@ -58,6 +58,25 @@ <state>EDITABLE</state> <valueProcess>%aditoprj%/entity/BulkMailAddRecipients_entity/entityfields/recipientcount/valueProcess.js</valueProcess> </entityField> + <entityParameter> + <name>comingFrom_param</name> + <expose v="true" /> + </entityParameter> + <entityField> + <name>currentRecipients</name> + <documentation>%aditoprj%/entity/BulkMailAddRecipients_entity/entityfields/currentrecipients/documentation.adoc</documentation> + <title>Current Recipients</title> + <valueProcess>%aditoprj%/entity/BulkMailAddRecipients_entity/entityfields/currentrecipients/valueProcess.js</valueProcess> + </entityField> + <entityField> + <name>notAddedRecipients</name> + </entityField> + <entityField> + <name>futureRecipients</name> + <documentation>%aditoprj%/entity/BulkMailAddRecipients_entity/entityfields/futurerecipients/documentation.adoc</documentation> + <title>Recipients after adding</title> + <valueProcess>%aditoprj%/entity/BulkMailAddRecipients_entity/entityfields/futurerecipients/valueProcess.js</valueProcess> + </entityField> </entityFields> <recordContainers> <datalessRecordContainer> diff --git a/entity/BulkMailAddRecipients_entity/entityfields/currentrecipients/documentation.adoc b/entity/BulkMailAddRecipients_entity/entityfields/currentrecipients/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..74e2caafdf491b4df68860937a0817c4ce434251 --- /dev/null +++ b/entity/BulkMailAddRecipients_entity/entityfields/currentrecipients/documentation.adoc @@ -0,0 +1,2 @@ +== currentRecipients; +needed for the score card, to display extra information. diff --git a/entity/BulkMailAddRecipients_entity/entityfields/currentrecipients/valueProcess.js b/entity/BulkMailAddRecipients_entity/entityfields/currentrecipients/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..ab684915b04cac155e1a7c5ef4e4f008443ab5fc --- /dev/null +++ b/entity/BulkMailAddRecipients_entity/entityfields/currentrecipients/valueProcess.js @@ -0,0 +1,15 @@ +import("system.logging"); +import("system.result"); +import("system.vars"); +import("Sql_lib"); + +var currentCount = newSelect("count(BULKMAILRECIPIENT.CONTACT_ID)") + .from("BULKMAILRECIPIENT") + .where("BULKMAILRECIPIENT.BULKMAIL_ID", vars.get("$field.BULKMAIL_ID")) + .cell() +if(currentCount) + result.string(currentCount) +else + result.string("0") + + diff --git a/entity/BulkMailAddRecipients_entity/entityfields/futurerecipients/documentation.adoc b/entity/BulkMailAddRecipients_entity/entityfields/futurerecipients/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..b3fd706b46e908ad4dd49cd1fb023137ed6717ae --- /dev/null +++ b/entity/BulkMailAddRecipients_entity/entityfields/futurerecipients/documentation.adoc @@ -0,0 +1,2 @@ +== futureRecipients; +needed for the score card, to display extra information. diff --git a/entity/BulkMailAddRecipients_entity/entityfields/futurerecipients/valueProcess.js b/entity/BulkMailAddRecipients_entity/entityfields/futurerecipients/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..9c50bb1b4d3e3e9076cff47ff37abfb2b665a600 --- /dev/null +++ b/entity/BulkMailAddRecipients_entity/entityfields/futurerecipients/valueProcess.js @@ -0,0 +1,9 @@ +import("system.vars"); +import("system.result"); +import("system.eMath") + +var res = eMath.addInt(vars.get("$field.recipientCount"), vars.get("$field.currentRecipients")); +if(res) + result.string(res); +else + result.string(0); \ No newline at end of file diff --git a/entity/BulkMailAddRecipients_entity/entityfields/recipientcontactids/valueProcess.js b/entity/BulkMailAddRecipients_entity/entityfields/recipientcontactids/valueProcess.js index 9705275249c269d4a34d59acf53a49f83fa02521..4b3206dc22331837d39d9e4aa4e7634336c3e2da 100644 --- a/entity/BulkMailAddRecipients_entity/entityfields/recipientcontactids/valueProcess.js +++ b/entity/BulkMailAddRecipients_entity/entityfields/recipientcontactids/valueProcess.js @@ -1,13 +1,37 @@ +import("system.eMath"); +import("FilterviewMenuAction_lib"); +import("Contact_lib"); import("system.result"); import("Bulkmail_lib"); +import("KeywordRegistry_basic"); +import("system.util"); +import("system.db"); +import("Sql_lib"); import("system.vars"); +import("system.neon"); + +var selection = JSON.parse(vars.getString("$param.ContactIds_param")); +var comingfrom = vars.getString("$param.comingFrom_param"); +var contactIds; + +if(!Array.isArray(selection)) //if selection is an array, data has been selected +{ + var condition = selection.condition; + if(comingfrom == "Organisation") + contactIds = FilterviewMenuActionUtils.organisationIdsFilter(condition); + else if (comingfrom == "Person") + contactIds = FilterviewMenuActionUtils.contactIdsFilter(condition); +} -var contactIds = JSON.parse(vars.getString("$param.ContactIds_param")); var bulkMailId = vars.get("$field.BULKMAIL_ID"); var res; if (bulkMailId) - res = JSON.stringify(BulkMailUtils.filterNewRecipients(bulkMailId, contactIds)); +{ + var recipients = BulkMailUtils.filterNewRecipients(bulkMailId, contactIds); + res = JSON.stringify(recipients); + neon.setFieldValue("$field.notAddedRecipients", eMath.subInt(parseInt(contactIds.length), parseInt(recipients.length))); +} else res = null; diff --git a/entity/BulkMailAddRecipients_entity/entityfields/recipientcountmessage/valueProcess.js b/entity/BulkMailAddRecipients_entity/entityfields/recipientcountmessage/valueProcess.js index ca3a11b99b6ee086734022d909edae33de24f635..80f08142f07db6851da182a44860374521000e27 100644 --- a/entity/BulkMailAddRecipients_entity/entityfields/recipientcountmessage/valueProcess.js +++ b/entity/BulkMailAddRecipients_entity/entityfields/recipientcountmessage/valueProcess.js @@ -2,14 +2,21 @@ import("system.translate"); import("system.result"); import("system.vars"); -var count = vars.getString("$field.recipientCount") +var count = vars.get("$field.recipientCount") var res = ""; +var resNotAdded = "\n\ +"; if (count && !vars.get("$sys.validationerrors")) { if (count == "0") res = translate.text("No new recipients found that can be added to the bulk mail."); else + { res = translate.withArguments("%0 new recipients will be added to the bulk mail.", [count]); + var notAdded = vars.get("$field.notAddedRecipients") + if (notAdded > 0) + resNotAdded += translate.withArguments("%0 of the chosen records are already recipients or don't have an e-mail set", [notAdded]); + } } -result.string(res); \ No newline at end of file +result.string(res + resNotAdded); \ No newline at end of file diff --git a/entity/CampaignAddParticipants_entity/CampaignAddParticipants_entity.aod b/entity/CampaignAddParticipants_entity/CampaignAddParticipants_entity.aod index 427c1e2626f0baade4750445935fb8b335212bf9..09334d4097724f7c81bfe1f6d0c6d98a1bf01c8c 100644 --- a/entity/CampaignAddParticipants_entity/CampaignAddParticipants_entity.aod +++ b/entity/CampaignAddParticipants_entity/CampaignAddParticipants_entity.aod @@ -35,12 +35,13 @@ <consumer>CampaignStepConsumer</consumer> <mandatory v="true" /> <state>EDITABLE</state> + <valueProcess>%aditoprj%/entity/CampaignAddParticipants_entity/entityfields/campaignstep_id/valueProcess.js</valueProcess> <displayValueProcess>%aditoprj%/entity/CampaignAddParticipants_entity/entityfields/campaignstep_id/displayValueProcess.js</displayValueProcess> - <onValueChange>%aditoprj%/entity/CampaignAddParticipants_entity/entityfields/campaignstep_id/onValueChange.js</onValueChange> </entityField> <entityField> <name>campaignParticipantMessage</name> <state>EDITABLE</state> + <valueProcess>%aditoprj%/entity/CampaignAddParticipants_entity/entityfields/campaignparticipantmessage/valueProcess.js</valueProcess> <onValueChangeTypes> <element>PROCESS</element> </onValueChangeTypes> @@ -102,15 +103,17 @@ </entityConsumer> <entityField> <name>campaignStepCurrentParticipantCount</name> + <documentation>%aditoprj%/entity/CampaignAddParticipants_entity/entityfields/campaignstepcurrentparticipantcount/documentation.adoc</documentation> <title>Current participants</title> <state>EDITABLE</state> <displayValueProcess>%aditoprj%/entity/CampaignAddParticipants_entity/entityfields/campaignstepcurrentparticipantcount/displayValueProcess.js</displayValueProcess> </entityField> <entityField> <name>campaignStepMaxParticipantCount</name> + <documentation>%aditoprj%/entity/CampaignAddParticipants_entity/entityfields/campaignstepmaxparticipantcount/documentation.adoc</documentation> <title>Max participants</title> <state>EDITABLE</state> - <displayValueProcess>%aditoprj%/entity/CampaignAddParticipants_entity/entityfields/campaignstepmaxparticipantcount/displayValueProcess.js</displayValueProcess> + <valueProcess>%aditoprj%/entity/CampaignAddParticipants_entity/entityfields/campaignstepmaxparticipantcount/valueProcess.js</valueProcess> </entityField> <entityField> <name>isUpdate</name> @@ -138,19 +141,18 @@ <state>DISABLED</state> <stateProcess>%aditoprj%/entity/CampaignAddParticipants_entity/entityfields/addparticipants/stateProcess.js</stateProcess> </entityActionField> + <entityField> + <name>campaignparticipantContactIds</name> + <documentation>%aditoprj%/entity/CampaignAddParticipants_entity/entityfields/campaignparticipantcontactids/documentation.adoc</documentation> + <title></title> + <valueProcess>%aditoprj%/entity/CampaignAddParticipants_entity/entityfields/campaignparticipantcontactids/valueProcess.js</valueProcess> + </entityField> + <entityParameter> + <name>comingFrom_param</name> + <expose v="true" /> + </entityParameter> </entityFields> <recordContainers> - <jDitoRecordContainer> - <name>jdito</name> - <jDitoRecordAlias>Data_alias</jDitoRecordAlias> - <contentProcess>%aditoprj%/entity/CampaignAddParticipants_entity/recordcontainers/jdito/contentProcess.js</contentProcess> - <onInsert>%aditoprj%/entity/CampaignAddParticipants_entity/recordcontainers/jdito/onInsert.js</onInsert> - <recordFieldMappings> - <jDitoRecordFieldMapping> - <name>UID.value</name> - </jDitoRecordFieldMapping> - </recordFieldMappings> - </jDitoRecordContainer> <datalessRecordContainer> <name>datalessConfig</name> <alias>Data_alias</alias> diff --git a/entity/CampaignAddParticipants_entity/entityfields/addparticipants/onActionProcess.js b/entity/CampaignAddParticipants_entity/entityfields/addparticipants/onActionProcess.js index bbf377c5c3803bd9e8c294d1de8ce1ccca72e0d6..6d047b2cd0b4210c09aadb26f83d583f1b0eebd2 100644 --- a/entity/CampaignAddParticipants_entity/entityfields/addparticipants/onActionProcess.js +++ b/entity/CampaignAddParticipants_entity/entityfields/addparticipants/onActionProcess.js @@ -22,7 +22,7 @@ if(participantRowIds != null && participantRowIds.length > 0) let contactIdsToHandle = participantRowIds; if(isUpdate == "false") - contactIdsToHandle = CampaignUtils.GetContactIdsNotInCampaignByRowIds(campaignId, participantRowIds); + contactIdsToHandle = vars.get("$field.campaignparticipantContactIds"); _handleRowIds(contactIdsToHandle, campaignId); } diff --git a/entity/CampaignAddParticipants_entity/entityfields/campaignparticipantcontactids/documentation.adoc b/entity/CampaignAddParticipants_entity/entityfields/campaignparticipantcontactids/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..d5d2cbde80798127495f89dcbf32fb7fbfc51cc8 --- /dev/null +++ b/entity/CampaignAddParticipants_entity/entityfields/campaignparticipantcontactids/documentation.adoc @@ -0,0 +1,3 @@ +== campaignparticipantContactIds; + +The ContactIds or OrganisationIds of the selected/filtered records. \ No newline at end of file diff --git a/entity/CampaignAddParticipants_entity/entityfields/campaignparticipantcontactids/valueProcess.js b/entity/CampaignAddParticipants_entity/entityfields/campaignparticipantcontactids/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..e831ec632cbba7601e7085e0e59fdbf772e58725 --- /dev/null +++ b/entity/CampaignAddParticipants_entity/entityfields/campaignparticipantcontactids/valueProcess.js @@ -0,0 +1,29 @@ +import("Campaign_lib"); +import("system.eMath"); +import("FilterviewMenuAction_lib"); +import("system.result"); +import("system.vars"); +import("system.neon"); + +if(vars.get("$field.CAMPAIGN_ID")) +{ + var comingfrom = vars.getString("$param.dataSourceTableName_param"); + var contactIds; + var filteredContactIds; + var selection = vars.getString("$param.campaignParticipantsRowIds_param"); + + if(vars.exists("$param.campaignParticipantsCondition_param") && vars.get("$param.campaignParticipantsCondition_param")) + { + selection = JSON.parse(vars.getString("$param.campaignParticipantsCondition_param")).condition; + if(comingfrom == "Organisation") + filteredContactIds = FilterviewMenuActionUtils.organisationIdsFilter(selection); + else if(comingfrom == "Person") + filteredContactIds = FilterviewMenuActionUtils.contactIdsFilter(selection) + contactIds = CampaignUtils.GetContactIdsNotInCampaignByRowIds(vars.get("$field.CAMPAIGN_ID"), filteredContactIds); + } + else + { + contactIds = CampaignUtils.GetContactIdsNotInCampaignByRowIds(vars.get("$field.CAMPAIGN_ID"), JSON.parse(selection)); + } + result.string(JSON.stringify(contactIds)); +} \ No newline at end of file diff --git a/entity/CampaignAddParticipants_entity/entityfields/campaignparticipantmessage/valueProcess.js b/entity/CampaignAddParticipants_entity/entityfields/campaignparticipantmessage/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..b08b067a18d8abf3bfcb5b27d61390176a9141de --- /dev/null +++ b/entity/CampaignAddParticipants_entity/entityfields/campaignparticipantmessage/valueProcess.js @@ -0,0 +1,36 @@ +import("system.eMath"); +import("FilterviewMenuAction_lib"); +import("system.translate"); +import("system.result"); +import("system.vars"); + +var res = ""; +var resNotAdded = "\n\ +"; +if(vars.get("$field.CAMPAIGN_ID") && vars.get("$field.campaignparticipantContactIds") && !vars.get("$sys.validationerrors")) +{ + var validCount = JSON.parse(vars.get("$field.campaignparticipantContactIds")).length; + var selectedIds; + var comingfrom = vars.get("$param.dataSourceTableName_param"); + + if (validCount && !vars.get("$sys.validationerrors") && vars.get("$field.CAMPAIGN_ID")) + { + if (validCount != 0) + { + res = translate.withArguments("%0 new participants will be added to the campaign.", [validCount]); + if(vars.exists("$param.campaignParticipantsRowIds_param") && vars.getString("$param.campaignParticipantsRowIds_param")) + selectedIds = JSON.parse(vars.getString("$param.campaignParticipantsRowIds_param")).length; + else + { + var selection = JSON.parse(vars.getString("$param.campaignParticipantsCondition_param")).condition; + if(comingfrom == "Organisation") + selectedIds = FilterviewMenuActionUtils.organisationIdsFilter(selection).length; + else if(comingfrom == "Person") + selectedIds = FilterviewMenuActionUtils.contactIdsFilter(selection).length; + } + var alreadyParticipant = eMath.subInt(selectedIds, validCount) + resNotAdded += translate.withArguments("%0 of the chosen records are already in the campaign", [alreadyParticipant]); + } + } +} +result.string(res + resNotAdded); \ No newline at end of file diff --git a/entity/CampaignAddParticipants_entity/entityfields/campaignstep_id/onValueChange.js b/entity/CampaignAddParticipants_entity/entityfields/campaignstep_id/onValueChange.js deleted file mode 100644 index 20f59c4bac6dd3416e26c27959f49ce0be78d680..0000000000000000000000000000000000000000 --- a/entity/CampaignAddParticipants_entity/entityfields/campaignstep_id/onValueChange.js +++ /dev/null @@ -1,2 +0,0 @@ -import("system.neon"); -neon.refresh(["$field.campaignParticipantMessage"]) \ No newline at end of file diff --git a/entity/CampaignAddParticipants_entity/recordcontainers/jdito/onInsert.js b/entity/CampaignAddParticipants_entity/entityfields/campaignstep_id/valueProcess.js similarity index 100% rename from entity/CampaignAddParticipants_entity/recordcontainers/jdito/onInsert.js rename to entity/CampaignAddParticipants_entity/entityfields/campaignstep_id/valueProcess.js diff --git a/entity/CampaignAddParticipants_entity/entityfields/campaignstepcurrentparticipantcount/documentation.adoc b/entity/CampaignAddParticipants_entity/entityfields/campaignstepcurrentparticipantcount/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..223c3e99d1b36fc7eac1298a7bd629b6f491eaf9 --- /dev/null +++ b/entity/CampaignAddParticipants_entity/entityfields/campaignstepcurrentparticipantcount/documentation.adoc @@ -0,0 +1,2 @@ +== campaignStepCurrentParticipantCount; +needed for the score card, to display extra information. diff --git a/entity/CampaignAddParticipants_entity/entityfields/campaignstepmaxparticipantcount/documentation.adoc b/entity/CampaignAddParticipants_entity/entityfields/campaignstepmaxparticipantcount/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..cc579ceb749024fa9a933344a3d38d0e6ca4920e --- /dev/null +++ b/entity/CampaignAddParticipants_entity/entityfields/campaignstepmaxparticipantcount/documentation.adoc @@ -0,0 +1,2 @@ +== campaignStepMaxParticipantCount; +needed for the score card, to display extra information. diff --git a/entity/CampaignAddParticipants_entity/entityfields/campaignstepmaxparticipantcount/valueProcess.js b/entity/CampaignAddParticipants_entity/entityfields/campaignstepmaxparticipantcount/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..824a3331dba66661c7d1108166e08d31c4d3ad6a --- /dev/null +++ b/entity/CampaignAddParticipants_entity/entityfields/campaignstepmaxparticipantcount/valueProcess.js @@ -0,0 +1,8 @@ +import("system.result"); +import("system.vars"); +import("Campaign_lib"); + +if(vars.get("$field.CAMPAIGNSTEP_ID")) + result.string(CampaignUtils.getMaxParticipantCountForStep(vars.get("$field.CAMPAIGNSTEP_ID"))); +else + result.string(0) \ No newline at end of file diff --git a/entity/CampaignAddParticipants_entity/entityfields/isoperationvalid/valueProcess.js b/entity/CampaignAddParticipants_entity/entityfields/isoperationvalid/valueProcess.js index 47fb5627a5b21a786a83cdb783128ca40cdfcdfc..512ffebcbe138c38a1bb1d1160217ff6fc6d8e69 100644 --- a/entity/CampaignAddParticipants_entity/entityfields/isoperationvalid/valueProcess.js +++ b/entity/CampaignAddParticipants_entity/entityfields/isoperationvalid/valueProcess.js @@ -111,7 +111,6 @@ if(selectedCampaignId != '') resultValue = "true"; } } - neon.setFieldValue("$field.campaignParticipantMessage", messageString); result.string(resultValue); } diff --git a/entity/CampaignAddParticipants_entity/recordcontainers/jdito/contentProcess.js b/entity/CampaignAddParticipants_entity/recordcontainers/jdito/contentProcess.js deleted file mode 100644 index e197aca8b7760073849e21fb581b065c47215654..0000000000000000000000000000000000000000 --- a/entity/CampaignAddParticipants_entity/recordcontainers/jdito/contentProcess.js +++ /dev/null @@ -1,9 +0,0 @@ -import("system.result"); -import("system.vars"); - -//TODO: This dummy implementation shouldn't be nescessary here. Remove this process eventually. #1051003 -var rows = []; -if (vars.get("$local.idvalues")) - rows = vars.get("$local.idvalues").map(function (id) {return [id];}); - -result.object(rows); \ No newline at end of file diff --git a/entity/CampaignParticipant_entity/CampaignParticipant_entity.aod b/entity/CampaignParticipant_entity/CampaignParticipant_entity.aod index 8905d49054e0f73bac14cc2798d6071a9b0b338f..97aaaa0c2e77fe7787f11b6bc9452a769332c946 100644 --- a/entity/CampaignParticipant_entity/CampaignParticipant_entity.aod +++ b/entity/CampaignParticipant_entity/CampaignParticipant_entity.aod @@ -186,7 +186,7 @@ <entityField> <name>campaignStepMaxParticipantCount</name> <title>Max participants</title> - <displayValueProcess>%aditoprj%/entity/CampaignParticipant_entity/entityfields/campaignstepmaxparticipantcount/displayValueProcess.js</displayValueProcess> + <valueProcess>%aditoprj%/entity/CampaignParticipant_entity/entityfields/campaignstepmaxparticipantcount/valueProcess.js</valueProcess> </entityField> <entityField> <name>ADVERTISINGBAN_ICON</name> diff --git a/entity/CampaignParticipant_entity/entityfields/campaignstepmaxparticipantcount/displayValueProcess.js b/entity/CampaignParticipant_entity/entityfields/campaignstepmaxparticipantcount/displayValueProcess.js deleted file mode 100644 index eb835646c71fb97012fc1d90d0e8d8c144b04064..0000000000000000000000000000000000000000 --- a/entity/CampaignParticipant_entity/entityfields/campaignstepmaxparticipantcount/displayValueProcess.js +++ /dev/null @@ -1,5 +0,0 @@ -import("system.result"); -import("system.vars"); -import("Campaign_lib"); - -result.string(CampaignUtils.getMaxParticipantCountForStep(vars.get("$field.CAMPAIGNSTEP_ID"))); \ No newline at end of file diff --git a/entity/CampaignParticipant_entity/entityfields/campaignstepmaxparticipantcount/valueProcess.js b/entity/CampaignParticipant_entity/entityfields/campaignstepmaxparticipantcount/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..824a3331dba66661c7d1108166e08d31c4d3ad6a --- /dev/null +++ b/entity/CampaignParticipant_entity/entityfields/campaignstepmaxparticipantcount/valueProcess.js @@ -0,0 +1,8 @@ +import("system.result"); +import("system.vars"); +import("Campaign_lib"); + +if(vars.get("$field.CAMPAIGNSTEP_ID")) + result.string(CampaignUtils.getMaxParticipantCountForStep(vars.get("$field.CAMPAIGNSTEP_ID"))); +else + result.string(0) \ No newline at end of file diff --git a/entity/ExportTemplateSelection_entity/ExportTemplateSelection_entity.aod b/entity/ExportTemplateSelection_entity/ExportTemplateSelection_entity.aod index de7cb9ab35c7b24aa5e1906d5068e532e53662fb..657143da0e8d1cc4834a0dacb97233cc3e0bce6a 100644 --- a/entity/ExportTemplateSelection_entity/ExportTemplateSelection_entity.aod +++ b/entity/ExportTemplateSelection_entity/ExportTemplateSelection_entity.aod @@ -71,11 +71,18 @@ </entityField> <entityActionField> <name>safeandexport</name> - <title>export using the selected template</title> + <title>export using the selected template</title> <onActionProcess>%aditoprj%/entity/ExportTemplateSelection_entity/entityfields/safeandexport/onActionProcess.js</onActionProcess> + <isMenuAction v="true" /> <iconId>NEON:EXPORT</iconId> <stateProcess>%aditoprj%/entity/ExportTemplateSelection_entity/entityfields/safeandexport/stateProcess.js</stateProcess> </entityActionField> + <entityField> + <name>exportCount</name> + <documentation>%aditoprj%/entity/ExportTemplateSelection_entity/entityfields/exportcount/documentation.adoc</documentation> + <titleProcess>%aditoprj%/entity/ExportTemplateSelection_entity/entityfields/exportcount/titleProcess.js</titleProcess> + <valueProcess>%aditoprj%/entity/ExportTemplateSelection_entity/entityfields/exportcount/valueProcess.js</valueProcess> + </entityField> </entityFields> <recordContainers> <datalessRecordContainer> diff --git a/entity/ExportTemplateSelection_entity/entityfields/exportcount/documentation.adoc b/entity/ExportTemplateSelection_entity/entityfields/exportcount/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..8d103628b9bb0d253324f37bd4e3423576a8359e --- /dev/null +++ b/entity/ExportTemplateSelection_entity/entityfields/exportcount/documentation.adoc @@ -0,0 +1,2 @@ +== exportCount; +needed for the score card, to display extra information. diff --git a/entity/ExportTemplateSelection_entity/entityfields/exportcount/titleProcess.js b/entity/ExportTemplateSelection_entity/entityfields/exportcount/titleProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..d12a65747fe928abcad84aab3f87c98917e61ade --- /dev/null +++ b/entity/ExportTemplateSelection_entity/entityfields/exportcount/titleProcess.js @@ -0,0 +1,13 @@ +import("system.translate"); +import("system.result"); +import("system.vars"); + +var comingFrom = vars.get("$field.comingfrom") +var res + +if(comingFrom == "Organisation") + res = translate.text("Organisations will be exported"); +else if(comingFrom == "Person") + res = translate.text("Contacts will be exported"); + +result.string(res) \ No newline at end of file diff --git a/entity/ExportTemplateSelection_entity/entityfields/exportcount/valueProcess.js b/entity/ExportTemplateSelection_entity/entityfields/exportcount/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..a650684a24f84809d4c90a99d7d0f48eeda908f9 --- /dev/null +++ b/entity/ExportTemplateSelection_entity/entityfields/exportcount/valueProcess.js @@ -0,0 +1,10 @@ +import("FilterviewMenuAction_lib"); +import("system.vars"); +import("system.result"); + +var selection = vars.getString("$field.selection"); + +if(selection) + result.string(JSON.parse(selection).length); +else + result.string(0); \ No newline at end of file diff --git a/entity/ExportTemplateSelection_entity/entityfields/safeandexport/onActionProcess.js b/entity/ExportTemplateSelection_entity/entityfields/safeandexport/onActionProcess.js index c4237df19e543c334921e62da29247f955cbe61b..0eecb635d118154d8a947e791019c9a143823850 100644 --- a/entity/ExportTemplateSelection_entity/entityfields/safeandexport/onActionProcess.js +++ b/entity/ExportTemplateSelection_entity/entityfields/safeandexport/onActionProcess.js @@ -7,7 +7,8 @@ var templateId = vars.get("$field.EXPORTTEMPLATE_ID"); var selection = vars.get("$field.selection"); var comingFrom = vars.get("$field.comingfrom"); -if(templateId){ +if(templateId) +{ var document = ExportTemplateUtils.buildExport(templateId, selection, comingFrom, filename); neon.download(document.content, document.filename); } \ No newline at end of file diff --git a/entity/ExportTemplateSelection_entity/entityfields/selection/valueProcess.js b/entity/ExportTemplateSelection_entity/entityfields/selection/valueProcess.js index 6779bc32ba75e82ff16f072e56a8efeefb0ba329..3d860b7c277b9a22885f01c55d0f714161e7698b 100644 --- a/entity/ExportTemplateSelection_entity/entityfields/selection/valueProcess.js +++ b/entity/ExportTemplateSelection_entity/entityfields/selection/valueProcess.js @@ -1,5 +1,19 @@ +import("FilterviewMenuAction_lib"); import("system.vars"); import("system.result"); -if(vars.get("$param.selectedData_param")) -result.string(vars.get("$param.selectedData_param")); \ No newline at end of file +var selection = JSON.parse(vars.getString("$param.selectedData_param")); +var comingfrom = vars.getString("$param.comingFrom_param"); +var contactIds; + + +if(!Array.isArray(selection)) //if selection is an array, data has been selected +{ + var condition = selection.condition; + if(comingfrom == "Organisation") + contactIds = FilterviewMenuActionUtils.organisationIdsFilter(condition); + else if (comingfrom == "Person") + contactIds = FilterviewMenuActionUtils.contactIdsFilter(condition); +} +result.string(JSON.stringify(contactIds)); + diff --git a/entity/Organisation_entity/Organisation_entity.aod b/entity/Organisation_entity/Organisation_entity.aod index 9fe5066d15193284355ea0e53ab9d5efcaf29c40..d4baac32bb99ce9c499697c327863886af9b9b2f 100644 --- a/entity/Organisation_entity/Organisation_entity.aod +++ b/entity/Organisation_entity/Organisation_entity.aod @@ -896,8 +896,8 @@ <title>Add to Bulkmail</title> <onActionProcess>%aditoprj%/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/onActionProcess.js</onActionProcess> <isObjectAction v="false" /> - <isSelectionAction v="true" /> <iconId>VAADIN:AT</iconId> + <state>EDITABLE</state> <stateProcess>%aditoprj%/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/stateProcess.js</stateProcess> <tooltipProcess>%aditoprj%/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/tooltipProcess.js</tooltipProcess> </entityActionField> @@ -906,7 +906,6 @@ <title>Add to serial letter</title> <onActionProcess>%aditoprj%/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtoserialletter/onActionProcess.js</onActionProcess> <isObjectAction v="false" /> - <isSelectionAction v="true" /> <iconId>VAADIN:ENVELOPES</iconId> <stateProcess>%aditoprj%/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtoserialletter/stateProcess.js</stateProcess> <tooltipProcess>%aditoprj%/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtoserialletter/tooltipProcess.js</tooltipProcess> @@ -918,6 +917,7 @@ <isMenuAction v="true" /> <isObjectAction v="false" /> <iconId>NEON:EXPORT</iconId> + <stateProcess>%aditoprj%/entity/Organisation_entity/entityfields/filterviewactiongroup/children/export/stateProcess.js</stateProcess> <tooltip>Export fields of this table</tooltip> <tooltipProcess>%aditoprj%/entity/Organisation_entity/entityfields/filterviewactiongroup/children/export/tooltipProcess.js</tooltipProcess> </entityActionField> diff --git a/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/onActionProcess.js b/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/onActionProcess.js index d723a8841f561e91a346e6eea8e86054aabaeaa1..9a2a483e4cc5785a6bf242a7494ee30c3ab9b554 100644 --- a/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/onActionProcess.js +++ b/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/onActionProcess.js @@ -1,6 +1,14 @@ import("Bulkmail_lib"); import("system.vars"); -import("system.neon"); -if (vars.exists("$sys.selection")) - BulkMailUtils.openAddRecipientView(vars.getString("$sys.selection")); \ No newline at end of file +var sysSelection = vars.get("$sys.selection"); + +if(sysSelection.length > 0) //if data selected -> use selected data +{ + BulkMailUtils.addParticipantsByRowIds(JSON.stringify(sysSelection)); +} +else //else -> use Filtercondition +{ + let sysFilter = vars.get("$sys.filter"); + BulkMailUtils.addParticipantsByCondition(JSON.stringify(sysFilter), vars.get("$sys.currentcontextname")); +} diff --git a/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/stateProcess.js b/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/stateProcess.js index 1a24bf4924a99876b3bec1f9bec24fe7bed7743d..81097eaaf9c8078380bb8851862b38e18fb1abf1 100644 --- a/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/stateProcess.js +++ b/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/stateProcess.js @@ -1,9 +1,7 @@ -import("system.neon"); -import("system.neon"); -import("system.result"); -import("KeywordRegistry_basic"); +import("FilterviewMenuAction_lib"); import("system.vars"); +import("system.result"); +var contactCount = vars.get("$sys.datarowcount"); -if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) - result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file +result.string(FilterviewMenuActionUtils.getComponentStateByRowCount(contactCount)); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtocampaignfromtable/onActionProcess.js b/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtocampaignfromtable/onActionProcess.js index c9b89f86a88ad0145a75d7a744938b719fca4c3e..d2b26e842b85f3da742191e8163d45b5078e3317 100644 --- a/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtocampaignfromtable/onActionProcess.js +++ b/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtocampaignfromtable/onActionProcess.js @@ -4,18 +4,12 @@ import("Campaign_lib"); var sysSelection = vars.get("$sys.selection"); -/* - * If there's a selection only those are ought to be added. - * Otherwise the filter gets checked, if a filter has beed set, the condition - * is used to determine the objects to be added. - * If no selection has been set, all objects will be added. - */ -if(sysSelection.length > 0) //selektierte IDs als Array +if(sysSelection.length > 0) //if data selected -> use selected data { - CampaignUtils.addParticipantsByRowIds(JSON.stringify(sysSelection), "ORGANISATION"); + CampaignUtils.addParticipantsByRowIds(JSON.stringify(sysSelection), vars.get("$sys.currentcontextname")); } -else +else //else -> use Filtercondition { - let sysFilter = vars.get("$sys.filter");//todo change name - CampaignUtils.addParticipantsByCondition(JSON.stringify(sysFilter), "ORGANISATION"); + let sysFilter = vars.get("$sys.filter"); + CampaignUtils.addParticipantsByCondition(JSON.stringify(sysFilter), vars.get("$sys.currentcontextname")); } \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtocampaignfromtable/stateProcess.js b/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtocampaignfromtable/stateProcess.js index a4f62ede0a6fc0d8c841610e69fcace9a4213f30..98d07ed94330546f78f2e51c304d9e0faf664903 100644 --- a/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtocampaignfromtable/stateProcess.js +++ b/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtocampaignfromtable/stateProcess.js @@ -1,19 +1,7 @@ -import("KeywordRegistry_basic"); -import("system.db"); +import("FilterviewMenuAction_lib"); import("system.vars"); -import("system.neon"); import("system.result"); var contactCount = vars.get("$sys.datarowcount"); -if(contactCount > 0) -{ - result.string(neon.COMPONENTSTATE_EDITABLE); -} -else -{ - result.string(neon.COMPONENTSTATE_DISABLED); -} - -if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) - result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file +FilterviewMenuActionUtils.getComponentStateByRowCount(contactCount); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtoserialletter/onActionProcess.js b/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtoserialletter/onActionProcess.js index 3bbd8231ed11dd2906547f569e1463e72561c9bd..dc03abb3d725bdf059ac78f6079a3c3214debd2e 100644 --- a/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtoserialletter/onActionProcess.js +++ b/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtoserialletter/onActionProcess.js @@ -1,6 +1,14 @@ import("Bulkmail_lib"); import("system.vars"); -import("system.neon"); -if (vars.exists("$sys.selection")) - SerialLetterUtils.openAddRecipientView(vars.getString("$sys.selection")); \ No newline at end of file +var sysSelection = vars.get("$sys.selection"); + +if(sysSelection.length > 0) //if data selected -> use selected data +{ + SerialLetterUtils.addParticipantsByRowIds(JSON.stringify(sysSelection)); +} +else //else -> use Filtercondition +{ + let sysFilter = vars.get("$sys.filter"); + SerialLetterUtils.addParticipantsByCondition(JSON.stringify(sysFilter), vars.get("$sys.currentcontextname")); +} \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtoserialletter/stateProcess.js b/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtoserialletter/stateProcess.js index daa09139c5a6115f0f8dea868089b1293977fe97..81097eaaf9c8078380bb8851862b38e18fb1abf1 100644 --- a/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtoserialletter/stateProcess.js +++ b/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtoserialletter/stateProcess.js @@ -1,8 +1,7 @@ -import("system.neon"); -import("system.result"); -import("KeywordRegistry_basic"); +import("FilterviewMenuAction_lib"); import("system.vars"); +import("system.result"); +var contactCount = vars.get("$sys.datarowcount"); -if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) - result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file +result.string(FilterviewMenuActionUtils.getComponentStateByRowCount(contactCount)); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/filterviewactiongroup/children/export/onActionProcess.js b/entity/Organisation_entity/entityfields/filterviewactiongroup/children/export/onActionProcess.js index d33e137213bc04c9d971f030d68840ab0e9c46b4..ecad88623a921908ff07c1929560d806ff8c440d 100644 --- a/entity/Organisation_entity/entityfields/filterviewactiongroup/children/export/onActionProcess.js +++ b/entity/Organisation_entity/entityfields/filterviewactiongroup/children/export/onActionProcess.js @@ -1,21 +1,14 @@ -import("system.neon"); +import("ExportTemplate_lib"); import("system.vars"); var sysSelection = vars.get("$sys.selection"); -var params; + if(sysSelection.length > 0) //if data selected -> use selected data { - params = { - "selectedData_param" : JSON.stringify(sysSelection), - "comingFrom_param" : vars.get("$sys.currentcontextname")} - neon.openContext("ExportTemplateSelection", "ExportTemplateSelectionEdit_view", null, neon.OPERATINGSTATE_VIEW, params); + ExportTemplateUtils.addParticipantsByRowIds(JSON.stringify(sysSelection), vars.get("$sys.currentcontextname")); } else //else -> use Filtercondition { let sysFilter = vars.get("$sys.filter"); - params = { - "selectedData_param" : JSON.stringify(sysFilter), - "comingFrom_param" : vars.get("$sys.currentcontextname")} - neon.openContext("ExportTemplateSelection", "ExportTemplateSelectionEdit_view", null, neon.OPERATINGSTATE_VIEW, params); -} - + ExportTemplateUtils.addParticipantsByCondition(JSON.stringify(sysFilter), vars.get("$sys.currentcontextname")); +} \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/filterviewactiongroup/children/export/stateProcess.js b/entity/Organisation_entity/entityfields/filterviewactiongroup/children/export/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..669533224153cb9af9dad27f4f82ef833db79d13 --- /dev/null +++ b/entity/Organisation_entity/entityfields/filterviewactiongroup/children/export/stateProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("FilterviewMenuAction_lib"); +import("system.vars"); + +var contactCount = vars.get("$sys.datarowcount"); + +result.string(FilterviewMenuActionUtils.getComponentStateByRowCount(contactCount)); \ No newline at end of file diff --git a/entity/Person_entity/Person_entity.aod b/entity/Person_entity/Person_entity.aod index f4eb6df51f725dd67cf449a67860dc27db708d33..cc779e4985e288113daa03ffcc0685af3cdd05f5 100644 --- a/entity/Person_entity/Person_entity.aod +++ b/entity/Person_entity/Person_entity.aod @@ -1040,7 +1040,6 @@ <title>Add to Bulkmail</title> <onActionProcess>%aditoprj%/entity/Person_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/onActionProcess.js</onActionProcess> <isObjectAction v="false" /> - <isSelectionAction v="true" /> <iconId>VAADIN:AT</iconId> <stateProcess>%aditoprj%/entity/Person_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/stateProcess.js</stateProcess> <tooltipProcess>%aditoprj%/entity/Person_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/tooltipProcess.js</tooltipProcess> @@ -1049,8 +1048,8 @@ <name>addToSerialLetter</name> <title>Add to serial letter</title> <onActionProcess>%aditoprj%/entity/Person_entity/entityfields/filterviewactiongroup/children/addtoserialletter/onActionProcess.js</onActionProcess> + <isMenuAction v="true" /> <isObjectAction v="false" /> - <isSelectionAction v="true" /> <iconId>VAADIN:ENVELOPES</iconId> <stateProcess>%aditoprj%/entity/Person_entity/entityfields/filterviewactiongroup/children/addtoserialletter/stateProcess.js</stateProcess> <tooltipProcess>%aditoprj%/entity/Person_entity/entityfields/filterviewactiongroup/children/addtoserialletter/tooltipProcess.js</tooltipProcess> @@ -1061,6 +1060,7 @@ <onActionProcess>%aditoprj%/entity/Person_entity/entityfields/filterviewactiongroup/children/export/onActionProcess.js</onActionProcess> <isObjectAction v="false" /> <iconId>NEON:EXPORT</iconId> + <stateProcess>%aditoprj%/entity/Person_entity/entityfields/filterviewactiongroup/children/export/stateProcess.js</stateProcess> <tooltip>Export fields of this table</tooltip> <tooltipProcess>%aditoprj%/entity/Person_entity/entityfields/filterviewactiongroup/children/export/tooltipProcess.js</tooltipProcess> </entityActionField> diff --git a/entity/Person_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/onActionProcess.js b/entity/Person_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/onActionProcess.js index d723a8841f561e91a346e6eea8e86054aabaeaa1..ead03187df10951374645e8b1c8a7515b27f1a76 100644 --- a/entity/Person_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/onActionProcess.js +++ b/entity/Person_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/onActionProcess.js @@ -1,6 +1,14 @@ import("Bulkmail_lib"); import("system.vars"); -import("system.neon"); -if (vars.exists("$sys.selection")) - BulkMailUtils.openAddRecipientView(vars.getString("$sys.selection")); \ No newline at end of file +var sysSelection = vars.get("$sys.selection"); + +if(sysSelection.length > 0) //if data selected -> use selected data +{ + BulkMailUtils.addParticipantsByRowIds(JSON.stringify(sysSelection)); +} +else //else -> use Filtercondition +{ + let sysFilter = vars.get("$sys.filter"); + BulkMailUtils.addParticipantsByCondition(JSON.stringify(sysFilter), vars.get("$sys.currentcontextname")); +} \ No newline at end of file diff --git a/entity/Person_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/stateProcess.js b/entity/Person_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/stateProcess.js index 92f584818ad1fcff6775adf3c9ef1acd2e807151..98d07ed94330546f78f2e51c304d9e0faf664903 100644 --- a/entity/Person_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/stateProcess.js +++ b/entity/Person_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/stateProcess.js @@ -1,8 +1,7 @@ +import("FilterviewMenuAction_lib"); import("system.vars"); -import("system.neon"); import("system.result"); -import("system.result"); -import("KeywordRegistry_basic"); -if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) - result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file +var contactCount = vars.get("$sys.datarowcount"); + +FilterviewMenuActionUtils.getComponentStateByRowCount(contactCount); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/filterviewactiongroup/children/addtocampaignfromtable/onActionProcess.js b/entity/Person_entity/entityfields/filterviewactiongroup/children/addtocampaignfromtable/onActionProcess.js index 5306ab46adf627dedf15b3c578162ed6720f8fed..dec741db1e10a5a36746e87da2b3496c02665940 100644 --- a/entity/Person_entity/entityfields/filterviewactiongroup/children/addtocampaignfromtable/onActionProcess.js +++ b/entity/Person_entity/entityfields/filterviewactiongroup/children/addtocampaignfromtable/onActionProcess.js @@ -2,20 +2,14 @@ import("system.vars"); import("system.neon"); import("Campaign_lib"); -/* - * If there's a selection only those are ought to be added. - * Otherwise the filter gets checked, if a filter has beed set, the condition - * is used to determine the objects to be added. - * If no selection has been set, all objects will be added. - */ var sysSelection = vars.get("$sys.selection"); -if(sysSelection.length > 0) //selektierte IDs als Array +if(sysSelection.length > 0) //if data selected -> use selected data { - CampaignUtils.addParticipantsByRowIds(JSON.stringify(sysSelection), "PERSON"); + CampaignUtils.addParticipantsByRowIds(JSON.stringify(sysSelection), vars.get("$sys.currentcontextname")); } -else +else //else -> use Filtercondition { let sysFilter = vars.get("$sys.filter");//todo change name - CampaignUtils.addParticipantsByCondition(JSON.stringify(sysFilter), "PERSON"); + CampaignUtils.addParticipantsByCondition(JSON.stringify(sysFilter), vars.get("$sys.currentcontextname")); } \ No newline at end of file diff --git a/entity/Person_entity/entityfields/filterviewactiongroup/children/addtocampaignfromtable/stateProcess.js b/entity/Person_entity/entityfields/filterviewactiongroup/children/addtocampaignfromtable/stateProcess.js index 1692669f6caf7db43e9f24decb3fcbfeb3c62993..98d07ed94330546f78f2e51c304d9e0faf664903 100644 --- a/entity/Person_entity/entityfields/filterviewactiongroup/children/addtocampaignfromtable/stateProcess.js +++ b/entity/Person_entity/entityfields/filterviewactiongroup/children/addtocampaignfromtable/stateProcess.js @@ -1,19 +1,7 @@ -import("KeywordRegistry_basic"); -import("system.db"); +import("FilterviewMenuAction_lib"); import("system.vars"); -import("system.neon"); import("system.result"); -var contactCount = vars.get("$sys.datarowcount") +var contactCount = vars.get("$sys.datarowcount"); -if(contactCount > 0) -{ - result.string(neon.COMPONENTSTATE_EDITABLE); -} -else -{ - result.string(neon.COMPONENTSTATE_DISABLED); -} - -if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) - result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file +FilterviewMenuActionUtils.getComponentStateByRowCount(contactCount); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/filterviewactiongroup/children/addtoserialletter/onActionProcess.js b/entity/Person_entity/entityfields/filterviewactiongroup/children/addtoserialletter/onActionProcess.js index 3bbd8231ed11dd2906547f569e1463e72561c9bd..dc03abb3d725bdf059ac78f6079a3c3214debd2e 100644 --- a/entity/Person_entity/entityfields/filterviewactiongroup/children/addtoserialletter/onActionProcess.js +++ b/entity/Person_entity/entityfields/filterviewactiongroup/children/addtoserialletter/onActionProcess.js @@ -1,6 +1,14 @@ import("Bulkmail_lib"); import("system.vars"); -import("system.neon"); -if (vars.exists("$sys.selection")) - SerialLetterUtils.openAddRecipientView(vars.getString("$sys.selection")); \ No newline at end of file +var sysSelection = vars.get("$sys.selection"); + +if(sysSelection.length > 0) //if data selected -> use selected data +{ + SerialLetterUtils.addParticipantsByRowIds(JSON.stringify(sysSelection)); +} +else //else -> use Filtercondition +{ + let sysFilter = vars.get("$sys.filter"); + SerialLetterUtils.addParticipantsByCondition(JSON.stringify(sysFilter), vars.get("$sys.currentcontextname")); +} \ No newline at end of file diff --git a/entity/Person_entity/entityfields/filterviewactiongroup/children/addtoserialletter/stateProcess.js b/entity/Person_entity/entityfields/filterviewactiongroup/children/addtoserialletter/stateProcess.js index 0712af69970fdab78181f33195515067e0003949..98d07ed94330546f78f2e51c304d9e0faf664903 100644 --- a/entity/Person_entity/entityfields/filterviewactiongroup/children/addtoserialletter/stateProcess.js +++ b/entity/Person_entity/entityfields/filterviewactiongroup/children/addtoserialletter/stateProcess.js @@ -1,7 +1,7 @@ -import("system.neon"); +import("FilterviewMenuAction_lib"); import("system.vars"); import("system.result"); -import("KeywordRegistry_basic"); -if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) - result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file +var contactCount = vars.get("$sys.datarowcount"); + +FilterviewMenuActionUtils.getComponentStateByRowCount(contactCount); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/filterviewactiongroup/children/export/onActionProcess.js b/entity/Person_entity/entityfields/filterviewactiongroup/children/export/onActionProcess.js index 2ad35007ff37100b2d33ffa1443d026442cb976e..ecad88623a921908ff07c1929560d806ff8c440d 100644 --- a/entity/Person_entity/entityfields/filterviewactiongroup/children/export/onActionProcess.js +++ b/entity/Person_entity/entityfields/filterviewactiongroup/children/export/onActionProcess.js @@ -1,20 +1,14 @@ -import("system.neon"); +import("ExportTemplate_lib"); import("system.vars"); var sysSelection = vars.get("$sys.selection"); -var params; + if(sysSelection.length > 0) //if data selected -> use selected data { - params = { - "selectedData_param" : JSON.stringify(sysSelection), - "comingFrom_param" : vars.get("$sys.currentcontextname")} - neon.openContext("ExportTemplateSelection", "ExportTemplateSelectionEdit_view", null, neon.OPERATINGSTATE_VIEW, params); + ExportTemplateUtils.addParticipantsByRowIds(JSON.stringify(sysSelection), vars.get("$sys.currentcontextname")); } else //else -> use Filtercondition { - var sysFilter = vars.get("$sys.filter"); - params = { - "selectedData_param" : JSON.stringify(sysFilter), - "comingFrom_param" : vars.get("$sys.currentcontextname")} - neon.openContext("ExportTemplateSelection", "ExportTemplateSelectionEdit_view", null, neon.OPERATINGSTATE_VIEW, params); + let sysFilter = vars.get("$sys.filter"); + ExportTemplateUtils.addParticipantsByCondition(JSON.stringify(sysFilter), vars.get("$sys.currentcontextname")); } \ No newline at end of file diff --git a/entity/Person_entity/entityfields/filterviewactiongroup/children/export/stateProcess.js b/entity/Person_entity/entityfields/filterviewactiongroup/children/export/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..98d07ed94330546f78f2e51c304d9e0faf664903 --- /dev/null +++ b/entity/Person_entity/entityfields/filterviewactiongroup/children/export/stateProcess.js @@ -0,0 +1,7 @@ +import("FilterviewMenuAction_lib"); +import("system.vars"); +import("system.result"); + +var contactCount = vars.get("$sys.datarowcount"); + +FilterviewMenuActionUtils.getComponentStateByRowCount(contactCount); \ No newline at end of file diff --git a/entity/SerialLetterAddRecipients_entity/SerialLetterAddRecipients_entity.aod b/entity/SerialLetterAddRecipients_entity/SerialLetterAddRecipients_entity.aod index cfcb2ee7353ee49d7cbc5062a8dc4411a4fa8d61..8cba893319d2f48d7f80c73787826262e8dae164 100644 --- a/entity/SerialLetterAddRecipients_entity/SerialLetterAddRecipients_entity.aod +++ b/entity/SerialLetterAddRecipients_entity/SerialLetterAddRecipients_entity.aod @@ -49,11 +49,27 @@ <iconId>VAADIN:ENVELOPES</iconId> <stateProcess>%aditoprj%/entity/SerialLetterAddRecipients_entity/entityfields/addparticipants/stateProcess.js</stateProcess> </entityActionField> + <entityParameter> + <name>comingFrom_param</name> + <expose v="true" /> + </entityParameter> + <entityField> + <name>currentRecipients</name> + <documentation>%aditoprj%/entity/SerialLetterAddRecipients_entity/entityfields/currentrecipients/documentation.adoc</documentation> + <title>Current Recipients</title> + <valueProcess>%aditoprj%/entity/SerialLetterAddRecipients_entity/entityfields/currentrecipients/valueProcess.js</valueProcess> + </entityField> <entityField> <name>recipientcount</name> <state>EDITABLE</state> <valueProcess>%aditoprj%/entity/SerialLetterAddRecipients_entity/entityfields/recipientcount/valueProcess.js</valueProcess> </entityField> + <entityField> + <name>futureRecipients</name> + <documentation>%aditoprj%/entity/SerialLetterAddRecipients_entity/entityfields/futurerecipients/documentation.adoc</documentation> + <title>Recipients after adding</title> + <valueProcess>%aditoprj%/entity/SerialLetterAddRecipients_entity/entityfields/futurerecipients/valueProcess.js</valueProcess> + </entityField> </entityFields> <recordContainers> <datalessRecordContainer> diff --git a/entity/SerialLetterAddRecipients_entity/entityfields/currentrecipients/documentation.adoc b/entity/SerialLetterAddRecipients_entity/entityfields/currentrecipients/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..74e2caafdf491b4df68860937a0817c4ce434251 --- /dev/null +++ b/entity/SerialLetterAddRecipients_entity/entityfields/currentrecipients/documentation.adoc @@ -0,0 +1,2 @@ +== currentRecipients; +needed for the score card, to display extra information. diff --git a/entity/SerialLetterAddRecipients_entity/entityfields/currentrecipients/valueProcess.js b/entity/SerialLetterAddRecipients_entity/entityfields/currentrecipients/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..1554f48883f0ab02553defcc9e53d0d111b635be --- /dev/null +++ b/entity/SerialLetterAddRecipients_entity/entityfields/currentrecipients/valueProcess.js @@ -0,0 +1,13 @@ +import("system.logging"); +import("system.result"); +import("system.vars"); +import("Sql_lib"); + +var currentCount = newSelect("count(CONTACT_ID)") + .from("LETTERRECIPIENT") + .where("LETTERRECIPIENT.SERIALLETTER_ID", vars.get("$field.SERIALLETTER_ID")) + .cell(); +if(currentCount) + result.string(currentCount); +else + result.string("0"); \ No newline at end of file diff --git a/entity/SerialLetterAddRecipients_entity/entityfields/futurerecipients/documentation.adoc b/entity/SerialLetterAddRecipients_entity/entityfields/futurerecipients/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..b3fd706b46e908ad4dd49cd1fb023137ed6717ae --- /dev/null +++ b/entity/SerialLetterAddRecipients_entity/entityfields/futurerecipients/documentation.adoc @@ -0,0 +1,2 @@ +== futureRecipients; +needed for the score card, to display extra information. diff --git a/entity/SerialLetterAddRecipients_entity/entityfields/futurerecipients/valueProcess.js b/entity/SerialLetterAddRecipients_entity/entityfields/futurerecipients/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..138ce6ef236a6fae0ef36ac938ebc8378b0a179d --- /dev/null +++ b/entity/SerialLetterAddRecipients_entity/entityfields/futurerecipients/valueProcess.js @@ -0,0 +1,9 @@ +import("system.vars"); +import("system.result"); +import("system.eMath") + +var res = eMath.addInt(vars.get("$field.recipientcount"), vars.get("$field.currentRecipients")); +if(res) + result.string(res); +else + result.string(0); \ No newline at end of file diff --git a/entity/SerialLetterAddRecipients_entity/entityfields/recipientcontactids/valueProcess.js b/entity/SerialLetterAddRecipients_entity/entityfields/recipientcontactids/valueProcess.js index 8a46791dce81c87d35e2c6cf4e985156068e211b..385706891b99b737c6892b3b1f818cbf0a7c48f2 100644 --- a/entity/SerialLetterAddRecipients_entity/entityfields/recipientcontactids/valueProcess.js +++ b/entity/SerialLetterAddRecipients_entity/entityfields/recipientcontactids/valueProcess.js @@ -1,3 +1,4 @@ +import("FilterviewMenuAction_lib"); import("Contact_lib"); import("system.result"); import("Bulkmail_lib"); @@ -7,7 +8,18 @@ import("system.db"); import("Sql_lib"); import("system.vars"); -var contactIds = JSON.parse(vars.getString("$param.ContactIds_param")); +var selection = JSON.parse(vars.getString("$param.ContactIds_param")); +var comingfrom = vars.getString("$param.comingFrom_param"); +var contactIds; + +if(!Array.isArray(selection)) //if selection is an array, data has been selected +{ + var condition = selection.condition; + if(comingfrom == "Organisation") + contactIds = FilterviewMenuActionUtils.organisationIdsFilter(condition); + else if (comingfrom == "Person") + contactIds = FilterviewMenuActionUtils.contactIdsFilter(condition); +} var serialLetterId = vars.get("$field.SERIALLETTER_ID") var res; @@ -16,5 +28,4 @@ if (serialLetterId) else res = null; -result.string(res); - +result.string(res); \ No newline at end of file diff --git a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod index d3a8ed8ce3f4feeb27f64a6d3ea1626fbf671009..b081966d43ab7928cd58e8cc62b24ff09beb5867 100644 --- a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod +++ b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod @@ -6968,6 +6968,40 @@ <entry> <key>workflow notification</key> </entry> + <entry> + <key>Workflow Model</key> + </entry> + <entry> + <key>Current Recipients</key> + </entry> + <entry> + <key>The workflow could not be deployed</key> + </entry> + <entry> + <key>Workflow deploy failed</key> + </entry> + <entry> + <key>%0 new recipients will be added to the bulk mail. \n\
 + %1 of the chosen records are already recipients or don't have an e-mail set</key> + </entry> + <entry> + <key>Recipients after adding</key> + </entry> + <entry> + <key>%0 of the chosen records are already recipients or don't have an e-mail set</key> + </entry> + <entry> + <key>Organisations will be exported</key> + </entry> + <entry> + <key>Contacts will be exported</key> + </entry> + <entry> + <key>%0 new participants will be added to the campaign.</key> + </entry> + <entry> + <key>%0 of the chosen records are already in the campaign</key> + </entry> <entry> <key>Permission received</key> </entry> @@ -6986,21 +7020,12 @@ <entry> <key>Total in euros</key> </entry> - <entry> - <key>Workflow Model</key> - </entry> <entry> <key>{SENT_MAIL}</key> </entry> <entry> <key>The Sales Project can only be filled when a company has been specified</key> </entry> - <entry> - <key>The workflow could not be deployed</key> - </entry> - <entry> - <key>Workflow deploy failed</key> - </entry> <entry> <key>Ø Probability</key> </entry> diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index 2e9dd22054766a6e8a0f99554175d660628a77b4..a105501a68ad6ec79f735497ed81cdeba9d557b3 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -391,10 +391,6 @@ <key>Salesproject phases</key> <value>Vertriebsprojektphasen</value> </entry> - <entry> - <key>%0 new recipients will be added to the bulk mail.</key> - <value>Der Serienmail werden %0 neue Empfänger hinzugefügt.</value> - </entry> <entry> <key>DSGVO Information</key> <value>DSGVO Informationen</value> @@ -8897,6 +8893,7 @@ Bitte Datumseingabe prüfen</value> </entry> <entry> <key>No new recipients found that can be added to the serial letter.</key> + <value>Keine neuen Teilnehmer gefunden die zum Serienbrief hinzugefügt werden können.</value> </entry> <entry> <key>New</key> @@ -8921,33 +8918,76 @@ Bitte Datumseingabe prüfen</value> </entry> <entry> <key>No new recipients found that can be added to the bulk mail.</key> + <value>Keine neuen Teilnehmer gefunden die zur Serienmail hinzugefügt werden können.</value> </entry> <entry> - <key>Total in euros</key> + <key>Current Recipients</key> + <value>Aktuelle Empfänger</value> </entry> <entry> - <key>export using the selected template</key> + <key>The workflow could not be deployed</key> </entry> <entry> - <key>send mail</key> + <key>Workflow deploy failed</key> </entry> <entry> - <key>Download letter and create Activity</key> + <key>Create model</key> </entry> <entry> - <key>{SENT_MAIL}</key> + <key>Edit workflow</key> </entry> <entry> - <key>The workflow could not be deployed</key> + <key>Recipients after adding</key> + <value>Empfänger nach dem hinzufügen</value> </entry> <entry> - <key>Add Participants</key> + <key>%0 new recipients will be added to the bulk mail.</key> + <value>Der Serienmail werden %0 neue Empfänger hinzugefügt.</value> </entry> <entry> - <key>Workflow deploy failed</key> + <key>%0 new participants will be added to the campaign.</key> + <value>Der Kampagne werden %0 neue Empfänger hinzugefügt.</value> </entry> <entry> - <key>Create model</key> + <key>%0 of the chosen records are already recipients or don't have an e-mail set</key> + <value>%0 der ausgewählten Datensätze sind entweder schon Empfänger oder haben keine E-Mail Addresse angegeben. + </value> + </entry> + <entry> + <key>%0 of the chosen records are already in the campaign</key> + <value>%0 der ausgewählten Datensätze sind schon in der Kampagne.</value> + </entry> + <entry> + <key>Organisations will be exported</key> + <value>Firmen werden exportiert</value> + </entry> + <entry> + <key>Contacts will be exported</key> + <value>Kontakte werden exportiert</value> + </entry> + <entry> + <key>%0 new recipients will be added to the bulk mail. \n\
 + %1 of the chosen records are already recipients or don't have an e-mail set</key> + </entry> + <entry> + <key>download ready</key> + </entry> + <entry> + <key>export using the selected template</key> + <value>Mit der ausgewählten Vorlage Exportieren</value> + </entry> + <entry> + <key>send mail</key> + </entry> + <entry> + <key>Download letter and create Activity</key> + </entry> + <entry> + <key>{SENT_MAIL}</key> + </entry> + <entry> + <key>Add Participants</key> + <value>Teilnehmer hinzufügen</value> </entry> <entry> <key>Release</key> @@ -8958,9 +8998,6 @@ Bitte Datumseingabe prüfen</value> <entry> <key>bulk mail sent</key> </entry> - <entry> - <key>Edit workflow</key> - </entry> <entry> <key>and open Report</key> </entry> @@ -8969,13 +9006,11 @@ Bitte Datumseingabe prüfen</value> </entry> <entry> <key>Add Recipients</key> + <value>Teilnehmer hinzufügen</value> </entry> <entry> <key>{SEND_MAIL}</key> </entry> - <entry> - <key>download ready</key> - </entry> <entry> <key>Latitude</key> </entry> @@ -9001,6 +9036,9 @@ Bitte Datumseingabe prüfen</value> <entry> <key>Probability AI</key> </entry> + <entry> + <key>Total in euros</key> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> </language> diff --git a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod index 77d0fd44c6f86134daec36249cce827d62ded843..d020e1f635b81e96a84f29f93e754fb0e17ea695 100644 --- a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod +++ b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod @@ -6942,13 +6942,19 @@ <key>send mail</key> </entry> <entry> - <key>Receive new Department Permission</key> + <key>and open modeler</key> </entry> <entry> - <key>Receive new User Permission</key> + <key>Workflow Model</key> </entry> <entry> - <key>and open modeler</key> + <key>Current Recipients</key> + </entry> + <entry> + <key>The workflow could not be deployed</key> + </entry> + <entry> + <key>Workflow deploy failed</key> </entry> <entry> <key>Create model</key> @@ -6956,6 +6962,34 @@ <entry> <key>Edit workflow</key> </entry> + <entry> + <key>%0 new recipients will be added to the bulk mail. \n\
 + %1 of the chosen records are already recipients or don't have an e-mail set</key> + </entry> + <entry> + <key>Recipients after adding</key> + </entry> + <entry> + <key>%0 of the chosen records are already recipients or don't have an e-mail set</key> + </entry> + <entry> + <key>Organisations will be exported</key> + </entry> + <entry> + <key>Contacts will be exported</key> + </entry> + <entry> + <key>%0 new participants will be added to the campaign.</key> + </entry> + <entry> + <key>%0 of the chosen records are already in the campaign</key> + </entry> + <entry> + <key>Receive new Department Permission</key> + </entry> + <entry> + <key>Receive new User Permission</key> + </entry> <entry> <key>workflow notification</key> </entry> @@ -6977,9 +7011,6 @@ <entry> <key>Total in euros</key> </entry> - <entry> - <key>Workflow Model</key> - </entry> <entry> <key>The Sales Project can only be filled when a company has been specified</key> </entry> @@ -6987,12 +7018,6 @@ <key>{SEND_MAIL}</key> <value>Send mail</value> </entry> - <entry> - <key>The workflow could not be deployed</key> - </entry> - <entry> - <key>Workflow deploy failed</key> - </entry> <entry> <key>{SENT_MAIL}</key> </entry> diff --git a/neonContext/CampaignAddParticipants/CampaignAddParticipants.aod b/neonContext/CampaignAddParticipants/CampaignAddParticipants.aod index 6e0db09316e290aa2d4ad7de62a796b6e4dd9775..11ff951e226c0184d2d4da14ea317a249ae44502 100644 --- a/neonContext/CampaignAddParticipants/CampaignAddParticipants.aod +++ b/neonContext/CampaignAddParticipants/CampaignAddParticipants.aod @@ -9,9 +9,5 @@ <name>c4f11246-9c24-4c1c-8e53-96acabf04bab</name> <view>CampaignAddParticipantsEdit_view</view> </neonViewReference> - <neonViewReference> - <name>87d572bd-f2ce-4283-8db0-a7d9f9441fa0</name> - <view>campaignParticipantMessage_view</view> - </neonViewReference> </references> </neonContext> diff --git a/neonView/BulkMailAddRecipientsEdit_view/BulkMailAddRecipientsEdit_view.aod b/neonView/BulkMailAddRecipientsEdit_view/BulkMailAddRecipientsEdit_view.aod index b51a66ffd812ac5f4afbec1d20584fe3be8998b9..3e391de817552197a795d56eae398c21e37f0fdf 100644 --- a/neonView/BulkMailAddRecipientsEdit_view/BulkMailAddRecipientsEdit_view.aod +++ b/neonView/BulkMailAddRecipientsEdit_view/BulkMailAddRecipientsEdit_view.aod @@ -6,11 +6,26 @@ <isOverlay v="false" /> <overlayOrientation>PORTRAIT</overlayOrientation> <layout> - <boxLayout> + <headerFooterLayout> <name>layout</name> - </boxLayout> + <header>SelectedBulkMailInfosScore</header> + </headerFooterLayout> </layout> <children> + <scoreCardViewTemplate> + <name>SelectedBulkMailInfosScore</name> + <entityField>#ENTITY</entityField> + <fields> + <entityFieldLink> + <name>1b9e38a5-e921-48f7-ba04-71b758fa9ed3</name> + <entityField>currentRecipients</entityField> + </entityFieldLink> + <entityFieldLink> + <name>4578042c-9210-4dc4-870f-298a390aebd8</name> + <entityField>futureRecipients</entityField> + </entityFieldLink> + </fields> + </scoreCardViewTemplate> <genericViewTemplate> <name>Generic</name> <editMode v="true" /> diff --git a/neonView/CampaignAddParticipantsEdit_view/CampaignAddParticipantsEdit_view.aod b/neonView/CampaignAddParticipantsEdit_view/CampaignAddParticipantsEdit_view.aod index 51e47fdf6319fc525098bfd9ec85a8432ed0503a..c5448b2e2f2a2ff8b9012a77e0ebae80c3056c21 100644 --- a/neonView/CampaignAddParticipantsEdit_view/CampaignAddParticipantsEdit_view.aod +++ b/neonView/CampaignAddParticipantsEdit_view/CampaignAddParticipantsEdit_view.aod @@ -30,22 +30,18 @@ <name>campaignDetail</name> <editMode v="true" /> <entityField>#ENTITY</entityField> + <informationField>campaignParticipantMessage</informationField> <fields> <entityFieldLink> - <name>4968ad35-3651-4654-a1b0-0e3d0fc6165d</name> + <name>e4fa5e06-cc8e-40c2-983c-371bd6b46958</name> <entityField>CAMPAIGN_ID</entityField> </entityFieldLink> <entityFieldLink> - <name>b9016725-1345-4526-88eb-2b05fb4089c8</name> + <name>f5cd3e7d-e2e3-401c-a314-6853ff269065</name> <entityField>CAMPAIGNSTEP_ID</entityField> </entityFieldLink> </fields> </genericViewTemplate> - <neonViewReference> - <name>1bfb0564-f81f-4c60-ae5b-1d9778a519ab</name> - <entityField>#ENTITY</entityField> - <view>campaignParticipantMessage_view</view> - </neonViewReference> <actionsViewTemplate> <name>ContinueActions</name> <actions> diff --git a/neonView/ExportTemplateSelectionEdit_view/ExportTemplateSelectionEdit_view.aod b/neonView/ExportTemplateSelectionEdit_view/ExportTemplateSelectionEdit_view.aod index 7a9b755b2040d6f09825ca7133ccaf29750c34c5..3886dffb7b0ba7f28718efe0bd922ab036e71352 100644 --- a/neonView/ExportTemplateSelectionEdit_view/ExportTemplateSelectionEdit_view.aod +++ b/neonView/ExportTemplateSelectionEdit_view/ExportTemplateSelectionEdit_view.aod @@ -5,11 +5,22 @@ <size>SMALL</size> <overlayOrientation>PORTRAIT</overlayOrientation> <layout> - <boxLayout> + <headerFooterLayout> <name>layout</name> - </boxLayout> + <header>ExportedDataInfoScore</header> + </headerFooterLayout> </layout> <children> + <scoreCardViewTemplate> + <name>ExportedDataInfoScore</name> + <entityField>#ENTITY</entityField> + <fields> + <entityFieldLink> + <name>731880ab-e7fd-462b-ae21-431673f232cc</name> + <entityField>exportCount</entityField> + </entityFieldLink> + </fields> + </scoreCardViewTemplate> <genericViewTemplate> <name>generic</name> <editMode v="true" /> diff --git a/neonView/SerialLetterAddRecipientsEdit_view/SerialLetterAddRecipientsEdit_view.aod b/neonView/SerialLetterAddRecipientsEdit_view/SerialLetterAddRecipientsEdit_view.aod index b3b8d67e1ba188142d23e3795d039485844f397b..cc896e3f349b75903b76419669dc8a6114b1dbd8 100644 --- a/neonView/SerialLetterAddRecipientsEdit_view/SerialLetterAddRecipientsEdit_view.aod +++ b/neonView/SerialLetterAddRecipientsEdit_view/SerialLetterAddRecipientsEdit_view.aod @@ -6,11 +6,26 @@ <isOverlay v="false" /> <overlayOrientation>PORTRAIT</overlayOrientation> <layout> - <noneLayout> + <headerFooterLayout> <name>layout</name> - </noneLayout> + <header>SelectedSerialLetterInfosScore</header> + </headerFooterLayout> </layout> <children> + <scoreCardViewTemplate> + <name>SelectedSerialLetterInfosScore</name> + <entityField>#ENTITY</entityField> + <fields> + <entityFieldLink> + <name>02bc3eb7-4ceb-4a54-ab56-9980b7653152</name> + <entityField>currentRecipients</entityField> + </entityFieldLink> + <entityFieldLink> + <name>5e91781a-d640-4096-a084-259c23bea825</name> + <entityField>futureRecipients</entityField> + </entityFieldLink> + </fields> + </scoreCardViewTemplate> <genericViewTemplate> <name>Generic</name> <editMode v="true" /> @@ -24,17 +39,6 @@ </entityFieldLink> </fields> </genericViewTemplate> - <genericViewTemplate> - <name>Message</name> - <hideLabels v="true" /> - <entityField>#ENTITY</entityField> - <fields> - <entityFieldLink> - <name>ab256925-6375-4b7f-880d-039f6a68ccbc</name> - <entityField>recipientCountMessage</entityField> - </entityFieldLink> - </fields> - </genericViewTemplate> <actionsViewTemplate> <name>ContinueActions</name> <actions> diff --git a/neonView/campaignParticipantMessage_view/campaignParticipantMessage_view.aod b/neonView/campaignParticipantMessage_view/campaignParticipantMessage_view.aod deleted file mode 100644 index f11aa26b7622597f92bbebfaa15af9b47767ff8e..0000000000000000000000000000000000000000 --- a/neonView/campaignParticipantMessage_view/campaignParticipantMessage_view.aod +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.6" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.6"> - <name>campaignParticipantMessage_view</name> - <majorModelMode>DISTRIBUTED</majorModelMode> - <layout> - <noneLayout> - <name>layout</name> - </noneLayout> - </layout> - <children> - <genericViewTemplate> - <name>Message_view</name> - <hideLabels v="true" /> - <hideEmptyFields v="true" /> - <entityField>#ENTITY</entityField> - <fields> - <entityFieldLink> - <name>bc1db862-a448-47f6-b534-2ce28dc993a8</name> - <entityField>campaignParticipantMessage</entityField> - </entityFieldLink> - </fields> - </genericViewTemplate> - </children> -</neonView> diff --git a/process/Bulkmail_lib/process.js b/process/Bulkmail_lib/process.js index ede9be7097f894fb89139076e79f0c1305f4b015..0715bd9e1ce5c6fcab1e43ae18fcbafd85e1572f 100644 --- a/process/Bulkmail_lib/process.js +++ b/process/Bulkmail_lib/process.js @@ -393,6 +393,38 @@ BulkMailUtils.copy = function(pBulkMailId) }; neon.openContext("BulkMail", null, null, neon.OPERATINGSTATE_NEW, params); } +/** + * Adds contacts or organistaions to a bulk mail by contactIds.<br> + * + * @param {String} pContactIds <p> + * The contact ids as JSON array.<br> + */ +BulkMailUtils.addParticipantsByRowIds = function(pContactIds) +{ + var params = { + "ContactIds_param" : pContactIds + }; + neon.openContext("BulkMailAddRecipients", "BulkMailAddRecipientsEdit_view", null, neon.OPERATINGSTATE_VIEW, params); +} + +/** + * Adds contacts or organistaions to a bulk mail by condition (filter).<br> + * + * @param {String} pCondition <p> + * Contact ids. + * @param {String} pSourceTableName <p> + * The source table.<br> + */ +BulkMailUtils.addParticipantsByCondition = function(pCondition, pSourceTableName) +{ + var params = { + "ContactIds_param" : pCondition, + "comingFrom_param" : pSourceTableName} + neon.openContext("BulkMailAddRecipients", "BulkMailAddRecipientsEdit_view", null, neon.OPERATINGSTATE_VIEW, params); +} + + + function SerialLetterUtils () {} @@ -551,4 +583,34 @@ SerialLetterUtils.getSerialLetterTemplate = function (pLetterId, pDocumentTempla if (!template.type) template = DocumentTemplate.loadTemplate(pDocumentTemplateId); return template; +} + +/** + * Adds contacts or organistaions to a serial letter by contactIds.<br> + * + * @param {String} pContactIds <p> + * The contact ids as JSON array.<br> + */ +SerialLetterUtils.addParticipantsByRowIds = function(pContactIds) +{ + var params = { + "ContactIds_param" : pContactIds + }; + neon.openContext("SerialLetterAddRecipients", "SerialLetterAddRecipientsEdit_view", null, neon.OPERATINGSTATE_VIEW, params); +} + +/** + * Adds contacts or organistaions to a serial letter by condition (filter).<br> + * + * @param {String} pCondition <p> + * Contact ids. + * @param {String} pSourceTableName <p> + * The source table.<br> + */ +SerialLetterUtils.addParticipantsByCondition = function(pCondition, pSourceTableName) +{ + var params = { + "ContactIds_param" : pCondition, + "comingFrom_param" : pSourceTableName} + neon.openContext("SerialLetterAddRecipients", "SerialLetterAddRecipientsEdit_view", null, neon.OPERATINGSTATE_VIEW, params); } \ No newline at end of file diff --git a/process/Campaign_lib/process.js b/process/Campaign_lib/process.js index b38ab24f96c87d6895583dcb9f2b787ea503fd34..482f9c6b20c2b2265536da9baa4d53c575049881 100644 --- a/process/Campaign_lib/process.js +++ b/process/Campaign_lib/process.js @@ -693,5 +693,5 @@ _CampaignUtils._openAddParticipantContext = function(pContext, pTargetDataExpres params["isUpdate_param"] = false; params["dataSourceTableName_param"] = pSourceTableName; - neon.openContext(pContext, "CampaignAddParticipantsEdit_view", null, neon.OPERATINGSTATE_VIEW, params); + neon.openContext(pContext, pView, null, neon.OPERATINGSTATE_VIEW, params); } \ No newline at end of file diff --git a/process/ExportTemplate_lib/process.js b/process/ExportTemplate_lib/process.js index a8c09911551c8dfd933e082febebfac8d3a25dd3..6d92feab13f5f37e5590a613fd3c1befca6a5586 100644 --- a/process/ExportTemplate_lib/process.js +++ b/process/ExportTemplate_lib/process.js @@ -1,3 +1,5 @@ +import("system.neon"); +import("system.vars"); import("Address_lib"); import("Keyword_lib"); import("KeywordRegistry_basic"); @@ -51,17 +53,7 @@ ExportTemplateUtils.buildExport = function (pExportTemplateId, pSelection, pComi selection = []; selection = JSON.parse(pSelection); //makes an array of the ContactIds/OrganisationIds of the selected data } - else - { - filteredIdcondition = JSON.parse(selection).condition; - if(comingFrom == "Person") - selection = ExportTemplateUtils.contactIdsFilter(filteredIdcondition); //selects all ContactIds of the filtered data - else if(comingFrom == "Organisation") - selection = ExportTemplateUtils.contactIdsOrganisationFilter(filteredIdcondition); //selects all OrganisationIds of the filtered data - else - throw new Error(translate.text("pComingFrom is not defined. 'ExportTemplateUtils.buildExport:66'")); - } - + if(filename == null || filename == undefined || filename.trim() == "") //if the user didn't choose a filename => generate one automatically filename = ExportTemplateUtils.getExportFileName(templateTitle, "UTC"); filename += ".csv"; @@ -94,7 +86,7 @@ ExportTemplateUtils.buildExport = function (pExportTemplateId, pSelection, pComi return {content : csvTable, filename : filename }; -} +}; /** * Gets an Array of all the Fields of a ExportTemplate using it's unique exportTemplateId. @@ -111,7 +103,7 @@ ExportTemplateUtils.getTemplateFields = function (pExportTemplateId) .where("EXPORTTEMPLATEFIELD.EXPORTTEMPLATE_ID", pExportTemplateId) .orderBy("EXPORTTEMPLATEFIELD.SORTING") .arrayColumn(); -} +}; /** * Generates a practical filename, with the templateName, and the date + time of the download, using it's unique exportTemplateId. @@ -128,45 +120,7 @@ ExportTemplateUtils.getExportFileName = function (pTemplateTitle, pTimeZone) var exportFileName = pTemplateTitle + "_" + datetime.toDate(datetime.date(), "dd.MM.yyyy.HH:mm:ss", pTimeZone); return exportFileName; -} - -/** - * Generates an Array of all the contactIds using the filtercondition - * - * @param {String} pCondition the condition of the filter - * - * @return {Array} all the contactids limited by the filtercondition - */ -ExportTemplateUtils.contactIdsFilter = function (pCondition) -{ - let query = newSelect("CONTACT.CONTACTID").from("CONTACT"); - - query.join("PERSON", "CONTACT.PERSON_ID = PERSON.PERSONID") - .leftJoin("ORGANISATION", "ORGANISATION.ORGANISATIONID = CONTACT.ORGANISATION_ID") - .leftJoin("ADDRESS", "ADDRESS.ADDRESSID = CONTACT.ADDRESS_ID") - .where(pCondition); - - return query.arrayColumn(); -} - -/** - * Generates an Array of all the organisationIds (=contactIds of the organisations) using the filtercondition - * - * @param {String} pCondition the condition of the filter - * - * @return {Array} all the organisationids (=contactIds of the organisations) limited by the filtercondition - */ -ExportTemplateUtils.contactIdsOrganisationFilter = function (pCondition) -{ - let query = newSelect("ORGANISATION.ORGANISATIONID").from("ORGANISATION"); - - query.leftJoin("CONTACT", "CONTACT.ORGANISATION_ID = ORGANISATION.ORGANISATIONID") - .leftJoin("PERSON", "PERSON.PERSONID = CONTACT.PERSON_ID") - .leftJoin("ADDRESS", "ADDRESS.ADDRESSID = CONTACT.ADDRESS_ID") - .where(pCondition); - - return query.arrayColumn(); -} +}; /** * Gets the title, language, sentenceseparator, fieldseparator and fielddelimiter of an export template using it's unique Id @@ -184,7 +138,7 @@ ExportTemplateUtils.getTemplateData = function (pExportTemplateId) .arrayRow(); data[1] = LanguageKeywordUtils.Iso2FromIso3(data[1]) //needed to get the language in the right format return data; -} +}; /** * Converts the sentence separator in the correct character if one of the keys is being used @@ -202,7 +156,7 @@ ExportTemplateUtils.getSentenceSeparator = function (pSentenceSeparator) return "\r\n"; else return pSentenceSeparator; -} +}; /** * Converts the field separator in the correct character if one of the keys is being used @@ -224,7 +178,7 @@ ExportTemplateUtils.getFieldSeparator = function (pFieldSeparator) return ";"; else return pFieldSeparator; -} +}; /** * Converts the field delimiter in the correct character if one of the keys is being used @@ -242,7 +196,7 @@ ExportTemplateUtils.getFieldDeLimiter = function (pFieldDeLimiter) return "\""; else return pFieldDeLimiter; -} +}; /** * Gets the Title of a Template @@ -257,4 +211,36 @@ ExportTemplateUtils.getExportTemplateTitle = function (pExportTemplateId) .from("EXPORTTEMPLATE") .where("EXPORTTEMPLATE.EXPORTTEMPLATEID", pExportTemplateId) .cell(true); -} \ No newline at end of file +}; + +/** + * Export contacts or organistaions by contactIds.<br> + * + * @param {String} pRowIds <p> + * The contact ids as JSON array.<br> + * @param {String} pSourceTableName <p> + * The source table.<br> + */ +ExportTemplateUtils.addParticipantsByRowIds = function (pRowIds, pSourceTableName) +{ + var params = { + "selectedData_param" : pRowIds, + "comingFrom_param" : pSourceTableName} + neon.openContext("ExportTemplateSelection", "ExportTemplateSelectionEdit_view", null, neon.OPERATINGSTATE_VIEW, params); +}; + +/** + * Export contacts or organistaions by condition (filter).<br> + * + * @param {String} pCondition <p> + * Contact ids. + * @param {String} pSourceTableName <p> + * The source table.<br> + */ +ExportTemplateUtils.addParticipantsByCondition = function (pCondition, pSourceTableName) +{ + var params = { + "selectedData_param" : pCondition, + "comingFrom_param" : pSourceTableName} + neon.openContext("ExportTemplateSelection", "ExportTemplateSelectionEdit_view", null, neon.OPERATINGSTATE_VIEW, params); +}; \ No newline at end of file diff --git a/process/FilterCondition_lib/process.js b/process/FilterCondition_lib/process.js index c49e3c2374d743883fdbd2659e0971eb9b4d7fe6..abb1cee432a5968d6390b3bc2789d7fbc8870b17 100644 --- a/process/FilterCondition_lib/process.js +++ b/process/FilterCondition_lib/process.js @@ -1,3 +1,5 @@ +import("system.neon"); +import("Sql_lib"); /** * Methods to help build filterCondition statements. * Do not create an instance of this! diff --git a/process/FilterviewMenuAction_lib/FilterviewMenuAction_lib.aod b/process/FilterviewMenuAction_lib/FilterviewMenuAction_lib.aod new file mode 100644 index 0000000000000000000000000000000000000000..3162cdadf0282fcd2b3e418c1b3727179a745ff7 --- /dev/null +++ b/process/FilterviewMenuAction_lib/FilterviewMenuAction_lib.aod @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> + <name>FilterviewMenuAction_lib</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <process>%aditoprj%/process/FilterviewMenuAction_lib/process.js</process> + <variants> + <element>LIBRARY</element> + </variants> +</process> diff --git a/process/FilterviewMenuAction_lib/process.js b/process/FilterviewMenuAction_lib/process.js new file mode 100644 index 0000000000000000000000000000000000000000..9dbcc8e25b9011540ed67392deab8b6d6488654d --- /dev/null +++ b/process/FilterviewMenuAction_lib/process.js @@ -0,0 +1,63 @@ +import("system.neon"); +import("Sql_lib"); +/** + * Methods for the menu actions in the filterview. + * Do not create an instance of this! + * + * @class + */ +function FilterviewMenuActionUtils() {} + +/** + * Generates an Array of all the contactIds using the filtercondition + * + * @param {Condition} pCondition the condition of the filter + * + * @return {Array} all the contactids limited by the filtercondition + */ +FilterviewMenuActionUtils.contactIdsFilter = function (pCondition) +{ + let query = newSelect("distinct CONTACT.CONTACTID").from("CONTACT"); + + query.join("PERSON", "CONTACT.PERSON_ID = PERSON.PERSONID") + .leftJoin("ORGANISATION", "ORGANISATION.ORGANISATIONID = CONTACT.ORGANISATION_ID") + .leftJoin("ADDRESS", "ADDRESS.ADDRESSID = CONTACT.ADDRESS_ID") + .where(pCondition); + + return query.arrayColumn(); +}; + +/** + * Generates an Array of all the organisationIds using the filtercondition + * + * @param {String} pCondition the condition of the filter + * + * @return {Array} all the organisationids (=contactIds of the organisations) limited by the filtercondition + */ +FilterviewMenuActionUtils.organisationIdsFilter = function (pCondition) +{ + let query = newSelect("distinct ORGANISATION.ORGANISATIONID").from("ORGANISATION"); + + query.leftJoin("CONTACT", "CONTACT.ORGANISATION_ID = ORGANISATION.ORGANISATIONID") + .leftJoin("PERSON", "PERSON.PERSONID = CONTACT.PERSON_ID") + .leftJoin("ADDRESS", "ADDRESS.ADDRESSID = CONTACT.ADDRESS_ID") + .where(pCondition); + + return query.arrayColumn(); +}; + +/** + * Retuns the componentstate using the rowcount. + * (used for the menu actions) + * + * @param {pDataRowCount} pDataRowCount data row count (vars.get("$sys.datarowcount");) + * + * @return {String} componentstate + */ +FilterviewMenuActionUtils.getComponentStateByRowCount = function(pDataRowCount) +{ + if(pDataRowCount > 0) + return neon.COMPONENTSTATE_EDITABLE; + else + return neon.COMPONENTSTATE_DISABLED; +}; \ No newline at end of file