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

OO-562: fix the difference between the profile editor and the home page about...

OO-562: fix the difference between the profile editor and the home page about the visibility of mandatory attributes
parent 096702c7
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,8 @@
package org.olat.user;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.olat.core.CoreSpringFactory;
......@@ -80,10 +82,17 @@ public class HomePageDisplayController extends BasicController {
// add configured property handlers and the homepage config
// do the looping in the velocity context
List<UserPropertyHandler> userPropertyHandlers = userManager.getUserPropertyHandlersFor(usageIdentifyer, false);
List<UserPropertyHandler> userPropertyHandlers
= new ArrayList<UserPropertyHandler>(userManager.getUserPropertyHandlersFor(usageIdentifyer, false));
for(Iterator<UserPropertyHandler> propIt=userPropertyHandlers.iterator(); propIt.hasNext(); ) {
UserPropertyHandler prop = propIt.next();
if(!hpc.isEnabled(prop.getName()) && !userManager.isMandatoryUserProperty(usageIdentifyer, prop)) {
propIt.remove();
}
}
mainVC.contextPut("userPropertyHandlers", userPropertyHandlers);
mainVC.contextPut("homepageConfig", hpc);
mainVC.contextPut("homepageConfig", hpc);
Controller dpc = new DisplayPortraitController(ureq, getWindowControl(), homeIdentity, true, false);
listenTo(dpc); // auto dispose
mainVC.put("image", dpc.getInitialComponent());
......
......@@ -19,7 +19,7 @@
</tr>
#end
#foreach( $propertyHandler in $userPropertyHandlers )
#if($homepageConfig.isEnabled($propertyHandler.getName()))
<tr>
<td>
<label>
......@@ -30,7 +30,6 @@
$!propertyHandler.getUserPropertyAsHTML($user, $locale)
</td>
</tr>
#end
#end
#if ( $homepageConfig.getTextAboutMe() && ($homepageConfig.getTextAboutMe() != "") )
<tr valign="top">
......
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