Răsfoiți Sursa

Bugfix: add resource type selection

andre 2 ani în urmă
părinte
comite
153e7b82fc

+ 2 - 0
app/Enums/Zimbra.php

@@ -46,6 +46,8 @@ class Zimbra
     const ACC_STATUS_PENDING = 'pending';
     const ACC_STATUS_PENDING = 'pending';
     const ACC_STATUS_SUSPEND = 'suspended';
     const ACC_STATUS_SUSPEND = 'suspended';
 
 
+    const RES_TYPE_LOCATION  = 'Location';
+    const RES_TYPE_EQUIPMENT = 'Equipment';
 
 
     const DEFAULT_LOGIN_LINK = 'https://zimbra-server';
     const DEFAULT_LOGIN_LINK = 'https://zimbra-server';
 
 

+ 5 - 0
app/UI/Client/Ressource/Providers/RessourceDataProvider.php

@@ -49,6 +49,11 @@ class RessourceDataProvider extends BaseDataProvider
             Zimbra::ACC_STATUS_PENDING       => $lang->absoluteT('zimbra','account','status','pending')
             Zimbra::ACC_STATUS_PENDING       => $lang->absoluteT('zimbra','account','status','pending')
         ];
         ];
 
 
+        $this->availableValues['type'] = [
+            Zimbra::RES_TYPE_LOCATION        => $lang->absoluteT('zimbra','account','status','active'),
+            Zimbra::RES_TYPE_EQUIPMENT       => $lang->absoluteT('zimbra','account','status','locked')
+        ];
+
         /**
         /**
          * product manager allow to check product settings
          * product manager allow to check product settings
          */
          */

+ 3 - 14
app/UI/Client/Ressource/Sections/GeneralSection.php

@@ -53,21 +53,10 @@ class GeneralSection extends FreeFieldsSection
         $this->generateDoubleSection([new Text('display_name'), new Select('status')]);
         $this->generateDoubleSection([new Text('display_name'), new Select('status')]);
         /***
         /***
          *
          *
-         * set cosId dependent od cos_name
+         * set type
          */
          */
-        if($productManager->get('cos_name') === ClassOfServices::CLASS_OF_SERVICE_QUOTA)
-        {
-            $field = new Select('cosId');
-            $this->addField($field);
-        }elseif($productManager->get('cos_name') === ClassOfServices::ZIMBRA_CONFIG_OPTIONS)
-        {
-            $field = new Hidden('cosId');
-            $this->addField($field);
-        }elseif($productManager->get('cos_name') !== ClassOfServices::CUSTOM_ZIMBRA)
-        {
-            $field = new Hidden('cosId');
-            $this->addField($field);
-        }
+        $field = new Select('type');
+        $this->addField($field);
 
 
         $passwd = new Password('password');
         $passwd = new Password('password');
         $passwd->setDescription('description');
         $passwd->setDescription('description');