use of org.olat.modules.co.ContactFormController in project openolat by klemens.
the class DENManageParticipantsController method createParticipantsMail.
private void createParticipantsMail(UserRequest ureq, List<Identity> participants) {
VelocityContainer sendMessageVC = createVelocityContainer("sendmessage");
ContactMessage cmsg = new ContactMessage(ureq.getIdentity());
ContactList contactList = new ContactList(translate("participants.message.to"));
contactList.addAllIdentites(participants);
cmsg.addEmailTo(contactList);
removeAsListenerAndDispose(contactCtr);
contactCtr = new ContactFormController(ureq, getWindowControl(), false, false, false, cmsg);
listenTo(contactCtr);
sendMessageVC.contextPut("title", translate("participants.message"));
sendMessageVC.put("contactForm", contactCtr.getInitialComponent());
removeAsListenerAndDispose(notificationCmc);
notificationCmc = new CloseableModalController(getWindowControl(), "close", sendMessageVC);
listenTo(notificationCmc);
notificationCmc.activate();
}
use of org.olat.modules.co.ContactFormController in project openolat by klemens.
the class MembersAvatarDisplayRunController method doSendEmailToMember.
private void doSendEmailToMember(ContactList contactList, UserRequest ureq) {
if (contactList.hasAddresses()) {
removeAsListenerAndDispose(cmc);
removeAsListenerAndDispose(emailController);
ContactMessage cmsg = new ContactMessage(ureq.getIdentity());
cmsg.addEmailTo(contactList);
// preset body template from i18n
cmsg.setBodyText(createBodyTemplate());
emailController = new ContactFormController(ureq, getWindowControl(), true, false, false, cmsg);
listenTo(emailController);
String title = translate("members.email.title");
cmc = new CloseableModalController(getWindowControl(), translate("close"), emailController.getInitialComponent(), true, title);
listenTo(cmc);
cmc.activate();
}
}
use of org.olat.modules.co.ContactFormController in project OpenOLAT by OpenOLAT.
the class CatalogNodeManagerController method doContact.
private void doContact(UserRequest ureq) {
removeAsListenerAndDispose(cmc);
removeAsListenerAndDispose(contactCtrl);
ContactList caretaker = new ContactList(translate("contact.to.groupname.caretaker"));
List<Identity> owners = new ArrayList<Identity>();
CatalogEntry parent = catalogEntry;
while (parent != null && owners.isEmpty()) {
SecurityGroup parentOwner = parent.getOwnerGroup();
if (parentOwner != null) {
owners = securityManager.getIdentitiesOfSecurityGroup(parentOwner);
}
parent = parent.getParent();
}
for (int i = owners.size(); i-- > 0; ) {
caretaker.add(owners.get(i));
}
// create e-mail Message
ContactMessage cmsg = new ContactMessage(ureq.getIdentity());
cmsg.addEmailTo(caretaker);
contactCtrl = new ContactFormController(ureq, getWindowControl(), true, false, false, cmsg);
listenTo(contactCtrl);
// open form in dialog
cmc = new CloseableModalController(getWindowControl(), "close", contactCtrl.getInitialComponent(), true, translate("contact.caretaker"));
listenTo(cmc);
cmc.activate();
}
use of org.olat.modules.co.ContactFormController in project OpenOLAT by OpenOLAT.
the class CertificateAndEfficiencyStatementController method contact.
private void contact(UserRequest ureq) {
removeAsListenerAndDispose(cmc);
ContactMessage cmsg = new ContactMessage(getIdentity());
ContactList contactList = new ContactList("to");
contactList.add(statementOwner);
cmsg.addEmailTo(contactList);
contactCtrl = new ContactFormController(ureq, getWindowControl(), true, false, false, cmsg);
listenTo(contactCtrl);
cmc = new CloseableModalController(getWindowControl(), translate("close"), contactCtrl.getInitialComponent());
cmc.activate();
listenTo(cmc);
}
use of org.olat.modules.co.ContactFormController in project OpenOLAT by OpenOLAT.
the class DENManager method sendParticipantsMessage.
/**
* Generates the mail window
* @param ureq
* @param wControl
* @param listener
* @param velocity_root
* @param trans
* @param participants
* @return VelocityContainer
*/
protected VelocityContainer sendParticipantsMessage(UserRequest ureq, WindowControl wControl, DefaultController listener, String velocity_root, Translator trans, List<Identity> participants) {
VelocityContainer sendMessageVC = new VelocityContainer("sendmessage", velocity_root + "/sendmessage.html", trans, listener);
ContactMessage cmsg = new ContactMessage(ureq.getIdentity());
ContactList contactList = null;
if (participants.size() == 1) {
contactList = new ContactList(participants.get(0).getUser().getProperty(UserConstants.EMAIL, ureq.getLocale()));
} else {
contactList = new ContactList(trans.translate("participants.message.to"));
}
contactList.addAllIdentites(participants);
cmsg.addEmailTo(contactList);
ContactFormController contactCtr = new ContactFormController(ureq, wControl, false, false, false, cmsg);
contactCtr.addControllerListener(listener);
sendMessageVC.contextPut("title", trans.translate("participants.message"));
sendMessageVC.put("contactForm", contactCtr.getInitialComponent());
return sendMessageVC;
}
Aggregations