Search in sources :

Example 1 with ReopenLectureBlockEvent

use of org.olat.modules.lecture.ui.event.ReopenLectureBlockEvent in project OpenOLAT by OpenOLAT.

the class TeacherLecturesTableController method event.

@Override
protected void event(UserRequest ureq, Controller source, Event event) {
    if (source == rollCallCtrl) {
        if (event instanceof ReopenLectureBlockEvent) {
            LectureBlock lectureBlock = rollCallCtrl.getLectureBlock();
            toolbarPanel.popController(rollCallCtrl);
            doSelectLectureBlock(ureq, lectureBlock);
        } else if (event == Event.DONE_EVENT || event == Event.CANCELLED_EVENT || event == Event.CHANGED_EVENT) {
            fireEvent(ureq, event);
        }
    } else if (toolsCalloutCtrl == source) {
        cleanUp();
    } else if (toolsCtrl == source) {
        if (event == Event.DONE_EVENT) {
            toolsCalloutCtrl.deactivate();
            cleanUp();
        }
    }
    super.event(ureq, source, event);
}
Also used : LectureBlock(org.olat.modules.lecture.LectureBlock) ReopenLectureBlockEvent(org.olat.modules.lecture.ui.event.ReopenLectureBlockEvent)

Example 2 with ReopenLectureBlockEvent

use of org.olat.modules.lecture.ui.event.ReopenLectureBlockEvent in project OpenOLAT by OpenOLAT.

the class TeacherRollCallController method doReopen.

private void doReopen(UserRequest ureq) {
    String before = lectureService.toAuditXml(lectureBlock);
    lectureBlock.setRollCallStatus(LectureRollCallStatus.reopen);
    if (lectureBlock.getStatus() == LectureBlockStatus.cancelled) {
        lectureBlock.setStatus(LectureBlockStatus.active);
    }
    lectureBlock = lectureService.save(lectureBlock, null);
    secCallback.updateLectureBlock(lectureBlock);
    updateUI();
    fireEvent(ureq, new ReopenLectureBlockEvent());
    String after = lectureService.toAuditXml(lectureBlock);
    lectureService.auditLog(LectureBlockAuditLog.Action.reopenLectureBlock, before, after, null, lectureBlock, null, lectureBlock.getEntry(), null, getIdentity());
    ThreadLocalUserActivityLogger.log(LearningResourceLoggingAction.LECTURE_BLOCK_ROLL_CALL_REOPENED, getClass(), CoreLoggingResourceable.wrap(lectureBlock, OlatResourceableType.lectureBlock, lectureBlock.getTitle()));
}
Also used : ReopenLectureBlockEvent(org.olat.modules.lecture.ui.event.ReopenLectureBlockEvent)

Example 3 with ReopenLectureBlockEvent

use of org.olat.modules.lecture.ui.event.ReopenLectureBlockEvent in project openolat by klemens.

the class TeacherLecturesTableController method event.

@Override
protected void event(UserRequest ureq, Controller source, Event event) {
    if (source == rollCallCtrl) {
        if (event instanceof ReopenLectureBlockEvent) {
            LectureBlock lectureBlock = rollCallCtrl.getLectureBlock();
            toolbarPanel.popController(rollCallCtrl);
            doSelectLectureBlock(ureq, lectureBlock);
        } else if (event == Event.DONE_EVENT || event == Event.CANCELLED_EVENT || event == Event.CHANGED_EVENT) {
            fireEvent(ureq, event);
        }
    } else if (toolsCalloutCtrl == source) {
        cleanUp();
    } else if (toolsCtrl == source) {
        if (event == Event.DONE_EVENT) {
            toolsCalloutCtrl.deactivate();
            cleanUp();
        }
    }
    super.event(ureq, source, event);
}
Also used : LectureBlock(org.olat.modules.lecture.LectureBlock) ReopenLectureBlockEvent(org.olat.modules.lecture.ui.event.ReopenLectureBlockEvent)

Example 4 with ReopenLectureBlockEvent

use of org.olat.modules.lecture.ui.event.ReopenLectureBlockEvent in project openolat by klemens.

the class TeacherRollCallController method doReopen.

private void doReopen(UserRequest ureq) {
    String before = lectureService.toAuditXml(lectureBlock);
    lectureBlock.setRollCallStatus(LectureRollCallStatus.reopen);
    if (lectureBlock.getStatus() == LectureBlockStatus.cancelled) {
        lectureBlock.setStatus(LectureBlockStatus.active);
    }
    lectureBlock = lectureService.save(lectureBlock, null);
    secCallback.updateLectureBlock(lectureBlock);
    updateUI();
    fireEvent(ureq, new ReopenLectureBlockEvent());
    String after = lectureService.toAuditXml(lectureBlock);
    lectureService.auditLog(LectureBlockAuditLog.Action.reopenLectureBlock, before, after, null, lectureBlock, null, lectureBlock.getEntry(), null, getIdentity());
    ThreadLocalUserActivityLogger.log(LearningResourceLoggingAction.LECTURE_BLOCK_ROLL_CALL_REOPENED, getClass(), CoreLoggingResourceable.wrap(lectureBlock, OlatResourceableType.lectureBlock, lectureBlock.getTitle()));
}
Also used : ReopenLectureBlockEvent(org.olat.modules.lecture.ui.event.ReopenLectureBlockEvent)

Aggregations

ReopenLectureBlockEvent (org.olat.modules.lecture.ui.event.ReopenLectureBlockEvent)4 LectureBlock (org.olat.modules.lecture.LectureBlock)2