| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- namespace ThurData\Servers\KerioEmail\App\UI\Client\EmailAccount\Sections;
- 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\Core\UI\Widget\Forms\Fields\Hidden;
- use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\Fields\Select;
- use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\Fields\Text;
- use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\Sections\InputGroup;
- use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\Fields\InputGroupElements;
- use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\Validators\Decimal;
- /**
- *
- * Created by PhpStorm.
- * User: ThurData
- * Date: 12.11.19
- * Time: 13:52
- * Class EditGeneralSection
- */
- class EditGeneralSection extends FreeFieldsSection
- {
- protected $id = 'editGeneralSection';
- protected $name = 'editGeneralSection';
- use FormExtendedTrait;
- public function initContent()
- {
- /**
- * add fields
- */
- $field = new Hidden('id');
- $this->addField($field);
- $this->generateDoubleSection([new Text('firstname'), new Text('lastname')]);
- $email =new InputGroup('usernameGroup');
- $email->addInputComponent((new InputGroupElements\Text('username'))->addHtmlAttribute('readonly','true'));
- $email->addInputAddon('emailSign', false, '@');
- $email->addInputComponent((new InputGroupElements\Text('domain'))->addHtmlAttribute('readonly','true'));
- $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)
- {
- $field = new Hidden('currentCosId');
- $this->addField($field);
- $field = new Select('cosId');
- $this->addField($field);
- }
- }
- }
|