use of org.olat.core.gui.components.form.flexible.impl.elements.table.DateFlexiCellRenderer in project openolat by klemens.
the class TeacherLecturesTableController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
if (withRepositoryEntry) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.externalRef, "open.course"));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.entry, "open.course"));
}
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.date, new DateFlexiCellRenderer(getLocale())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.startTime, new TimeFlexiCellRenderer(getLocale())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.endTime, new TimeFlexiCellRenderer(getLocale())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.lectureBlock));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.location));
if (withTeachers) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.teachers));
}
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(TeachCols.status, new LectureBlockStatusCellRenderer(getTranslator())));
DefaultFlexiColumnModel detailsCol = new DefaultFlexiColumnModel(TeachCols.details.i18nHeaderKey(), TeachCols.details.ordinal(), "details", new BooleanCellRenderer(new StaticFlexiCellRenderer(translate("table.header.details"), "details"), null));
// set sort key even though we do not sort - added as css classes to column headers for styling
detailsCol.setSortKey(TeachCols.details.name());
columnsModel.addFlexiColumnModel(detailsCol);
DefaultFlexiColumnModel toolsCol = new DefaultFlexiColumnModel(TeachCols.tools);
toolsCol.setSortable(false);
columnsModel.addFlexiColumnModel(toolsCol);
tableModel = new TeacherOverviewDataModel(columnsModel, getLocale());
tableEl = uifactory.addTableElement(getWindowControl(), "table", tableModel, 20, false, getTranslator(), formLayout);
FlexiTableSortOptions sortOptions = new FlexiTableSortOptions();
sortOptions.setDefaultOrderBy(new SortKey(TeachCols.date.name(), sortAsc));
tableEl.setSortSettings(sortOptions);
tableEl.setCustomizeColumns(false);
tableEl.setNumOfRowsEnabled(false);
tableEl.setEmtpyTableMessageKey(emptyI18nKey);
tableEl.setAndLoadPersistedPreferences(ureq, "lecture-teacher-overview-".concat(id));
}
use of org.olat.core.gui.components.form.flexible.impl.elements.table.DateFlexiCellRenderer in project openolat by klemens.
the class CertificateAndEfficiencyStatementListController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
if (linkToCoachingTool) {
coachingToolButton = uifactory.addFormLink("coaching.tool", formLayout, Link.BUTTON);
}
FlexiTableColumnModel tableColumnModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
tableColumnModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.displayName));
tableColumnModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.score));
tableColumnModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.passed, new PassedCellRenderer()));
tableColumnModel.addFlexiColumnModel(new DefaultFlexiColumnModel("table.header.show", translate("table.header.show"), CMD_SHOW));
tableColumnModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.lastModified));
tableColumnModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.certificate, new DownloadCertificateCellRenderer(assessedIdentity, getLocale())));
tableColumnModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Cols.recertification, new DateFlexiCellRenderer(getLocale())));
tableColumnModel.addFlexiColumnModel(new DefaultFlexiColumnModel("table.header.launchcourse", translate("table.header.launchcourse"), CMD_LAUNCH_COURSE));
DefaultFlexiColumnModel deleteColumn = new DefaultFlexiColumnModel(Cols.deleteEfficiencyStatement.i18nHeaderKey(), Cols.deleteEfficiencyStatement.ordinal(), CMD_DELETE, new BooleanCellRenderer(new StaticFlexiCellRenderer(translate("table.action.delete"), CMD_DELETE), null));
tableColumnModel.addFlexiColumnModel(deleteColumn);
// artefact
if (portfolioV2Module.isEnabled()) {
tableColumnModel.addFlexiColumnModel(new DefaultFlexiColumnModel("table.header.artefact", Cols.efficiencyStatement.ordinal(), CMD_MEDIA, new StaticFlexiCellRenderer(CMD_MEDIA, new AsArtefactCellRenderer())));
} else {
EPArtefactHandler<?> artHandler = portfolioModule.getArtefactHandler(EfficiencyStatementArtefact.ARTEFACT_TYPE);
if (portfolioModule.isEnabled() && artHandler != null && artHandler.isEnabled() && assessedIdentity.equals(getIdentity())) {
tableColumnModel.addFlexiColumnModel(new DefaultFlexiColumnModel("table.header.artefact", Cols.efficiencyStatement.ordinal(), CMD_ARTEFACT, new StaticFlexiCellRenderer(CMD_ARTEFACT, new AsArtefactCellRenderer())));
}
}
tableModel = new CertificateAndEfficiencyStatementListModel(tableColumnModel, getLocale());
loadModel();
tableEl = uifactory.addTableElement(getWindowControl(), "certificates", tableModel, getTranslator(), formLayout);
tableEl.setElementCssClass("o_sel_certificates_table");
}
use of org.olat.core.gui.components.form.flexible.impl.elements.table.DateFlexiCellRenderer in project openolat by klemens.
the class StudentCoursesController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
if (formLayout instanceof FormLayoutContainer) {
FormLayoutContainer layoutCont = (FormLayoutContainer) formLayout;
String fullName = userManager.getUserDisplayName(student);
layoutCont.contextPut("studentName", StringHelper.escapeHtml(fullName));
}
// add the table
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
if (isAdministrativeUser) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Columns.name, "select"));
}
int colIndex = UserListController.USER_PROPS_OFFSET;
for (int i = 0; i < userPropertyHandlers.size(); i++) {
UserPropertyHandler userPropertyHandler = userPropertyHandlers.get(i);
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, userPropertyHandler.i18nColumnDescriptorLabelKey(), colIndex++, "select", true, userPropertyHandler.i18nColumnDescriptorLabelKey()));
}
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Columns.repoName, "select"));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Columns.passed, new PassedCellRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Columns.score, new ScoreCellRenderer()));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Columns.certificate, new DownloadCertificateCellRenderer(getLocale())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Columns.recertification, new DateFlexiCellRenderer(getLocale())));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Columns.progress, new ProgressRenderer(true, getTranslator())));
if (lectureModule.isEnabled()) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Columns.plannedLectures));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Columns.attendedLectures));
if (lectureModule.isAuthorizedAbsenceEnabled()) {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Columns.unauthorizedAbsenceLectures));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Columns.authorizedAbsenceLectures));
} else {
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Columns.absentLectures));
}
}
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Columns.lastModification));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Columns.lastUserModified));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Columns.lastCoachModified));
model = new EfficiencyStatementEntryTableDataModel(columnsModel);
tableEl = uifactory.addTableElement(getWindowControl(), "table", model, 20, false, getTranslator(), formLayout);
tableEl.setExportEnabled(true);
tableEl.setEmtpyTableMessageKey("error.no.found");
tableEl.setAndLoadPersistedPreferences(ureq, "fStudentCourseListController");
}
Aggregations