use of org.olat.modules.lecture.ui.component.LecturesCompulsoryRenderer in project OpenOLAT by OpenOLAT.
the class ParticipantLectureBlocksController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
if (formLayout instanceof FormLayoutContainer) {
FormLayoutContainer layoutCont = (FormLayoutContainer) formLayout;
if (withPrint) {
layoutCont.contextPut("winid", "w" + layoutCont.getFormItemComponent().getDispatchID());
layoutCont.getFormItemComponent().addListener(this);
layoutCont.getFormItemComponent().contextPut("withPrint", Boolean.TRUE);
layoutCont.contextPut("title", StringHelper.escapeHtml(entry.getDisplayname()));
openCourseButton = uifactory.addFormLink("open.course", formLayout, Link.BUTTON);
openCourseButton.setIconLeftCSS("o_icon o_CourseModule_icon");
} else {
layoutCont.contextPut("title", translate("lectures.repository.print.title", new String[] { StringHelper.escapeHtml(entry.getDisplayname()), StringHelper.escapeHtml(userManager.getUserDisplayName(assessedIdentity)) }));
}
layoutCont.contextPut("authorizedAbsenceEnabled", authorizedAbsenceEnabled);
}
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.date, new DateFlexiCellRenderer(getLocale())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.entry));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.lectureBlock));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.coach));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.plannedLectures, new LecturesCompulsoryRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.attendedLectures));
if (authorizedAbsenceEnabled) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.unauthorizedAbsentLectures));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.authorizedAbsentLectures));
} else {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.absentLectures));
}
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.status, new LectureBlockRollCallStatusCellRenderer(authorizedAbsenceEnabled, absenceDefaultAuthorized, getTranslator())));
if (appealEnabled && withAppeal && assessedIdentity.equals(getIdentity())) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("appeal", ParticipantCols.appeal.ordinal(), "appeal", new BooleanCellRenderer(new StaticFlexiCellRenderer(translate("appeal"), "appeal"), null)));
}
tableModel = new ParticipantLectureBlocksDataModel(columnsModel, authorizedAbsenceEnabled, absenceDefaultAuthorized, getLocale());
int paging = withPrint ? 20 : -1;
tableEl = uifactory.addTableElement(getWindowControl(), "table", tableModel, paging, false, getTranslator(), formLayout);
FlexiTableSortOptions options = new FlexiTableSortOptions();
options.setDefaultOrderBy(new SortKey(ParticipantCols.date.name(), true));
tableEl.setSortSettings(options);
tableEl.setCustomizeColumns(withPrint);
tableEl.setAndLoadPersistedPreferences(ureq, "participant-roll-call-appeal");
tableEl.setEmtpyTableMessageKey("empty.repository.entry.lectures");
List<FlexiTableFilter> filters = new ArrayList<>();
filters.add(new FlexiTableFilter(translate("filter.showAll"), "showAll", true));
filters.add(new FlexiTableFilter(translate("filter.mandatory"), "mandatory"));
tableEl.setFilters("", filters, false);
}
use of org.olat.modules.lecture.ui.component.LecturesCompulsoryRenderer in project openolat by klemens.
the class ParticipantLectureBlocksController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
if (formLayout instanceof FormLayoutContainer) {
FormLayoutContainer layoutCont = (FormLayoutContainer) formLayout;
if (withPrint) {
layoutCont.contextPut("winid", "w" + layoutCont.getFormItemComponent().getDispatchID());
layoutCont.getFormItemComponent().addListener(this);
layoutCont.getFormItemComponent().contextPut("withPrint", Boolean.TRUE);
layoutCont.contextPut("title", StringHelper.escapeHtml(entry.getDisplayname()));
openCourseButton = uifactory.addFormLink("open.course", formLayout, Link.BUTTON);
openCourseButton.setIconLeftCSS("o_icon o_CourseModule_icon");
} else {
layoutCont.contextPut("title", translate("lectures.repository.print.title", new String[] { StringHelper.escapeHtml(entry.getDisplayname()), StringHelper.escapeHtml(userManager.getUserDisplayName(assessedIdentity)) }));
}
layoutCont.contextPut("authorizedAbsenceEnabled", authorizedAbsenceEnabled);
}
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.date, new DateFlexiCellRenderer(getLocale())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.entry));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.lectureBlock));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.coach));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.plannedLectures, new LecturesCompulsoryRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.attendedLectures));
if (authorizedAbsenceEnabled) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.unauthorizedAbsentLectures));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.authorizedAbsentLectures));
} else {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.absentLectures));
}
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ParticipantCols.status, new LectureBlockRollCallStatusCellRenderer(authorizedAbsenceEnabled, absenceDefaultAuthorized, getTranslator())));
if (appealEnabled && withAppeal && assessedIdentity.equals(getIdentity())) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("appeal", ParticipantCols.appeal.ordinal(), "appeal", new BooleanCellRenderer(new StaticFlexiCellRenderer(translate("appeal"), "appeal"), null)));
}
tableModel = new ParticipantLectureBlocksDataModel(columnsModel, authorizedAbsenceEnabled, absenceDefaultAuthorized, getLocale());
int paging = withPrint ? 20 : -1;
tableEl = uifactory.addTableElement(getWindowControl(), "table", tableModel, paging, false, getTranslator(), formLayout);
FlexiTableSortOptions options = new FlexiTableSortOptions();
options.setDefaultOrderBy(new SortKey(ParticipantCols.date.name(), true));
tableEl.setSortSettings(options);
tableEl.setCustomizeColumns(withPrint);
tableEl.setAndLoadPersistedPreferences(ureq, "participant-roll-call-appeal");
tableEl.setEmtpyTableMessageKey("empty.repository.entry.lectures");
List<FlexiTableFilter> filters = new ArrayList<>();
filters.add(new FlexiTableFilter(translate("filter.showAll"), "showAll", true));
filters.add(new FlexiTableFilter(translate("filter.mandatory"), "mandatory"));
tableEl.setFilters("", filters, false);
}
Aggregations