AddAccountForm.php 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. namespace ModulesGarden\Servers\ZimbraEmail\App\UI\Client\EmailAccount\Forms;
  3. use ModulesGarden\Servers\ZimbraEmail\App\Libs\Product\ProductManager;
  4. use ModulesGarden\Servers\ZimbraEmail\App\Libs\Zimbra\Components\Api\Soap\Models\ClassOfService;
  5. use ModulesGarden\Servers\ZimbraEmail\App\Libs\Zimbra\Components\Api\Soap\Repository\ClassOfServices;
  6. use ModulesGarden\Servers\ZimbraEmail\App\Traits\FormExtendedTrait;
  7. use ModulesGarden\Servers\ZimbraEmail\App\UI\Admin\Custom\Forms\SortedFieldForm;
  8. use ModulesGarden\Servers\ZimbraEmail\App\UI\Admin\Custom\Sections\RowSection;
  9. use ModulesGarden\Servers\ZimbraEmail\App\UI\Client\EmailAccount\Providers\AccountDataProvider;
  10. use ModulesGarden\Servers\ZimbraEmail\App\UI\Client\EmailAccount\Sections\AdditionalSection;
  11. use ModulesGarden\Servers\ZimbraEmail\App\UI\Client\EmailAccount\Sections\GeneralSection;
  12. use ModulesGarden\Servers\ZimbraEmail\App\Validators\PasswordsValidator;
  13. use ModulesGarden\Servers\ZimbraEmail\App\Validators\RepeatPasswordValidator;
  14. use function ModulesGarden\Servers\ZimbraEmail\Core\Helper\di;
  15. use ModulesGarden\Servers\ZimbraEmail\Core\UI\Interfaces\ClientArea;
  16. use ModulesGarden\Servers\ZimbraEmail\Core\UI\Widget\Forms\BaseForm;
  17. use ModulesGarden\Servers\ZimbraEmail\Core\UI\Widget\Forms\Fields\Hidden;
  18. use ModulesGarden\Servers\ZimbraEmail\Core\UI\Widget\Forms\Fields\Password;
  19. use ModulesGarden\Servers\ZimbraEmail\Core\UI\Widget\Forms\Fields\Select;
  20. use ModulesGarden\Servers\ZimbraEmail\Core\UI\Widget\Forms\Fields\Text;
  21. use ModulesGarden\Servers\ZimbraEmail\Core\UI\Widget\Forms\FormConstants;
  22. use ModulesGarden\Servers\ZimbraEmail\Core\UI\Widget\Forms\Sections\HalfPageSection;
  23. use ModulesGarden\Servers\ZimbraEmail\Core\UI\Widget\Forms\Sections\InputGroup;
  24. use ModulesGarden\Servers\ZimbraEmail\Core\UI\Widget\Forms\Fields\InputGroupElements;
  25. use ModulesGarden\Servers\ZimbraEmail\Core\UI\Widget\Forms\Sections\RawSection;
  26. /**
  27. *
  28. * Created by PhpStorm.
  29. * User: Tomasz Bielecki ( tomasz.bi@modulesgarden.com )
  30. * Date: 10.09.19
  31. * Time: 13:06
  32. * Class AddAccountForm
  33. */
  34. class AddAccountForm extends SortedFieldForm implements ClientArea
  35. {
  36. use FormExtendedTrait;
  37. protected $id = 'addAccountForm';
  38. protected $name = 'addAccountForm';
  39. protected $title = 'addAccountForm';
  40. public function initContent()
  41. {
  42. $this->setFormType(FormConstants::CREATE);
  43. $this->setProvider(new AccountDataProvider());
  44. $this->initFields();
  45. $this->loadDataToForm();
  46. }
  47. public function initFields()
  48. {
  49. $this->addSection(new GeneralSection());
  50. $this->addSection(new AdditionalSection());
  51. }
  52. }