Browse Source

productconfiguration, disable useless features

andre 2 năm trước cách đây
mục cha
commit
a48a59a95c

+ 1 - 43
app/Enums/Kerio.php

@@ -52,49 +52,7 @@ class Kerio
     const DEFAULT_LOGIN_LINK = 'https://kerio-server';
 
     const BASE_ACCOUNT_CONFIG = [
-        'kerioFeatureMailEnabled',
-        'kerioFeatureCalendarEnabled',
-        'kerioFeatureBriefcasesEnabled',
-        'kerioFeatureContactsEnabled',
-        'kerioFeatureTasksEnabled',
-        'kerioFeatureOptionsEnabled',
-        'kerioFeatureTaggingEnabled',
-        'kerioFeatureChangePasswordEnabled',
-        'kerioFeatureManageZimlets',
-        'kerioFeatureGalEnabled',
-        'kerioFeatureWebClientOfflineAccessEnabled',
-        'kerioFeatureImportFolderEnabled',
-        'kerioDumpsterEnabled',
-        'kerioFeatureSharingEnabled',
-        'kerioFeatureSkinChangeEnabled',
-        'kerioFeatureHtmlComposeEnabled',
-        'kerioFeatureMAPIConnectorEnabled',
-        'kerioFeatureTouchClientEnabled',
-        'kerioFeatureGalAutoCompleteEnabled',
-        'kerioFeatureExportFolderEnabled',
-        'kerioDumpsterPurgeEnabled',
-        'kerioFeatureMailPriorityEnabled',
-        'kerioImapEnabled',
-        'kerioFeatureImapDataSourceEnabled',
-        'kerioFeatureMailSendLaterEnabled',
-        'kerioFeatureFiltersEnabled',
-        'kerioFeatureNewMailNotificationEnabled',
-        'kerioFeatureReadReceiptsEnabled',
-        'kerioFeatureFlaggingEnabled',
-        'kerioPop3Enabled',
-        'kerioFeaturePop3DataSourceEnabled',
-        'kerioFeatureConversationsEnabled',
-        'kerioFeatureOutOfOfficeReplyEnabled',
-        'kerioFeatureIdentitiesEnabled',
-        'kerioFeatureDistributionListFolderEnabled',
-        'kerioFeatureGroupCalendarEnabled',
-        'kerioFeatureCalendarReminderDeviceEmailEnabled',
-        'kerioFeatureAdvancedSearchEnabled',
-        'kerioFeatureInitialSearchPreferenceEnabled',
-        'kerioFeatureSavedSearchesEnabled',
-        'kerioFeaturePeopleSearchEnabled',
-        'kerioFeatureSMIMEEnabled',
-        'kerioFeatureEwsEnabled'
+        // fill with attributes like imapEnabled etc.
     ];
 
 }

+ 1 - 28
app/UI/Admin/ProductConfiguration/Pages/ConfigForm.php

@@ -38,37 +38,10 @@ class ConfigForm extends FormIntegration implements AdminArea
         /** kerio setting section **/
         $this->addSection(new KerioSettings());
 
-        /** essential features section **/
-        $this->addSection(new EssentialFeatures());
-
-        /** general features section **/
-        $this->addSection(new GeneralFeatures());
-
-        /** mail service features section **/
-        $this->addSection(new MailServiceFeatures());
-
-        /** contact features section **/
-        $this->addSection(new ContactFeatures());
-
-        /** calendar features section **/
-        $this->addSection(new CalendarFeatures());
-
-        /** search features section **/
-        $this->addSection(new SearchFeatures());
-
-        /** search features section **/
-        $this->addSection(new MimeFeatures());
-
-        /** class of service features section **/
-//        $this->addSection(new ClassOfServiceFeatures());
-
         /** available features in ca **/
         $this->addSection(new ClientAreaFeatures());
 
-        /** configurable option section**/
-        $this->addSection(new ConfigurableOptions());
-
-//        $this->loadDataToForm();
+        $this->loadDataToForm();
     }
 
 }

+ 5 - 22
app/UI/Admin/ProductConfiguration/Pages/Sections/KerioSettings.php

@@ -41,13 +41,13 @@ class KerioSettings extends BoxSectionExtended implements AdminArea
         $leftSection = new HalfPageSection('leftSide');
 
 
-        $field = new ExtendedInputField('acc_limit');
+        $field = new ExtendedInputField('domain_size_limit');
         $field->setFieldType(ExtendedInputField::TYPE_NUMBER);
         $field->addHtmlAttribute('min', Size::UNLIMITED);
         $field->setDescription('description');
         $leftSection->addField($field);
 
-        $field = new ExtendedInputField('acc_base');
+        $field = new ExtendedInputField('account_size_limit');
         $field->setFieldType(ExtendedInputField::TYPE_NUMBER);
         $field->addHtmlAttribute('min', Size::UNLIMITED);
         $field->setDescription('description');
@@ -59,19 +59,10 @@ class KerioSettings extends BoxSectionExtended implements AdminArea
         $field->setDescription('description');
         $leftSection->addField($field);
 
-        $field = new Select('cos_name');
-        $field->addHtmlAttribute('onChange','hiddeSections(event)');
-        $field->setDescription('description');
-        $leftSection->addField($field);
-
         $loginLink = new Text('login_link');
         $loginLink->setDescription('description');
         $leftSection->addField($loginLink);
 
-        $field = new Switcher('filterAccountsByCOS');
-        $field->setDescription('description');
-        $leftSection->addField($field);
-
         return $leftSection;
     }
 
@@ -83,33 +74,25 @@ class KerioSettings extends BoxSectionExtended implements AdminArea
     {
         $right = new HalfPageSection('rightSide');
 
-        $field = new ExtendedInputField('acc_size');
-        $field->setFieldType(ExtendedInputField::TYPE_NUMBER);
-        $field->addHtmlAttribute('min', Size::UNLIMITED);
-        $field->setDescription('description');
-        $right->addField($field);
-
         $field = new ExtendedInputField('domain_alias_limit');
         $field->setFieldType(ExtendedInputField::TYPE_NUMBER);
         $field->addHtmlAttribute('min', Size::UNLIMITED);
         $field->setDescription('description');
         $right->addField($field);
 
-        $field = new ExtendedInputField('dist_list_limit');
+        $field = new ExtendedInputField('account_limit');
         $field->setFieldType(ExtendedInputField::TYPE_NUMBER);
         $field->addHtmlAttribute('min', Size::UNLIMITED);
         $field->setDescription('description');
         $right->addField($field);
 
-        $field = new ExtendedInputField('domainMaxSize');
+        $field = new ExtendedInputField('dist_list_limit');
         $field->setFieldType(ExtendedInputField::TYPE_NUMBER);
         $field->addHtmlAttribute('min', Size::UNLIMITED);
         $field->setDescription('description');
         $right->addField($field);
 
-        $field = new ExtendedInputField('domainBaseSize');
-        $field->setFieldType(ExtendedInputField::TYPE_NUMBER);
-        $field->addHtmlAttribute('min', Size::UNLIMITED);
+        $field = new Switcher('outllok_connector');
         $field->setDescription('description');
         $right->addField($field);
 

+ 20 - 63
app/UI/Admin/ProductConfiguration/Providers/ProductConfigurationDataProvider.php

@@ -30,26 +30,22 @@ class ProductConfigurationDataProvider extends BaseDataProvider implements Admin
 {
 
     const FORM_DATA = [
-            'acc_limit',
-            'acc_base',
-            'alias_limit',
-            'cos_name',
-            'login_link',
-            'filterAccountsByCOS',
-            'acc_size',
-            'domain_alias_limit',
-            'dist_list_limit',
-            'domainMaxSize',
-            'domainBaseSize',
-            'cos',
-            'ca_emailAccountPage',
-            'ca_ressourcePage',
-            'ca_distributionListPage',
-            'ca_goToWebmailPage',
-            'ca_emailAliasesPage',
-            'ca_domainAliasesPage',
-            'ca_logInToMailboxButton',
-        ];
+        'domain_size_limit',
+        'account_size_limit',
+        'account_limit',
+        'alias_limit',
+        'domain_alias_limit',
+        'dist_list_limit',
+        'outllok_connector',
+        'login_link',
+        'ca_emailAccountPage',
+        'ca_ressourcePage',
+        'ca_distributionListPage',
+        'ca_goToWebmailPage',
+        'ca_emailAliasesPage',
+        'ca_domainAliasesPage',
+        'ca_logInToMailboxButton',
+    ];
 
     const FILED_NOT_UPDATED = [
         'login_link'
@@ -77,21 +73,12 @@ class ProductConfigurationDataProvider extends BaseDataProvider implements Admin
     public function update()
     {
         $this->catchFormData();
-
-        $cos = $this->formData['cos'];
-        unset($this->formData['cos']);
-
         $productId = $this->request->get('id');
 
         foreach ($this->formData as $key => $value)
         {
             ProductConfiguration::updateOrCreate(['product_id' => $productId, 'setting' => $key], ['value' => $value]);
         }
-
-        /**
-         * save  serialized cos
-         */
-        ProductConfiguration::updateOrCreate(['product_id' => $productId, 'setting' => 'cos'], ['value' => json_encode($cos)]);
     }
 
     /**
@@ -100,39 +87,14 @@ class ProductConfigurationDataProvider extends BaseDataProvider implements Admin
     protected function loadDefaultData()
     {
         /* default data */
-        $this->data['acc_limit']          = Size::DEFAULT_ACC_LIMIT;
-        $this->data['acc_base']           = Size::DEFAULT_ACC_BASE;
-        $this->data['acc_size']           = Size::DEFAULT_ACC_SIZE;
+        $this->data['domain_size_limit']  = Size::DEFAULT_DOMAIN_LIMIT;
+        $this->data['account_size_limit'] = Size::DEFAULT_ACCOUNT_SIZE;
+        $this->data['account_limit']      = Size::DEFAULT_ACCOUNT_LIMIT;
         $this->data['alias_limit']        = Size::DEFAULT_ALIAS_LIMIT;
         $this->data['domain_alias_limit'] = Size::DEFAULT_DOMAIN_ALIAS_LIMIT;
-        $this->data['cos_name']           = ClassOfServices::CUSTOM_KERIO;
         $this->data['dist_list_limit']    = Size::DEFAULT_DIST_ALIAS_LIMIT;
+        $this->data['outllok_connector']  = Kerio::ATTR_DISABLED;
         $this->data['login_link']         = Kerio::DEFAULT_LOGIN_LINK;
-        $this->data['domainMaxSize']      = Size::UNLIMITED;
-        $this->data['domainBaseSize']     = Size::UNLIMITED;
-
-        /* available class of services*/
-        $this->availableValues['cos_name'] = [
-            ClassOfServices::CUSTOM_KERIO          => $this->getLang()->absoluteT('addonAA', 'configuration', 'product', 'kerio', 'cos', 'Use Custom Settings'),
-            ClassOfServices::KERIO_CONFIG_OPTIONS  => $this->getLang()->absoluteT('addonAA', 'configuration', 'product', 'kerio', 'cos', 'Allow clients to choose Class Of Service'),
-            ClassOfServices::CLASS_OF_SERVICE_QUOTA => $this->getLang()->absoluteT('addonAA', 'configuration', 'product', 'kerio', 'cos', 'Allow clients to choose Class Of Service Quota Per Account'),
-        ];
-
-
-        $manager    = new KerioManager();
-        $repository = $manager->getApiByProduct($this->getRequestValue('id'))->soap->repository();
-        $cosList        = $repository->cos->all();
-
-        /**
-         * class of services from API
-         */
-        foreach ($cosList as $cos)
-        {
-            /**
-             * @var $cos \ThurData\Servers\KerioEmail\App\Libs\Kerio\Components\Api\Soap\Models\ClassOfService
-             */
-            $this->availableValues['cos_name'][$cos->getId()] = $this->getLang()->absoluteT($cos->getName());
-        }
     }
 
     /**
@@ -144,11 +106,6 @@ class ProductConfigurationDataProvider extends BaseDataProvider implements Admin
 
         foreach ($settings as $setting)
         {
-            if('cos' === $setting->setting)
-            {
-                $this->data[$setting->setting] = json_decode($setting->value, true);
-                continue;
-            }
             $this->data[$setting->setting] = $setting->value;
         }
     }