use of org.olat.modules.co.ContactFormController in project OpenOLAT by OpenOLAT.
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 OpenOLAT.
the class AbstractBusinessGroupListController method doAskToLeaveGroup.
private void doAskToLeaveGroup(UserRequest ureq, BusinessGroup businessGroup, ContactList contacts) {
String[] args = new String[] { businessGroup.getName(), businessGroup.getKey().toString(), // courses
"", getIdentity().getUser().getProperty(UserConstants.FIRSTNAME, getLocale()), getIdentity().getUser().getProperty(UserConstants.LASTNAME, getLocale()) };
ContactMessage msg = new ContactMessage(getIdentity());
msg.setSubject(translate("request.leaving.subject", args));
msg.setBodyText(translate("request.leaving.body", args));
msg.addEmailTo(contacts);
contactCtrl = new ContactFormController(ureq, getWindowControl(), true, false, true, msg);
listenTo(contactCtrl);
cmc = new CloseableModalController(getWindowControl(), "close", contactCtrl.getInitialComponent(), true, translate("dialog.modal.bg.asktoleave.title"));
cmc.activate();
listenTo(cmc);
}
use of org.olat.modules.co.ContactFormController in project OpenOLAT by OpenOLAT.
the class AbstractMemberListController method doOpenContact.
protected void doOpenContact(UserRequest ureq, MemberView member) {
removeAsListenerAndDispose(contactCtrl);
Identity choosenIdentity = securityManager.loadIdentityByKey(member.getIdentityKey());
String fullname = userManager.getUserDisplayName(choosenIdentity);
ContactMessage cmsg = new ContactMessage(ureq.getIdentity());
ContactList emailList = new ContactList(fullname);
emailList.add(choosenIdentity);
cmsg.addEmailTo(emailList);
OLATResourceable ores = OresHelper.createOLATResourceableType("Contact");
WindowControl bwControl = addToHistory(ureq, ores, null);
contactCtrl = new ContactFormController(ureq, bwControl, true, false, false, cmsg);
listenTo(contactCtrl);
toolbarPanel.pushController(fullname, contactCtrl);
}
use of org.olat.modules.co.ContactFormController in project openolat by klemens.
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 klemens.
the class MembersTableController method doSendEmailToMember.
private void doSendEmailToMember(ContactList contactList, UserRequest ureq) {
if (contactList.getEmailsAsStrings().size() > 0) {
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();
}
}
Aggregations