Sfoglia il codice sorgente

Se agrega versión de docsis al formulario cd CMTS.

Maxi Schvindt 7 anni fa
parent
commit
80a3bb645c

+ 7 - 3
src/CablemodemBundle/Admin/CMTSAdmin.php

@@ -18,8 +18,6 @@ class CMTSAdmin extends BaseAdmin
         $datagridMapper
             ->add('name')
             ->add('host')
-            ->add('snmpCommunity')
-            ->add('snmpVersion')
             ->add('executeSnmp')
         ;
     }
@@ -34,6 +32,7 @@ class CMTSAdmin extends BaseAdmin
             ->add('host')
             ->add('snmpCommunity')
             ->add('snmpVersion')
+            ->add('docsVersion')
             ->add('executeSnmp')
             ->add('_action', null, array(
                 'actions' => array(
@@ -50,6 +49,9 @@ class CMTSAdmin extends BaseAdmin
      */
     protected function configureFormFields(FormMapper $formMapper)
     {
+
+        $docsVersion = ['DOCS-QOS & DOCS-QOS 3' => 2,'DOCS-QOS' => 1,'DOCS-QOS 3' => 3];
+        $snmpVersion = ['SNMPv1' => 1,'SNMPv2' => 2,'SNMPv3' => 3];
         $formMapper
                 ->tab('cmts_form_general')
                     ->with('CMTS')
@@ -61,7 +63,8 @@ class CMTSAdmin extends BaseAdmin
                     ->with('CMTS')
                         ->add('host')
                         ->add('snmpCommunity')
-                        ->add('snmpVersion')
+                        ->add('snmpVersion', 'choice', array('required'=>true, 'choices' => $snmpVersion, 'data' => 2))
+                        ->add('docsVersion', 'choice', array('required'=>true, 'choices' => $docsVersion))
                     ->end()
                 ->end()
                 ->tab('stats')
@@ -84,6 +87,7 @@ class CMTSAdmin extends BaseAdmin
             ->add('host')
             ->add('snmpCommunity')
             ->add('snmpVersion')
+            ->add('docsVersion')
             ->add('executeSnmp')
         ;
     }

+ 28 - 0
src/CablemodemBundle/Entity/CMTS.php

@@ -66,6 +66,13 @@ class CMTS implements DeviceInterface, TenancyIdTraitInterface, SoftDeleteInterf
      * @ORM\Column(type="boolean", nullable=true, columnDefinition="BOOLEAN DEFAULT TRUE")
      */
     protected $executeSnmp = true;
+
+    /**
+     * @ORM\Column(type="integer")
+     * 
+     * @Assert\NotNull
+     */
+    protected $docsVersion;
     
     /**
      * @ORM\ManyToOne(targetEntity="CMTSModel", fetch="EXTRA_LAZY")
@@ -232,6 +239,7 @@ class CMTS implements DeviceInterface, TenancyIdTraitInterface, SoftDeleteInterf
             'modelId' => $this->model ? $this->model->getId() : null,
             'snmpCommunity' => $this->snmpCommunity,
             'snmpVersion' => $this->snmpVersion,
+            'docsVersion' => $this->docsVersion,
             'executeSnmp' => $this->executeSnmp,
         ];
         
@@ -292,4 +300,24 @@ class CMTS implements DeviceInterface, TenancyIdTraitInterface, SoftDeleteInterf
         return $this->timeCmtsOctets;
     }
 
+    /**
+     * @return int
+     */
+    public function getDocsVersion()
+    {
+        return $this->docsVersion;
+    }
+
+    /**
+     * @param int $docsVersion
+     * 
+     * @return $this
+     */
+    public function setDocsVersion($docsVersion)
+    {
+        $this->docsVersion = $docsVersion;
+        
+        return $this;
+    }
+
 }

+ 1 - 1
src/CablemodemBundle/Form/CMTSType.php

@@ -13,7 +13,7 @@ class CMTSType extends AbstractType
      */
     public function buildForm(FormBuilderInterface $builder, array $options)
     {
-        $builder->add('name')->add('host')->add('snmpCommunity')->add('snmpVersion')->add('executeSnmp')->add('extraData')->add('tenancyId')->add('model')->add('timeScan')->add('timeCmtsOctets');
+        $builder->add('name')->add('host')->add('snmpCommunity')->add('snmpVersion')->add('executeSnmp')->add('extraData')->add('tenancyId')->add('model')->add('timeScan')->add('timeCmtsOctets')->add('docsVersion');
     }
     
     /**

+ 4 - 0
src/CablemodemBundle/Resources/translations/CablemodemBundle.es.yml

@@ -37,6 +37,7 @@ filter:
     label_profile: Perfil
     label_mark: Marca
     label_library: Librería
+    label_docs_version: Versión DOCSIS
 form:
     label_name: Nombre
     label_parent: Padre
@@ -65,6 +66,7 @@ form:
     label_library: Librería
     label_time_scan: Escanear CMs e Interfaces
     label_time_cmts_octets: Tráfico de CMTS y CMs
+    label_docs_version: Versión DOCSIS
 list:
     label_id: Id
     label_name: Nombre
@@ -93,6 +95,7 @@ list:
     label_profile: Perfil
     label_mark: Marca
     label_library: Librería
+    label_docs_version: Versión DOCSIS
 show:
     label_id: Id
     label_name: Nombre
@@ -121,3 +124,4 @@ show:
     label_extra_data: Extra Data
     label_mark: Marca
     label_library: Librería
+    label_docs_version: Versión DOCSIS