Search in sources :

Example 1 with BGMembership

use of org.olat.group.model.BGMembership in project OpenOLAT by OpenOLAT.

the class BGRoleCellRenderer method render.

private void render(StringOutput sb, Object val) {
    if (val instanceof BusinessGroupMembership) {
        BusinessGroupMembership membership = (BusinessGroupMembership) val;
        boolean and = false;
        if (membership.isOwner()) {
            and = and(sb, and);
            sb.append(trans.translate("owned.groups"));
        }
        if (membership.isParticipant()) {
            and = and(sb, and);
            sb.append(trans.translate("search.attendee"));
        }
        if (membership.isWaiting()) {
            and = and(sb, and);
            sb.append(trans.translate("search.waiting"));
        }
    } else if (val instanceof BGMembership) {
        BGMembership membership = (BGMembership) val;
        switch(membership) {
            case owner:
                sb.append(trans.translate("owned.groups"));
                break;
            case participant:
                sb.append(trans.translate("search.attendee"));
                break;
            case waiting:
                sb.append(trans.translate("search.waiting"));
                break;
        }
    }
}
Also used : BusinessGroupMembership(org.olat.group.BusinessGroupMembership) BGMembership(org.olat.group.model.BGMembership)

Example 2 with BGMembership

use of org.olat.group.model.BGMembership in project openolat by klemens.

the class BGRoleCellRenderer method render.

private void render(StringOutput sb, Object val) {
    if (val instanceof BusinessGroupMembership) {
        BusinessGroupMembership membership = (BusinessGroupMembership) val;
        boolean and = false;
        if (membership.isOwner()) {
            and = and(sb, and);
            sb.append(trans.translate("owned.groups"));
        }
        if (membership.isParticipant()) {
            and = and(sb, and);
            sb.append(trans.translate("search.attendee"));
        }
        if (membership.isWaiting()) {
            and = and(sb, and);
            sb.append(trans.translate("search.waiting"));
        }
    } else if (val instanceof BGMembership) {
        BGMembership membership = (BGMembership) val;
        switch(membership) {
            case owner:
                sb.append(trans.translate("owned.groups"));
                break;
            case participant:
                sb.append(trans.translate("search.attendee"));
                break;
            case waiting:
                sb.append(trans.translate("search.waiting"));
                break;
        }
    }
}
Also used : BusinessGroupMembership(org.olat.group.BusinessGroupMembership) BGMembership(org.olat.group.model.BGMembership)

Example 3 with BGMembership

use of org.olat.group.model.BGMembership in project openolat by klemens.

the class BGUserManagementController method event.

@Override
protected void event(UserRequest ureq, Controller source, Event event) {
    if (source == cmc) {
        cleanupPopup();
    } else if (source == addCtrl) {
        List<Identity> identitiesToAdd = extractIdentities(event);
        BGMembership type = (BGMembership) addCtrl.getUserObject();
        switch(type) {
            case owner:
                userTableModel.addOwners(identitiesToAdd);
                break;
            case participant:
                userTableModel.addParticipants(identitiesToAdd);
                break;
            case waiting:
                userTableModel.addToWaitingList(identitiesToAdd);
                break;
        }
        usersCtrl.modelChanged();
        cmc.deactivate();
        cleanupPopup();
    } else if (source == usersCtrl) {
        if (event.getCommand().equals(Table.COMMAND_MULTISELECT)) {
            TableMultiSelectEvent tmse = (TableMultiSelectEvent) event;
            if (tmse.getAction().equals(COMMAND_REMOVEUSER)) {
                List<Identity> toRemove = userTableModel.getObjects(tmse.getSelection());
                removeIdentities(toRemove);
            }
        }
    }
    super.event(ureq, source, event);
}
Also used : BGMembership(org.olat.group.model.BGMembership) TableMultiSelectEvent(org.olat.core.gui.components.table.TableMultiSelectEvent) List(java.util.List) Identity(org.olat.core.id.Identity)

Example 4 with BGMembership

use of org.olat.group.model.BGMembership in project OpenOLAT by OpenOLAT.

the class BGUserManagementController method event.

@Override
protected void event(UserRequest ureq, Controller source, Event event) {
    if (source == cmc) {
        cleanupPopup();
    } else if (source == addCtrl) {
        List<Identity> identitiesToAdd = extractIdentities(event);
        BGMembership type = (BGMembership) addCtrl.getUserObject();
        switch(type) {
            case owner:
                userTableModel.addOwners(identitiesToAdd);
                break;
            case participant:
                userTableModel.addParticipants(identitiesToAdd);
                break;
            case waiting:
                userTableModel.addToWaitingList(identitiesToAdd);
                break;
        }
        usersCtrl.modelChanged();
        cmc.deactivate();
        cleanupPopup();
    } else if (source == usersCtrl) {
        if (event.getCommand().equals(Table.COMMAND_MULTISELECT)) {
            TableMultiSelectEvent tmse = (TableMultiSelectEvent) event;
            if (tmse.getAction().equals(COMMAND_REMOVEUSER)) {
                List<Identity> toRemove = userTableModel.getObjects(tmse.getSelection());
                removeIdentities(toRemove);
            }
        }
    }
    super.event(ureq, source, event);
}
Also used : BGMembership(org.olat.group.model.BGMembership) TableMultiSelectEvent(org.olat.core.gui.components.table.TableMultiSelectEvent) List(java.util.List) Identity(org.olat.core.id.Identity)

Aggregations

BGMembership (org.olat.group.model.BGMembership)4 List (java.util.List)2 TableMultiSelectEvent (org.olat.core.gui.components.table.TableMultiSelectEvent)2 Identity (org.olat.core.id.Identity)2 BusinessGroupMembership (org.olat.group.BusinessGroupMembership)2