コード例 #1
0
  /**
   * Constructor for the email
   *
   * @param wControl
   * @param ureq
   * @param mailTemplate
   * @param useCancel
   */
  public BGMailNotificationEditController(
      WindowControl wControl,
      UserRequest ureq,
      MailTemplate mailTemplate,
      boolean ccSenderAllowed,
      boolean customizingAvailable,
      boolean useCancel,
      boolean mandatory) {
    super(ureq, wControl);
    this.mailTemplate = mailTemplate;
    orgMailSubject = mailTemplate.getSubjectTemplate();
    orgMailBody = mailTemplate.getBodyTemplate();
    cpFrom = mailTemplate.getCpfrom();

    mainVC = createVelocityContainer("mailnotification");
    mailForm =
        new BGMailTemplateController(
            ureq,
            wControl,
            mailTemplate,
            ccSenderAllowed,
            customizingAvailable,
            useCancel,
            mandatory);
    listenTo(mailForm);

    mainVC.put("mailForm", mailForm.getInitialComponent());

    putInitialPanel(mainVC);
  }
コード例 #2
0
 /**
  * @return The mail template containing the configured mail or null if user decided to not send a
  *     mail
  */
 public MailTemplate getMailTemplate() {
   if (mailForm.sendMailSwitchEnabled()) {
     return mailTemplate;
   } else {
     return null;
   }
 }
コード例 #3
0
 @Override
 public void event(UserRequest ureq, Controller source, Event event) {
   if (source == mailForm) {
     if (event == Event.DONE_EVENT) {
       mailForm.updateTemplateFromForm(mailTemplate);
       fireEvent(ureq, event);
     } else if (event == Event.CANCELLED_EVENT) {
       mailTemplate = null;
       fireEvent(ureq, event);
     }
   }
 }
コード例 #4
0
 public boolean isSendMail() {
   return mailForm.sendMailSwitchEnabled();
 }