diff --git a/entity/BulkMailTesting_entity/BulkMailTesting_entity.aod b/entity/BulkMailTesting_entity/BulkMailTesting_entity.aod index 59218772f1dd9a28bb56351fe7c0be8a46c19ae5..0f166b2a7563e8a4935f4ef7ae171db2c68dae9d 100644 --- a/entity/BulkMailTesting_entity/BulkMailTesting_entity.aod +++ b/entity/BulkMailTesting_entity/BulkMailTesting_entity.aod @@ -6,25 +6,28 @@ <siblings> <element>BulkMail_entity</element> </siblings> - <recordContainer>jdito</recordContainer> + <recordContainer>datalessRecordContainer</recordContainer> <entityFields> <entityProvider> <name>#PROVIDER</name> </entityProvider> <entityField> <name>UID</name> + <state>EDITABLE</state> </entityField> <entityField> <name>TESTING_CONTACT_ID</name> <title>Contact</title> <consumer>Contacts</consumer> <linkedContext>AnyContact</linkedContext> + <state>EDITABLE</state> <valueProcess>%aditoprj%/entity/BulkMailTesting_entity/entityfields/testing_contact_id/valueProcess.js</valueProcess> <displayValueProcess>%aditoprj%/entity/BulkMailTesting_entity/entityfields/testing_contact_id/displayValueProcess.js</displayValueProcess> </entityField> <entityField> <name>TESTING_EMAIL_ADDRESS</name> <title>Recipient address</title> + <state>EDITABLE</state> <valueProcess>%aditoprj%/entity/BulkMailTesting_entity/entityfields/testing_email_address/valueProcess.js</valueProcess> </entityField> <entityField> @@ -32,6 +35,7 @@ <title>Save settings</title> <contentType>BOOLEAN</contentType> <dropDownProcess>%aditoprj%/entity/BulkMailTesting_entity/entityfields/savesettings/dropDownProcess.js</dropDownProcess> + <state>EDITABLE</state> </entityField> <entityParameter> <name>BulkMailId_param</name> @@ -46,6 +50,12 @@ <fieldName>#PROVIDER</fieldName> </dependency> </entityConsumer> + <entityActionField> + <name>testMail</name> + <title>Test email</title> + <onActionProcess>%aditoprj%/entity/BulkMailTesting_entity/entityfields/testmail/onActionProcess.js</onActionProcess> + <iconId>VAADIN:CLIPBOARD_CHECK</iconId> + </entityActionField> </entityFields> <recordContainers> <jDitoRecordContainer> @@ -59,5 +69,9 @@ </jDitoRecordFieldMapping> </recordFieldMappings> </jDitoRecordContainer> + <datalessRecordContainer> + <name>datalessRecordContainer</name> + <alias>Data_alias</alias> + </datalessRecordContainer> </recordContainers> </entity> diff --git a/entity/BulkMailTesting_entity/entityfields/testmail/onActionProcess.js b/entity/BulkMailTesting_entity/entityfields/testmail/onActionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..db08c5e29fae3ab2bf823fc4016e2cab2ef00100 --- /dev/null +++ b/entity/BulkMailTesting_entity/entityfields/testmail/onActionProcess.js @@ -0,0 +1,19 @@ +import("Sql_lib"); +import("system.db"); +import("Bulkmail_lib"); +import("system.vars"); + +var testingContact = vars.get("$field.TESTING_CONTACT_ID"); +var testingEmail = vars.get("$field.TESTING_EMAIL_ADDRESS"); +var bulkMailId = vars.get("$param.BulkMailId_param"); + +BulkMailUtils.sendBulkMailOnServer(bulkMailId, [[testingContact, testingEmail]]); + +if (vars.get("$field.SAVESETTINGS") == "1") +{ + newWhere("BULKMAIL.BULKMAILID", bulkMailId) + .updateFields({ + "TESTING_CONTACT_ID" : testingContact, + "TESTING_EMAIL_ADDRESS" : testingEmail + }); +} \ No newline at end of file diff --git a/entity/BulkMail_entity/entityfields/testmail/onActionProcess.js b/entity/BulkMail_entity/entityfields/testmail/onActionProcess.js index 3852daca44d122f7a011d6fe4559d34cf7390321..3845e374537d50e6e9ab706741a4a672d7208d04 100644 --- a/entity/BulkMail_entity/entityfields/testmail/onActionProcess.js +++ b/entity/BulkMail_entity/entityfields/testmail/onActionProcess.js @@ -10,7 +10,7 @@ var testingEmail = vars.get("$field.TESTING_EMAIL_ADDRESS"); if (testingContact && testingEmail) BulkMailUtils.sendBulkMailOnServer(vars.get("$field.BULKMAILID"), [[testingContact, testingEmail]]); else - neon.openContext("BulkMailTesting", "BulkMailTesting_view", null, neon.OPERATINGSTATE_NEW, { + neon.openContext("BulkMailTesting", "BulkMailTesting_view", null, neon.OPERATINGSTATE_VIEW, { "BulkMailId_param" : vars.get("$field.BULKMAILID") }); diff --git a/neonView/BulkMailTesting_view/BulkMailTesting_view.aod b/neonView/BulkMailTesting_view/BulkMailTesting_view.aod index 5dbcfe7eeee365bb0adfc1fb3e16f9271b5a0d5a..d3a8fa5c4e91d33df9a3b0e52819cd55bb5810de 100644 --- a/neonView/BulkMailTesting_view/BulkMailTesting_view.aod +++ b/neonView/BulkMailTesting_view/BulkMailTesting_view.aod @@ -13,6 +13,7 @@ <genericViewTemplate> <name>Generic</name> <editMode v="true" /> + <hideEmptyFields v="false" /> <entityField>#ENTITY</entityField> <fields> <entityFieldLink> @@ -29,5 +30,12 @@ </entityFieldLink> </fields> </genericViewTemplate> + <actionsViewTemplate> + <name>ContinueActions</name> + <actions> + <element>testMail</element> + </actions> + <entityField>#ENTITY</entityField> + </actionsViewTemplate> </children> </neonView>