浏览代码

readonly form fields in edition onu. Related to https://gitlab.com/interlink-sa/flowdat3/modules/ftth/issues/33

Guillermo Espinoza 6 年之前
父节点
当前提交
6175b5bc63
共有 2 个文件被更改,包括 25 次插入3 次删除
  1. 19 3
      src/FTTHBundle/Admin/ONUAdmin.php
  2. 6 0
      src/FTTHBundle/Form/ONUType.php

+ 19 - 3
src/FTTHBundle/Admin/ONUAdmin.php

@@ -146,6 +146,7 @@ class ONUAdmin extends WorkflowBaseAdmin
             ],
             ],
             'attr' => [
             'attr' => [
                 'class' => 'zte_v4 hidden',
                 'class' => 'zte_v4 hidden',
+                'readonly' => $readonly,
             ],
             ],
         ];
         ];
 
 
@@ -286,15 +287,30 @@ class ONUAdmin extends WorkflowBaseAdmin
                     ])
                     ])
                     ->add('vlanProfile', null, $optionsZTEV4)
                     ->add('vlanProfile', null, $optionsZTEV4)
                     ->add('onuProfile', null, $optionsZTEV4)
                     ->add('onuProfile', null, $optionsZTEV4)
-                    ->add('trafficProfileIn')
-                    ->add('trafficProfileOut')
-                    ->add('tcontprofile')
+                    ->add('trafficProfileIn', null, [
+                        'attr' => [
+                            'readonly' => $readonly,
+                        ],
+                    ])
+                    ->add('trafficProfileOut', null, [
+                        'attr' => [
+                            'readonly' => $readonly,
+                        ],
+                    ])
+                    ->add('tcontprofile', null, [
+                        'attr' => [
+                            'readonly' => $readonly,
+                        ],
+                    ])
                     ->add('catv')
                     ->add('catv')
                 ->end()
                 ->end()
                 ->with("FiberLink | FiberHome", ['class' => "col-md-12 olt_mark FiberLink FiberHome"])
                 ->with("FiberLink | FiberHome", ['class' => "col-md-12 olt_mark FiberLink FiberHome"])
                     ->add('vlans', null, array(
                     ->add('vlans', null, array(
                         'required' => false,
                         'required' => false,
                         'multiple' => true,
                         'multiple' => true,
+                        'attr' => [
+                            'readonly' => $readonly,
+                        ],
                     ))
                     ))
                 ->end()
                 ->end()
                 ->with('Extra')
                 ->with('Extra')

+ 6 - 0
src/FTTHBundle/Form/ONUType.php

@@ -120,6 +120,12 @@ class ONUType extends AbstractType
                 $form->remove('model');
                 $form->remove('model');
                 $form->remove('position');
                 $form->remove('position');
                 $form->remove('vlan');
                 $form->remove('vlan');
+                $form->remove('vlans');
+                $form->remove('tcontprofile');
+                $form->remove('trafficProfileOut');
+                $form->remove('trafficProfileIn');
+                $form->remove('vlanProfile');
+                $form->remove('onuProfile');
             }
             }
         });
         });
     }
     }