From: hickert Date: Tue, 17 May 2011 11:33:10 +0000 (+0000) Subject: Fixed sorting for device config parameters X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=da7c0fc28737b0e02a1cab8c528a2dd1711b1f9e;p=gosa.git Fixed sorting for device config parameters git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20845 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto/admin/systems/goto/Device/class_DeviceConfig.inc b/gosa-plugins/goto/admin/systems/goto/Device/class_DeviceConfig.inc index 4e981fb1d..c77adbd33 100644 --- a/gosa-plugins/goto/admin/systems/goto/Device/class_DeviceConfig.inc +++ b/gosa-plugins/goto/admin/systems/goto/Device/class_DeviceConfig.inc @@ -79,19 +79,32 @@ class DeviceConfig extends plugin // Initialize to plugin if(!$this->initialized){ + + // 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($this->rpcErrorMessage)); + return($display.$smarty->fetch(get_template_path('goto/Device/DeviceConfig.tpl', TRUE))); + } + + // Load assignable elements. + $assignableElements = $rpc->listAssignableElements('squeeze/1.0'); if(!$rpc->success()){ $smarty = get_smarty(); $smarty->assign("error", TRUE); $smarty->assign("errorMsg", msgPool::rpcError($this->rpcErrorMessage)); return($display.$smarty->fetch(get_template_path('goto/Device/DeviceConfig.tpl', TRUE))); }else{ + + // Initialization completed. $this->initialized = TRUE; $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; } } @@ -132,9 +145,6 @@ class DeviceConfig extends plugin ***************/ // Fill list of assignable elements - $rpc = $this->config->getRpcHandle(); - $res = $rpc->listAssignableElements('squeeze/1.0'); - $this->assignableElements = $res; $data = $lData = array();; foreach($this->assignableElements as $name => $element){ @@ -148,6 +158,7 @@ class DeviceConfig extends plugin } $this->assignableElementsList->setListData($data, $lData); + $this->assignableElementsList->update(); // Build list of assigned Elements $data = $lData = array();; @@ -166,6 +177,7 @@ class DeviceConfig extends plugin $lData[$name] = array('data' => array($name, $desc)); } $this->usedElementsList->setListData($data, $lData); + $this->usedElementsList->update(); // Build up parameter list $data = $lData = array();; @@ -190,6 +202,7 @@ class DeviceConfig extends plugin } } $this->parameterList->setListData($data, $lData); + $this->parameterList->update(); // Build up smarty template. $smarty = get_smarty();