Browse Source

desing configOptions

andre 5 years ago
parent
commit
341410b6af
1 changed files with 20 additions and 20 deletions
  1. 20 20
      zimbraSingle.inc

+ 20 - 20
zimbraSingle.inc

@@ -361,7 +361,6 @@ function zimbraSingleClientArea($userData)
 }
 
 function zimbraSingleConfigOptions($params) {
-    $configOptions = array();
     $accessData = zimbraSingleGetAccess();
     $api = new Zm_Auth($accessData['zimbraServer'], $accessData['adminUser'], $accessData['adminPass'], "admin");
     $login = $api->login();
@@ -375,6 +374,26 @@ function zimbraSingleConfigOptions($params) {
         );
         return false;
     }
+    $apiAccountManager = new Zm_Account($api);
+    $response = $apiAccountManager->getAllCos();
+    if(is_a($response, "Exception")) {
+        logModuleCall(
+            'zimbrasingle',
+            __FUNCTION__,
+            $params,
+            "Error : could not fetch classes of service",
+            ""
+        );
+        return false;
+    }
+    $cosNames = recursiveFindAll($response, 'NAME');
+    $configOptions = array();
+    $configOptions['cos'] = array(
+        "FriendlyName" => "Class of Service",
+        "Type" => "dropdown",
+        "Options" => implode(',', $cosNames),
+        "Description" => "Tick to use this COS",
+    );
     $apiDomainManager = new Zm_Domain($api);
     $response = $apiDomainManager->getAllDomains();
     if(is_a($response, "Exception")) {
@@ -395,25 +414,6 @@ function zimbraSingleConfigOptions($params) {
             "Description" => "use this domain in customer selection?",
         );
     }
-    $apiAccountManager = new Zm_Account($api);
-    $response = $apiAccountManager->getAllCos();
-    if(is_a($response, "Exception")) {
-        logModuleCall(
-            'zimbrasingle',
-            __FUNCTION__,
-            $params,
-            "Error : could not fetch classes of service",
-            ""
-        );
-        return false;
-    }
-    $cosNames = recursiveFindAll($response, 'NAME');
-    $configOptions['cos'] = array(
-        "FriendlyName" => "Class of Service",
-        "Type" => "radio",
-        "Options" => implode(',', $cosNames),
-        "Description" => "Tick to use this COS",
-    );
     return $configOptions;
 }