Ver Fonte

add Account

andre há 2 anos atrás
pai
commit
c7f992bf5c

+ 1 - 1
app/UI/Client/EmailAccount/Providers/AccountDataProvider.php

@@ -37,7 +37,7 @@ class AccountDataProvider extends BaseDataProvider
         $hid = $this->request->get('id');
         $hosting = Hosting::where('id', $hid)->first();
         $this->data['domain'] = $this->getWhmcsParamByKey('customfields')['maildomain'];
-        $this->data['quota'] = 10;
+        $this->data['quota'] = 0;
         $lang = di('lang');
         $this->availableValues['status'] = [
             Kerio::ACC_STATUS_ACTIVE        => $lang->absoluteT('kerio','account','status','active'),

+ 5 - 2
app/UI/Client/EmailAccount/Sections/GeneralSection.php

@@ -4,6 +4,7 @@ use ThurData\Servers\KerioEmail\App\Libs\Product\ProductManager;
 use ThurData\Servers\KerioEmail\App\Libs\Kerio\Components\Api\Soap\Repository\ClassOfServices;
 use ThurData\Servers\KerioEmail\App\Traits\FormExtendedTrait;
 use ThurData\Servers\KerioEmail\App\UI\Admin\Custom\Sections\FreeFieldsSection;
+use ThurData\Servers\KerioEmail\App\Validators\IntegerValueValidator;
 use ThurData\Servers\KerioEmail\App\Validators\PasswordsValidator;
 use ThurData\Servers\KerioEmail\App\Validators\RepeatPasswordValidator;
 use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\Fields\Hidden;
@@ -52,8 +53,10 @@ class GeneralSection extends FreeFieldsSection
         $this->addSection($email);
 
         $this->generateDoubleSection([new Text('display_name'), new Select('status')]);
-
-        $this->generateDoubleSection([new Number('quota'), new Select('unit')]);
+        $quota = new Text('quota');
+        $quota->setDescription('description');
+        $quota->addValidator(new IntegerValueValidator(TRUE));
+        $this->generateDoubleSection([$quota, new Select('unit')]);
 
         $passwd = new Password('password');
         $passwd->setDescription('description');