|
@@ -116,6 +116,13 @@ class ONUAdmin extends WorkflowBaseAdmin
|
|
|
protected function configureFormFields(FormMapper $formMapper)
|
|
|
{
|
|
|
$subject = $this->getSubject();
|
|
|
+ $id = $subject->getId();
|
|
|
+ $disabled = is_null($id) ? false : 'disabled';
|
|
|
+ $flashbag = $this->get('session')->getFlashBag();
|
|
|
+ if ($id) {
|
|
|
+ $flashbag->add('warning', $this->trans('warning.disabled.fields'));
|
|
|
+ }
|
|
|
+
|
|
|
$em = $this->get("doctrine.orm.entity_manager");
|
|
|
|
|
|
// busco el ONU template si se pasa como parámetro
|
|
@@ -143,7 +150,7 @@ class ONUAdmin extends WorkflowBaseAdmin
|
|
|
];
|
|
|
|
|
|
// Editando la ONU o hay template base o pasado como parámetro
|
|
|
- if ($subject->getId() || $template) {
|
|
|
+ if ($id || $template) {
|
|
|
$olt = $subject->getOlt();
|
|
|
|
|
|
// Según el modelo de OLT se muestran algunos campos específicos
|
|
@@ -162,7 +169,6 @@ class ONUAdmin extends WorkflowBaseAdmin
|
|
|
}
|
|
|
|
|
|
if ($template && $this->isCurrentRoute('create')) {
|
|
|
- $flashbag = $this->get('session')->getFlashBag();
|
|
|
$flashbag->add("warning", $this->trans("msg_use_template_onu_in_create_onu_ftth"));
|
|
|
}
|
|
|
|
|
@@ -185,7 +191,8 @@ class ONUAdmin extends WorkflowBaseAdmin
|
|
|
->add('clientId')
|
|
|
->add('ponSerialNumber', null, array(
|
|
|
'attr' => array(
|
|
|
- 'style' => 'text-transform: uppercase;'
|
|
|
+ 'style' => 'text-transform: uppercase;',
|
|
|
+ 'disabled' => $disabled,
|
|
|
)));
|
|
|
if ($this->hasParameter('show.onu.activationCode') && $this->getParameter('show.onu.activationCode') == true) {
|
|
|
$formMapper->add('activationCode');
|
|
@@ -210,8 +217,15 @@ class ONUAdmin extends WorkflowBaseAdmin
|
|
|
return $value->getOlt()->getName();
|
|
|
}
|
|
|
},
|
|
|
- ))
|
|
|
- ->add('model')
|
|
|
+ 'attr' => [
|
|
|
+ 'disabled' => $disabled,
|
|
|
+ ],
|
|
|
+ ))
|
|
|
+ ->add('model', null, [
|
|
|
+ 'attr' => [
|
|
|
+ 'disabled' => $disabled,
|
|
|
+ ],
|
|
|
+ ])
|
|
|
->add('comments')
|
|
|
->end()
|
|
|
->end()
|
|
@@ -227,15 +241,29 @@ class ONUAdmin extends WorkflowBaseAdmin
|
|
|
'style' => 'text-transform: uppercase;',
|
|
|
'readonly' => 'readonly'
|
|
|
)))
|
|
|
- ->add('olt','hidden', array('attr' => array("hidden" => true)))
|
|
|
- ->add('position')
|
|
|
+ ->add('olt','hidden', array(
|
|
|
+ 'attr' => array(
|
|
|
+ "hidden" => true
|
|
|
+ )))
|
|
|
+ ->add('position', null, [
|
|
|
+ 'attr' => [
|
|
|
+ 'disabled' => $disabled,
|
|
|
+ ],
|
|
|
+ ])
|
|
|
->add('ip')
|
|
|
- ->add('mac')
|
|
|
+ ->add('mac', null, [
|
|
|
+ 'attr' => [
|
|
|
+ 'disabled' => $disabled,
|
|
|
+ ],
|
|
|
+ ])
|
|
|
->add('radiusAuth', 'choice', [
|
|
|
'choices' => [
|
|
|
'Pon Serial Number' => 'psn',
|
|
|
'MAC Address' => 'mac'
|
|
|
- ]
|
|
|
+ ],
|
|
|
+ 'attr' => [
|
|
|
+ 'disabled' => $disabled,
|
|
|
+ ],
|
|
|
])
|
|
|
->end()
|
|
|
->with('Huawei', ['class' => "col-md-12 {$hidden['Huawei']} olt_mark Huawei"])
|
|
@@ -245,10 +273,17 @@ class ONUAdmin extends WorkflowBaseAdmin
|
|
|
'allow_delete' => true,
|
|
|
'required' => false,
|
|
|
'by_reference' => false,
|
|
|
+ 'attr' => [
|
|
|
+ 'disabled' => $disabled,
|
|
|
+ ],
|
|
|
))
|
|
|
->end()
|
|
|
->with('ZTE', ['class' => "col-md-12 {$hidden['ZTE']} olt_mark ZTE"])
|
|
|
- ->add('vlan')
|
|
|
+ ->add('vlan', null, [
|
|
|
+ 'attr' => [
|
|
|
+ 'disabled' => $disabled,
|
|
|
+ ],
|
|
|
+ ])
|
|
|
->add('vlanProfile', null, $optionsZTEV4)
|
|
|
->add('onuProfile', null, $optionsZTEV4)
|
|
|
->add('trafficProfileIn')
|