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()));
}
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);
}
}
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();
}
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");
}
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;
}
Aggregations