andre 2 anni fa
parent
commit
81ed6e3215

+ 12 - 18
app/UI/Client/DistributionList/Providers/EditListDataProvider.php

@@ -39,6 +39,11 @@ class EditListDataProvider extends AddListDataProvider
             "replyTo",
             "posting"
         );
+        $cond = array(
+            "fieldName" => "id",
+            "comparator" => "Eq",
+            "value" => $this->actionElementId
+        );
 
         $api = new KerioWhmcs('whmcsKerioEmail', 'Thurdata', '1.0');
         try {
@@ -65,12 +70,6 @@ class EditListDataProvider extends AddListDataProvider
             );
             return ['error' => $error->getMessage()];
         }
-        $cond = array(
-            "fieldName" => "id",
-            "comparator" => "Eq",
-            "value" => $this->actionElementId
-        );
-
         try {
             $list = $api->getMailingLists($fields,$domainID,[ $cond ]);
         } catch (KerioApiException $error) {
@@ -103,15 +102,10 @@ class EditListDataProvider extends AddListDataProvider
          * load api
          */
 
-//        $list             = $repository->lists()->getDistributionListBydId($this->actionElementId);
-//        $this->data['id'] = $list->getId();
-
-//        $res                    = explode('@', $list->getName());
-//        $this->data['listmail'] = $res[0];
-//        $this->data['domain']   = $res[1];
+        $this->data['id'] = $list[0]['id'];
 
-//        $this->data['emailAliases']  = implode(',', $list->getResourceAliases());
-//        $this->data['owners']        = implode(',', $list->getResourceOwners());
+        $this->data['listmail'] = $list[0]['name'];
+        $this->data['domain']   = $this->getWhmcsParamByKey('domain');
 
         /**
          * allow to check which should be removed
@@ -185,10 +179,10 @@ class EditListDataProvider extends AddListDataProvider
 //        $ownMembers = $this->data['memberList'] ? $this->data['memberList'] : [];
 //        $this->data['customMember'] = implode(',',array_diff($members, $ownMembers));
 
-//        if($this->formData)
-//        {
-//            $this->loadReloadedData();
-//        }
+        if($this->formData)
+        {
+            $this->loadReloadedData();
+        }
 
     }