filter = Filter::fromQueryString(str_replace( 'downtime_id', 'downtime_internal_id', (string)$this->params )); $this->downtimes = $this->backend->select()->from('downtime', array( 'id' => 'downtime_internal_id', 'objecttype' => 'downtime_objecttype', 'comment' => 'downtime_comment', 'author_name' => 'downtime_author_name', 'start' => 'downtime_start', 'scheduled_start' => 'downtime_scheduled_start', 'scheduled_end' => 'downtime_scheduled_end', 'end' => 'downtime_end', 'duration' => 'downtime_duration', 'is_flexible' => 'downtime_is_flexible', 'is_fixed' => 'downtime_is_fixed', 'is_in_effect' => 'downtime_is_in_effect', 'entry_time' => 'downtime_entry_time', 'host_state' => 'downtime_host_state', 'service_state' => 'downtime_service_state', 'host_name', 'host', 'service', 'service_description', 'host_display_name', 'service_display_name' ))->addFilter($this->filter)->getQuery()->fetchAll(); $this->getTabs() ->add( 'downtimes', array( 'title' => $this->translate( 'Display detailed information about multiple downtimes.' ), 'icon' => 'plug', 'label' => $this->translate('Downtimes'), 'url' =>'monitoring/downtimes/show' ) )->activate('downtimes')->extend(new DashboardAction()); } public function showAction() { if (false === $this->downtimes) { return; } $this->view->downtimes = $this->downtimes; $this->view->isService = $this->isService; // $this->view->delDowntimeForm = $this->createDelDowntimeForm(); $this->view->listAllLink = Url::fromPath('monitoring/list/downtimes') ->setQueryString($this->filter->toQueryString()); $this->view->removeAllLink = Url::fromPath('monitoring/downtimes/removeAll') ->setParams($this->params); } public function removeAllAction() { } private function createDelDowntimeForm() { $delDowntimeForm = new DeleteDowntimeCommandForm(); $delDowntimeForm->setObjects($this->downtimes); $delDowntimeForm->populate( array( 'downtime_id' => $this->downtime->id, 'redirect' => Url::fromPath('monitoring/list/downtimes') ) ); if (! $this->isService) { $delDowntimeForm->setAction( $this->view->url('monitoring/host/delete-downtime', array('host' => $this->downtime->host_name)) ); } else { $delDowntimeForm->setAction( $this->view->url('monitoring/service/delete-downtime', array( 'host' => $this->downtime->host_name, 'service' => $this->downtime->service_description )) ); } return $delDowntimeForm; } }