| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <?php
- namespace ModulesGarden\Servers\KerioEmail\App\UI\Client\EmailAccount\Sections;
- use ModulesGarden\Servers\KerioEmail\App\Libs\Product\ProductManager;
- use ModulesGarden\Servers\KerioEmail\App\Libs\Kerio\Components\Api\Soap\Repository\ClassOfServices;
- use ModulesGarden\Servers\KerioEmail\App\Traits\FormExtendedTrait;
- use ModulesGarden\Servers\KerioEmail\App\UI\Admin\Custom\Sections\FreeFieldsSection;
- use ModulesGarden\Servers\KerioEmail\Core\UI\Widget\Forms\Fields\Hidden;
- use ModulesGarden\Servers\KerioEmail\Core\UI\Widget\Forms\Fields\Select;
- use ModulesGarden\Servers\KerioEmail\Core\UI\Widget\Forms\Fields\Text;
- use ModulesGarden\Servers\KerioEmail\Core\UI\Widget\Forms\Sections\InputGroup;
- use ModulesGarden\Servers\KerioEmail\Core\UI\Widget\Forms\Fields\InputGroupElements;
- /**
- *
- * Created by PhpStorm.
- * User: Tomasz Bielecki ( tomasz.bi@modulesgarden.com )
- * Date: 12.11.19
- * Time: 13:52
- * Class EditGeneralSection
- */
- class EditGeneralSection extends FreeFieldsSection
- {
- protected $id = 'editGeneralSection';
- protected $name = 'editGeneralSection';
- use FormExtendedTrait;
- public function initContent()
- {
- /**
- * hosting id
- */
- $hid = $this->getRequestValue('id');
- /**
- * product manager allow to check product settings
- */
- $productManager = new ProductManager();
- $productManager->loadByHostingId($hid);
- /**
- * 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')]);
- if($productManager->get('cos_name') === ClassOfServices::CLASS_OF_SERVICE_QUOTA)
- {
- $field = new Hidden('currentCosId');
- $this->addField($field);
- $field = new Select('cosId');
- $this->addField($field);
- }
- }
- }
|