Browse Source

desing configOptions

andre 5 years ago
parent
commit
56fb16f26b
1 changed files with 20 additions and 21 deletions
  1. 20 21
      zimbraSingle.inc

+ 20 - 21
zimbraSingle.inc

@@ -374,27 +374,6 @@ function zimbraSingleConfigOptions($params) {
         );
         );
         return false;
         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" => "radio",
-        "Options" => implode(',', $cosNames),
-        "Description" => "Tick to use this COS",
-    );
-    $configOptions[1] = array();
     $apiDomainManager = new Zm_Domain($api);
     $apiDomainManager = new Zm_Domain($api);
     $response = $apiDomainManager->getAllDomains();
     $response = $apiDomainManager->getAllDomains();
     if(is_a($response, "Exception")) {
     if(is_a($response, "Exception")) {
@@ -415,6 +394,26 @@ function zimbraSingleConfigOptions($params) {
             "Description" => "use this domain in customer selection?",
             "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 = array();
+    $configOptions['cos'] = array(
+        "FriendlyName" => "Class of Service",
+        "Type" => "radio",
+        "Options" => implode(',', $cosNames),
+        "Description" => "Tick to use this COS",
+    );
     return $configOptions;
     return $configOptions;
 }
 }