Explorar o código

Se añade posibilidad de leer servicio de tr069 desde el modelo de la ONU.

Maxi Schvindt %!s(int64=7) %!d(string=hai) anos
pai
achega
f6ae80eea9
Modificáronse 1 ficheiros con 12 adicións e 1 borrados
  1. 12 1
      src/FTTHBundle/Admin/ONUAdmin.php

+ 12 - 1
src/FTTHBundle/Admin/ONUAdmin.php

@@ -112,9 +112,12 @@ class ONUAdmin extends WorkflowBaseAdmin
         if($this->isCurrentRoute('edit')) {
         if($this->isCurrentRoute('edit')) {
 
 
             if($this->getParameter('tr069_service')) {
             if($this->getParameter('tr069_service')) {
+                $object = $this->getSubject();
                 $serviceName = $this->getParameter('tr069_api');
                 $serviceName = $this->getParameter('tr069_api');
+                if($model = $object->getModel()) {
+                    if($model->getData('tr069_api')) $serviceName = $model->getData('tr069_api');
+                }
                 $tr069 = $this->get($serviceName);
                 $tr069 = $this->get($serviceName);
-                $object = $this->getSubject();
                 
                 
                 $query = array('$or' => array());
                 $query = array('$or' => array());
                 if($object->getSerialNumber()) {
                 if($object->getSerialNumber()) {
@@ -260,7 +263,12 @@ class ONUAdmin extends WorkflowBaseAdmin
             ->end();
             ->end();
 
 
         if($this->getParameter('tr069_service')) {
         if($this->getParameter('tr069_service')) {
+            $object = $this->getSubject();
             $serviceName = $this->getParameter('tr069_api');
             $serviceName = $this->getParameter('tr069_api');
+            if($model = $object->getModel()) {
+                if($model->getData('tr069_api')) $serviceName = $model->getData('tr069_api');
+            }
+            
             $tr069 = $this->get($serviceName);
             $tr069 = $this->get($serviceName);
             $object = $this->getSubject();
             $object = $this->getSubject();
                 
                 
@@ -376,6 +384,9 @@ class ONUAdmin extends WorkflowBaseAdmin
             $status = ($this->getForm()->get('tr069_status')->getData()) ?? null;
             $status = ($this->getForm()->get('tr069_status')->getData()) ?? null;
 
 
             $serviceName = $this->getParameter('tr069_api');
             $serviceName = $this->getParameter('tr069_api');
+            if($model = $onu->getModel()) {
+                if($model->getData('tr069_api')) $serviceName = $model->getData('tr069_api');
+            }
             $tr069 = $this->get($serviceName);
             $tr069 = $this->get($serviceName);
 
 
             if(!is_null($catv)) $aux = $tr069->setCATV($id, $catv);
             if(!is_null($catv)) $aux = $tr069->setCATV($id, $catv);