Explorar o código

api#17 onuProfile enabled for ZTE in API. Related to ftth#55

Guillermo Espinoza %!s(int64=5) %!d(string=hai) anos
pai
achega
5f1ececb8e
Modificáronse 1 ficheiros con 10 adicións e 1 borrados
  1. 10 1
      src/FTTHBundle/Form/ONUType.php

+ 10 - 1
src/FTTHBundle/Form/ONUType.php

@@ -125,7 +125,16 @@ class ONUType extends AbstractType
                 $form->remove('trafficProfileOut');
                 $form->remove('trafficProfileIn');
                 $form->remove('vlanProfile');
-                $form->remove('onuProfile');
+
+                // checking if the OLT is ZTE
+                // and removing onuProfile field if it's not
+                $olt = $onu->getOlt();
+                if ($olt && $olt->getModel()) {
+                    $oltModel = $olt->getModel();
+                    if (strpos($oltModel->getName(), 'ZTE') === false) {
+                        $form->remove('onuProfile');
+                    }
+                }
             }
         });
     }