summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 706eb68)
raw | patch | inline | side by side (parent: 706eb68)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 8 Feb 2008 06:48:29 +0000 (06:48 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 8 Feb 2008 06:48:29 +0000 (06:48 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8772 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/goto/admin/groups/apps/app_list.tpl | patch | blob | history | |
gosa-plugins/goto/admin/groups/apps/class_groupApplication2.inc | patch | blob | history |
diff --git a/gosa-plugins/goto/admin/groups/apps/app_list.tpl b/gosa-plugins/goto/admin/groups/apps/app_list.tpl
index 55726745440bf038098873ad281df7c820ab39bd..f99854a897290c2211b3a7bd00cd7a4b56a78322 100644 (file)
<td>
<select name="FAIrelease" onChange="document.mainform.submit();">
{foreach from=$releases item=item key=key}
- <option value="{$item}" {if $item == $FAIrelease} selected {/if}>{$item}</option>
+ <option value="{$key}" {if $key == $FAIrelease} selected {/if}>{$item.name}</option>
{/foreach}
</select>
</td>
diff --git a/gosa-plugins/goto/admin/groups/apps/class_groupApplication2.inc b/gosa-plugins/goto/admin/groups/apps/class_groupApplication2.inc
index eee7f50becdebfb1f979a1e115d86681c621c3f9..6a4e6c8969f0846bbdba8b968ccdcbc6f71a0187 100644 (file)
var $a_Structure= array();
var $a_Structure_on_load = array();
var $Releases;
- var $FAIrelease = "/";
+ var $FAIrelease = 0;
var $apps = array();
public function __construct(&$config, $dn= NULL, $parent= NULL)
/* Get required release informations */
if($this->enableReleaseManagement){
$this->Releases = $this->getReleases();
- $this->FAIrelease = "/";
+ $this->FAIrelease = 0;
}
$this->curbase = $this->config->current['BASE'];
$this->reload();
$filter = "(&(objectClass=organizationalUnit)(objectClass=FAIbranch))";
$res = get_list($filter,"application", $dn, array("ou"), GL_SUBSEARCH);
- $ret =array();
+ $ret =array(array("name" => "/" , "parts" => array()));
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 $part){
+ foreach($parts as $key => $part){
if(empty($part)) {
+ unset($parts[$key]);
continue;
}
- $str .= str_replace(",","",$part)."/";
+ $part = str_replace(",","",$part);
+ $str .= $part."/";
+ $parts[$key] = $part;
}
$name = preg_replace("/\/$/","",$str);
if(empty($name)) {
$name ="/";
}
- $ret[$attrs['dn']] = $name;
+ $ret[] = array("name" => $name , "dn" => $attrs['dn'], "parts" => $parts);
}
}
- natcasesort($ret);
return($ret);
}
}
}else{
- $priority = -1;
+ $priority = 1;
if(isset($attrs['gosaApplicationPriority'])){
$priority= $attrs['gosaApplicationPriority'][0];
}
$smarty = get_smarty();
-
/* Create application list */
$div = new divSelectBox("appgroup");
$div->SetHeight(300);
}
/* Create 'open' and 'add' links */
- if($this->acl_is_writeable("gosaMemberApplication",$this->no_release_acls)){
+# if($this->acl_is_writeable("gosaMemberApplication",$this->no_release_acls)){
$linkadd = "<a href='?plug=".$_GET['plug']."&act=add&id=%s'>%s</a>";
- }else{
- $linkadd = "%s";
- }
+ # }else{
+ # $linkadd = "%s";
+ # }
$linkopen = "<a href='?plug=".$_GET['plug']."&act=depopen&depid=%s'>%s</a>";
/* Create base back entry */
}
/* Add applications found on this base */
+ $apps = array();
foreach($apps as $key => $app){
$div->AddEntry(array(
array("string"=>sprintf("<input class='center' type='checkbox' value='1' name='AddApp_%s'>",$key).
}
- $entries = $this->_get_all_entries();
$smarty->assign("FAIrelease",$this->FAIrelease);
$smarty->assign("app_list",$div->DrawList());
$smarty->assign("releases",$this->Releases);
-
- if($this->FAIrelease == "/"){
- $tmp = $entries;
- }else{
- $tmp = $entries[$this->FAIrelease];
- }
-
- $smarty->assign("entries",$this->_get_all_entries(TRUE,$tmp['ENTRIES']));
+ $entries = $this->_get_entries_for_release($this->FAIrelease);
+ $smarty->assign("entries",$entries);
$display= $smarty->fetch (get_template_path('app_list.tpl', TRUE, dirname(__FILE__)));
return($display);
}
+ function _get_entries_for_release($release,$cur = NULL)
+ {
+ $release_info = $this->Releases[$release];
+ $cur = &$this->a_Structure;
+
+ $found = FALSE;
+ foreach($release_info['parts'] as $name){
+ foreach($cur as $key => $obj){
+ if($obj['TYPE'] == "RELEASE" && $obj['NAME'] == $name){
+ $cur = &$cur[$key]['ENTRIES'];
+ $found = TRUE;
+ break;
+ }
+ $found = FALSE;
+ }
+ }
+ if($found){
+ return($this->_get_all_entries(TRUE,TRUE,$cur));
+ }else{
+ return(array());
+ }
+ }
+
+
function _edit_entry_edit($id)
{
}
@param Boolean $add_tags If TRUE, OPEN/CLOSE Tags will be appended.
@param &Array Start here, Pointer to an array.
*/
- function _get_all_entries($add_tags = FALSE,$cur = NULL)
+ function _get_all_entries($add_tags = FALSE, $skip_release = FALSE, $cur = NULL)
{
$ret = array();
if($cur == NULL){
}
foreach($cur as $key => $entry){
+ if($skip_release && $entry['TYPE'] == "RELEASE"){
+ continue;
+ }
+
$tmp = $entry;
if(!$add_tags){
$ret[$tmp['UNIQID']] = &$cur[$key];
if(isset($entry['ENTRIES']) && count($entry['ENTRIES'])){
- $ret = array_merge($ret,$this->_get_all_entries($add_tags,&$cur[$key]['ENTRIES']));
+ $ret = array_merge($ret,$this->_get_all_entries($add_tags,$skip_release,&$cur[$key]['ENTRIES']));
}
}else{
if(isset($tmp['ENTRIES'])){
$ret[] = $tmp;
if(isset($entry['ENTRIES']) && count($entry['ENTRIES'])){
$ret[] = array("TYPE" => "OPEN", "PARENT" => $entry['UNIQID']);
- $ret = array_merge($ret,$this->_get_all_entries($add_tags,&$cur[$key]['ENTRIES']));
+ $ret = array_merge($ret,$this->_get_all_entries($add_tags,$skip_release,&$cur[$key]['ENTRIES']));
$ret[] = array("TYPE" => "CLOSE" , "PARENT" => $entry['UNIQID']);
}
}