Skip to content
Snippets Groups Projects
Commit 3a264f87 authored by S.Listl's avatar S.Listl
Browse files

Send bulk mail dialog

parent 4983a989
No related branches found
No related tags found
No related merge requests found
......@@ -94,6 +94,7 @@
<onActionProcess>%aditoprj%/entity/BulkMail_entity/entityfields/sendmail/onActionProcess.js</onActionProcess>
<iconId>VAADIN:PAPERPLANE</iconId>
<stateProcess>%aditoprj%/entity/BulkMail_entity/entityfields/sendmail/stateProcess.js</stateProcess>
<tooltipProcess>%aditoprj%/entity/BulkMail_entity/entityfields/sendmail/tooltipProcess.js</tooltipProcess>
</entityActionField>
<entityField>
<name>ICON</name>
......
import("system.translate");
import("system.question");
import("Sql_lib");
import("system.neon");
import("system.vars");
......@@ -5,7 +7,11 @@ import("Bulkmail_lib");
import("system.db");
import("KeywordRegistry_basic");
db.updateData("BULKMAIL", ["STATUS"], null, [$KeywordRegistry.bulkMailStatus$beingSent()],
SqlCondition.equals("BULKMAIL.BULKMAILID", vars.get("$field.BULKMAILID"), "1=2"));
neon.refreshAll();
BulkMailUtils.sendBulkMailOnServer(vars.get("$field.BULKMAILID"));
\ No newline at end of file
var send = question.askYesNo(translate.text("Bulk mail"), translate.text("Should the mail be sent now?"), false);
if (send)
{
db.updateData("BULKMAIL", ["STATUS"], null, [$KeywordRegistry.bulkMailStatus$beingSent()],
SqlCondition.equals("BULKMAIL.BULKMAILID", vars.get("$field.BULKMAILID"), "1=2"));
neon.refreshAll();
BulkMailUtils.sendBulkMailOnServer(vars.get("$field.BULKMAILID"));
}
\ No newline at end of file
import("system.translate");
import("system.result");
result.string(translate.text("Send"));
\ No newline at end of file
......@@ -86,6 +86,13 @@
</entityParameter>
</children>
</entityConsumer>
<entityActionField>
<name>openAdminView</name>
<title>Open admin view</title>
<onActionProcess>%aditoprj%/entity/SerialLetter_entity/entityfields/openadminview/onActionProcess.js</onActionProcess>
<iconId>VAADIN:CURLY_BRACKETS</iconId>
<stateProcess>%aditoprj%/entity/SerialLetter_entity/entityfields/openadminview/stateProcess.js</stateProcess>
</entityActionField>
</entityFields>
<recordContainers>
<dbRecordContainer>
......
import("system.vars");
import("Context_lib");
AdminViewUtils.open("SERIALLETTERID", [
["DOCUMENTTEMPLATE_ID", vars.get("$field.DOCUMENTTEMPLATE_ID")]
]);
\ No newline at end of file
import("Context_lib");
import("system.result");
result.string(AdminViewUtils.getActionState());
\ No newline at end of file
......@@ -82,6 +82,10 @@
<key>Categorization</key>
<value>Kategorisierung</value>
</entry>
<entry>
<key>Should the mail be sent now?</key>
<value>Soll die Mail jetzt versendet werden?</value>
</entry>
<entry>
<key>Names</key>
<value>Namen</value>
......
......@@ -14,6 +14,7 @@
<iconField>ICON</iconField>
<titleField>NAME</titleField>
<descriptionField>STATUS</descriptionField>
<favoriteAction1>sendMail</favoriteAction1>
<entityField>#ENTITY</entityField>
</cardViewTemplate>
<genericViewTemplate>
......
......@@ -210,7 +210,7 @@ Email.prototype.getEML = function()
*
* @return {boolean} true, if the mail was sent sucessfully
*/
Email.prototype.send = function ()
Email.prototype.send = function (pUser)
{
var ENCODING = "UTF-8";
var mailId;
......@@ -227,7 +227,10 @@ Email.prototype.send = function ()
util.sleep(1500);
mailId = mail.newMail();
}
if (this.sender)
mail.setSender(mailId, this.sender);
if (this.toRecipients.length)
mail.addRecipients(mailId, mail.RECIPIENT_TO, this.toRecipients);
......@@ -245,7 +248,10 @@ Email.prototype.send = function ()
else
mail.addText(mailId, "", "text/html", ENCODING, null);
mail.sendMail(mailId);
if (pUser)
mail.sendMailAs(pUser, mailId);
else
mail.sendMail(mailId);
return true;
}
catch (ex)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment