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);
}
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;
}
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");
}
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"));
}
}
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);
}
Aggregations