diff --git a/entity/CampaignAddParticipants_entity/CampaignAddParticipants_entity.aod b/entity/CampaignAddParticipants_entity/CampaignAddParticipants_entity.aod index 1366fd58e74a7dc00fcdd1617047efabaf8e508e..2bd6d6b593e73e023f936f64da158620915dee68 100644 --- a/entity/CampaignAddParticipants_entity/CampaignAddParticipants_entity.aod +++ b/entity/CampaignAddParticipants_entity/CampaignAddParticipants_entity.aod @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.3.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.1"> <name>CampaignAddParticipants_entity</name> + <title>Add participants to Campaign</title> <majorModelMode>DISTRIBUTED</majorModelMode> <recordContainer>jdito</recordContainer> <entityFields> @@ -11,11 +12,13 @@ <name>CAMPAIGN_ID</name> <title>Campaign</title> <consumer>CampaignConsumer</consumer> + <mandatory v="true" /> </entityField> <entityField> <name>CAMPAIGNSTEP_ID</name> <title>Campaign Step</title> <consumer>CampaignStepConsumer</consumer> + <mandatory v="true" /> </entityField> <entityField> <name>campaignParticipantMessage</name> diff --git a/entity/CampaignParticipant_entity/CampaignParticipant_entity.aod b/entity/CampaignParticipant_entity/CampaignParticipant_entity.aod index 829d5af3194343ef3a3702e7af1c38e186fcfc55..24a2e510c37db9206b01579db4a1da66568ab52e 100644 --- a/entity/CampaignParticipant_entity/CampaignParticipant_entity.aod +++ b/entity/CampaignParticipant_entity/CampaignParticipant_entity.aod @@ -64,6 +64,7 @@ <title>Campaign</title> <consumer>CampaignsConsumer</consumer> <valueProcess>%aditoprj%/entity/CampaignParticipant_entity/entityfields/campaign_id/valueProcess.js</valueProcess> + <displayValueProcess>%aditoprj%/entity/CampaignParticipant_entity/entityfields/campaign_id/displayValueProcess.js</displayValueProcess> <onValueChange>%aditoprj%/entity/CampaignParticipant_entity/entityfields/campaign_id/onValueChange.js</onValueChange> <onValueChangeTypes> <element>MASK</element> @@ -144,7 +145,7 @@ </entityConsumer> <entityField> <name>CONTACTCONTEXT</name> - <linkedContextProcess>%aditoprj%/entity/CampaignParticipant_entity/entityfields/contactcontext/linkedContextProcess.js</linkedContextProcess> + <valueProcess>%aditoprj%/entity/CampaignParticipant_entity/entityfields/contactcontext/valueProcess.js</valueProcess> </entityField> </entityFields> <recordContainers> @@ -152,7 +153,6 @@ <name>ParticipantsDbRecordContainer</name> <alias>Data_alias</alias> <conditionProcess>%aditoprj%/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/conditionProcess.js</conditionProcess> - <onDBUpdate>%aditoprj%/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/onDBUpdate.js</onDBUpdate> <linkInformation> <linkInformation> <name>12b5bf2e-e376-4c40-9799-fb07961a455d</name> diff --git a/entity/CampaignParticipant_entity/entityfields/campaign_id/displayValueProcess.js b/entity/CampaignParticipant_entity/entityfields/campaign_id/displayValueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..12ea2ba316a5f6370d042673bc2c79c8019841f4 --- /dev/null +++ b/entity/CampaignParticipant_entity/entityfields/campaign_id/displayValueProcess.js @@ -0,0 +1,9 @@ +import("system.result"); +import("system.db"); +import("system.vars"); +import("Campaign_lib"); + +var campaignId = vars.get("$field.CAMPAIGN_ID"); +var campaignName = CampaignUtils.getCampaignNameById(campaignId); + +result.string(campaignName); \ No newline at end of file diff --git a/entity/CampaignParticipant_entity/entityfields/contactcontext/linkedContextProcess.js b/entity/CampaignParticipant_entity/entityfields/contactcontext/valueProcess.js similarity index 100% rename from entity/CampaignParticipant_entity/entityfields/contactcontext/linkedContextProcess.js rename to entity/CampaignParticipant_entity/entityfields/contactcontext/valueProcess.js diff --git a/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/conditionProcess.js b/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/conditionProcess.js index a924702b522709f1bd693da4b8a329ff9de865f3..db030eee9a91a5eae552c5cb328e8d26cfdb4eb5 100644 --- a/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/conditionProcess.js +++ b/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/conditionProcess.js @@ -9,6 +9,11 @@ if(vars.get("$param.CampaignId_param") != null && vars.get("$param.CampaignId_pa if(vars.get("$param.CampaignStepId_param") != null && vars.get("$param.CampaignStepId_param") != "") resultValue += " AND CAMPAIGNSTEP_ID = '" + vars.get("$param.CampaignStepId_param") + "'"; - + result.string(resultValue); -} \ No newline at end of file +} +else if(vars.get("$param.CampaignStepId_param") != null && vars.get("$param.CampaignStepId_param") != "") + { + resultValue = "CAMPAIGNSTEP_ID = '" + vars.get("$param.CampaignStepId_param") + "'"; + result.string(resultValue); + } \ No newline at end of file diff --git a/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/onDBUpdate.js b/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/onDBUpdate.js deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/entity/CampaignStep_entity/CampaignStep_entity.aod b/entity/CampaignStep_entity/CampaignStep_entity.aod index d9c83b4647b9e239f56ff3e20d51684813c333ee..c97381d2921c288abfd81a45fff6e73eef1c5b94 100644 --- a/entity/CampaignStep_entity/CampaignStep_entity.aod +++ b/entity/CampaignStep_entity/CampaignStep_entity.aod @@ -11,10 +11,12 @@ </entityProvider> <entityField> <name>CAMPAIGNSTEPID</name> + <mandatory v="true" /> <valueProcess>%aditoprj%/entity/CampaignStep_entity/entityfields/campaignstepid/valueProcess.js</valueProcess> </entityField> <entityField> <name>CAMPAIGN_ID</name> + <mandatory v="true" /> <valueProcess>%aditoprj%/entity/CampaignStep_entity/entityfields/campaign_id/valueProcess.js</valueProcess> </entityField> <entityField> @@ -49,6 +51,7 @@ <title>Status</title> <consumer>KeywordStates</consumer> <mandatory v="true" /> + <valueProcess>%aditoprj%/entity/CampaignStep_entity/entityfields/state/valueProcess.js</valueProcess> <displayValueProcess>%aditoprj%/entity/CampaignStep_entity/entityfields/state/displayValueProcess.js</displayValueProcess> </entityField> <entityField> @@ -162,6 +165,11 @@ </entityParameter> </children> </entityConsumer> + <entityField> + <name>CurrentMaxParticipantsInfo</name> + <title>Participants</title> + <valueProcess>%aditoprj%/entity/CampaignStep_entity/entityfields/currentmaxparticipantsinfo/valueProcess.js</valueProcess> + </entityField> </entityFields> <recordContainers> <dbRecordContainer> diff --git a/entity/CampaignStep_entity/entityfields/campaignparticipantsconsumer/children/campaignstepid_param/valueProcess.js b/entity/CampaignStep_entity/entityfields/campaignparticipantsconsumer/children/campaignstepid_param/valueProcess.js index 3c2f1c06fcaf51951f47bcf15233d0571e35ea6f..737745c8c91d70a5a56cb216a4586749ea411dda 100644 --- a/entity/CampaignStep_entity/entityfields/campaignparticipantsconsumer/children/campaignstepid_param/valueProcess.js +++ b/entity/CampaignStep_entity/entityfields/campaignparticipantsconsumer/children/campaignstepid_param/valueProcess.js @@ -1,4 +1,6 @@ +import("system.logging"); import("system.result"); import("system.vars"); +logging.log("CS_entity_CPCOnsumer_CSId_param: field.CAMPAIGNSTEPID ->" + vars.getString("$field.CAMPAIGNSTEPID")); result.string(vars.getString("$field.CAMPAIGNSTEPID")); \ No newline at end of file diff --git a/entity/CampaignStep_entity/entityfields/currentmaxparticipantsinfo/valueProcess.js b/entity/CampaignStep_entity/entityfields/currentmaxparticipantsinfo/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..f3447d7251ccdd3bc5fdb2115c62be33268ab094 --- /dev/null +++ b/entity/CampaignStep_entity/entityfields/currentmaxparticipantsinfo/valueProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("system.vars"); +import("Campaign_lib"); + +let currentParticipantsCount = CampaignUtils.getParticipantCountForStep(vars.get("$field.CAMPAIGNSTEPID")); +let maxParticipantsStepCount = vars.get("$field.MAXPARTICIPANTS"); +result.string(currentParticipantsCount + "/" + maxParticipantsStepCount); \ No newline at end of file diff --git a/entity/CampaignStep_entity/entityfields/state/valueProcess.js b/entity/CampaignStep_entity/entityfields/state/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..9524152a718ff70b850fa270593399e3fdc5f5bd --- /dev/null +++ b/entity/CampaignStep_entity/entityfields/state/valueProcess.js @@ -0,0 +1,7 @@ +import("system.vars"); +import("system.result"); +import("system.neon"); +import("KeywordRegistry_basic"); + +if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && !vars.get("$this.value")) + result.string($KeywordRegistry.campaignStepState$open()); \ No newline at end of file diff --git a/entity/Campaign_entity/Campaign_entity.aod b/entity/Campaign_entity/Campaign_entity.aod index 02c68c9a1ff4672d281d76aaa627d46f68779ef9..76cf93a876dac52a2aaf89b43253878449c4adff 100644 --- a/entity/Campaign_entity/Campaign_entity.aod +++ b/entity/Campaign_entity/Campaign_entity.aod @@ -33,6 +33,7 @@ <title>Ende</title> <contentType>DATE</contentType> <resolution>DAY</resolution> + <outputFormat>dd.MM.YYYY</outputFormat> <state>READONLY</state> <displayValueProcess>%aditoprj%/entity/Campaign_entity/entityfields/date_end/displayValueProcess.js</displayValueProcess> </entityField> @@ -88,6 +89,7 @@ <title>Status</title> <consumer>KeywordStates</consumer> <mandatory v="true" /> + <valueProcess>%aditoprj%/entity/Campaign_entity/entityfields/state/valueProcess.js</valueProcess> <displayValueProcess>%aditoprj%/entity/Campaign_entity/entityfields/state/displayValueProcess.js</displayValueProcess> </entityField> <entityConsumer> diff --git a/entity/Campaign_entity/entityfields/state/valueProcess.js b/entity/Campaign_entity/entityfields/state/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..24a86c10cb9eef3178aa13268f2a7106785b9d07 --- /dev/null +++ b/entity/Campaign_entity/entityfields/state/valueProcess.js @@ -0,0 +1,7 @@ +import("system.neon"); +import("system.vars"); +import("system.result"); +import("KeywordRegistry_basic"); + +if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && !vars.get("$this.value")) + result.string($KeywordRegistry.campaignState$planning()); \ No newline at end of file diff --git a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod index 186bf01194b3a32385b10a71a07d7b8a19bb7405..fd5c8a001733b25ac3c543831ea6ea7a4e63f63d 100644 --- a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod +++ b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod @@ -2769,9 +2769,6 @@ <entry> <key>Add to Campaign</key> </entry> - <entry> - <key>Protected</key> - </entry> <entry> <key>Choose a campaign and a step to add the contact to a campaign</key> </entry> @@ -2784,6 +2781,15 @@ <entry> <key>Add the selection to a campaign</key> </entry> + <entry> + <key>protected</key> + </entry> + <entry> + <key>participants will be added to the selected campaign step</key> + </entry> + <entry> + <key>Add participants to Campaign</key> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> <sqlModels> diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index 55f57db49cfe1bf15960b4f6dc83ff40520141c1..7b3df4cc3a1a9d70a3a9ef1965baf44c7a424f62 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -317,6 +317,10 @@ <key>Addresstype</key> <value>Adresstyp</value> </entry> + <entry> + <key>Add participants to Campaign</key> + <value>Teilnehmer/innen zu Kampagne hinzufügen</value> + </entry> <entry> <key>Firstname</key> <value>Vorname</value> diff --git a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod index e5a524f35b06c8c1148797e0b46d5843216e31d9..ad028c1ec3980ed92cae71e76b5d14bed37d3ae4 100644 --- a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod +++ b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod @@ -2799,9 +2799,6 @@ <entry> <key>Add to Campaign</key> </entry> - <entry> - <key>Protected</key> - </entry> <entry> <key>Choose a campaign and a step to add the contact to a campaign</key> </entry> @@ -2814,6 +2811,15 @@ <entry> <key>Add the selection to a campaign</key> </entry> + <entry> + <key>protected</key> + </entry> + <entry> + <key>participants will be added to the selected campaign step</key> + </entry> + <entry> + <key>Add participants to Campaign</key> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> </language> diff --git a/neonView/CampaignPreview_view/CampaignPreview_view.aod b/neonView/CampaignPreview_view/CampaignPreview_view.aod index 613d6c3a587544fc3a8e74b64544f301b7f92792..2293d5bbed0c78adbbd98c91a03e52566f755b10 100644 --- a/neonView/CampaignPreview_view/CampaignPreview_view.aod +++ b/neonView/CampaignPreview_view/CampaignPreview_view.aod @@ -32,9 +32,5 @@ </entityFieldLink> </fields> </genericViewTemplate> - <actionListViewTemplate> - <name>testActionList</name> - <entityField>#ENTITY</entityField> - </actionListViewTemplate> </children> </neonView> diff --git a/neonView/CampaignStepFilter_view/CampaignStepFilter_view.aod b/neonView/CampaignStepFilter_view/CampaignStepFilter_view.aod index 9616f2ae4aba092c7f1e311ce6d3085aa47fbbb9..5b4e3ac8b18b2f0ec22163c47bbf30f0a94c03cf 100644 --- a/neonView/CampaignStepFilter_view/CampaignStepFilter_view.aod +++ b/neonView/CampaignStepFilter_view/CampaignStepFilter_view.aod @@ -23,10 +23,6 @@ <name>d9ca59de-1441-494a-91f0-1cff91c575de</name> <entityField>NAME</entityField> </neonTableColumn> - <neonTableColumn> - <name>3efaade9-c5f6-49d7-9eda-e954487dba99</name> - <entityField>EMPLOYEE_CONTACT_ID</entityField> - </neonTableColumn> <neonTableColumn> <name>0ffcc021-2b58-49f6-91d0-21f4029f744f</name> <entityField>DATE_START</entityField> @@ -35,6 +31,10 @@ <name>2507d34f-3bc2-426c-9acc-d8ae146daee8</name> <entityField>DATE_END</entityField> </neonTableColumn> + <neonTableColumn> + <name>4ee7481b-c629-4da2-8d7a-b33e2e10821e</name> + <entityField>CurrentMaxParticipantsInfo</entityField> + </neonTableColumn> <neonTableColumn> <name>9fa9d9f4-5851-4125-ba59-09aa2fb07f89</name> <entityField>STATE</entityField> diff --git a/neonView/CampaignStepPreview_view/CampaignStepPreview_view.aod b/neonView/CampaignStepPreview_view/CampaignStepPreview_view.aod index 6b3dcd8ccab4061f9180270c1a95529c174b272e..8c395ff7f28c9f820df379230f3b6774718a53a5 100644 --- a/neonView/CampaignStepPreview_view/CampaignStepPreview_view.aod +++ b/neonView/CampaignStepPreview_view/CampaignStepPreview_view.aod @@ -14,5 +14,23 @@ <subtitleField>STATE</subtitleField> <entityField>#ENTITY</entityField> </cardViewTemplate> + <genericViewTemplate> + <name>CampaignStepInfosGeneric</name> + <entityField>#ENTITY</entityField> + <fields> + <entityFieldLink> + <name>4cbf0232-1dab-47f9-b62a-b539d5035c53</name> + <entityField>DATE_START</entityField> + </entityFieldLink> + <entityFieldLink> + <name>677875bc-6b50-4dd8-b8bf-eba5c0e94c56</name> + <entityField>DATE_END</entityField> + </entityFieldLink> + <entityFieldLink> + <name>1d6cc036-f0db-445f-a614-565a4c509933</name> + <entityField>CurrentMaxParticipantsInfo</entityField> + </entityFieldLink> + </fields> + </genericViewTemplate> </children> </neonView> diff --git a/process/Campaign_lib/process.js b/process/Campaign_lib/process.js index 6f1125961d9009aca7d19d0053a2fbb565a0e15b..debba2f9b285a31a50bfdf52c2c136337eebcdb8 100644 --- a/process/Campaign_lib/process.js +++ b/process/Campaign_lib/process.js @@ -1,5 +1,6 @@ import("system.db"); import("system.neon"); +import("Sql_lib"); /** * Methods for campaignmanagement. @@ -29,6 +30,30 @@ CampaignUtils.addParticipants = function(pRowIds) _CampaignUtils._openAddParticipantContext("CampaignAddParticipants", pRowIds, "campaignParticipants_param", "CampaignAddParticipantsEdit_view"); } +CampaignUtils.getCampaignNameById = function(pCampaignId) +{ + let name = ""; + if (pCampaignId) + { + name = db.cell(SqlCondition.begin() + .andPrepare("CAMPAIGN.CAMPAIGNID", pCampaignId) + .buildSql("select CAMPAIGN.NAME from CAMPAIGN")); + } + return name; +} + +CampaignUtils.getParticipantCountForStep = function(pCampaignStepId) +{ + let count = 0; + if (pCampaignStepId) + { + count = db.cell(SqlCondition.begin() + .andPrepare("CAMPAIGNPARTICIPANT.CAMPAIGNSTEP_ID", pCampaignStepId) + .buildSql("select count(*) from CAMPAIGNPARTICIPANT")); + } + return count; +} + /** * Methods for campaignmanagement. * Do not create an instance of this! diff --git a/process/KeywordRegistry_basic/KeywordRegistry_basic.aod b/process/KeywordRegistry_basic/KeywordRegistry_basic.aod index eddf2366e9f4b3e924943b353909ca3a5959827d..f134eecec0a5f6d23f46e3351e0705400e34e153 100644 --- a/process/KeywordRegistry_basic/KeywordRegistry_basic.aod +++ b/process/KeywordRegistry_basic/KeywordRegistry_basic.aod @@ -3,4 +3,5 @@ <name>KeywordRegistry_basic</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/KeywordRegistry_basic/process.js</process> + <publishAsWebservice v="true" /> </process> diff --git a/process/KeywordRegistry_basic/process.js b/process/KeywordRegistry_basic/process.js index 8ea7f805158eb77c84f5c0bf0640355fd0d8d316..4da0715ad3b2be2f79a1997978263e629e3c0330 100644 --- a/process/KeywordRegistry_basic/process.js +++ b/process/KeywordRegistry_basic/process.js @@ -67,5 +67,6 @@ $KeywordRegistry.contactDepartment = function(){return "ContactDepartment";}; $KeywordRegistry.contactPosition = function(){return "ContactPosition";}; $KeywordRegistry.contactContactrole = function(){return "ContactContactrole";}; $KeywordRegistry.campaignState = function(){return "CampaignManagementStates";}; +$KeywordRegistry.campaignState$planning = function(){return "e04c9c59-0590-463c-a10e-e25c583e9cf2";}; $KeywordRegistry.campaignStepState = function(){return "CampaignManagementStepStates";}; - +$KeywordRegistry.campaignStepState$open = function(){return "bbf69673-2ec6-46f8-b231-684a31be9fbd";}; diff --git a/process/Proto_lib/Proto_lib.aod b/process/Proto_lib/Proto_lib.aod index 99585a3435e1e59f774bb6872bae063923df18bf..53b5288a5b9c43f8f99d547bf9bc00960f4d259c 100644 --- a/process/Proto_lib/Proto_lib.aod +++ b/process/Proto_lib/Proto_lib.aod @@ -3,4 +3,5 @@ <name>Proto_lib</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/Proto_lib/process.js</process> + <publishAsWebservice v="true" /> </process> diff --git a/process/_test_clientProcess/_test_clientProcess.aod b/process/_test_clientProcess/_test_clientProcess.aod index 71b66312f6dd84b5369075feff91e149de0a0dcc..3156788d53a7c7c34059887fc15f82746556cedc 100644 --- a/process/_test_clientProcess/_test_clientProcess.aod +++ b/process/_test_clientProcess/_test_clientProcess.aod @@ -3,5 +3,6 @@ <name>_test_clientProcess</name> <majorModelMode>DISTRIBUTED</majorModelMode> <process>%aditoprj%/process/_test_clientProcess/process.js</process> + <publishAsWebservice v="true" /> <alias>Data_alias</alias> </process>