public function showAction()
 {
     $this->setAutorefreshInterval(15);
     $checkNowForm = new CheckNowCommandForm();
     $checkNowForm->setObjects($this->serviceList)->handleRequest();
     $this->view->checkNowForm = $checkNowForm;
     $this->serviceList->setColumns(array('host_icon_image', 'host_icon_image_alt', 'host_name', 'host_address', 'host_output', 'host_state', 'host_problem', 'host_handled', 'service_icon_image', 'service_icon_image_alt', 'service_output', 'service_description', 'service_state', 'service_problem', 'service_handled', 'service_acknowledged', 'service_in_downtime', 'service_is_flapping', 'service_notifications_enabled', 'service_active_checks_enabled', 'service_passive_checks_enabled'));
     $acknowledgedObjects = $this->serviceList->getAcknowledgedObjects();
     if (!empty($acknowledgedObjects)) {
         $removeAckForm = new RemoveAcknowledgementCommandForm();
         $removeAckForm->setObjects($acknowledgedObjects)->handleRequest();
         $this->view->removeAckForm = $removeAckForm;
     }
     $this->setAutorefreshInterval(15);
     $this->view->rescheduleAllLink = Url::fromRequest()->setPath('monitoring/services/reschedule-check');
     $this->view->downtimeAllLink = Url::fromRequest()->setPath('monitoring/services/schedule-downtime');
     $this->view->processCheckResultAllLink = Url::fromRequest()->setPath('monitoring/services/process-check-result');
     $this->view->addCommentLink = Url::fromRequest()->setPath('monitoring/services/add-comment');
     $this->view->deleteCommentLink = Url::fromRequest()->setPath('monitoring/services/delete-comment');
     $this->view->stats = $this->serviceList->getServiceStateSummary();
     $this->view->objects = $this->serviceList;
     $this->view->unhandledObjects = $this->serviceList->getUnhandledObjects();
     $this->view->problemObjects = $this->serviceList->getProblemObjects();
     $this->view->downtimeUnhandledLink = Url::fromPath('monitoring/services/schedule-downtime')->setQueryString($this->serviceList->getUnhandledObjects()->objectsFilter()->toQueryString());
     $this->view->downtimeLink = Url::fromPath('monitoring/services/schedule-downtime')->setQueryString($this->serviceList->getProblemObjects()->objectsFilter()->toQueryString());
     $this->view->acknowledgedObjects = $acknowledgedObjects;
     $this->view->acknowledgeLink = Url::fromPath('monitoring/services/acknowledge-problem')->setQueryString($this->serviceList->getUnacknowledgedObjects()->objectsFilter()->toQueryString());
     $this->view->unacknowledgedObjects = $this->serviceList->getUnacknowledgedObjects();
     $this->view->objectsInDowntime = $this->serviceList->getObjectsInDowntime();
     $this->view->inDowntimeLink = Url::fromPath('monitoring/list/services')->setQueryString($this->serviceList->getObjectsInDowntime()->objectsFilter(array('host' => 'host_name', 'service' => 'service_description'))->toQueryString());
     $this->view->showDowntimesLink = Url::fromPath('monitoring/downtimes/show')->setQueryString($this->serviceList->getObjectsInDowntime()->objectsFilter()->toQueryString());
     $this->view->commentsLink = Url::fromRequest()->setPath('monitoring/list/comments');
     $this->view->sendCustomNotificationLink = Url::fromRequest()->setPath('monitoring/services/send-custom-notification');
 }
 public function showAction()
 {
     $this->setAutorefreshInterval(15);
     $checkNowForm = new CheckNowCommandForm();
     $checkNowForm->setObjects($this->hostList)->handleRequest();
     $this->view->checkNowForm = $checkNowForm;
     $this->hostList->setColumns(array('host_acknowledged', 'host_active_checks_enabled', 'host_display_name', 'host_handled', 'host_in_downtime', 'host_is_flapping', 'host_last_state_change', 'host_name', 'host_notifications_enabled', 'host_passive_checks_enabled', 'host_problem', 'host_state'));
     $acknowledgedObjects = $this->hostList->getAcknowledgedObjects();
     if (!empty($acknowledgedObjects)) {
         $removeAckForm = new RemoveAcknowledgementCommandForm();
         $removeAckForm->setObjects($acknowledgedObjects)->handleRequest();
         $this->view->removeAckForm = $removeAckForm;
     }
     $hostStates = $this->hostList->getStateSummary();
     $this->setAutorefreshInterval(15);
     $this->view->rescheduleAllLink = Url::fromRequest()->setPath('monitoring/hosts/reschedule-check');
     $this->view->downtimeAllLink = Url::fromRequest()->setPath('monitoring/hosts/schedule-downtime');
     $this->view->processCheckResultAllLink = Url::fromRequest()->setPath('monitoring/hosts/process-check-result');
     $this->view->addCommentLink = Url::fromRequest()->setPath('monitoring/hosts/add-comment');
     $this->view->stats = $hostStates;
     $this->view->objects = $this->hostList;
     $this->view->unhandledObjects = $this->hostList->getUnhandledObjects();
     $this->view->problemObjects = $this->hostList->getProblemObjects();
     $this->view->acknowledgeUnhandledLink = Url::fromPath('monitoring/hosts/acknowledge-problem')->setQueryString($this->hostList->getUnhandledObjects()->objectsFilter()->toQueryString());
     $this->view->downtimeUnhandledLink = Url::fromPath('monitoring/hosts/schedule-downtime')->setQueryString($this->hostList->getUnhandledObjects()->objectsFilter()->toQueryString());
     $this->view->downtimeLink = Url::fromPath('monitoring/hosts/schedule-downtime')->setQueryString($this->hostList->getProblemObjects()->objectsFilter()->toQueryString());
     $this->view->acknowledgedObjects = $this->hostList->getAcknowledgedObjects();
     $this->view->acknowledgeLink = Url::fromPath('monitoring/hosts/acknowledge-problem')->setQueryString($this->hostList->getUnacknowledgedObjects()->objectsFilter()->toQueryString());
     $this->view->unacknowledgedObjects = $this->hostList->getUnacknowledgedObjects();
     $this->view->objectsInDowntime = $this->hostList->getObjectsInDowntime();
     $this->view->inDowntimeLink = Url::fromPath('monitoring/list/hosts')->setQueryString($this->hostList->getObjectsInDowntime()->objectsFilter()->toQueryString());
     $this->view->showDowntimesLink = Url::fromPath('monitoring/list/downtimes')->setQueryString($this->hostList->objectsFilter()->andFilter(FilterEqual::where('object_type', 'host'))->toQueryString());
     $this->view->commentsLink = Url::fromRequest()->setPath('monitoring/list/comments');
     $this->view->sendCustomNotificationLink = Url::fromRequest()->setPath('monitoring/hosts/send-custom-notification');
 }
 /**
  * Creates a menu item link element
  *
  * @param Menu $menu
  *
  * @return string
  */
 public function createLink(Menu $menu)
 {
     if ($menu->getIcon() && strpos($menu->getIcon(), '.') === false) {
         return sprintf('<a href="%s"%s><i aria-hidden="true" class="icon-%s"></i>%s</a>', $menu->getUrl() ?: '#', $this->getAttributes(), $menu->getIcon(), $this->getView()->escape($menu->getTitle()));
     }
     return sprintf('<a href="%s"%s>%s%s<span></span></a>', $menu->getUrl() ?: '#', $this->getAttributes(), $menu->getIcon() ? '<img aria-hidden="true" src="' . Url::fromPath($menu->getIcon()) . '" class="icon" /> ' : '', $this->getView()->escape($menu->getTitle()));
 }
 /**
  * {@inheritdoc}
  */
 public function isValid($value)
 {
     if (Url::fromPath($value)->isExternal()) {
         $this->_error('IS_EXTERNAL');
         return false;
     }
     return true;
 }
 /**
  * Create a command form to delete a single comment
  *
  * @return DeleteCommentsCommandForm
  */
 private function createDelCommentForm()
 {
     $this->assertPermission('monitoring/command/comment/delete');
     $delCommentForm = new DeleteCommentCommandForm();
     $delCommentForm->setAction(Url::fromPath('monitoring/comment/show')->setParam('comment_id', $this->comment->id));
     $delCommentForm->handleRequest();
     return $delCommentForm;
 }
 /**
  * Create a command form to delete a single comment
  *
  * @return DeleteDowntimeCommandForm
  */
 private function createDelDowntimeForm()
 {
     $this->assertPermission('monitoring/command/downtime/delete');
     $delDowntimeForm = new DeleteDowntimeCommandForm();
     $delDowntimeForm->setAction(Url::fromPath('monitoring/downtime/show')->setParam('downtime_id', $this->downtime->id));
     $delDowntimeForm->handleRequest();
     return $delDowntimeForm;
 }
 protected function getActionIcons($view)
 {
     $icons = array();
     if (!$this->bp->isLocked()) {
         $url = Url::fromPath('businessprocess/node/simulate', array('config' => $this->bp->getName(), 'node' => $this->name));
         $icons[] = $this->actionIcon($view, 'magic', $url, 'Simulation');
     }
     return $icons;
 }
Exemple #8
0
 /**
  * Set the redirect URL
  *
  * Unlike {@link setRedirect()} this method only sets a redirect URL on the response for later usage.
  * {@link prepare()} will take care of the correct redirect handling and HTTP headers on XHR and "normal" browser
  * requests.
  *
  * @param   string|Url $redirectUrl
  *
  * @return  $this
  */
 protected function setRedirectUrl($redirectUrl)
 {
     if (!$redirectUrl instanceof Url) {
         $redirectUrl = Url::fromPath((string) $redirectUrl);
     }
     $redirectUrl->getParams()->setSeparator('&');
     $this->redirectUrl = $redirectUrl;
     return $this;
 }
 public function getActionsForService(Service $service)
 {
     if ($service->check_command == "logstash_events") {
         // TODO: add icon when Icingaweb2 supports it
         // <i class="icon-doc-text"></i>
         return array(mt('logstash', 'Logstash events') => Url::fromPath('elasticsearch/event/list', array('host' => $service->getHost()->getName(), 'service' => $service->getName())));
     } else {
         return array();
     }
 }
Exemple #10
0
 /**
  * Create a new MenuRenderer
  *
  * @param   Menu    $menu   The menu to render
  * @param   string  $url    A relative url to identify "active" children with
  */
 public function __construct(Menu $menu, $url = null)
 {
     if ($url instanceof Url) {
         $this->url = $url;
     } else {
         $this->url = Url::fromPath($url);
     }
     $this->defaultRenderer = new MenuItemRenderer();
     parent::__construct(new PermittedMenuItemFilter($menu), RecursiveIteratorIterator::CHILD_FIRST);
 }
 /**
  * Display comment detail view
  */
 public function showAction()
 {
     $this->view->comment = $this->comment;
     if ($this->hasPermission('monitoring/command/comment/delete')) {
         $listUrl = Url::fromPath('monitoring/list/comments')->setQueryString('comment_type=(comment|ack)');
         $form = new DeleteCommentCommandForm();
         $form->populate(array('comment_id' => $this->comment->id, 'comment_is_service' => isset($this->comment->service_description), 'redirect' => $listUrl))->handleRequest();
         $this->view->delCommentForm = $form;
     }
 }
Exemple #12
0
 /**
  * {@inheritdoc}
  */
 public function getRedirectUrl()
 {
     $redirect = null;
     if ($this->created) {
         $redirect = $this->getElement('redirect')->getValue();
     }
     if (empty($redirect) || strpos($redirect, 'authentication/logout') !== 0) {
         $redirect = static::REDIRECT_URL;
     }
     return Url::fromPath($redirect);
 }
Exemple #13
0
 /**
  * {@inheritdoc}
  */
 public function getRedirectUrl()
 {
     $redirect = null;
     if ($this->created) {
         $redirect = $this->getElement('redirect')->getValue();
     }
     if (empty($redirect)) {
         $redirect = static::REDIRECT_URL;
     }
     return Url::fromPath($redirect);
 }
 /**
  * {@inheritdoc}
  */
 public function getValues($suppressArrayNotation = false)
 {
     $values = parent::getValues($suppressArrayNotation);
     if (isset($values['url']) && $values['url']) {
         $url = Url::fromPath($values['url']);
         if (!$url->isExternal() && ($relativePath = $url->getRelativeUrl())) {
             $values['url'] = $relativePath;
         }
     }
     return $values;
 }
 /**
  * Display the form for removing a downtime list
  */
 public function deleteAllAction()
 {
     $this->assertPermission('monitoring/command/downtime/delete');
     $this->view->downtimes = $this->downtimes;
     $this->view->listAllLink = Url::fromPath('monitoring/list/downtimes')->setQueryString($this->filter->toQueryString());
     $delDowntimeForm = new DeleteDowntimesCommandForm();
     $delDowntimeForm->setTitle($this->view->translate('Remove all Downtimes'));
     $delDowntimeForm->addDescription(sprintf($this->translate('Confirm removal of %d downtimes.'), $this->downtimes->count()));
     $delDowntimeForm->setRedirectUrl(Url::fromPath('monitoring/list/downtimes'));
     $delDowntimeForm->setDowntimes($this->downtimes->fetchAll())->handleRequest();
     $this->view->delAllDowntimeForm = $delDowntimeForm;
 }
 public function getActionsForService(Service $service)
 {
     $db = $this->db();
     if (!$db) {
         return array();
     }
     if (IcingaHost::exists($service->host_name, $db)) {
         return array('Inspect' => Url::fromPath('director/inspect/object', array('type' => 'service', 'plural' => 'services', 'name' => sprintf('%s!%s', $service->host_name, $service->service_description))));
     } else {
         return array();
     }
 }
 public function runAction()
 {
     $id = $this->params->get('id');
     $import = new Import(ImportSource::load($id, $this->db()));
     if ($runId = $import->run()) {
         Notification::success('Import succeeded');
         $this->redirectNow(Url::fromPath('director/importrun', array('id' => $runId)));
     } else {
         Notification::success('Import skipped, no changes detected');
         $this->redirectNow('director/list/importrun');
     }
 }
 /**
  * Display the form for removing a comment list
  */
 public function deleteAllAction()
 {
     $this->assertPermission('monitoring/command/comment/delete');
     $listCommentsLink = Url::fromPath('monitoring/list/comments')->setQueryString('comment_type=(comment|ack)');
     $delCommentForm = new DeleteCommentsCommandForm();
     $delCommentForm->setTitle($this->view->translate('Remove all Comments'));
     $delCommentForm->addDescription(sprintf($this->translate('Confirm removal of %d comments.'), count($this->comments)));
     $delCommentForm->setComments($this->comments)->setRedirectUrl($listCommentsLink)->handleRequest();
     $this->view->delCommentForm = $delCommentForm;
     $this->view->comments = $this->comments;
     $this->view->listAllLink = Url::fromPath('monitoring/list/comments')->setQueryString($this->filter->toQueryString());
 }
 public function getActionsForHost(Host $host)
 {
     $db = $this->db();
     if (!$db) {
         return array();
     }
     if (IcingaHost::exists($host->host_name, $db)) {
         return array('Modify' => Url::fromPath('director/host/edit', array('name' => $host->host_name)), 'Inspect' => Url::fromPath('director/inspect/object', array('type' => 'host', 'plural' => 'hosts', 'name' => $host->host_name)));
     } else {
         return array();
     }
 }
 /**
  * {@inheritdoc}
  */
 public function getValues($suppressArrayNotation = false)
 {
     $values = parent::getValues($suppressArrayNotation);
     if (isset($values['url']) && $values['url']) {
         $url = Url::fromPath($values['url']);
         if ($url->getBasePath() === $this->getRequest()->getBasePath()) {
             $values['url'] = $url->getRelativeUrl();
         } else {
             $values['url'] = $url->getAbsoluteUrl();
         }
     }
     return $values;
 }
 public function removeAction()
 {
     $name = $this->getParam('type');
     if ($name === null) {
         throw new IcingaException('You need to specify a type to edit!');
     }
     $this->createTabs('events', 'edit');
     $form = new EventTypeForm();
     $form->setRedirectUrl(Url::fromPath('elasticsearch/types'));
     $form->setRepository(new EventTypeRepository());
     $form->remove($name)->handleRequest();
     $this->view->form = $form;
     $this->render('form');
 }
 /**
  * Display the detail view for a downtime
  */
 public function showAction()
 {
     $isService = isset($this->downtime->service_description);
     $this->view->downtime = $this->downtime;
     $this->view->isService = $isService;
     $this->view->listAllLink = Url::fromPath('monitoring/list/downtimes');
     $this->view->showHostLink = Url::fromPath('monitoring/host/show')->setParam('host', $this->downtime->host_name);
     $this->view->showServiceLink = Url::fromPath('monitoring/service/show')->setParam('host', $this->downtime->host_name)->setParam('service', $this->downtime->service_description);
     $this->view->stateName = $isService ? Service::getStateText($this->downtime->service_state) : Host::getStateText($this->downtime->host_state);
     if ($this->hasPermission('monitoring/command/downtime/delete')) {
         $form = new DeleteDowntimeCommandForm();
         $form->populate(array('downtime_id' => $this->downtime->id, 'downtime_is_service' => $isService, 'redirect' => Url::fromPath('monitoring/list/downtimes')))->handleRequest();
         $this->view->delDowntimeForm = $form;
     }
 }
Exemple #23
0
 public function renderControllerAction($controller)
 {
     $this->assertNoHeadersSent();
     ini_set('memory_limit', '384M');
     ini_set('max_execution_time', 300);
     $viewRenderer = $controller->getHelper('viewRenderer');
     $controller->render($viewRenderer->getScriptAction(), $viewRenderer->getResponseSegment(), $viewRenderer->getNoController());
     $layout = $controller->getHelper('layout')->setLayout('pdf');
     $layout->content = $controller->getResponse();
     $html = $layout->render();
     $imgDir = Url::fromPath('img');
     $html = preg_replace('~src="' . $imgDir . '/~', 'src="' . Icinga::app()->getBootstrapDirectory() . '/img/', $html);
     $this->load_html($html);
     $this->render();
     $request = $controller->getRequest();
     $this->stream(sprintf('%s-%s-%d.pdf', $request->getControllerName(), $request->getActionName(), time()));
 }
Exemple #24
0
 public function renderControllerAction($controller)
 {
     $this->assertNoHeadersSent();
     ini_set('memory_limit', '384M');
     ini_set('max_execution_time', 300);
     $request = $controller->getRequest();
     $layout = $controller->getHelper('layout')->setLayout('pdf');
     $controller->render();
     $layout->content = $controller->getResponse();
     $html = $layout->render();
     $imgDir = Url::fromPath('img');
     $html = preg_replace('~src="' . $imgDir . '/~', 'src="' . Icinga::app()->getBootstrapDirecory() . '/img/', $html);
     $html = preg_replace('~src="/svg/chart.php(.*)"~', 'class="icon" src="http://master1.com/png/chart.php$1"', $html);
     $this->load_html($html);
     $this->render();
     $this->stream(sprintf('%s-%s-%d.pdf', $request->getControllerName(), $request->getActionName(), time()));
 }
 /**
  * List all shared navigation items
  */
 public function sharedAction()
 {
     $this->assertPermission('config/application/navigation');
     $config = Config::app('navigation');
     $config->getConfigObject()->setKeyColumn('name');
     $query = $config->select();
     $removeForm = new Form();
     $removeForm->setUidDisabled();
     $removeForm->setAction(Url::fromPath('navigation/unshare'));
     $removeForm->addElement('hidden', 'name', array('decorators' => array('ViewHelper')));
     $removeForm->addElement('hidden', 'redirect', array('value' => Url::fromPath('navigation/shared'), 'decorators' => array('ViewHelper')));
     $removeForm->addElement('button', 'btn_submit', array('escape' => false, 'type' => 'submit', 'class' => 'link-like spinner', 'value' => 'btn_submit', 'decorators' => array('ViewHelper'), 'label' => $this->view->icon('trash'), 'title' => $this->translate('Unshare this navigation item')));
     $this->view->removeForm = $removeForm;
     $this->view->types = $this->listItemTypes();
     $this->view->items = $query;
     $this->getTabs()->add('navigation/shared', array('title' => $this->translate('List and configure shared navigation items'), 'label' => $this->translate('Shared Navigation'), 'url' => 'navigation/shared'))->activate('navigation/shared');
     $this->setupSortControl(array('type' => $this->translate('Type'), 'owner' => $this->translate('Owner'), 'name' => $this->translate('Shared Navigation')), $query);
 }
Exemple #26
0
 public function redirectAndExit($url)
 {
     if (!$url instanceof Url) {
         $url = Url::fromPath($url);
     }
     $url->getParams()->setSeparator('&');
     if (Icinga::app()->getFrontController()->getRequest()->isXmlHttpRequest()) {
         $this->setHeader('X-Icinga-Redirect', rawurlencode($url->getAbsoluteUrl()));
     } else {
         $this->setRedirect($url->getAbsoluteUrl());
     }
     $session = Session::getSession();
     if ($session->hasChanged()) {
         $session->write();
     }
     $this->sendHeaders();
     exit;
 }
 /**
  * Loads search dashlets
  *
  * @param string $searchString
  */
 protected function loadSearchDashlets($searchString)
 {
     $pane = $this->createPane(self::SEARCH_PANE)->getPane(self::SEARCH_PANE)->setTitle(t('Search'));
     $this->activate(self::SEARCH_PANE);
     $manager = Icinga::app()->getModuleManager();
     $searchUrls = array();
     foreach ($manager->getLoadedModules() as $module) {
         $moduleSearchUrls = $module->getSearchUrls();
         if (!empty($moduleSearchUrls)) {
             if ($searchString === '') {
                 $pane->add(t('Ready to search'), 'search/hint');
                 return;
             }
             $searchUrls = array_merge($searchUrls, $moduleSearchUrls);
         }
     }
     usort($searchUrls, array($this, 'compareSearchUrls'));
     foreach (array_reverse($searchUrls) as $searchUrl) {
         $pane->addDashlet($searchUrl->title . ': ' . $searchString, Url::fromPath($searchUrl->url, array('q' => $searchString)));
     }
 }
 /**
  * Log into the application
  */
 public function loginAction()
 {
     $icinga = Icinga::app();
     if (($requiresSetup = $icinga->requiresSetup()) && $icinga->setupTokenExists()) {
         $this->redirectNow(Url::fromPath('setup'));
     }
     $form = new LoginForm();
     if ($this->Auth()->isAuthenticated()) {
         $this->redirectNow($form->getRedirectUrl());
     }
     if (!$requiresSetup) {
         if (!$this->getRequest()->hasCookieSupport()) {
             $this->getResponse()->setBody("Cookies must be enabled to run this application.\n")->setHttpResponseCode(403)->sendResponse();
             exit;
         }
         $form->handleRequest();
     }
     $this->view->form = $form;
     $this->view->title = $this->translate('Icinga Web 2 Login');
     $this->view->requiresSetup = $requiresSetup;
 }
Exemple #29
0
 public function showAction()
 {
     $this->setAutorefreshInterval(15);
     if ($this->Auth()->hasPermission('monitoring/command/schedule-check')) {
         $checkNowForm = new CheckNowCommandForm();
         $checkNowForm->setObjects($this->hostList)->handleRequest();
         $this->view->checkNowForm = $checkNowForm;
     }
     $acknowledgedObjects = $this->hostList->getAcknowledgedObjects();
     if (!empty($acknowledgedObjects)) {
         $removeAckForm = new RemoveAcknowledgementCommandForm();
         $removeAckForm->setObjects($acknowledgedObjects)->handleRequest();
         $this->view->removeAckForm = $removeAckForm;
     }
     $featureStatus = $this->hostList->getFeatureStatus();
     $toggleFeaturesForm = new ToggleObjectFeaturesCommandForm(array('backend' => $this->backend, 'objects' => $this->hostList));
     $toggleFeaturesForm->load((object) $featureStatus)->handleRequest();
     $this->view->toggleFeaturesForm = $toggleFeaturesForm;
     $hostStates = $this->hostList->getStateSummary();
     $this->setAutorefreshInterval(15);
     $this->view->rescheduleAllLink = Url::fromRequest()->setPath('monitoring/hosts/reschedule-check');
     $this->view->downtimeAllLink = Url::fromRequest()->setPath('monitoring/hosts/schedule-downtime');
     $this->view->processCheckResultAllLink = Url::fromRequest()->setPath('monitoring/hosts/process-check-result');
     $this->view->addCommentLink = Url::fromRequest()->setPath('monitoring/hosts/add-comment');
     $this->view->stats = $hostStates;
     $this->view->objects = $this->hostList;
     $this->view->unhandledObjects = $this->hostList->getUnhandledObjects();
     $this->view->problemObjects = $this->hostList->getProblemObjects();
     $this->view->acknowledgeUnhandledLink = Url::fromPath('monitoring/hosts/acknowledge-problem')->setQueryString($this->hostList->getUnhandledObjects()->objectsFilter()->toQueryString());
     $this->view->downtimeUnhandledLink = Url::fromPath('monitoring/hosts/schedule-downtime')->setQueryString($this->hostList->getUnhandledObjects()->objectsFilter()->toQueryString());
     $this->view->downtimeLink = Url::fromPath('monitoring/hosts/schedule-downtime')->setQueryString($this->hostList->getProblemObjects()->objectsFilter()->toQueryString());
     $this->view->acknowledgedObjects = $this->hostList->getAcknowledgedObjects();
     $this->view->acknowledgeLink = Url::fromPath('monitoring/hosts/acknowledge-problem')->setQueryString($this->hostList->getUnacknowledgedObjects()->objectsFilter()->toQueryString());
     $this->view->unacknowledgedObjects = $this->hostList->getUnacknowledgedObjects();
     $this->view->objectsInDowntime = $this->hostList->getObjectsInDowntime();
     $this->view->inDowntimeLink = Url::fromPath('monitoring/list/hosts')->setQueryString($this->hostList->getObjectsInDowntime()->objectsFilter()->toQueryString());
     $this->view->showDowntimesLink = Url::fromPath('monitoring/list/downtimes')->setQueryString($this->hostList->objectsFilter()->andFilter(FilterEqual::where('object_type', 'host'))->toQueryString());
     $this->view->commentsLink = Url::fromRequest()->setPath('monitoring/list/comments');
     $this->view->sendCustomNotificationLink = Url::fromRequest()->setPath('monitoring/hosts/send-custom-notification');
 }
 public function indexAction()
 {
     $this->getTabs()->add('timeline', array('title' => $this->translate('Show the number of historical event records grouped by time and type'), 'label' => $this->translate('Timeline'), 'url' => Url::fromRequest()))->extend(new DashboardAction())->extend(new MenuAction())->activate('timeline');
     $this->view->title = $this->translate('Timeline');
     // TODO: filter for hard_states (precedence adjustments necessary!)
     $this->setupIntervalBox();
     list($displayRange, $forecastRange) = $this->buildTimeRanges();
     $detailUrl = Url::fromPath('monitoring/list/eventhistory');
     $timeline = new TimeLine($this->applyRestriction('monitoring/filter/objects', $this->backend->select()->from('eventhistory', array('name' => 'type', 'time' => 'timestamp'))), array('notify' => array('class' => 'timeline-notification', 'detailUrl' => $detailUrl, 'label' => mt('monitoring', 'Notifications')), 'hard_state' => array('class' => 'timeline-hard-state', 'detailUrl' => $detailUrl, 'label' => mt('monitoring', 'Hard state changes')), 'comment' => array('class' => 'timeline-comment', 'detailUrl' => $detailUrl, 'label' => mt('monitoring', 'Comments')), 'ack' => array('class' => 'timeline-ack', 'label' => mt('monitoring', 'Acknowledgements')), 'dt_start' => array('class' => 'timeline-downtime-start', 'detailUrl' => $detailUrl, 'label' => mt('monitoring', 'Started downtimes')), 'dt_end' => array('class' => 'timeline-downtime-end', 'detailUrl' => $detailUrl, 'label' => mt('monitoring', 'Ended downtimes'))));
     $timeline->setMaximumCircleWidth('6em');
     $timeline->setMinimumCircleWidth('0.3em');
     $timeline->setDisplayRange($displayRange);
     $timeline->setForecastRange($forecastRange);
     $beingExtended = $this->getRequest()->getParam('extend') == 1;
     $timeline->setSession($this->Window()->getSessionNamespace('timeline', !$beingExtended));
     $this->view->timeline = $timeline;
     $this->view->nextRange = $forecastRange;
     $this->view->beingExtended = $beingExtended;
     $this->view->intervalFormat = $this->getIntervalFormat();
     $oldBase = $timeline->getCalculationBase(false);
     $this->view->switchedContext = $oldBase !== null && $oldBase !== $timeline->getCalculationBase(true);
 }