| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <?php
- namespace ModulesGarden\Servers\KerioEmail\App\UI\Client\Ressource\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\App\Validators\PasswordsValidator;
- use ModulesGarden\Servers\KerioEmail\App\Validators\RepeatPasswordValidator;
- use ModulesGarden\Servers\KerioEmail\Core\UI\Widget\Forms\Fields\Hidden;
- use ModulesGarden\Servers\KerioEmail\Core\UI\Widget\Forms\Fields\Password;
- 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\Fields\Switcher;
- use ModulesGarden\Servers\KerioEmail\Core\UI\Widget\Forms\Fields\Number;
- 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:39
- * Class GeneralSection
- */
- class GeneralSection extends FreeFieldsSection
- {
- protected $id = 'generalSection';
- protected $name = 'generalSection';
- use FormExtendedTrait;
- public function initContent()
- {
- /**
- * hosting id
- */
- $hid = $this->getRequestValue('id');
- /**
- * product manager allow to check product settings
- */
- $productManager = new ProductManager();
- $productManager->loadByHostingId($hid);
- $email = new InputGroup('usernameGroup');
- $email->addTextField('username', false, 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')]);
- $passwd = new Password('password');
- $passwd->setDescription('description');
- $passwd->addValidator(new PasswordsValidator());
- $passwd->notEmpty();
- $repPasswd = (new Password('repeat_password'))->addValidator(new RepeatPasswordValidator());
- $repPasswd->notEmpty();
- $this->generateDoubleSection([$passwd, $repPasswd]);
- $type = new Select('type');
- $capacity = new Text('capacity');
- $this->generateDoubleSection([$type, $capacity]);
- $field = new Text('description');
- $this->addField($field);
- $field = new Text('notes');
- $this->addField($field);
- $autoAcceptDecline = (new Switcher('auto_accept'))->setDefaultValue('on');
- $autoDeclineBusy = (new Switcher('auto_busy'))->setDefaultValue('on');
- $this->generateDoubleSection([$autoAcceptDecline, $autoDeclineBusy]);
- }
- }
|