Code

Updated Device Config
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 17 May 2011 12:11:57 +0000 (12:11 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 17 May 2011 12:11:57 +0000 (12:11 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20848 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/goto/Device/class_DeviceConfig.inc

index 52decfb568c3aecd2a86ac7ef85f19236f168bd3..94c2397d3c579bd039efbb290df6dedc09756716 100644 (file)
@@ -83,18 +83,6 @@ class DeviceConfig extends plugin
             // Load config settings for the current device.
             $rpc = $this->config->getRpcHandle();
             $res = $rpc->systemGetConfigParameters($this->deviceUUID);
-            if(!$rpc->success()){
-                $smarty = get_smarty();
-                $smarty->assign("error", TRUE);
-                $smarty->assign("errorMsg", msgPool::rpcError($rpc->get_error()));
-                return($smarty->fetch(get_template_path('goto/Device/DeviceConfig.tpl', TRUE)));
-            }
-           
-            // Load assignable elements.
-            $release = $this->parent->by_object['InstallRecipe']->installRelease;
-            $release = preg_replace("/^[^\/]+\//","", $release);
-            $assignableElements = $rpc->listAssignableElements($release);
             if(!$rpc->success()){
                 $smarty = get_smarty();
                 $smarty->assign("error", TRUE);
@@ -107,10 +95,23 @@ class DeviceConfig extends plugin
                 $this->is_account = $this->initially_was_account = isset($res['item']);
                 if(isset($res['var']))     $this->parameterValues = $res['var'];
                 if(isset($res['item']))      $this->usedElements = $res['item'];
-                $this->assignableElements = $assignableElements;
             }
         }
 
+        // Load assignable elements.
+        $rpc = $this->config->getRpcHandle();
+        $release = $this->parent->by_object['InstallRecipe']->installRelease;
+        $release = preg_replace("/^[^\/]+\//","", $release);
+        $assignableElements = $rpc->listAssignableElements($release);
+        if(!$rpc->success()){
+            $smarty = get_smarty();
+            $smarty->assign("error", TRUE);
+            $smarty->assign("errorMsg", msgPool::rpcError($rpc->get_error()));
+            return($smarty->fetch(get_template_path('goto/Device/DeviceConfig.tpl', TRUE)));
+        }else{
+            $this->assignableElements = $assignableElements;
+        }
+
         // Log account access
         if($this->is_account && !$this->view_logged){
             $this->view_logged = TRUE;