浏览代码

Created the template to use voip

Jean Sumara 5 年之前
父节点
当前提交
5e4a926bff

文件差异内容过多而无法显示
+ 2 - 2
app/DoctrineMigrations/src/action.yml


+ 21 - 2
src/FTTHBundle/Admin/ONUAdmin.php

@@ -106,6 +106,7 @@ class ONUAdmin extends WorkflowBaseAdmin
                 'template' => 'WorkflowBundle:Workflow:base_list_field_current_state.html.twig'
             ))
             ->add('catv')
+            ->add('voip')
             ->add('created')
             ->add('logOLT.status', 'string', array(
                 'template' => 'FTTHBundle:Type:list_status_field_type.html.twig'))
@@ -305,6 +306,7 @@ class ONUAdmin extends WorkflowBaseAdmin
                         ],
                     ])
                     ->add('catv')
+                    ->add('voip')
                 ->end()
                 ->with('Huawei', ['class' => "col-md-12 {$hidden['Huawei']} olt_mark Huawei"])
                     ->add('servicePorts', CollectionType::class, array(
@@ -357,7 +359,8 @@ class ONUAdmin extends WorkflowBaseAdmin
                 'servicePorts' => $this->trans("helps.service_port"),
                 'mac' => $this->trans("helps.mac"),
                 'radiusAuth' => $this->trans("helps.radiusAuth"),
-                'catv' => $this->trans("helps.catv")
+                'catv' => $this->trans("helps.catv"),
+                'voip' => $this->trans("helps.voip")
             ));
 
 
@@ -404,6 +407,7 @@ class ONUAdmin extends WorkflowBaseAdmin
                     $status = $tr069Data['Status']['_value'] ?? null;
 
                     $catv = $tr069Data['CatvPower']['_value'] ?? null;
+                    $voip = $tr069Data['Voip']['_value'] ?? null;
 
                     $ip = $tr069Data['ExternalIPAddress']['_value'] ?? null;
 
@@ -426,6 +430,9 @@ class ONUAdmin extends WorkflowBaseAdmin
                             ->with('CATV',['description' => $this->trans('helps.tr069_catv')])
                                 ->add('tr069_catv', CheckboxType::class, array('mapped' => false, 'data' => $catv, 'required' => false))
                             ->end()
+                            ->with('VOIP',['description' => $this->trans('helps.tr069_voip')])
+                                ->add('tr069_voip', CheckboxType::class, array('mapped' => false, 'data' => $voip, 'required' => false))
+                            ->end()
                         ->end();
 
                     $tr069Data = 1;
@@ -551,6 +558,7 @@ class ONUAdmin extends WorkflowBaseAdmin
                     ->add('trafficProfileIn')
                     ->add('trafficProfileOut')
                     ->add('catv')
+                    ->add('voip')
                     ;
 
                     // Consulto en stats la url del detalle de onu
@@ -646,6 +654,7 @@ class ONUAdmin extends WorkflowBaseAdmin
                 $status = $tr069Data['Status']['_value'] ?? null;
 
                 $catv = $tr069Data['CatvPower']['_value'] ?? null;
+                $voip = $tr069Data['Voip']['_value'] ?? null;
 
                 $showMapper
                     ->tab('TR069')
@@ -666,6 +675,9 @@ class ONUAdmin extends WorkflowBaseAdmin
                         ->with('CATV',['description' => $this->trans('helps.tr069_catv')])
                             ->add('tr069_catv', null, array('template' => 'FTTHBundle:ONU:base_show_boolean.html.twig', 'boolean' => $catv))
                         ->end()
+                        ->with('VoIP',['description' => $this->trans('helps.tr069_voip')])
+                            ->add('tr069_voip', null, array('template' => 'FTTHBundle:ONU:base_show_boolean.html.twig', 'boolean' => $voip))
+                        ->end()
                     ->end();
             } else {
                 $showMapper
@@ -720,8 +732,9 @@ class ONUAdmin extends WorkflowBaseAdmin
         if((boolean) $this->getForm()->get('tr069_exist')->getData()) {
             $ssid = ($this->getForm()->get('tr069_ssid')->getData()) ?? null;
             $pass = ($this->getForm()->get('tr069_pass')->getData()) ?? null;
-            $id = ($this->getForm()->get('tr069_id')->getData()) ?? null;;
+            $id = ($this->getForm()->get('tr069_id')->getData()) ?? null;
             $catv = ($this->getForm()->get('tr069_catv')->getData()) ?? null;
+            $voip = ($this->getForm()->get('tr069_voip')->getData()) ?? null;
             $broadcast = ($this->getForm()->get('tr069_broadcast')->getData()) ?? null;
             $status = ($this->getForm()->get('tr069_status')->getData()) ?? null;
 
@@ -732,6 +745,7 @@ class ONUAdmin extends WorkflowBaseAdmin
             $tr069 = $this->get($serviceName);
 
             if(!is_null($catv)) $aux = $tr069->setCATV($id, $catv);
+            if(!is_null($voip)) $aux = $tr069->setVoIP($id, $voip);
 
             if($ssid) $aux = $tr069->setWlan($id, $ssid, $pass);
 
@@ -798,6 +812,10 @@ class ONUAdmin extends WorkflowBaseAdmin
         if($catv = $template->getCatv()) {
             $form->add('catv', null, array('data' => $catv));
         }
+        
+        if($voip = $template->getVoIP()) {
+            $form->add('voip', null, array('data' => $voip));
+        }
 
         if($vlans = $template->getVlans()) {
             $form->add('vlans', null, array('data' => $vlans));
@@ -827,6 +845,7 @@ class ONUAdmin extends WorkflowBaseAdmin
         $fields[$this->trans('export.link')] = "link";
         $fields[$this->trans('export.position')] = "position";
         $fields[$this->trans('export.catv')] = "catv";
+        $fields[$this->trans('export.voip')] = "voip";
         $fields[$this->trans('export.activationCode')] = "activationCode";
         $fields[$this->trans('export.created')] = "created";
         $fields[$this->trans('export.updated')] = "updated";

+ 1 - 0
src/FTTHBundle/Admin/ONUTemplateAdmin.php

@@ -80,6 +80,7 @@ class ONUTemplateAdmin extends BaseAdmin
                     ->add('trafficProfileOut')
                     ->add('tcontprofile')
                     ->add('catv')
+                    ->add('voip')
                 ->end()
                 ->with('Extra')
                     ->add('extraData')

+ 26 - 0
src/FTTHBundle/Entity/ONU.php

@@ -261,6 +261,12 @@ class ONU implements DeviceInterface, TenancyIdTraitInterface, LocationInterface
      */
     protected $catv = false;
 
+
+    /**
+     * @ORM\Column(type="boolean", nullable=true, options={"default": false})
+     */
+    protected $voip = false;
+
     /**
      * @ORM\Column(type="text", nullable=true)
      */
@@ -971,6 +977,26 @@ class ONU implements DeviceInterface, TenancyIdTraitInterface, LocationInterface
         return $this;
     }
 
+    /**
+     * @return boolean
+     */
+    public function getVoIP()
+    {
+        return $this->voip;
+    }
+
+    /**
+     * @param boolean $voip
+     *
+     * @return ONU
+     */
+    public function setVoIP($voip)
+    {
+        $this->voip = $voip;
+
+        return $this;
+    }
+
     /**
      * @return string
      */

+ 27 - 0
src/FTTHBundle/Entity/ONUTemplate.php

@@ -127,6 +127,11 @@ class ONUTemplate implements TenancyIdTraitInterface
      */
     protected $catv = true;
 
+    /**
+     * @ORM\Column(type="boolean", nullable=true, columnDefinition="BOOLEAN DEFAULT TRUE")
+     */
+    protected $voip = true;
+
     /**
      * Constructor
      */
@@ -527,4 +532,26 @@ class ONUTemplate implements TenancyIdTraitInterface
         return $this->catv;
     }
 
+    /**
+     * Set voip
+     *
+     * @param boolean $e
+     * @return ONUTemplate
+     */
+    public function setVoIP($e)
+    {
+        $this->voip = $e;
+        return $this;
+    }
+
+    /**
+     * Get voip
+     *
+     * @return boolean
+     */
+    public function getVoIP()
+    {
+        return $this->voip;
+    }
+
 }

+ 5 - 0
src/FTTHBundle/Resources/translations/FTTHBundle.es.yml

@@ -158,6 +158,7 @@ form:
     label_capacity: Capacidad
     label_routing_mode: Modalidad de ruteo
     label_catv: CATV
+    label_voip: VoIP
     label_wifi: Wifi
     label_value: Valor
     label_vlan: VLAN ID
@@ -230,6 +231,7 @@ list:
     label_capacity: Capacidad
     label_routing_mode: Modalidad de ruteo
     label_catv: CATV
+    label_voip: VoIP
     label_wifi: Wifi
     label_value: Valor
     label_used_by_default: Default
@@ -309,6 +311,7 @@ show:
     label_capacity: Capacidad
     label_routing_mode: Modalidad de ruteo
     label_catv: CATV
+    label_voip: VoIP
     label_wifi: Wifi
     label_value: Valor
     label_used_by_default: Default
@@ -345,6 +348,7 @@ export:
     link: LINK
     position: Position
     catv: CATV
+    voip: VoIP
     activationCode: Código de Activación
     created: Creada
     updated: Actualizada
@@ -368,6 +372,7 @@ helps:
     profile_download: Expresado en bits
     profile_template: Template a utilizar para gestión de radius
     catv: Utilizado para habilitar/deshabilitar CATV en la ONU conectada a OLT ZTE o Huawei (algunos modelos).
+    voip: Utilizado para habilitar/deshabilitar VoIP en la ONU.
 error:
     address_not_found: La dirección "%client_address%" no fue encontrada en los servicios de google.
     nap_relation_olt_not_found: No se encontró la relación entre el nap y la olt.