From 03d297d65cf343848c43829d5d2c5fc63bdf8c66 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 6 Nov 2009 09:38:08 +0000 Subject: [PATCH] Added release selection git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14772 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/applications/application-filter.tpl | 1 + .../admin/applications/application-filter.xml | 8 ++++ .../admin/applications/application-list.xml | 2 +- .../class_applicationManagement.inc | 38 +++++++++++++++++-- 4 files changed, 44 insertions(+), 5 deletions(-) diff --git a/gosa-plugins/goto/admin/applications/application-filter.tpl b/gosa-plugins/goto/admin/applications/application-filter.tpl index ba7af5cde..fc24ad639 100644 --- a/gosa-plugins/goto/admin/applications/application-filter.tpl +++ b/gosa-plugins/goto/admin/applications/application-filter.tpl @@ -18,6 +18,7 @@ + {$RELEASE} {$NAME} diff --git a/gosa-plugins/goto/admin/applications/application-filter.xml b/gosa-plugins/goto/admin/applications/application-filter.xml index bcdcb01b3..859d79b05 100644 --- a/gosa-plugins/goto/admin/applications/application-filter.xml +++ b/gosa-plugins/goto/admin/applications/application-filter.xml @@ -19,6 +19,14 @@ auto + + RELEASE + combobox + Loading. + Loading.. + Loading... + + textfield NAME diff --git a/gosa-plugins/goto/admin/applications/application-list.xml b/gosa-plugins/goto/admin/applications/application-list.xml index 07ca7379c..5f0deb825 100644 --- a/gosa-plugins/goto/admin/applications/application-list.xml +++ b/gosa-plugins/goto/admin/applications/application-list.xml @@ -7,7 +7,7 @@ true true - applications + application 1 diff --git a/gosa-plugins/goto/admin/applications/class_applicationManagement.inc b/gosa-plugins/goto/admin/applications/class_applicationManagement.inc index 15bdc7d1e..db6d93ccd 100644 --- a/gosa-plugins/goto/admin/applications/class_applicationManagement.inc +++ b/gosa-plugins/goto/admin/applications/class_applicationManagement.inc @@ -46,13 +46,13 @@ class applicationManagement extends management # if (session::global_is_set(get_class($this)."_filter")){ # $filter= session::global_get(get_class($this)."_filter"); # } else { - $filter = new filter(get_template_path("application-filter.xml", true)); - $filter->setObjectStorage($this->storagePoints); + $filter = new filter(get_template_path("application-filter-release.xml", true)); +# $filter->setObjectStorage($this->storagePoints); # } $this->setFilter($filter); // Build headpage - $headpage = new listing(get_template_path("application-list.xml", true)); + $headpage = new listing(get_template_path("application-list-release.xml", true)); $headpage->setFilter($filter); // Add copy&paste and snapshot handler. @@ -72,9 +72,39 @@ class applicationManagement extends management function renderList() { + $filter = $this->getFilter(); $headpage = $this->getHeadpage(); - return(management::renderList()); + $filter->setComboBoxOptions("RELEASE",$this->getReleaseList()); + + if(isset($_POST['RELEASE'])){ + $headpage->setBase($_POST['RELEASE']); + }else{ + $headpage->setBase($base = get_ou('applicationRDN').$this->config->current['BASE']); + } + + $headpage->update(); + $display = $headpage->render(); + return($this->getHeader().$display); + + } + + function getReleaseList($base = "", $prefix ="") + { + $list = array(); + if(empty($base)){ + $base = get_ou('applicationRDN').$this->config->current['BASE']; + $list[$base] = "/"; + } + + $ldap = $this->config->get_ldap_link(); + $ldap->ls("(objectClass=FAIbranch)",$base,array("ou","FAIstate")); + while($release = $ldap->fetch()){ + $list[$release['dn']] = $prefix.$release['ou'][0]; + $list = array_merge($list,$this->getReleaseList($release['dn'],$prefix."  ")); + } + return($list); } + function IsReleaseManagementActivated() { -- 2.30.2