|
@@ -108,6 +108,9 @@ class CablemodemAdmin extends WorkflowBaseAdmin
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * Agrega en la vista show de Cablemodem un tab DHCP mostrando
|
|
|
+ * Host Cablemodem, CPE y MTA si tiene asociado
|
|
|
+ *
|
|
|
* @param ShowMapper $showMapper
|
|
|
*/
|
|
|
protected function addDHCPTab(ShowMapper $showMapper)
|
|
@@ -117,14 +120,39 @@ class CablemodemAdmin extends WorkflowBaseAdmin
|
|
|
->end()
|
|
|
->end();
|
|
|
}
|
|
|
+ $template = 'CablemodemBundle:CRUD:host_show_field.html.twig';
|
|
|
+
|
|
|
+ $types = [
|
|
|
+ 'Mta',
|
|
|
+ 'Cpe',
|
|
|
+ ];
|
|
|
+
|
|
|
$showMapper
|
|
|
->tab('DHCP')
|
|
|
->with('Host')
|
|
|
- ->add('host', null, array(
|
|
|
- 'template' => 'CablemodemBundle:CRUD:host_show_field.html.twig',
|
|
|
- ))
|
|
|
- ->end()
|
|
|
+ ->add('host', null, [
|
|
|
+ 'template' => $template,
|
|
|
+ ])
|
|
|
->end();
|
|
|
+
|
|
|
+ foreach ($types as $type) {
|
|
|
+ $method = "get{$type}FixedIp";
|
|
|
+ if ($this->getSubject()->$method()) {
|
|
|
+ $showMapper
|
|
|
+ ->with($type)
|
|
|
+ ->add($type, null, [
|
|
|
+ 'template' => $template,
|
|
|
+ 'data' => [
|
|
|
+ 'hostType' => [
|
|
|
+ $type => $this->get('cablemodem.host_service')->getIdHostType(strtoupper($type)),
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ ])
|
|
|
+ ->end();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ $showMapper->end();
|
|
|
}
|
|
|
|
|
|
}
|