Search in sources :

Example 26 with DateFlexiCellRenderer

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));
}
Also used : DateFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.DateFlexiCellRenderer) FlexiTableSortOptions(org.olat.core.gui.components.form.flexible.elements.FlexiTableSortOptions) TimeFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.TimeFlexiCellRenderer) StaticFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer) BooleanCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) SortKey(org.olat.core.commons.persistence.SortKey) LectureBlockStatusCellRenderer(org.olat.modules.lecture.ui.component.LectureBlockStatusCellRenderer) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)

Example 27 with DateFlexiCellRenderer

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");
}
Also used : DateFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.DateFlexiCellRenderer) StaticFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer) BooleanCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) PassedCellRenderer(org.olat.course.assessment.bulk.PassedCellRenderer) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)

Example 28 with DateFlexiCellRenderer

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");
}
Also used : DateFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.DateFlexiCellRenderer) ScoreCellRenderer(org.olat.modules.assessment.ui.ScoreCellRenderer) FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) PassedCellRenderer(org.olat.course.assessment.bulk.PassedCellRenderer) DownloadCertificateCellRenderer(org.olat.course.certificate.ui.DownloadCertificateCellRenderer) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel) UserPropertyHandler(org.olat.user.propertyhandlers.UserPropertyHandler)

Aggregations

DateFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.DateFlexiCellRenderer)28 DefaultFlexiColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)28 FlexiTableColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel)26 StaticFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer)18 BooleanCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer)10 SortKey (org.olat.core.commons.persistence.SortKey)8 FlexiTableSortOptions (org.olat.core.gui.components.form.flexible.elements.FlexiTableSortOptions)8 FormLayoutContainer (org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)8 PassedCellRenderer (org.olat.course.assessment.bulk.PassedCellRenderer)8 UserPropertyHandler (org.olat.user.propertyhandlers.UserPropertyHandler)8 TextFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.TextFlexiCellRenderer)6 DownloadCertificateCellRenderer (org.olat.course.certificate.ui.DownloadCertificateCellRenderer)6 ScoreCellRenderer (org.olat.modules.assessment.ui.ScoreCellRenderer)6 FlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiCellRenderer)4 TimeFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.TimeFlexiCellRenderer)4 TaxonomyCompetenceTypeRenderer (org.olat.modules.taxonomy.ui.component.TaxonomyCompetenceTypeRenderer)4 ArrayList (java.util.ArrayList)2 LicenseRenderer (org.olat.core.commons.services.license.ui.LicenseRenderer)2 FlexiTableFilter (org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter)2 FlexiColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiColumnModel)2