andre пре 2 година
родитељ
комит
ea364218f7

+ 10 - 3
app/UI/Client/EmailAccount/Providers/EditAccountDataProvider.php

@@ -158,6 +158,14 @@ class EditAccountDataProvider extends BaseDataProvider
         $productManager = new ProductManager();
         $productManager->loadByHostingId($hid);
 
+        $account['isEnabled'] = $this->formData['status'] === 'active' ? TRUE : FALSE;
+        if ($this->formData['quota'] > 0) {
+            $account['diskSizeLimit']['isActive'] = TRUE;
+            $account['diskSizeLimit']['limit']['value'] = $this->formData['quota'];
+            $account['diskSizeLimit']['limit']['unit'] = $this->formData['unit'];
+        } else {
+            $account['diskSizeLimit']['isActive'] = FALSE;
+        }
         $fields['firstName'] = $this->formData['firstname'];
         $fields['surName'] = $this->formData['lastname'];
         $fields['commonName'] = $this->formData['display_name'];
@@ -182,7 +190,7 @@ class EditAccountDataProvider extends BaseDataProvider
             return ['error' => $error->getMessage()];
         }
         try {
-            $result = $api->setAddress($this->formData['id'], $fields);
+            $result = $api->modifyUser($this->formData['id'], $account);
         } catch (KerioApiException $error) {
             logModuleCall(
                 'kerioEmail',
@@ -193,9 +201,8 @@ class EditAccountDataProvider extends BaseDataProvider
             );
             return ['error' => $error->getMessage()];
         }
-        $status['isEnabled'] = $this->formData['status'] === 'active' ? TRUE : FALSE;
         try {
-            $result = $api->modifyUser($this->formData['id'], $status);
+            $result = $api->setAddress($this->formData['id'], $fields);
         } catch (KerioApiException $error) {
             logModuleCall(
                 'kerioEmail',

+ 4 - 0
app/UI/Client/EmailAccount/Sections/EditGeneralSection.php

@@ -57,6 +57,10 @@ class EditGeneralSection extends FreeFieldsSection
         $this->addSection($email);
 
         $this->generateDoubleSection([new Text('display_name'), new Select('status')]);
+        $quota = new Text('quota');
+        $quota->setDescription('description');
+        $quota->addValidator(new Decimal(0));
+        $this->generateDoubleSection([$quota, new Select('unit')]);
 
         if($productManager->get('cos_name') === ClassOfServices::CLASS_OF_SERVICE_QUOTA)
         {