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

OO-169: fix e-portfolio for groups which hasn't any owner

--HG--
branch : 80-patch
parent aab68514
No related branches found
No related tags found
No related merge requests found
......@@ -1197,6 +1197,9 @@ public class EPFrontendManager extends BasicManager {
* @return
*/
public static String getAllOwnersAsString(PortfolioStructureMap map){
if(map.getOwnerGroup() == null) {
return null;
}
List<Identity> ownerIdents = BaseSecurityManager.getInstance().getIdentitiesOfSecurityGroup(map.getOwnerGroup());
List<String> identNames = new ArrayList<String>();
for (Identity identity : ownerIdents) {
......@@ -1213,6 +1216,9 @@ public class EPFrontendManager extends BasicManager {
* @return
*/
public static String getFirstOwnerAsString(PortfolioStructureMap map){
if(map.getOwnerGroup() == null) {
return "n/a";
}
List<Identity> ownerIdents = BaseSecurityManager.getInstance().getIdentitiesOfSecurityGroup(map.getOwnerGroup());
if(ownerIdents.size() > 0){
Identity id = ownerIdents.get(0);
......@@ -1228,13 +1234,15 @@ public class EPFrontendManager extends BasicManager {
* @return
*/
public static Identity getFirstOwnerIdentity(PortfolioStructureMap map){
if(map.getOwnerGroup() == null) {
return null;
}
List<Identity> ownerIdents = BaseSecurityManager.getInstance().getIdentitiesOfSecurityGroup(map.getOwnerGroup());
if (ownerIdents.size() > 0) {
Identity id = ownerIdents.get(0);
return id;
} else {
throw new AssertException("OwnerGroup of given ePortfolioMap (" + map.getResourceableId() + ") is empty!");
}
return null;
}
// not yet available
......
......@@ -127,9 +127,12 @@ public class EPMapViewController extends BasicController implements Activateable
protected void initForm(UserRequest ureq) {
Identity ownerIdentity = EPFrontendManager.getFirstOwnerIdentity(map);
DisplayPortraitController portraitCtr = new DisplayPortraitController(ureq, getWindowControl(), ownerIdentity, false,true,true,false);
if(ownerIdentity != null) {
DisplayPortraitController portraitCtr = new DisplayPortraitController(ureq, getWindowControl(), ownerIdentity, false,true,true,false);
mainVc.put("ownerportrait", portraitCtr.getInitialComponent());
}
mainVc.contextPut("map", map);
mainVc.put("ownerportrait", portraitCtr.getInitialComponent());
mainVc.contextPut("style", ePFMgr.getValidStyleName(map));
Boolean editMode = editButton == null ? Boolean.FALSE : (Boolean)editButton.getUserObject();
......
......@@ -30,8 +30,9 @@
#if(!$r.available("editor"))
<div class="b_eportfolio_mapdescr">$map.description</div>
<div class="b_eportfolio_mapowner">$r.translate("map.owners","") $r.render("ownerportrait")</div>
#if($r.available("ownerportrait"))
<div class="b_eportfolio_mapowner">$r.translate("map.owners","") $r.render("ownerportrait")</div>
#end
<div class="b_clearfix"></div>
## show av. artefacts here...
......
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