Search in sources :

Example 16 with ContactFormController

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();
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) ContactFormController(org.olat.modules.co.ContactFormController) ContactList(org.olat.core.util.mail.ContactList) VelocityContainer(org.olat.core.gui.components.velocity.VelocityContainer) ContactMessage(org.olat.core.util.mail.ContactMessage)

Example 17 with ContactFormController

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();
    }
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) ContactFormController(org.olat.modules.co.ContactFormController) ContactMessage(org.olat.core.util.mail.ContactMessage)

Example 18 with ContactFormController

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();
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) ContactFormController(org.olat.modules.co.ContactFormController) ArrayList(java.util.ArrayList) CatalogEntry(org.olat.repository.CatalogEntry) ContactList(org.olat.core.util.mail.ContactList) Identity(org.olat.core.id.Identity) SecurityGroup(org.olat.basesecurity.SecurityGroup) ContactMessage(org.olat.core.util.mail.ContactMessage)

Example 19 with ContactFormController

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);
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) ContactFormController(org.olat.modules.co.ContactFormController) ContactList(org.olat.core.util.mail.ContactList) ContactMessage(org.olat.core.util.mail.ContactMessage)

Example 20 with ContactFormController

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;
}
Also used : ContactFormController(org.olat.modules.co.ContactFormController) ContactList(org.olat.core.util.mail.ContactList) VelocityContainer(org.olat.core.gui.components.velocity.VelocityContainer) ContactMessage(org.olat.core.util.mail.ContactMessage)

Aggregations

ContactFormController (org.olat.modules.co.ContactFormController)30 ContactMessage (org.olat.core.util.mail.ContactMessage)28 ContactList (org.olat.core.util.mail.ContactList)22 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)20 Identity (org.olat.core.id.Identity)12 WindowControl (org.olat.core.gui.control.WindowControl)6 ArrayList (java.util.ArrayList)4 VelocityContainer (org.olat.core.gui.components.velocity.VelocityContainer)4 OLATResourceable (org.olat.core.id.OLATResourceable)4 HashMap (java.util.HashMap)2 List (java.util.List)2 UserBulkChangeStep00 (org.olat.admin.user.bulkChange.UserBulkChangeStep00)2 SecurityGroup (org.olat.basesecurity.SecurityGroup)2 SingleIdentityChosenEvent (org.olat.basesecurity.events.SingleIdentityChosenEvent)2 UserRequest (org.olat.core.gui.UserRequest)2 TableEvent (org.olat.core.gui.components.table.TableEvent)2 TableMultiSelectEvent (org.olat.core.gui.components.table.TableMultiSelectEvent)2 TreePosition (org.olat.core.gui.components.tree.TreePosition)2 Event (org.olat.core.gui.control.Event)2 ControllerCreator (org.olat.core.gui.control.creator.ControllerCreator)2