Search in sources :

Example 1 with LeavingStatusList

use of org.olat.repository.LeavingStatusList in project OpenOLAT by OpenOLAT.

the class CourseRuntimeController method doLeave.

private void doLeave(UserRequest ureq) {
    if (roles.isGuestOnly())
        return;
    MailerResult result = new MailerResult();
    MailPackage reMailing = new MailPackage(result, getWindowControl().getBusinessControl().getAsString(), true);
    // leave course
    LeavingStatusList status = new LeavingStatusList();
    repositoryManager.leave(getIdentity(), getRepositoryEntry(), status, reMailing);
    // leave groups
    businessGroupService.leave(getIdentity(), getRepositoryEntry(), status, reMailing);
    if (status.isWarningManagedGroup() || status.isWarningManagedCourse()) {
        showWarning("sign.out.warning.managed");
    } else if (status.isWarningGroupWithMultipleResources()) {
        showWarning("sign.out.warning.mutiple.resources");
    } else {
        showInfo("sign.out.success", new String[] { getRepositoryEntry().getDisplayname() });
    }
    doClose(ureq);
}
Also used : LeavingStatusList(org.olat.repository.LeavingStatusList) MailPackage(org.olat.core.util.mail.MailPackage) MailerResult(org.olat.core.util.mail.MailerResult)

Example 2 with LeavingStatusList

use of org.olat.repository.LeavingStatusList in project openolat by klemens.

the class RepositoryEntryDetailsController method doLeave.

protected void doLeave() {
    if (guestOnly)
        return;
    MailerResult result = new MailerResult();
    MailPackage reMailing = new MailPackage(result, getWindowControl().getBusinessControl().getAsString(), true);
    LeavingStatusList status = new LeavingStatusList();
    // leave course
    repositoryManager.leave(getIdentity(), entry, status, reMailing);
    // leave groups
    businessGroupService.leave(getIdentity(), entry, status, reMailing);
    // make sur all changes are committed
    DBFactory.getInstance().commit();
    if (status.isWarningManagedGroup() || status.isWarningManagedCourse()) {
        showWarning("sign.out.warning.managed");
    } else if (status.isWarningGroupWithMultipleResources()) {
        showWarning("sign.out.warning.mutiple.resources");
    } else {
        showInfo("sign.out.success", new String[] { entry.getDisplayname() });
    }
}
Also used : LeavingStatusList(org.olat.repository.LeavingStatusList) MailPackage(org.olat.core.util.mail.MailPackage) MailerResult(org.olat.core.util.mail.MailerResult)

Example 3 with LeavingStatusList

use of org.olat.repository.LeavingStatusList in project openolat by klemens.

the class CourseRuntimeController method doLeave.

private void doLeave(UserRequest ureq) {
    if (roles.isGuestOnly())
        return;
    MailerResult result = new MailerResult();
    MailPackage reMailing = new MailPackage(result, getWindowControl().getBusinessControl().getAsString(), true);
    // leave course
    LeavingStatusList status = new LeavingStatusList();
    repositoryManager.leave(getIdentity(), getRepositoryEntry(), status, reMailing);
    // leave groups
    businessGroupService.leave(getIdentity(), getRepositoryEntry(), status, reMailing);
    if (status.isWarningManagedGroup() || status.isWarningManagedCourse()) {
        showWarning("sign.out.warning.managed");
    } else if (status.isWarningGroupWithMultipleResources()) {
        showWarning("sign.out.warning.mutiple.resources");
    } else {
        showInfo("sign.out.success", new String[] { getRepositoryEntry().getDisplayname() });
    }
    doClose(ureq);
}
Also used : LeavingStatusList(org.olat.repository.LeavingStatusList) MailPackage(org.olat.core.util.mail.MailPackage) MailerResult(org.olat.core.util.mail.MailerResult)

Example 4 with LeavingStatusList

use of org.olat.repository.LeavingStatusList in project OpenOLAT by OpenOLAT.

the class RepositoryEntryDetailsController method doLeave.

protected void doLeave() {
    if (guestOnly)
        return;
    MailerResult result = new MailerResult();
    MailPackage reMailing = new MailPackage(result, getWindowControl().getBusinessControl().getAsString(), true);
    LeavingStatusList status = new LeavingStatusList();
    // leave course
    repositoryManager.leave(getIdentity(), entry, status, reMailing);
    // leave groups
    businessGroupService.leave(getIdentity(), entry, status, reMailing);
    // make sur all changes are committed
    DBFactory.getInstance().commit();
    if (status.isWarningManagedGroup() || status.isWarningManagedCourse()) {
        showWarning("sign.out.warning.managed");
    } else if (status.isWarningGroupWithMultipleResources()) {
        showWarning("sign.out.warning.mutiple.resources");
    } else {
        showInfo("sign.out.success", new String[] { entry.getDisplayname() });
    }
}
Also used : LeavingStatusList(org.olat.repository.LeavingStatusList) MailPackage(org.olat.core.util.mail.MailPackage) MailerResult(org.olat.core.util.mail.MailerResult)

Aggregations

MailPackage (org.olat.core.util.mail.MailPackage)4 MailerResult (org.olat.core.util.mail.MailerResult)4 LeavingStatusList (org.olat.repository.LeavingStatusList)4