Skip to content
Snippets Groups Projects
Commit bb68efbd authored by srosse's avatar srosse
Browse files

OO-4872: remove user name column in waiting list of topic assignement

parent da3a7385
No related branches found
No related tags found
No related merge requests found
...@@ -688,7 +688,7 @@ public class GroupController extends BasicController { ...@@ -688,7 +688,7 @@ public class GroupController extends BasicController {
} }
List<UserPropertyHandler> userPropertyHandlers = userManager.getUserPropertyHandlersFor(usageIdentifyer, isAdministrativeUser); List<UserPropertyHandler> userPropertyHandlers = userManager.getUserPropertyHandlersFor(usageIdentifyer, isAdministrativeUser);
identitiesTableModel = new IdentitiesOfGroupTableDataModel(views, getLocale(), userPropertyHandlers, isAdministrativeUser); identitiesTableModel = new IdentitiesOfGroupTableDataModel(views, getLocale(), userPropertyHandlers);
tableCtr.setTableDataModel(identitiesTableModel); tableCtr.setTableDataModel(identitiesTableModel);
} }
} }
...@@ -44,43 +44,44 @@ import org.olat.user.propertyhandlers.UserPropertyHandler; ...@@ -44,43 +44,44 @@ import org.olat.user.propertyhandlers.UserPropertyHandler;
public class IdentitiesOfGroupTableDataModel extends DefaultTableDataModel<GroupMemberView> { public class IdentitiesOfGroupTableDataModel extends DefaultTableDataModel<GroupMemberView> {
private List<UserPropertyHandler> userPropertyHandlers; private List<UserPropertyHandler> userPropertyHandlers;
private boolean isAdministrativeUser;
/** /**
* @param combo a List of Object[] with the array[0] = Identity, array[1] = addedToGroupTimestamp * @param combo a List of Object[] with the array[0] = Identity, array[1] = addedToGroupTimestamp
*/ */
public IdentitiesOfGroupTableDataModel(List<GroupMemberView> combo, Locale locale, List<UserPropertyHandler> userPropertyHandlers, boolean isAdministrativeUser) { public IdentitiesOfGroupTableDataModel(List<GroupMemberView> combo, Locale locale, List<UserPropertyHandler> userPropertyHandlers) {
super(combo); super(combo);
setLocale(locale); setLocale(locale);
this.userPropertyHandlers = userPropertyHandlers; this.userPropertyHandlers = userPropertyHandlers;
this.isAdministrativeUser = isAdministrativeUser;
} }
@Override @Override
public final Object getValueAt(int row, int col) { public final Object getValueAt(int row, int col) {
GroupMemberView co = getObject(row); GroupMemberView co = getObject(row);
switch(col) { if(col == 1) {
case 1: return co.getOnlineStatus(); return co.getOnlineStatus();
case 2: return co.getAddedAt(); }
default: { if(col == 2) {
User user = co.getIdentity().getUser(); return co.getAddedAt();
UserPropertyHandler userPropertyHandler = userPropertyHandlers.get(col - 3); }
String value = userPropertyHandler.getUserProperty(user, getLocale()); int index = col - 3;
return (value == null ? "n/a" : value); if(index >= 0 && index < userPropertyHandlers.size()) {
} User user = co.getIdentity().getUser();
UserPropertyHandler userPropertyHandler = userPropertyHandlers.get(col - 3);
String value = userPropertyHandler.getUserProperty(user, getLocale());
return (value == null ? "n/a" : value);
} }
return "ERROR";
} }
@Override @Override
public int getColumnCount() { public int getColumnCount() {
// + loginname + adddate or just + loginname // online status + add date
return userPropertyHandlers.size() + (isAdministrativeUser ? 2 : 1); return userPropertyHandlers.size() + 2;
} }
@Override @Override
public IdentitiesOfGroupTableDataModel createCopyWithEmptyList() { public IdentitiesOfGroupTableDataModel createCopyWithEmptyList() {
return new IdentitiesOfGroupTableDataModel(new ArrayList<GroupMemberView>(), getLocale(), userPropertyHandlers, isAdministrativeUser); return new IdentitiesOfGroupTableDataModel(new ArrayList<GroupMemberView>(), getLocale(), userPropertyHandlers);
} }
/** /**
......
...@@ -144,12 +144,6 @@ public class WaitingGroupController extends GroupController { ...@@ -144,12 +144,6 @@ public class WaitingGroupController extends GroupController {
protected void initGroupTable(TableController tableCtr, UserRequest ureq, boolean enableTablePreferences, boolean enableUserSelection) { protected void initGroupTable(TableController tableCtr, UserRequest ureq, boolean enableTablePreferences, boolean enableUserSelection) {
List<UserPropertyHandler> userPropertyHandlers = userManager.getUserPropertyHandlersFor(usageIdentifyer, isAdministrativeUser); List<UserPropertyHandler> userPropertyHandlers = userManager.getUserPropertyHandlersFor(usageIdentifyer, isAdministrativeUser);
// first the login name // first the login name
if (isAdministrativeUser) {
// first the login name, but only if administrative user
DefaultColumnDescriptor cd0 = new DefaultColumnDescriptor("table.user.login", 0, COMMAND_VCARD, ureq.getLocale());
cd0.setIsPopUpWindowAction(true, "height=700, width=900, location=no, menubar=no, resizable=yes, status=no, scrollbars=yes, toolbar=no");
tableCtr.addColumnDescriptor(cd0);
}
if(chatEnabled) { if(chatEnabled) {
tableCtr.addColumnDescriptor(new CustomRenderColumnDescriptor("table.header.online", 1, COMMAND_IM, getLocale(), tableCtr.addColumnDescriptor(new CustomRenderColumnDescriptor("table.header.online", 1, COMMAND_IM, getLocale(),
ColumnDescriptor.ALIGNMENT_LEFT, new OnlineIconRenderer())); ColumnDescriptor.ALIGNMENT_LEFT, new OnlineIconRenderer()));
......
...@@ -698,7 +698,7 @@ public class GroupController extends BasicController { ...@@ -698,7 +698,7 @@ public class GroupController extends BasicController {
} }
List<UserPropertyHandler> userPropertyHandlers = userManager.getUserPropertyHandlersFor(usageIdentifyer, isAdministrativeUser); List<UserPropertyHandler> userPropertyHandlers = userManager.getUserPropertyHandlersFor(usageIdentifyer, isAdministrativeUser);
identitiesTableModel = new IdentitiesOfGroupTableDataModel(views, getLocale(), userPropertyHandlers, isAdministrativeUser); identitiesTableModel = new IdentitiesOfGroupTableDataModel(views, getLocale(), userPropertyHandlers);
tableCtr.setTableDataModel(identitiesTableModel); tableCtr.setTableDataModel(identitiesTableModel);
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment