- */
-// {{{ICINGA_LICENSE_HEADER}}}
-
-use Icinga\Web\Url;
-
-/**
- * Class Zend_View_Helper_Qlink
- * TODO: Search for the best and safest quoting
- * TODO: Check whether attributes are safe. Script, title in combination with
- * Hover-Tips etc. Eventually create a whitelist for a few options only.
- */
-class Zend_View_Helper_Qlink extends Zend_View_Helper_Abstract
-{
-
- public function qlink($htmlContent, $urlFormat, array $uriParams = array(),
- array $properties = array())
- {
- $quote = true;
- $attributes = array();
- $baseUrl = null;
- foreach ($properties as $key => $val) {
- if ($key === 'baseUrl' ) {
- // $baseUrl = filter_var($val, FILTER_SANITIZE_URL) . '/';
- $baseUrl = $val; //rawurlencode($val) . '/';
- continue;
- }
- if ($key === 'quote') {
- $quote = $val;
- continue;
- }
- if ($key === 'target') {
- $attributes[] = 'target="'.$val.'"';
- }
- if ($key === 'style' && is_array($val)) {
- if (empty($val)) {
- continue;
- }
- $parts = array();
- foreach ($val as $k => $v) {
- $parts[] = "$k: $v";
- }
- $attributes[] = 'style="' . implode('; ', $parts) . '"';
- continue;
- }
- $attributes[] = sprintf(
- '%s="%s"',
- //filter_var($key, FILTER_SANITIZE_URL),
- rawurlencode($key),
- //filter_var($val, FILTER_SANITIZE_FULL_SPECIAL_CHARS)
- rawurlencode($val)
- );
-
- }
- if ($urlFormat instanceof Url) {
- $url = $urlFormat;
- $uriParams = $url->getParams() + $uriParams;
- } else {
- $url = Url::fromPath($urlFormat);
- }
- $url->setParams($uriParams);
- if ($baseUrl) {
- $url->setBaseUrl($baseUrl);
- }
- return sprintf(
- '%s',
-// $this->getFormattedUrl($urlFormat, $uriParams, $baseUrl),
- $url,
- !empty($attributes) ? ' ' . implode(' ', $attributes) : '',
- $quote
- ? filter_var(
- $htmlContent,
- FILTER_SANITIZE_FULL_SPECIAL_CHARS,
- FILTER_FLAG_NO_ENCODE_QUOTES
- )
- // Alternativ: htmlentities($htmlContent)
- : $htmlContent
- );
- }
-/*
- public function getFormattedUrl($urlFormat, $uriParams, $baseUrl = null)
- {
- $params = $args = array();
- foreach ($uriParams as $name => $value) {
- if (is_int($name)) {
- $params[] = rawurlencode($value);
- } else {
- $args[] = rawurlencode($name) . '=' . rawurlencode($value);
- }
- }
- $url = $urlFormat;
- $url = vsprintf($url, $params);
- if (! empty($args)) {
- $url .= '?' . implode('&', $args);
- }
- return is_null($baseUrl) ? $this->view->baseUrl($url) : $baseUrl.$url;
- }
-*/
-}
-
-// @codingStandardsIgnoreStop
diff --git a/application/views/helpers/layout/Container.php b/application/views/helpers/layout/Container.php
deleted file mode 100644
index 12cb1ddab..000000000
--- a/application/views/helpers/layout/Container.php
+++ /dev/null
@@ -1,140 +0,0 @@
-view = $view;
- $this->id = $containerid;
-
- foreach ($flags as $type => $value) {
- if ($type === 'elementId') {
- $this->elementId = $value;
- continue;
- }
- if ($type === 'refreshInterval') {
- $this->refreshInterval = intval($type);
- continue;
- }
- if ($type == 'detachable' && $value == true) {
- $this->features["detachable"] = true;
- continue;
- }
- if ($type == 'expandable' && $value == true) {
- $this->features["expandable"] = true;
- continue;
- }
-
- if ($type == "icingaUrl") {
- $this->url = $value;
- continue;
- }
- if ($type == "iframeFallback") {
- $this->iframeFallback = true;
- }
- if ($type == 'class') {
- $this->class = $value;
- continue;
- }
- }
- return $this;
- }
- public function beginContent()
- {
- ob_start();
- return $this;
-
- }
-
- public function endContent()
- {
- $content = ob_get_contents();
- ob_end_clean();
- return $this->buildDOM($content);
- }
-
- public function buildDOM($content = "")
- {
- $additional = "";
- if ($this->refreshInterval > 0)
- $additional .= " container-refresh-interval='{$this->refreshInterval}' ";
- if ($this->elementId)
- $additional .= " id='$this->elementId'";
- $url = "";
- if ($this->url) {
- $url = $this->view->baseUrl($this->url);
- $additional .= "icinga-url='{$url}'";
- if($this->iframeFallback) {
- $content = "
-
- ";
- }
- }
-
- $controls = $this->getControlDOM();
-
- $html = "
-
- $controls
- $content
-
- ";
-
- return $html;
- }
-
- private function getControlDOM()
- {
- if(empty($this->features))
- return "";
- $features = "";
- foreach($this->features as $feature=>$enabled) {
- if(!$enabled)
- continue;
- if($feature == "detachable") {
- $url = $this->view->baseUrl($this->url ? $this->url : Zend_Controller_Front::getInstance()->getRequest()->getRequestUri());
- $features .= "
- ";
- }
- if($feature == "expandable") {
- $url = $this->url ? $this->url : Zend_Controller_Front::getInstance()->getRequest()->getRequestUri();
- $features .= "
- ";
- }
- }
- return "$features
";
- }
-
- public function registerTabs($tabHelper)
- {
-
- }
-
- public function __toString() {
- return $this->endContent();
- }
-}
-
-class Zend_View_Helper_Container extends Zend_View_Helper_Abstract
-{
-
- /**
- * @param $id
- * @param array $flags
- * @return Zend_View_Helper_Container
- */
- public function container($containerid, $flags = array())
- {
- return new Zend_View_Helper_Container_State($containerid,$flags,$this->view);
-
- }
-
-
-}
diff --git a/application/views/helpers/layout/DetailTabs.php b/application/views/helpers/layout/DetailTabs.php
deleted file mode 100644
index 7a33cbdb1..000000000
--- a/application/views/helpers/layout/DetailTabs.php
+++ /dev/null
@@ -1,65 +0,0 @@
- $settings->qlink(
- 'Host',
- $module.'/detail/show',
- $urlParams + array('active' => 'host')
- ),
- );
-
- if ($settings->service) {
- $tabs['service'] = $settings->qlink(
- 'Service',
- $module.'/detail/show',
- $urlParams
- );
- }
-
- $tabs['history'] = $settings->qlink(
- 'History',
- $module.'/history',
- $urlParams
- );
-
-
- $tabs['hostservices'] = $settings->qlink(
- 'Services',
- $module.'/hostservices',
- $urlParams
- );
-
-
- $html = '';
-
- foreach ($tabs as $name => $tab) {
- $class = $name === $settings->active ? ' class="active"' : '';
- $html .= "- $tab
";
- }
- $html .= "
";
-
-
- return $html;
- }
-
-}
diff --git a/application/views/helpers/layout/Expandable.php b/application/views/helpers/layout/Expandable.php
deleted file mode 100644
index 3c36bd22f..000000000
--- a/application/views/helpers/layout/Expandable.php
+++ /dev/null
@@ -1,58 +0,0 @@
-
- $title
- ";
- }
- $controls = $this->getControlDOM();
- $skeleton = "
-
-
$title $controls
-
-
- $content
-
-
";
- return $skeleton;
- }
-
- public function getControlDOM() {
-
- $features = "
-
-
-
-
-
-
- ";
-
-
- return "$features
";
- }
-}
diff --git a/application/views/scripts/index/welcome.phtml b/application/views/scripts/index/welcome.phtml
index 566aea19e..982e45304 100644
--- a/application/views/scripts/index/welcome.phtml
+++ b/application/views/scripts/index/welcome.phtml
@@ -1,2 +1,2 @@
Welcome to Icinga!
-You should install/configure some = $this->qlink('modules', 'modules/overview') ?> now!
+You should install/configure some modules now!
diff --git a/library/Icinga/Web/Controller/ActionController.php b/library/Icinga/Web/Controller/ActionController.php
index c0395a4ce..5698de2d0 100755
--- a/library/Icinga/Web/Controller/ActionController.php
+++ b/library/Icinga/Web/Controller/ActionController.php
@@ -235,6 +235,8 @@ class ActionController extends ZfController
{
if ($url instanceof Url) {
$url = $url->getRelativeUrl();
+ } else {
+ $url = Url::fromPath($url)->getRelativeUrl();
}
$this->_helper->Redirector->gotoUrlAndExit($url);
}
diff --git a/modules/monitoring/application/controllers/CommandController.php b/modules/monitoring/application/controllers/CommandController.php
index 3f243d7a7..1796bcf3e 100644
--- a/modules/monitoring/application/controllers/CommandController.php
+++ b/modules/monitoring/application/controllers/CommandController.php
@@ -29,7 +29,7 @@
use Icinga\Application\Benchmark;
use Icinga\Application\Icinga;
-use \Monitoring\Backend;
+use \Icinga\Module\Monitoring\Backend;
use \Icinga\Application\Config;
use Icinga\Application\Logger;
use Icinga\Authentication\Manager;
diff --git a/modules/monitoring/application/controllers/ShowController.php b/modules/monitoring/application/controllers/ShowController.php
index 231760ddd..9c9ffda19 100644
--- a/modules/monitoring/application/controllers/ShowController.php
+++ b/modules/monitoring/application/controllers/ShowController.php
@@ -85,7 +85,6 @@ class Monitoring_ShowController extends ModuleActionController
}
$this->view->object = $object;
$this->createTabs();
- $this->prepareTicketHook();
}
/**
@@ -302,7 +301,6 @@ class Monitoring_ShowController extends ModuleActionController
->where('object_type', 'host')
->fetchPairs();
$this->view->object->prefetch();
- $this->prepareTicketHook();
$this->prepareGrapherHook();
}
@@ -359,52 +357,6 @@ class Monitoring_ShowController extends ModuleActionController
));
}
- /**
- * Ticets actions
- */
- public function ticketAction()
- {
- if (Hook::has('ticket')) {
- // TODO: Still hardcoded, should ask for URL:
- $id = $this->_getParam('ticket');
- $ticketModule = 'rt';
- $this->render();
- $this->redirect(
- 'ticket',
- 'show',
- $ticketModule,
- array(
- 'id' => $id
- )
- );
- }
- }
-
- protected function prepareTicketHook()
- {
- if (Hook::has('ticket')) {
- $object = $this->view->object;
- $params = array(
- 'host' => $object->host_name
- );
- if ($object instanceof Service) {
- $params['service'] = $object->service_description;
- }
-
- $params['ticket'] = '__ID__';
- $this->view->ticket_link = preg_replace(
- '~__ID__~',
- '\$1',
- $this->view->qlink('#__ID__',
- 'monitoring/show/ticket',
- $params
- )
- );
- // TODO: Global ticket pattern config (or per environment)
- $this->view->ticket_pattern = '~#(\d{4,6})~';
- }
- }
-
protected function prepareGrapherHook()
{
if ($grapher = Hook::get('grapher')) {
@@ -482,18 +434,9 @@ class Monitoring_ShowController extends ModuleActionController
'urlParams' => $params,
)
);
- if ($this->action_name === 'ticket') {
- $tabs->add(
- 'ticket',
- array(
- 'title' => 'Ticket',
- 'icon' => 'img/classic/ticket.gif',
- 'url' => 'monitoring/show/ticket',
- 'urlParams' => $params + array('ticket' => $this->_getParam('ticket')),
- )
- );
- }
-
+
+
+
$tabs->extend(new OutputFormat())
->extend(new DashboardAction())
->extend(new BasketAction);
diff --git a/modules/monitoring/application/views/scripts/command/list.phtml b/modules/monitoring/application/views/scripts/command/list.phtml
index f37ae4db1..31a77bd5e 100644
--- a/modules/monitoring/application/views/scripts/command/list.phtml
+++ b/modules/monitoring/application/views/scripts/command/list.phtml
@@ -2,7 +2,9 @@
\ No newline at end of file
diff --git a/modules/monitoring/application/views/scripts/list/downtimes.phtml b/modules/monitoring/application/views/scripts/list/downtimes.phtml
index de4ef74b2..75412addb 100644
--- a/modules/monitoring/application/views/scripts/list/downtimes.phtml
+++ b/modules/monitoring/application/views/scripts/list/downtimes.phtml
@@ -16,143 +16,121 @@ function formatDateString($self,$dateString){
$paginator = $downtimes->paginate();
$downtimes = $downtimes->fetchAll();
?>
-
=
$this->paginationControl(
- $paginator,
- null,
- array(
- 'mixedPagination.phtml',
- 'default'),
- array('preserve' => $this->preserve))
+$paginator,
+null,
+array(
+'mixedPagination.phtml',
+'default'),
+array('preserve' => $this->preserve))
?>
-
- Is In Effect |
- Object |
- Host Name |
- Service Name |
- Entry Time |
- Author |
- Comment |
- Start Time |
- End Time |
- Type |
- Trigger Time |
- Downtime ID |
- Trigger ID |
- Duration |
-
-
-
-
- = $downtime->downtime_is_in_effect == 0 ? 'False' : 'True'; ?>
- |
-
-
- object_type == 'service'): ?>
- 
-
- object_type == 'host'): ?>
- 
-
-
- |
-
- = $downtime->host_name ?>
- |
-
- = $downtime->service_description ?>
- |
-
- = formatDateString($this,$downtime->downtime_entry_time); ?>
- |
-
- = $downtime->downtime_author_name ?>
- |
-
- = $downtime->downtime_comment_data ?>
- |
-
- = formatDateString($this,$downtime->downtime_scheduled_start_time); ?>
- |
-
- = formatDateString($this,$downtime->downtime_scheduled_end_time); ?>
- |
-
- = $downtime->downtime_is_fixed == 1 ? 'Fixed' : 'Not Fixed' ?>
- |
-
- downtime_trigger_time);
- echo $date != 'undef' ? $date : 'N/A';
- ?>
- |
-
- = $downtime->downtime_internal_downtime_id ?>
- |
-
- = $downtime->downtime_triggered_by_id == 0 ?
- 'N/A' : $downtime->downtime_triggered_by_id ?>
- |
-
- = $this->util()->showHourMin(intval($downtime->downtime_duration)); ?>
- |
-
- service_description)) {
- echo $this->qlink(
- '',
- 'monitoring/show/host',
- array(
- 'host' => $downtime->host_name
- ),
- array(
- 'class' => 'row-action'
- )
- );
- } else {
- echo $this->qlink(
- '',
- 'monitoring/show/service',
- array(
- 'host' => $downtime->host_name,
- 'service' => $downtime->service_description
- ),
- array(
- 'class' => 'row-action'
- )
- );
- }
- ?>
- |
-
-
+
+ Is In Effect |
+ Object |
+ Host Name |
+ Service Name |
+ Entry Time |
+ Author |
+ Comment |
+ Start Time |
+ End Time |
+ Type |
+ Trigger Time |
+ Downtime ID |
+ Trigger ID |
+ Duration |
+
+
+
+
+
+ = $downtime->downtime_is_in_effect == 0 ? 'False' : 'True'; ?>
+ |
+
+
+
+ object_type == 'service'): ?>
+ 
+
+
+ object_type == 'host'): ?>
+ 
+
+
+
+ |
+
+ = $downtime->host_name ?>
+ |
+
+ = $downtime->service_description ?>
+ |
+
+ = formatDateString($this,$downtime->downtime_entry_time); ?>
+ |
+
+ = $downtime->downtime_author_name ?>
+ |
+
+ = $downtime->downtime_comment_data ?>
+ |
+
+ = formatDateString($this,$downtime->downtime_scheduled_start_time); ?>
+ |
+
+ = formatDateString($this,$downtime->downtime_scheduled_end_time); ?>
+ |
+
+ = $downtime->downtime_is_fixed == 1 ? 'Fixed' : 'Not Fixed' ?>
+ |
+
+ downtime_trigger_time);
+ echo $date != 'undef' ? $date : 'N/A';
+ ?>
+ |
+
+ = $downtime->downtime_internal_downtime_id ?>
+ |
+
+ = $downtime->downtime_triggered_by_id == 0 ?
+ 'N/A' : $downtime->downtime_triggered_by_id ?>
+ |
+
+ = $this->util()->showHourMin(intval($downtime->downtime_duration)); ?>
+ |
+
+ |
+
+
diff --git a/modules/monitoring/application/views/scripts/list/hosts-compact.phtml b/modules/monitoring/application/views/scripts/list/hosts-compact.phtml
index bb7401421..3da1a7c7a 100644
--- a/modules/monitoring/application/views/scripts/list/hosts-compact.phtml
+++ b/modules/monitoring/application/views/scripts/list/hosts-compact.phtml
@@ -4,106 +4,108 @@ $viewHelper = $this->getHelper('MonitoringState');
$trimArea = $this->getHelper('Trim');
?>
-= $this->paginationControl($hosts, null, null, array('preserve' => $this->preserve)) ?>
+= $this->paginationControl($hosts, null, null, array('preserve' => $this->preserve)) ?>
+
+
+ Status |
+ Host |
+ Output |
+ |
+
+
+
+
+
+
+ start(); ?>
+ host_icon_image) : ?>
+ 
+
+ end(); ?>
+
+ |
+
+ start(); ?>
-
-
- Status |
- Host |
- Output |
- |
-
-
-
-
-
-
- start(); ?>
- host_icon_image) : ?>
- 
-
- end(); ?>
- |
-
- start(); ?>
- host_handled && $host->host_state > 0): ?>
-
-
-
-
- host_acknowledged && !$host->host_in_downtime): ?>
-
-
-
-
- host_is_flapping): ?>
-
-
-
-
- host_notifications_enabled): ?>
-
-
-
-
- host_in_downtime): ?>
-
-
-
-
- end(); ?>
- |
-
-
- = $this->qlink(
- " ".ucfirst($viewHelper->monitoringState($host, 'host')).''.
- ' since '.
- $this->timeSince($host->host_last_state_change),
- 'monitoring/show/history', array(
- 'host' => $host->host_name
- ),
- array('quote' => false)
- );?>
- host_state_type == 0): ?>
-
-
-
-
-
- |
-
-
- host_last_comment !== null): ?>
-
-
-
-
- = $this->qlink(
- ''.$host->host_name.' '.
- ''.$host->host_address.'',
- 'monitoring/show/host', array(
- 'host' => $host->host_name
- ), array(
- 'class' => 'row-action',
- 'quote' => false
- )
- ); ?>
+ host_handled && $host->host_state > 0): ?>
+
+
+
+
+
+ host_acknowledged && !$host->host_in_downtime): ?>
+
+
+
+
+
+ host_is_flapping): ?>
+
+
+
+
+
+ host_notifications_enabled): ?>
+
+
+
+
+
+ host_in_downtime): ?>
+
+
+
+
+
+ end(); ?>
+
+ |
+
+ |
-
- = $this->escape(substr(strip_tags($host->host_output), 0, 500)); ?>
- |
-
-
-
+
+
+ |
+
+
+ host_last_comment !== null): ?>
+
+
+
+
+
+ = $host->host_name; ?>
+
+ = $host->host_address; ?>
+
+
+ host_action_url != ''): ?>
+ Action
+
+
+ host_notes_url != ''): ?>
+ Notes
+
+ |
+
+ = $this->escape(substr(strip_tags($host->host_output), 0, 500)); ?>
+ |
+
+
+
diff --git a/modules/monitoring/application/views/scripts/list/hosts.phtml b/modules/monitoring/application/views/scripts/list/hosts.phtml
index 325c3800b..f7b2a6d0b 100644
--- a/modules/monitoring/application/views/scripts/list/hosts.phtml
+++ b/modules/monitoring/application/views/scripts/list/hosts.phtml
@@ -5,123 +5,127 @@ $hosts = $this->hosts->paginate();
$viewHelper = $this->getHelper('MonitoringState');
$trimArea = $this->getHelper('Trim');
?>
-
= $this->paginationControl($hosts, null, null, array('preserve' => $this->preserve)) ?>
-
-
- Status |
- Host |
- Output |
- |
-
-
-
-
-
-
- start(); ?>
- host_icon_image) : ?>
- 
-
- end(); ?>
- |
-
- start(); ?>
- host_handled && $host->host_state > 0): ?>
-
-
-
-
- host_acknowledged && !$host->host_in_downtime): ?>
-
-
-
-
- host_is_flapping): ?>
-
-
-
-
- host_notifications_enabled): ?>
-
-
-
-
- host_in_downtime): ?>
-
-
-
-
- end(); ?>
- |
-
-
- = $this->qlink(
- " ".ucfirst($viewHelper->monitoringState($host, 'host'))."".
- ' since '.
- $this->timeSince($host->host_last_state_change),
- 'monitoring/show/history', array(
- 'host' => $host->host_name
- ),
- array('quote' => false)
- );?>
- host_state_type == 0): ?>
-
-
-
-
-
- |
+
+
+ Status |
+ Host |
+ Output |
+ |
+
+
+
-
- host_last_comment !== null): ?>
-
-
-
-
- = $this->qlink(
- "".$host->host_name." ".
- "".$host->host_address."",
- 'monitoring/show/host', array(
- 'host' => $host->host_name
- ), array(
- 'class' => 'row-action',
- 'quote' => false
- )
- ); ?>
+
+ |
+
+
+ start(); ?>
+
+ host_icon_image) : ?>
+ 
+
+
+ end(); ?>
+
+ |
+
+
+ start(); ?>
+
+ host_handled && $host->host_state > 0): ?>
+
+
+
+
+
+ host_acknowledged && !$host->host_in_downtime): ?>
+
+
+
+
+
+ host_is_flapping): ?>
+
+
+
+
+
+ host_notifications_enabled): ?>
+
+
+
+
+
+ host_in_downtime): ?>
+
+
+
+
+
+ end(); ?>
+
+
+ |
+
+
+ = ucfirst($viewHelper->monitoringState($host, 'host')); ?>
+
+ since
+ = $this->timeSince($host->host_last_state_change); ?>
- host_action_url != ""): ?>
- Action
-
+ host_state_type == 0): ?>
+
+
+
+
- host_notes_url != ""): ?>
- Notes
-
- |
-
- = $this->escape(substr(strip_tags($host->host_output), 0, 10000)); ?>
- |
-
-
-
+
+
+
+
+
+
+ host_last_comment !== null): ?>
+
+
+
+
+
+ = $host->host_name ?>
+ = $host->host_address ?>
+
+
+ host_action_url != ""): ?>
+ Action
+
+
+ host_notes_url != ""): ?>
+ Notes
+
+
+ |
+
+ = $this->escape(substr(strip_tags($host->host_output), 0, 10000)); ?>
+ |
+
+
+
diff --git a/modules/monitoring/application/views/scripts/list/notifications.phtml b/modules/monitoring/application/views/scripts/list/notifications.phtml
index 41bf12f3b..5271200ec 100644
--- a/modules/monitoring/application/views/scripts/list/notifications.phtml
+++ b/modules/monitoring/application/views/scripts/list/notifications.phtml
@@ -7,23 +7,24 @@ $formatter = $this->getHelper('MonitoringProperties');
?>
paginationControl($notifications, null, null, array('preserve' => $t
?>
-
-
- Host |
- Service |
- Type |
- Time |
- Contact |
- Notification command |
- Information |
-
-
-
-
-
-
- = $notification->host_name ?>
- |
-
- = empty($notification->service_description) ? '' : $notification->service_description; ?>
- |
- = $formatter->getNotificationType($notification); ?>
- |
-
- = $notification->notification_start_time ?>
- |
-
- = $notification->notification_contact ?>
- |
-
- = $notification->notification_command ?>
- |
-
- = $this->escape(substr(strip_tags($notification->notification_information), 0, 10000)); ?>
- |
-
- notification_type) === 0): ?>
-
-
-
-
-
- |
-
-
-
+
+
+ Host |
+ Service |
+ Type |
+ Time |
+ Contact |
+ Notification command |
+ Information |
+
+
+
+
+
+
+ = $notification->host_name ?>
+ |
+
+ = empty($notification->service_description) ? '' : $notification->service_description; ?>
+ |
+ = $formatter->getNotificationType($notification); ?>
+ |
+
+ = $notification->notification_start_time ?>
+ |
+
+ = $notification->notification_contact ?>
+ |
+
+ = $notification->notification_command ?>
+ |
+
+ = $this->escape(substr(strip_tags($notification->notification_information), 0, 10000)); ?>
+ |
+
+
+
diff --git a/modules/monitoring/application/views/scripts/list/services-bak.phtml b/modules/monitoring/application/views/scripts/list/services-bak.phtml
deleted file mode 100644
index 3af9b2173..000000000
--- a/modules/monitoring/application/views/scripts/list/services-bak.phtml
+++ /dev/null
@@ -1,171 +0,0 @@
-= $this->tabs ?>
-paginate();
-
-function getRowProperties(&$service, &$last_host, $scope) {
- if ($last_host !== $service->host_name) {
- $host_col = '' . $scope->qlink(
- $service->host_name,
- 'monitoring/show/host',
- array('host' => $service->host_name)
- ) . ':'
- . (isset($service->host->address) ? ' ( ' . $scope->escape($service->host->address) . ')' : '')
- . '';
- $last_host = $service->host_name;
- } else {
- $host_col = ' ';
- }
- $icons = array();
- if ($service->service_acknowledged) {
- $icons['ack.gif'] = 'Problem has been acknowledged';
- }
-
- if ($service->service_in_downtime) {
- $icons['downtime.gif'] = 'Service is in a scheduled downtime';
- }
-
- if ($service->host_problems) {
- $icons['server.png'] = 'This services host has a problem';
- }
-
- $state_classes = array($scope->monitoringState($service));
-
- if ($service->service_handled) {
- $state_classes[] = 'handled';
- }
- if ($service->service_last_state_change > (time() - 600)) {
- $state_classes[] = 'new';
- }
- $state_title = strtoupper($scope->monitoringState($service))
- . ' since '
- . date('Y-m-d H:i:s', $service->service_last_state_change);
- if ($scope->grapher && $scope->grapher->hasGraph($service->host_name, $service->service_description)) {
- $graph = $scope->grapher->getSmallPreviewImage(
- $service->host_name,
- $service->service_description
- );
- } else {
- $graph = '';
- }
- return array($host_col,$icons,$state_classes,$state_title,$graph);
-}
-
-$fparams = $this->services->getAppliedFilter()->toParams();
-if ($this->preserve === null) {
- $this->preserve = $fparams;
-} else {
- $this->preserve += $fparams;
-}
- $last_host = null;
-$always = array();
-if (isset($_GET['sort'])) {
- $always['sort'] = $_GET['sort'];
-}
-if (isset($_GET['dir'])) {
- $always['dir'] = $_GET['dir'];
-}
-?>
-
- if (! empty($fparams)): ?>
-
Filters
- foreach ($fparams as $k => $v): ?>
-= $this->qlink(
- 'x',
- 'monitoring/list/services',
- $this->services->getAppliedFilter()->without($k)->toParams() + $always,
- array(
- 'style' => array('color' => 'red')
- )
-) ?> = $this->escape("$k = $v") ?>
- endforeach ?>
-
- endif ?>
-
-
-
-
-
- Sorry, no services found for this search
-
-
-
-= $this->paginationControl($paginator, null, null, array('preserve' => $this->preserve )); ?>
-
-
-fetchAll() as $service):
- list($host_col,$icons,$state_classes,$state_title,$graph) = getRowProperties($service,$last_host,$this); ?>
-
-
- = $this->qlink(
-
- $service->service_state == 99 ? 'PENDING' :
- substr(strtoupper($this->monitoringState($service)), 0, 4)
- . ' since '
- . $this->timeSince($service->service_last_state_change),
- 'monitoring/show/history', array(
- 'host' => $service->host_name,
- 'service' => $service->service_description
- ), array('quote' => false)) ?>
- |
-
-
- $alt) {
- echo $this->img('img/classic/' . $icon, array(
- 'class' => 'icon',
- 'title' => $alt
- ));
- } ?>
- = $host_col ?>
- = $this->qlink($service->service_description, 'monitoring/show/service', array(
- 'host' => $service->host_name,
- 'service' => $service->service_description
- ), array('class' => 'row-action')
- )
- ?>
-
-
-
- = $this->escape(substr(strip_tags($service->service_output), 0, 900)) ?>
-
- = $graph ?>
- |
- foreach ($this->extraColumns as $col): ?>
- = $this->escape($service->$col) ?> |
- endforeach ?>
-
-
-
-
diff --git a/modules/monitoring/application/views/scripts/list/services-compact.phtml b/modules/monitoring/application/views/scripts/list/services-compact.phtml
index 1ce5a87a5..f89bc772b 100644
--- a/modules/monitoring/application/views/scripts/list/services-compact.phtml
+++ b/modules/monitoring/application/views/scripts/list/services-compact.phtml
@@ -1,137 +1,130 @@
paginate();
-
$viewHelper = $this->getHelper('MonitoringState');
$trimArea = $this->getHelper('Trim');
?>
-
- Sorry, no services found for this search
-
+
+ Sorry, no services found for this search
+
= $this->paginationControl($paginator, null, null, array('preserve' => $this->preserve)) ?>
-
-
- Status |
- Service |
- Output |
- |
-
-
-
- fetchAll() as $service): ?>
-
-
- start(); ?>
- service_icon_image) : ?>
- 
-
- end(); ?>
- |
-
- start(); ?>
- service_handled && $service->service_state > 0): ?>
-
-
-
-
- service_acknowledged && !$service->service_in_downtime): ?>
-
-
-
-
- service_is_flapping): ?>
-
-
-
-
- service_notifications_enabled): ?>
-
-
-
-
- service_in_downtime): ?>
-
-
-
-
- end(); ?>
- |
+
+
+ Status |
+ Service |
+ Output |
+ |
+
+
+
+
+ fetchAll() as $service): ?>
+
+
+
+ start(); ?>
+
+ service_icon_image) : ?>
+ 
+
+
+ end(); ?>
+
+ |
+
+ start(); ?>
+
+ service_handled && $service->service_state > 0): ?>
+
+
+
+
+
+ service_acknowledged && !$service->service_in_downtime): ?>
+
+
+
+
+
+ service_is_flapping): ?>
+
+
+
+
+
+ service_notifications_enabled): ?>
+
+
+
+
+
+ service_in_downtime): ?>
+
+
+
+
+
+ end(); ?>
+
+ |
-
-
- = $this->qlink(
- " ".ucfirst($viewHelper->monitoringState($service, 'service'))."".
- ' since '.
- $this->timeSince($service->service_last_state_change),
- 'monitoring/show/history', array(
- 'host' => $service->host_name,
- 'service' => $service->service_description
- ),
- array('quote' => false)
- );?>
- service_state_type == 0): ?>
-
-
-
-
-
- |
+
+
+ = ucfirst($viewHelper->monitoringState($service, 'service')); ?>
+ since '
+ = $this->timeSince($service->service_last_state_change); ?>
+
+ service_state_type == 0): ?>
+
+
+
+
+
+
+ |
+
+
+ service_last_comment !== null): ?>
+
+
+
+
- |
- service_last_comment !== null): ?>
-
-
-
-
- = $this->qlink(
- "".$service->service_display_name." ",
- 'monitoring/show/service', array(
- 'host' => $service->host_name,
- 'service' => $service->service_description
- ), array(
- 'class' => 'row-action',
- 'quote' => false
- )
- ); ?>
- = $this->qlink(
- $service->host_name,
- 'monitoring/show/host', array(
- 'host' => $service->host_name
- ), array(
- 'class' => 'row-action',
- 'quote' => false
- )
- ); ?>
+ = $service->service_display_name; ?>
+
+ = $service->host_name; ?>
- service_action_url != ""): ?>
- Action
-
+ service_action_url != ""): ?>
+ Action
+
- service_notes_url != ""): ?>
- Notes
-
- service_state_type == 0): ?>
-
-
-
-
- |
+ service_notes_url != ""): ?>
+ Notes
+
+ service_state_type == 0): ?>
+
+
+
+
-
- = $this->escape(substr(strip_tags($service->service_output), 0, 10000)); ?>
- |
-
-
-
+
+
+
+ = $this->escape(substr(strip_tags($service->service_output), 0, 10000)); ?>
+ |
+
+
+
+
diff --git a/modules/monitoring/application/views/scripts/list/services.phtml b/modules/monitoring/application/views/scripts/list/services.phtml
index 2b2ff07e7..824443245 100644
--- a/modules/monitoring/application/views/scripts/list/services.phtml
+++ b/modules/monitoring/application/views/scripts/list/services.phtml
@@ -8,172 +8,150 @@ $trimArea = $this->getHelper('Trim');
?>
-
- Sorry, no services found for this search
-
+
+ Sorry, no services found for this search
+
-
= $this->paginationControl($paginator, null, null, array('preserve' => $this->preserve)) ?>
-
-
- Status |
- Service |
- Host |
- Output |
- |
-
-
-
- fetchAll() as $service): ?>
-
-
- start(); ?>
- service_icon_image) : ?>
- 
-
- end(); ?>
- |
-
- start(); ?>
- service_handled && $service->service_state > 0): ?>
-
-
-
-
- service_acknowledged && !$service->service_in_downtime): ?>
-
-
-
-
- service_is_flapping): ?>
-
-
-
-
- service_notifications_enabled): ?>
-
-
-
-
- service_in_downtime): ?>
-
-
-
-
- end(); ?>
- |
+
+
+ Status |
+ Service |
+ Host |
+ Output |
+ |
+
+
+
+
+ fetchAll() as $service): ?>
+
+
+ start(); ?>
+
+ service_icon_image) : ?>
+ 
+
+
+ end(); ?>
+
+ |
+
+ start(); ?>
+
+ service_handled && $service->service_state > 0): ?>
+
+
+
+
+
+ service_acknowledged && !$service->service_in_downtime): ?>
+
+
+
+
+
+ service_is_flapping): ?>
+
+
+
+
+
+ service_notifications_enabled): ?>
+
+
+
+
+
+ service_in_downtime): ?>
+
+
+
+
+
+ end(); ?>
+
+ |
-
-
- = $this->qlink(
- " ".ucfirst($viewHelper->monitoringState($service, 'service'))."".
- ' since '.
- $this->timeSince($service->service_last_state_change),
- 'monitoring/show/history', array(
- 'host' => $service->host_name,
- 'service' => $service->service_description
- ),
- array('quote' => false)
- );?>
- service_state_type == 0): ?>
-
-
-
-
-
- |
+
+
+ = ucfirst($viewHelper->monitoringState($service, 'service')); ?>
+ since
+ = $this->timeSince($service->service_last_state_change); ?>
+
+ service_state_type == 0): ?>
+
+
+
+
+
+
+ |
+
+ service_last_comment !== null): ?>
+
+
+
+
+ = $service->service_display_name; ?>
+
- |
- service_last_comment !== null): ?>
-
-
-
-
- = $this->qlink(
- "".$service->service_display_name." ",
- 'monitoring/show/service', array(
- 'host' => $service->host_name,
- 'service' => $service->service_description
- ), array(
- 'class' => 'row-action',
- 'quote' => false
- )
- ); ?>
+ service_action_url != ""): ?>
+ Action
+
+ service_notes_url != ""): ?>
+ Notes
+
- service_action_url != ""): ?>
- Action
-
+ service_state_type == 0): ?>
+
+
+
+
+ |
- service_notes_url != ""): ?>
- Notes
-
- service_state_type == 0): ?>
-
-
-
-
-
+
+ = $service->host_name; ?>
- |
- = $this->qlink(
- $service->host_name,
- 'monitoring/show/host', array(
- 'host' => $service->host_name
- ), array(
- 'class' => 'row-action',
- 'quote' => false
- )
- ); ?>
+
+ (= ucfirst($viewHelper->monitoringState($service, 'host')); ?>)
+
+
+ = $service->host_address ?>
+
+ |
-
- = $this->qlink(
- "(".ucfirst($viewHelper->monitoringState($service, 'host')).")",
- 'monitoring/show/history', array(
- 'host' => $service->host_name,
- 'service' => $service->service_description
- ),
- array('quote' => false)
- );?>
-
-
- = $service->host_address ?>
-
-
-
-
- = $this->escape(substr(strip_tags($service->service_output), 0, 10000)); ?>
- |
-
-
-
+
+ = $this->escape(substr(strip_tags($service->service_output), 0, 10000)); ?>
+ |
+
+
+
diff --git a/modules/monitoring/application/views/scripts/show/components/contacts.phtml b/modules/monitoring/application/views/scripts/show/components/contacts.phtml
index de9e0b62b..02f84b08b 100644
--- a/modules/monitoring/application/views/scripts/show/components/contacts.phtml
+++ b/modules/monitoring/application/views/scripts/show/components/contacts.phtml
@@ -2,15 +2,15 @@
if (!empty($this->contacts)) {
$contactList = array();
foreach ($this->contacts as $contact) {
- $contactList[] = $this->qlink(
- $contact->contact_alias,
- 'monitoring/show/contact',
- array(
- 'contact_name' => $contact->contact_name
- )
- );
+ $contactList[] = '' . $contact->contact_alias . '';
}
+
echo 'Contacts: ';
echo implode(', ', $contactList);
}
@@ -18,15 +18,13 @@
if (!empty($this->contactgroups)) {
$contactGroupList = array();
foreach ($this->contactgroups as $contactgroup) {
- $contactGroupList[] = $this->qlink(
- $contactgroup->contactgroup_alias,
+ $contactGroupList[] = '' . $contactgroup->contactgroup_alias . '';
}
-
echo 'Contactgroups: ';
echo implode(', ', $contactGroupList);
}
diff --git a/modules/monitoring/application/views/scripts/show/components/hostgroups.phtml b/modules/monitoring/application/views/scripts/show/components/hostgroups.phtml
index 79767c463..23f5b725c 100644
--- a/modules/monitoring/application/views/scripts/show/components/hostgroups.phtml
+++ b/modules/monitoring/application/views/scripts/show/components/hostgroups.phtml
@@ -4,9 +4,9 @@ if (empty($object->hostgroups)) return;
$list = array();
foreach ($object->hostgroups as $name => $alias) {
- $list[] = $this->qlink($alias, 'monitoring/list/services', array(
- 'hostgroups' => $name
- ));
+ $list[] = ''
+ . $alias
+ . '';
}
echo 'Hostgroups: ' . implode(', ', $list) . "
\n";
diff --git a/modules/monitoring/application/views/scripts/show/components/servicegroups.phtml b/modules/monitoring/application/views/scripts/show/components/servicegroups.phtml
index 7d0e31101..3fc7d7ac4 100644
--- a/modules/monitoring/application/views/scripts/show/components/servicegroups.phtml
+++ b/modules/monitoring/application/views/scripts/show/components/servicegroups.phtml
@@ -4,9 +4,9 @@ if (empty($object->servicegroups)) return;
$list = array();
foreach ($object->servicegroups as $name => $alias) {
- $list[] = $this->qlink($alias, 'monitoring/list/services', array(
- 'servicegroups' => $name
- ));
+ $list[] = ''
+ . $alias
+ . '';
}
echo 'Servicegroups: ' . implode(', ', $list) . "
\n";
diff --git a/modules/monitoring/application/views/scripts/show/history.phtml b/modules/monitoring/application/views/scripts/show/history.phtml
index 92d25fd07..2397bd0e2 100644
--- a/modules/monitoring/application/views/scripts/show/history.phtml
+++ b/modules/monitoring/application/views/scripts/show/history.phtml
@@ -10,40 +10,39 @@ There are no matching history entries right now
= $this->paginationControl($hhistory, null, null, array('preserve' => $preserve)); ?>
-
-
-
+
+ object_type == 'host') {
- $states = array('up', 'down', 'unreachable', 'unknown', 99 => 'pending', null => 'pending');
-} else {
- $states = array('ok', 'warning', 'critical', 'unknown', 99 => 'pending', null => 'pending');
-}
+ if ($event->object_type == 'host') {
+ $states = array('up', 'down', 'unreachable', 'unknown', 99 => 'pending', null => 'pending');
+ } else {
+ $states = array('ok', 'warning', 'critical', 'unknown', 99 => 'pending', null => 'pending');
+ }
-$row_class = array_key_exists($event->state, $states) ? $states[$event->state] : 'invalid';
+ $row_class = array_key_exists($event->state, $states) ? $states[$event->state] : 'invalid';
-?>
-= date('d.m. H:i', $event->timestamp ) ?> |
- if (! $object): ?>
-= $this->escape($event->host_name) ?> |
+ ?>
+
= date('d.m. H:i', $event->timestamp ) ?> |
+
+ if (! $object): ?>
+ = $this->escape($event->host_name) ?> |
+ endif ?>
+
+ if (! $object instanceof Monitoring\Object\Service): ?>
+
+ if ($object): ?>
+ service_description; ?>
+
+ else: ?>
+ = $this->escape($event->service_description) ?>
+ endif ?>
+ |
endif ?>
- if (! $object instanceof Monitoring\Object\Service): ?>
- if ($object): ?>
-= $this->qlink(
- $event->service_description,
- 'monitoring/show/service',
- array(
- 'host' => $object->host_name,
- 'service' => $event->service_description
- )
-) ?>
- else: ?>
-= $this->escape($event->service_description) ?>
- endif ?>
- |
- endif ?>
- 16,
'height' => 16,
@@ -80,17 +79,12 @@ switch ($event->type) {
break;
}
?>
- if ($event->attempt !== null): ?>
- [ = $event->attempt ?>/=$event->max_attempts ?> ]
- endif ?>
- = $ticket_pattern ? preg_replace(
- $ticket_pattern,
- $ticket_link,
- $this->pluginOutput($event->output)
- ) : $this->pluginOutput($event->output) ?>
- |
-
+ if ($event->attempt !== null): ?>
+ [ = $event->attempt ?>/=$event->max_attempts ?> ]
+ endif ?>
+
+
endforeach ?>
-
+
endif ?>
diff --git a/modules/monitoring/application/views/scripts/show/host.phtml b/modules/monitoring/application/views/scripts/show/host.phtml
index 94dd72371..523aeea29 100644
--- a/modules/monitoring/application/views/scripts/show/host.phtml
+++ b/modules/monitoring/application/views/scripts/show/host.phtml
@@ -2,13 +2,12 @@
$hostgroupLinkList = array();
if (!empty($this->hostgroups)) {
foreach ($this->hostgroups as $name => $alias) {
- $hostgroupLinkList[] = $this->qlink(
- $alias,
- 'monitoring/list/services',
+ $hostgroupLinkList[] = ''.$alias. '';
}
}
?>
@@ -27,40 +26,40 @@ $this->partial(
= $this->preview_image ?>
= $this->render('show/components/comments.phtml'); ?>
@@ -70,39 +69,39 @@ $this->partial(
= $this->render('show/components/customvars.phtml'); ?>
host->host_perfdata): ?>
-
+
\ No newline at end of file
diff --git a/modules/monitoring/application/views/scripts/show/service.phtml b/modules/monitoring/application/views/scripts/show/service.phtml
index 2315affbe..ebab7b9f8 100644
--- a/modules/monitoring/application/views/scripts/show/service.phtml
+++ b/modules/monitoring/application/views/scripts/show/service.phtml
@@ -3,13 +3,12 @@
$servicegroupLinkList = array();
if (!empty($this->servicegroups)) {
foreach ($this->servicegroups as $name => $alias) {
- $servicegroupLinkList[] = $this->qlink(
- $alias,
+ $servicegroupLinkList[] = '' . $alias . '';
}
}
?>
@@ -26,42 +25,41 @@ $this->partial(
?>
= $this->preview_image ?>
-
= $this->render('show/components/comments.phtml'); ?>
@@ -71,40 +69,40 @@ $this->partial(
= $this->render('show/components/customvars.phtml'); ?>
service->service_perfdata): ?>
-
\ No newline at end of file