Search in sources :

Example 16 with LectureBlock

use of org.olat.modules.lecture.LectureBlock in project OpenOLAT by OpenOLAT.

the class LectureListRepositoryController method doDelete.

private void doDelete(LectureBlockRow row) {
    if (LectureBlockManagedFlag.isManaged(row.getLectureBlock(), LectureBlockManagedFlag.delete))
        return;
    LectureBlock lectureBlock = row.getLectureBlock();
    lectureService.deleteLectureBlock(lectureBlock);
    showInfo("lecture.deleted");
    logAudit("Lecture block deleted: " + lectureBlock, null);
    ThreadLocalUserActivityLogger.log(LearningResourceLoggingAction.LECTURE_BLOCK_DELETED, getClass(), CoreLoggingResourceable.wrap(lectureBlock, OlatResourceableType.lectureBlock, lectureBlock.getTitle()));
}
Also used : LectureBlock(org.olat.modules.lecture.LectureBlock)

Example 17 with LectureBlock

use of org.olat.modules.lecture.LectureBlock in project OpenOLAT by OpenOLAT.

the class LectureListRepositoryController method doConfirmBulkDelete.

private void doConfirmBulkDelete(UserRequest ureq) {
    Set<Integer> selections = tableEl.getMultiSelectedIndex();
    List<LectureBlock> blocks = new ArrayList<>();
    for (Integer selection : selections) {
        LectureBlockRow blockRow = tableModel.getObject(selection);
        if (!LectureBlockManagedFlag.isManaged(blockRow.getLectureBlock(), LectureBlockManagedFlag.delete)) {
            blocks.add(blockRow.getLectureBlock());
        }
    }
    if (blocks.isEmpty()) {
        showWarning("error.atleastone.lecture");
    } else {
        StringBuilder titles = new StringBuilder();
        for (LectureBlock block : blocks) {
            if (titles.length() > 0)
                titles.append(", ");
            titles.append(StringHelper.escapeHtml(block.getTitle()));
        }
        String text = translate("confirm.delete.lectures", new String[] { titles.toString() });
        bulkDeleteDialogCtrl = activateYesNoDialog(ureq, translate("delete.lectures.title"), text, bulkDeleteDialogCtrl);
        bulkDeleteDialogCtrl.setUserObject(blocks);
    }
}
Also used : LectureBlock(org.olat.modules.lecture.LectureBlock) ArrayList(java.util.ArrayList) LectureBlockRow(org.olat.modules.lecture.model.LectureBlockRow)

Example 18 with LectureBlock

use of org.olat.modules.lecture.LectureBlock in project OpenOLAT by OpenOLAT.

the class LectureListRepositoryController method doEditLectureBlock.

private void doEditLectureBlock(UserRequest ureq, LectureBlockRow row) {
    if (editLectureCtrl != null)
        return;
    LectureBlock block = lectureService.getLectureBlock(row);
    editLectureCtrl = new EditLectureBlockController(ureq, getWindowControl(), entry, block);
    listenTo(editLectureCtrl);
    cmc = new CloseableModalController(getWindowControl(), "close", editLectureCtrl.getInitialComponent(), true, translate("add.lecture"));
    listenTo(cmc);
    cmc.activate();
}
Also used : LectureBlock(org.olat.modules.lecture.LectureBlock) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)

Example 19 with LectureBlock

use of org.olat.modules.lecture.LectureBlock in project OpenOLAT by OpenOLAT.

the class LectureListRepositoryController method doDelete.

private void doDelete(List<LectureBlock> blocks) {
    for (LectureBlock block : blocks) {
        lectureService.deleteLectureBlock(block);
        logAudit("Lecture block deleted: " + block, null);
        ThreadLocalUserActivityLogger.log(LearningResourceLoggingAction.LECTURE_BLOCK_DELETED, getClass(), CoreLoggingResourceable.wrap(block, OlatResourceableType.lectureBlock, block.getTitle()));
    }
    showInfo("lecture.deleted");
}
Also used : LectureBlock(org.olat.modules.lecture.LectureBlock)

Example 20 with LectureBlock

use of org.olat.modules.lecture.LectureBlock in project OpenOLAT by OpenOLAT.

the class TeacherToolOverviewController method getRows.

@Override
protected List<LectureBlockRow> getRows(LecturesBlockSearchParameters searchParams) {
    List<LectureBlock> blocksWithTeachers = lectureService.getLectureBlocks(getIdentity(), searchParams);
    List<LectureBlockRow> rows = new ArrayList<>(blocksWithTeachers.size());
    for (LectureBlock block : blocksWithTeachers) {
        RepositoryEntry entry = block.getEntry();
        rows.add(new LectureBlockRow(block, entry.getDisplayname(), entry.getExternalRef(), "", true));
    }
    return rows;
}
Also used : LectureBlock(org.olat.modules.lecture.LectureBlock) ArrayList(java.util.ArrayList) RepositoryEntry(org.olat.repository.RepositoryEntry) LectureBlockRow(org.olat.modules.lecture.model.LectureBlockRow)

Aggregations

LectureBlock (org.olat.modules.lecture.LectureBlock)232 Identity (org.olat.core.id.Identity)132 Test (org.junit.Test)116 RepositoryEntry (org.olat.repository.RepositoryEntry)98 Date (java.util.Date)64 LectureBlockRollCall (org.olat.modules.lecture.LectureBlockRollCall)42 URI (java.net.URI)30 ArrayList (java.util.ArrayList)30 HttpResponse (org.apache.http.HttpResponse)30 Group (org.olat.basesecurity.Group)30 Calendar (java.util.Calendar)26 ICourse (org.olat.course.ICourse)24 BusinessGroup (org.olat.group.BusinessGroup)24 CourseConfigVO (org.olat.restapi.support.vo.CourseConfigVO)24 LectureBlockToGroup (org.olat.modules.lecture.LectureBlockToGroup)22 RepositoryEntryLectureConfiguration (org.olat.modules.lecture.RepositoryEntryLectureConfiguration)20 LecturesBlockSearchParameters (org.olat.modules.lecture.model.LecturesBlockSearchParameters)16 List (java.util.List)14 HttpGet (org.apache.http.client.methods.HttpGet)14 LectureBlockToTeacher (org.olat.modules.lecture.model.LectureBlockToTeacher)14