From ff90c591798a85715de311d53e631502616d5d6f Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 3 May 2006 09:18:08 +0000 Subject: [PATCH] Added check for different type of parent tabs (Faiprofile/Workstation) git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3191 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/fai/class_faiSummaryTab.inc | 50 +++++++++++++++-------- plugins/admin/fai/faiSummary.tpl | 6 +++ 2 files changed, 39 insertions(+), 17 deletions(-) diff --git a/plugins/admin/fai/class_faiSummaryTab.inc b/plugins/admin/fai/class_faiSummaryTab.inc index 3b292f75b..7d08cfa27 100644 --- a/plugins/admin/fai/class_faiSummaryTab.inc +++ b/plugins/admin/fai/class_faiSummaryTab.inc @@ -12,6 +12,10 @@ class faiSummaryTab extends plugin{ var $FAIclass; var $attributes = array("FAIclass"); + var $is_dialog = false; + + var $InitCalled = false; + function faiSummaryTab($config,$dn) { plugin::plugin($config,$dn); @@ -30,28 +34,33 @@ class faiSummaryTab extends plugin{ "Tree" =>"ou=packages,") , "FAIprofile" => array( "Image" =>"images/fai_profile.png", "Tree" =>"ou=profiles,")); + } - if(count($this->FAIclass)){ - - - /* Set Release */ - if(preg_match("/:/",$this->FAIclass)){ - if(preg_match("/:/",$this->FAIclass)){ - $this->Release =trim( preg_replace("/^.*:/","",$this->FAIclass)); - } + function init() + { + $this->InitCalled = true; + $this->Result = array(); + $_SESSION['faiSummaryTab']['UniqueID'] = 0; + + /* Get classes & release name + There are 2 different tabs which use the summary tab + faiProfile / Workstations */ + $tmp = $this->getBranches(); + if(isset($this->parent->by_name['faiProfile'])){ + $this->Classes = $this->parent->by_object['faiProfile']->FAIclasses; + $str = preg_replace("/^.*ou=profiles,/","",$this->dn); + if(isset($tmp[$str])){ + $this->Release = $tmp[$str]; } - - /* Get classes */ - $tmp = split("\ ", preg_replace("/:.*$/","",$this->FAIclass)); - foreach($tmp as $class){ - if(!empty($class)){ - $this->Classes[]= trim($class); - } + }elseif(isset($this->parent->by_name['workgeneric'])){ + $this->Classes = $this->parent->by_object['workstartup']->FAIclass; + $this->Release = $this->parent->by_object['workstartup']->FAIrelease; + $tmp = array_flip($tmp); + if(!isset($tmp[$this->Release])) { + $this->Release = ""; } } - $_SESSION['faiSummaryTab']['UniqueID'] = 0; - $this->Releases = array_flip($this->getBranches()); if(count($this->Classes) && (!empty($this->Release))){ @@ -84,6 +93,10 @@ class faiSummaryTab extends plugin{ function execute() { + if(!$this->InitCalled){ + $this->init(); + } + $display = ""; $smarty = get_smarty(); $this->ObjectList = $this->createSummary($this->Result); @@ -565,6 +578,9 @@ class faiSummaryTab extends plugin{ $value = preg_replace("/_.*$/","",$value); $this->Result = $this->closeTag($this->Result,$value); } + if(preg_match("/^reloadList/",$name)){ + $this->InitCalled = false; + } } } } diff --git a/plugins/admin/fai/faiSummary.tpl b/plugins/admin/fai/faiSummary.tpl index 0b1ba3e25..9a5cca2c1 100644 --- a/plugins/admin/fai/faiSummary.tpl +++ b/plugins/admin/fai/faiSummary.tpl @@ -3,6 +3,12 @@ {t}FAI object tree{/t} + + + + {t}Reload class and release configuration from parent object.{/t} + + {$objectList} -- 2.30.2