|
@@ -108,10 +108,21 @@ class OnuAdmin extends BaseAdmin
|
|
|
*/
|
|
|
public function configureActionButtons($action, $object = null)
|
|
|
{
|
|
|
+
|
|
|
$actions = parent::configureActionButtons($action, $object);
|
|
|
- $actions['show_in_map'] = array(
|
|
|
- 'template' => 'StatsBundle:Onu:map_button.html.twig',
|
|
|
- );
|
|
|
+ if($action == "list") {
|
|
|
+ $actions['show_in_map'] = array('template' => 'StatsBundle:Onu:map_button.html.twig');
|
|
|
+ } elseif($action == "show") {
|
|
|
+ $deviceServer = $object->getDeviceServer();
|
|
|
+ $urls = $this->get('webservice')->getData($deviceServer->getUrl());
|
|
|
+ if(isset($urls['url_ftth'])) {
|
|
|
+ $deviceId = $object->getDeviceId();
|
|
|
+ $url = "{$urls['url_ftth']}/admin/ftth/onu/{$deviceId}/show";
|
|
|
+ $this->parameters = array('url_ftth' => $url);
|
|
|
+ $actions['show_in_ftth'] = array('template' => 'StatsBundle:Onu:ftth_button.html.twig');
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
return $actions;
|
|
|
}
|