Remove unused joins and conform to coding guidelines

This commit is contained in:
Matthias Jentsch 2015-09-14 12:05:15 +02:00
parent 9110153ab8
commit 32b4715130
7 changed files with 15 additions and 43 deletions

View File

@ -1,21 +1,21 @@
<?php if (isset($object->service_check_timeperiod_alias)): ?>
<?php if (isset($object->service_check_timeperiod)): ?>
<tr>
<th><?= $this->translate('Check Timeperiod') ?></th>
<td>
<?= $object->service_check_timeperiod_alias ?>
<?= $object->service_check_timeperiod ?>
</td>
</tr>
<?php endif; ?>
<?php endif ?>
<?php if (isset($object->host_check_timeperiod_alias)): ?>
<?php if (isset($object->host_check_timeperiod)): ?>
<tr>
<th><?= $this->translate('Check Timeperiod') ?></th>
<td>
<?= $object->host_check_timeperiod_alias ?>
<?= $object->host_check_timeperiod ?>
</td>
</tr>
<?php endif; ?>
<?php endif ?>

View File

@ -159,10 +159,7 @@ class HoststatusQuery extends IdoQuery
'service_display_name' => 's.display_name COLLATE latin1_general_ci',
),
'checktimeperiods' => array(
'host_check_timeperiod_alias' => 'ctp.alias COLLATE latin1_general_ci'
),
'notificationtimeperiods' => array(
'host_notification_timeperiod_alias' => 'ntp.alias COLLATE latin1_general_ci'
'host_check_timeperiod' => 'ctp.alias COLLATE latin1_general_ci'
)
);
@ -272,15 +269,6 @@ class HoststatusQuery extends IdoQuery
);
}
protected function joinNotificationtimeperiods()
{
$this->select->joinLeft(
array('ntp' => $this->prefix . 'timeperiods'),
'ntp.timeperiod_object_id = h.notification_timeperiod_object_id',
array()
);
}
protected function joinChecktimeperiods()
{
$this->select->joinLeft(

View File

@ -271,10 +271,7 @@ class ServicestatusQuery extends IdoQuery
'service_unhandled' => 'CASE WHEN (ss.problem_has_been_acknowledged + ss.scheduled_downtime_depth + COALESCE(hs.current_state, 0)) = 0 THEN 1 ELSE 0 END'
),
'checktimeperiods' => array(
'service_check_timeperiod_alias' => 'ctp.alias COLLATE latin1_general_ci'
),
'notificationtimeperiods' => array(
'service_notification_timeperiod_alias' => 'ntp.alias COLLATE latin1_general_ci'
'service_check_timeperiod' => 'ctp.alias COLLATE latin1_general_ci'
)
);
@ -392,15 +389,6 @@ class ServicestatusQuery extends IdoQuery
);
}
protected function joinNotificationtimeperiods()
{
$this->select->joinLeft(
array('ntp' => $this->prefix . 'timeperiods'),
'ntp.timeperiod_object_id = s.notification_timeperiod_object_id',
array()
);
}
protected function joinChecktimeperiods()
{
$this->select->joinLeft(

View File

@ -32,6 +32,7 @@ class HostStatus extends DataView
'host_output',
'host_long_output',
'host_check_command',
'host_check_timeperiod',
'host_perfdata',
'host_check_source',
'host_passive_checks_enabled',
@ -59,9 +60,7 @@ class HostStatus extends DataView
'host_severity',
'host_problem',
'host_ipv4',
'host_acknowledgement_type',
'host_check_timeperiod_alias',
'host_notification_timeperiod_alias'
'host_acknowledgement_type'
);
}

View File

@ -73,6 +73,7 @@ class ServiceStatus extends DataView
'service_problem',
'service_perfdata',
'service_check_source',
'service_check_timeperiod',
'service_active_checks_enabled',
'service_active_checks_enabled_changed',
'service_passive_checks_enabled',
@ -94,8 +95,6 @@ class ServiceStatus extends DataView
'service_modified_service_attributes',
'service_host_name',
'service_acknowledgement_type',
'service_check_timeperiod_alias',
'service_notification_timeperiod_alias'
);
}

View File

@ -101,6 +101,7 @@ class Host extends MonitoredObject
'host_check_execution_time',
'host_check_latency',
'host_check_source',
'host_check_timeperiod',
'host_current_check_attempt',
'host_current_notification_number',
'host_display_name',
@ -136,9 +137,7 @@ class Host extends MonitoredObject
'host_process_perfdata' => 'host_process_performance_data',
'host_state',
'host_state_type',
'instance_name',
'host_check_timeperiod_alias',
'host_notification_timeperiod_alias'
'instance_name'
);
if ($this->backend->getType() === 'livestatus') {
$columns[] = 'host_contacts';

View File

@ -133,6 +133,7 @@ class Service extends MonitoredObject
'service_check_execution_time',
'service_check_latency',
'service_check_source',
'service_check_timeperiod',
'service_current_notification_number',
'service_description',
'service_display_name',
@ -163,9 +164,7 @@ class Service extends MonitoredObject
'service_perfdata',
'service_process_perfdata' => 'service_process_performance_data',
'service_state',
'service_state_type',
'service_check_timeperiod_alias',
'service_notification_timeperiod_alias'
'service_state_type'
))
->where('host_name', $this->host->getName())
->where('service_description', $this->service);