From e449e52f6ef55942fe8bf39377e13639e593888a Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 10 Oct 2007 13:48:36 +0000 Subject: [PATCH] Fixed dhcp subdialog buttons when configuring a dhcpHost from any systems generic plugin git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7495 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_componentGeneric.inc | 6 +++++- plugins/admin/systems/class_dhcpHost.inc | 5 ++++- plugins/admin/systems/class_phoneGeneric.inc | 6 +++++- plugins/admin/systems/class_printGeneric.inc | 8 +++++++- plugins/admin/systems/class_servGeneric.inc | 7 ++++++- plugins/admin/systems/class_systemManagement.inc | 5 +++++ plugins/admin/systems/class_terminalGeneric.inc | 6 +++++- plugins/admin/systems/class_winGeneric.inc | 6 +++++- plugins/admin/systems/class_workstationGeneric.inc | 7 ++++++- 9 files changed, 48 insertions(+), 8 deletions(-) diff --git a/plugins/admin/systems/class_componentGeneric.inc b/plugins/admin/systems/class_componentGeneric.inc index 5605253aa..3bd61a220 100644 --- a/plugins/admin/systems/class_componentGeneric.inc +++ b/plugins/admin/systems/class_componentGeneric.inc @@ -108,7 +108,11 @@ class componentGeneric extends plugin $smarty->assign("base_select", $this->base); /* Show main page */ - $smarty->assign("netconfig", $this->netConfigDNS->execute()); + $str = $this->netConfigDNS->execute(); + if(is_object($this->netConfigDNS->dialog)){ + return($str); + } + $smarty->assign("netconfig", $str); return($smarty->fetch (get_template_path('component.tpl', TRUE))); } diff --git a/plugins/admin/systems/class_dhcpHost.inc b/plugins/admin/systems/class_dhcpHost.inc index 55e1bee64..610eadc6e 100644 --- a/plugins/admin/systems/class_dhcpHost.inc +++ b/plugins/admin/systems/class_dhcpHost.inc @@ -127,7 +127,10 @@ class dhcpHost extends dhcpPlugin { $message= array(); - $cache = $this->parent->dhcpObjectCache; + $cache = array(); + if(isset($this->parent)){ + $cache = $this->parent->dhcpObjectCache; + } /* All required fields are set? */ if ($this->cn == ""){ diff --git a/plugins/admin/systems/class_phoneGeneric.inc b/plugins/admin/systems/class_phoneGeneric.inc index 365aaf5af..a505fa931 100644 --- a/plugins/admin/systems/class_phoneGeneric.inc +++ b/plugins/admin/systems/class_phoneGeneric.inc @@ -252,7 +252,11 @@ class phoneGeneric extends plugin $smarty->assign("goFonDefaultIPs",array("dynamic"=>_("dynamic"),"network"=>_("Networksettings"))); /* Show main page */ - $smarty->assign("netconfig", $this->netConfigDNS->execute()); + $str = $this->netConfigDNS->execute(); + if(is_object($this->netConfigDNS->dialog)){ + return($str); + } + $smarty->assign("netconfig", $str); $smarty->assign("phonesettings", dirname(__FILE__)."/phonesettings.tpl"); return($smarty->fetch (get_template_path('phone.tpl', TRUE))); } diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc index c1b7ae244..18b1ba025 100644 --- a/plugins/admin/systems/class_printGeneric.inc +++ b/plugins/admin/systems/class_printGeneric.inc @@ -549,7 +549,13 @@ class printgeneric extends plugin $smarty->assign("AdminMembers" ,$adminlist); $smarty->assign("AdminMemberKeys",array_flip($adminlist)); if(preg_match("/Printer/i",$this->BelongsTo)){ - $smarty->assign("netconfig", $this->netConfigDNS->execute()); + + /* Show main page */ + $str = $this->netConfigDNS->execute(); + if(is_object($this->netConfigDNS->dialog)){ + return($str); + } + $smarty->assign("netconfig", $str); } else { $smarty->assign("netconfig", ""); } diff --git a/plugins/admin/systems/class_servGeneric.inc b/plugins/admin/systems/class_servGeneric.inc index 375169693..de16b1d52 100644 --- a/plugins/admin/systems/class_servGeneric.inc +++ b/plugins/admin/systems/class_servGeneric.inc @@ -224,7 +224,12 @@ class servgeneric extends plugin /* Show main page */ $smarty->assign("fai_activated",$this->fai_activated); - $smarty->assign("netconfig", $this->netConfigDNS->execute()); + + $str = $this->netConfigDNS->execute(); + if(is_object($this->netConfigDNS->dialog)){ + return($str); + } + $smarty->assign("netconfig", $str); $smarty->assign("modes", $this->modes); return($smarty->fetch (get_template_path('server.tpl', TRUE))); diff --git a/plugins/admin/systems/class_systemManagement.inc b/plugins/admin/systems/class_systemManagement.inc index bd4fe814a..aacc86281 100644 --- a/plugins/admin/systems/class_systemManagement.inc +++ b/plugins/admin/systems/class_systemManagement.inc @@ -821,6 +821,11 @@ class systems extends plugin } } + if(isset($this->systab->by_object[$this->systab->current]->netConfigDNS) && + $this->systab->by_object[$this->systab->current]->netConfigDNS->dialog){ + $dialog = TRUE; + } + if (!$dialog){ $display.= "

\n"; $display.= "\n"; diff --git a/plugins/admin/systems/class_terminalGeneric.inc b/plugins/admin/systems/class_terminalGeneric.inc index 64e37b81f..b0c2e4c67 100644 --- a/plugins/admin/systems/class_terminalGeneric.inc +++ b/plugins/admin/systems/class_terminalGeneric.inc @@ -358,7 +358,11 @@ class termgeneric extends plugin $smarty->assign("member_of_ogroup",$this->member_of_ogroup); /* Show main page */ - $smarty->assign("netconfig", $this->netConfigDNS->execute()); + $str = $this->netConfigDNS->execute(); + if(is_object($this->netConfigDNS->dialog)){ + return($str); + } + $smarty->assign("netconfig", $str); return($smarty->fetch (get_template_path('terminal.tpl', TRUE))); } diff --git a/plugins/admin/systems/class_winGeneric.inc b/plugins/admin/systems/class_winGeneric.inc index 173d65520..ef279f3ab 100644 --- a/plugins/admin/systems/class_winGeneric.inc +++ b/plugins/admin/systems/class_winGeneric.inc @@ -142,7 +142,11 @@ class wingeneric extends plugin $smarty->assign("base_select", $this->base); /* Show main page */ - $smarty->assign("netconfig", $this->netConfigDNS->execute()); + $str = $this->netConfigDNS->execute(); + if(is_object($this->netConfigDNS->dialog)){ + return($str); + } + $smarty->assign("netconfig", $str); return($smarty->fetch (get_template_path('wingeneric.tpl', TRUE))); } diff --git a/plugins/admin/systems/class_workstationGeneric.inc b/plugins/admin/systems/class_workstationGeneric.inc index db73b29f6..5b5a58a6c 100644 --- a/plugins/admin/systems/class_workstationGeneric.inc +++ b/plugins/admin/systems/class_workstationGeneric.inc @@ -343,8 +343,13 @@ class workgeneric extends plugin $smarty->assign("inheritTimeServer",$this->inheritTimeServer); $smarty->assign("member_of_ogroup",$this->member_of_ogroup); + $str = $this->netConfigDNS->execute(); + if(is_object($this->netConfigDNS->dialog)){ + return($str); + } + $smarty->assign("netconfig", $str); + /* Show main page */ - $smarty->assign("netconfig", $this->netConfigDNS->execute()); return($smarty->fetch (get_template_path('workstation.tpl', TRUE))); } -- 2.30.2