From 88b696f472d82c177f49a2f9e33184bba7cfc82e Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 11 Feb 2008 09:49:33 +0000 Subject: [PATCH] Made new group application plugin release save. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8812 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../goto/admin/groups/apps/app_list.tpl | 2 + .../groups/apps/class_groupApplication2.inc | 75 ++++++++++--------- 2 files changed, 41 insertions(+), 36 deletions(-) diff --git a/gosa-plugins/goto/admin/groups/apps/app_list.tpl b/gosa-plugins/goto/admin/groups/apps/app_list.tpl index 0cb597952..15279907d 100644 --- a/gosa-plugins/goto/admin/groups/apps/app_list.tpl +++ b/gosa-plugins/goto/admin/groups/apps/app_list.tpl @@ -1,4 +1,5 @@ + {if $enableReleaseManagement} + {/if}
{t}Release{/t} @@ -9,6 +10,7 @@
"/" , "parts" => array(),"suffix" => get_ou('applicationou'))); - foreach($res as $attrs){ - if(preg_match("/".get_ou('applicationou')."/",$attrs['dn'])){ - $bb = preg_replace("/".get_ou('applicationou').".*/","",$attrs['dn']); - $parts = array_reverse(split("ou=",$bb)); - - $str =""; - foreach($parts as $key => $part){ - if(empty($part)) { - unset($parts[$key]); - continue; + if($this->enableReleaseManagement){ + + /* Only display those releases that we are able to read */ + $dn = $this->config->current['BASE']; + $filter = "(&(objectClass=organizationalUnit)(objectClass=FAIbranch))"; + $res = get_list($filter,"application", $dn, array("ou","FAIstate"), GL_SUBSEARCH); + + foreach($res as $attrs){ + if(preg_match("/".get_ou('applicationou')."/",$attrs['dn'])){ + $bb = preg_replace("/".get_ou('applicationou').".*/","",$attrs['dn']); + $parts = array_reverse(split("ou=",$bb)); + + $str =""; + foreach($parts as $key => $part){ + if(empty($part)) { + unset($parts[$key]); + continue; + } + $part = str_replace(",","",$part); + $str .= $part."/"; + $parts[$key] = $part; } - $part = str_replace(",","",$part); - $str .= $part."/"; - $parts[$key] = $part; - } - $name = preg_replace("/\/$/","",$str); - if(empty($name)) { - $name ="/"; - } - $FAIstate = ""; - if(isset($attrs['FAIstate'])){ - $FAIstate = $attrs['FAIstate'][0]; + $name = preg_replace("/\/$/","",$str); + if(empty($name)) { + $name ="/"; + } + $FAIstate = ""; + if(isset($attrs['FAIstate'])){ + $FAIstate = $attrs['FAIstate'][0]; + } + + $ret[$name] = array("name" => $name, + "FAIstate" => $FAIstate, + "dn" => $attrs['dn'], + "parts" => $parts,"suffix" => $bb.get_ou('applicationou')); } - - $ret[$name] = array("name" => $name, - "FAIstate" => $FAIstate, - "dn" => $attrs['dn'], - "parts" => $parts,"suffix" => $bb.get_ou('applicationou')); } } ksort($ret); @@ -193,6 +194,7 @@ class appgroup2 extends plugin } } }elseif(in_array("FAIbranch",$attrs['objectClass'])){ + $type = "RELEASE"; if(isset($attrs['FAIstate'][0])){ $data['FAIstate'] = $attrs['FAIstate'][0]; @@ -320,6 +322,7 @@ class appgroup2 extends plugin } + $smarty->assign("enableReleaseManagement",$this->enableReleaseManagement); $smarty->assign("FAIrelease",$this->FAIrelease); $smarty->assign("app_list",$div->DrawList()); $smarty->assign("releases",$this->Releases); -- 2.30.2