瀏覽代碼

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

Guillermo Espinoza 5 年之前
父節點
當前提交
5f1ececb8e
共有 1 個文件被更改,包括 10 次插入1 次删除
  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');
+                    }
+                }
             }
         });
     }