Search in sources :

Example 1 with BGTableItem

use of org.olat.group.ui.main.BGTableItem in project OpenOLAT by OpenOLAT.

the class CourseBusinessGroupListController method searchTableItems.

@Override
protected List<BGTableItem> searchTableItems(BusinessGroupQueryParams params) {
    List<StatisticsBusinessGroupRow> rows = businessGroupService.findBusinessGroupsFromRepositoryEntry(params, getIdentity(), getResource());
    List<BGTableItem> items = new ArrayList<>(rows.size());
    for (StatisticsBusinessGroupRow row : rows) {
        BusinessGroupMembership membership = row.getMember();
        Boolean allowLeave = membership != null;
        Boolean allowDelete = isAdmin() ? Boolean.TRUE : (membership == null ? null : new Boolean(membership.isOwner()));
        FormLink markLink = uifactory.addFormLink("mark_" + row.getKey(), "mark", "", null, null, Link.NONTRANSLATED);
        markLink.setIconLeftCSS(row.isMarked() ? Mark.MARK_CSS_LARGE : Mark.MARK_ADD_CSS_LARGE);
        BGTableItem item = new BGTableItem(row, markLink, allowLeave, allowDelete);
        item.setNumOfOwners(row.getNumOfCoaches());
        item.setNumOfParticipants(row.getNumOfParticipants());
        item.setNumWaiting(row.getNumWaiting());
        item.setNumOfPendings(row.getNumPending());
        items.add(item);
    }
    return items;
}
Also used : StatisticsBusinessGroupRow(org.olat.group.model.StatisticsBusinessGroupRow) BusinessGroupMembership(org.olat.group.BusinessGroupMembership) BGTableItem(org.olat.group.ui.main.BGTableItem) ArrayList(java.util.ArrayList) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink)

Example 2 with BGTableItem

use of org.olat.group.ui.main.BGTableItem in project openolat by klemens.

the class CourseBusinessGroupListController method searchTableItems.

@Override
protected List<BGTableItem> searchTableItems(BusinessGroupQueryParams params) {
    List<StatisticsBusinessGroupRow> rows = businessGroupService.findBusinessGroupsFromRepositoryEntry(params, getIdentity(), getResource());
    List<BGTableItem> items = new ArrayList<>(rows.size());
    for (StatisticsBusinessGroupRow row : rows) {
        BusinessGroupMembership membership = row.getMember();
        Boolean allowLeave = membership != null;
        Boolean allowDelete = isAdmin() ? Boolean.TRUE : (membership == null ? null : new Boolean(membership.isOwner()));
        FormLink markLink = uifactory.addFormLink("mark_" + row.getKey(), "mark", "", null, null, Link.NONTRANSLATED);
        markLink.setIconLeftCSS(row.isMarked() ? Mark.MARK_CSS_LARGE : Mark.MARK_ADD_CSS_LARGE);
        BGTableItem item = new BGTableItem(row, markLink, allowLeave, allowDelete);
        item.setNumOfOwners(row.getNumOfCoaches());
        item.setNumOfParticipants(row.getNumOfParticipants());
        item.setNumWaiting(row.getNumWaiting());
        item.setNumOfPendings(row.getNumPending());
        items.add(item);
    }
    return items;
}
Also used : StatisticsBusinessGroupRow(org.olat.group.model.StatisticsBusinessGroupRow) BusinessGroupMembership(org.olat.group.BusinessGroupMembership) BGTableItem(org.olat.group.ui.main.BGTableItem) ArrayList(java.util.ArrayList) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink)

Aggregations

ArrayList (java.util.ArrayList)2 FormLink (org.olat.core.gui.components.form.flexible.elements.FormLink)2 BusinessGroupMembership (org.olat.group.BusinessGroupMembership)2 StatisticsBusinessGroupRow (org.olat.group.model.StatisticsBusinessGroupRow)2 BGTableItem (org.olat.group.ui.main.BGTableItem)2