Search in sources :

Example 16 with FlexiTableFilter

use of org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter in project openolat by klemens.

the class MediaCenterController method initFilters.

private void initFilters(FlexiTableElement tableElement) {
    List<FlexiTableFilter> filters = new ArrayList<>(16);
    filters.add(new FlexiTableFilter(translate("filter.show.all"), "showall"));
    filters.add(FlexiTableFilter.SPACER);
    List<MediaHandler> handlers = portfolioService.getMediaHandlers();
    for (MediaHandler handler : handlers) {
        filters.add(new FlexiTableFilter(translate("artefact." + handler.getType()), handler.getType()));
    }
    tableElement.setFilters(null, filters, false);
}
Also used : MediaHandler(org.olat.modules.portfolio.MediaHandler) FlexiTableFilter(org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter) ArrayList(java.util.ArrayList)

Example 17 with FlexiTableFilter

use of org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter in project openolat by klemens.

the class AuthorListController method getFilters.

private List<FlexiTableFilter> getFilters() {
    List<OrderedRepositoryHandler> supportedHandlers = repositoryHandlerFactory.getOrderRepositoryHandlers();
    List<FlexiTableFilter> resources = new ArrayList<>(supportedHandlers.size() + 1);
    int lastGroup = 0;
    for (OrderedRepositoryHandler handler : supportedHandlers) {
        // for each 10-group, crate a separator
        int group = handler.getOrder() / 10;
        if (group > lastGroup) {
            resources.add(FlexiTableFilter.SPACER);
            lastGroup = group;
        }
        String type = handler.getHandler().getSupportedType();
        String inconLeftCss = RepositoyUIFactory.getIconCssClass(type);
        resources.add(new FlexiTableFilter(translate(type), type, inconLeftCss));
    }
    return resources;
}
Also used : FlexiTableFilter(org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter) ArrayList(java.util.ArrayList) OrderedRepositoryHandler(org.olat.repository.handlers.RepositoryHandlerFactory.OrderedRepositoryHandler)

Example 18 with FlexiTableFilter

use of org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter in project openolat by klemens.

the class PaypalTransactionsController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    backLink = uifactory.addFormLink("back", formLayout, Link.LINK_BACK);
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Columns.status, new PaypalTransactionStatusRenderer()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Columns.orderNr));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Columns.payResponseDate));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Columns.payAmount));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Columns.ipnTransactionId));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Columns.ipnTransactionStatus));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Columns.ipnSenderTransactionId));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Columns.ipnSenderTransactionStatus));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Columns.ipnPendingReason));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Columns.ipnSender));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Columns.payAck));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Columns.payPaymentExecStatus));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(Columns.olatStatus));
    DefaultFlexiColumnModel selectColumns = new DefaultFlexiColumnModel("select", translate("select"), CMD_SELECT);
    selectColumns.setExportable(false);
    selectColumns.setAlwaysVisible(true);
    columnsModel.addFlexiColumnModel(selectColumns);
    dataModel = new PaypalTransactionDataModel(columnsModel);
    tableEl = uifactory.addTableElement(getWindowControl(), "results", dataModel, 25, false, getTranslator(), formLayout);
    tableEl.setEmtpyTableMessageKey("paypal.transactions.empty");
    tableEl.setCustomizeColumns(true);
    tableEl.setExportEnabled(true);
    tableEl.setSearchEnabled(true);
    FlexiTableSortOptions options = new FlexiTableSortOptions();
    options.setDefaultOrderBy(new SortKey(Columns.payResponseDate.name(), false));
    options.setFromColumnModel(true);
    tableEl.setSortSettings(options);
    List<FlexiTableFilter> filters = new ArrayList<>();
    filters.add(new FlexiTableFilter(translate("show.all"), "showAll"));
    filters.add(FlexiTableFilter.SPACER);
    for (PaypalMergedState state : PaypalMergedState.values()) {
        filters.add(new FlexiTableFilter(translate("filter.".concat(state.name())), state.name()));
    }
    tableEl.setFilters("", filters, false);
    ;
    tableEl.setAndLoadPersistedPreferences(ureq, "FPaypalTransaction");
}
Also used : FlexiTableSortOptions(org.olat.core.gui.components.form.flexible.elements.FlexiTableSortOptions) FlexiTableFilter(org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter) ArrayList(java.util.ArrayList) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) SortKey(org.olat.core.commons.persistence.SortKey) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)

Example 19 with FlexiTableFilter

use of org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter in project openolat by klemens.

the class OrdersController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(OrderCol.status, new OrderStatusRenderer()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(OrderCol.orderNr));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(OrderCol.creationDate));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(OrderCol.summary));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(OrderCol.methods, new AccessMethodRenderer(acModule)));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(OrderCol.total));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("table.order.details", translate("select"), CMD_SELECT));
    dataSource = new OrdersDataSource(acService, null, identity, null);
    dataModel = new OrdersDataModel(dataSource, getLocale(), userManager, columnsModel);
    tableEl = uifactory.addTableElement(getWindowControl(), "orderList", dataModel, 25, true, getTranslator(), formLayout);
    tableEl.setExportEnabled(true);
    tableEl.setEmtpyTableMessageKey("table.order.empty");
    List<FlexiTableFilter> filters = new ArrayList<>();
    filters.add(new FlexiTableFilter(translate("order.status.payed"), OrderStatus.PAYED.name()));
    filters.add(new FlexiTableFilter(translate("order.status.error"), OrderStatus.ERROR.name()));
    tableEl.setFilters("", filters, false);
    if (formLayout instanceof FormLayoutContainer) {
        FormLayoutContainer layoutCont = (FormLayoutContainer) formLayout;
        layoutCont.contextPut("title", translate("orders.my"));
        layoutCont.contextPut("description", translate("orders.my.desc"));
    }
}
Also used : FlexiTableFilter(org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter) ArrayList(java.util.ArrayList) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)

Example 20 with FlexiTableFilter

use of org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter 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);
}
Also used : DateFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.DateFlexiCellRenderer) FlexiTableSortOptions(org.olat.core.gui.components.form.flexible.elements.FlexiTableSortOptions) ArrayList(java.util.ArrayList) FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer) SortKey(org.olat.core.commons.persistence.SortKey) StaticFlexiCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer) BooleanCellRenderer(org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer) FlexiTableFilter(org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) LecturesCompulsoryRenderer(org.olat.modules.lecture.ui.component.LecturesCompulsoryRenderer) LectureBlockRollCallStatusCellRenderer(org.olat.modules.lecture.ui.component.LectureBlockRollCallStatusCellRenderer) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)

Aggregations

FlexiTableFilter (org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter)52 ArrayList (java.util.ArrayList)40 DefaultFlexiColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)24 FlexiTableColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel)24 FormLayoutContainer (org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)18 UserPropertyHandler (org.olat.user.propertyhandlers.UserPropertyHandler)16 SortKey (org.olat.core.commons.persistence.SortKey)14 FlexiTableSortOptions (org.olat.core.gui.components.form.flexible.elements.FlexiTableSortOptions)12 StaticFlexiCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.StaticFlexiCellRenderer)10 BusinessGroup (org.olat.group.BusinessGroup)10 PassedCellRenderer (org.olat.course.assessment.bulk.PassedCellRenderer)8 Component (org.olat.core.gui.components.Component)6 FormLink (org.olat.core.gui.components.form.flexible.elements.FormLink)6 FormBasicController (org.olat.core.gui.components.form.flexible.impl.FormBasicController)6 BooleanCellRenderer (org.olat.core.gui.components.form.flexible.impl.elements.table.BooleanCellRenderer)6 Controller (org.olat.core.gui.control.Controller)6 Activateable2 (org.olat.core.gui.control.generic.dtabs.Activateable2)6 SearchAssessedIdentityParams (org.olat.course.assessment.model.SearchAssessedIdentityParams)6 AssessmentEntryStatus (org.olat.modules.assessment.model.AssessmentEntryStatus)6 Collections (java.util.Collections)4