use of org.olat.modules.lecture.LectureBlockStatus in project OpenOLAT by OpenOLAT.
the class LectureServiceImpl method adaptRollCalls.
@Override
public void adaptRollCalls(LectureBlock lectureBlock) {
LectureBlockStatus status = lectureBlock.getStatus();
LectureRollCallStatus rollCallStatus = lectureBlock.getRollCallStatus();
if (status == LectureBlockStatus.done || rollCallStatus == LectureRollCallStatus.closed || rollCallStatus == LectureRollCallStatus.autoclosed) {
log.warn("Try to adapt roll call of a closed lecture block: " + lectureBlock.getKey());
return;
}
List<LectureBlockRollCall> rollCallList = lectureBlockRollCallDao.getRollCalls(lectureBlock);
for (LectureBlockRollCall rollCall : rollCallList) {
int numOfLectures = lectureBlock.getEffectiveLecturesNumber();
if (numOfLectures <= 0 && lectureBlock.getStatus() != LectureBlockStatus.cancelled) {
numOfLectures = lectureBlock.getPlannedLecturesNumber();
}
lectureBlockRollCallDao.adaptLecture(lectureBlock, rollCall, numOfLectures, null);
}
}
use of org.olat.modules.lecture.LectureBlockStatus in project OpenOLAT by OpenOLAT.
the class LectureBlockStatusCellRenderer method render.
@Override
public void render(Renderer renderer, StringOutput target, Object cellValue, int row, FlexiTableComponent source, URLBuilder ubu, Translator trans) {
if (cellValue instanceof LectureBlockStatus) {
LectureBlockStatus status = (LectureBlockStatus) cellValue;
target.append(translator.translate(status.name()));
} else if (cellValue instanceof LectureBlock) {
LectureBlock block = (LectureBlock) cellValue;
String status = getStatus(block, translator);
if (StringHelper.containsNonWhitespace(status)) {
target.append(status);
}
}
}
use of org.olat.modules.lecture.LectureBlockStatus in project openolat by klemens.
the class LectureServiceImpl method adaptRollCalls.
@Override
public void adaptRollCalls(LectureBlock lectureBlock) {
LectureBlockStatus status = lectureBlock.getStatus();
LectureRollCallStatus rollCallStatus = lectureBlock.getRollCallStatus();
if (status == LectureBlockStatus.done || rollCallStatus == LectureRollCallStatus.closed || rollCallStatus == LectureRollCallStatus.autoclosed) {
log.warn("Try to adapt roll call of a closed lecture block: " + lectureBlock.getKey());
return;
}
List<LectureBlockRollCall> rollCallList = lectureBlockRollCallDao.getRollCalls(lectureBlock);
for (LectureBlockRollCall rollCall : rollCallList) {
int numOfLectures = lectureBlock.getEffectiveLecturesNumber();
if (numOfLectures <= 0 && lectureBlock.getStatus() != LectureBlockStatus.cancelled) {
numOfLectures = lectureBlock.getPlannedLecturesNumber();
}
lectureBlockRollCallDao.adaptLecture(lectureBlock, rollCall, numOfLectures, null);
}
}
use of org.olat.modules.lecture.LectureBlockStatus in project openolat by klemens.
the class ParticipantLectureBlocksDataModel method isDataVisible.
private boolean isDataVisible(LectureBlockAndRollCall row) {
LectureBlockStatus status = row.getStatus();
if (LectureBlockStatus.cancelled.equals(status)) {
return false;
}
LectureRollCallStatus rollCallStatus = row.getRollCallStatus();
return status == LectureBlockStatus.done && (rollCallStatus == LectureRollCallStatus.closed || rollCallStatus == LectureRollCallStatus.autoclosed);
}
use of org.olat.modules.lecture.LectureBlockStatus in project openolat by klemens.
the class LectureBlockRollCallStatusCellRenderer method render.
private void render(StringOutput target, LectureBlockAndRollCall rollCall) {
if (rollCall.isRollCalled()) {
LectureBlockStatus status = rollCall.getStatus();
LectureRollCallStatus rollCallStatus = rollCall.getRollCallStatus();
if (status == LectureBlockStatus.cancelled) {
String title = translator.translate("cancelled");
target.append("<span title='").append(title).append("'><i class='o_icon o_icon-lg o_icon_cancelled'> </i></span>");
} else if (status == LectureBlockStatus.done && (rollCallStatus == LectureRollCallStatus.closed || rollCallStatus == LectureRollCallStatus.autoclosed)) {
renderClosed(target, rollCall);
} else {
String title = translator.translate("in.progress");
target.append("<span title='").append(title).append("'><i class='o_icon o_icon-lg o_icon_status_in_review'> </i></span>");
}
} else if (!rollCall.isCompulsory()) {
String title = translator.translate("rollcall.tooltip.free");
target.append("<span title='").append(title).append("'><i class='o_icon o_icon-lg o_lectures_rollcall_free'> </i></span>");
}
}
Aggregations