Show/Contact: Add notification history to view

refs #4804
This commit is contained in:
Marius Hein 2014-08-27 16:36:52 +02:00
parent 9465c3ffb6
commit 5e84ff4ac4
5 changed files with 22 additions and 1 deletions

View File

@ -123,6 +123,7 @@ class Monitoring_ShowController extends Controller
'contact_alias',
'contact_email',
'contact_pager',
'contact_object_id',
'contact_notify_service_timeperiod',
'contact_notify_service_recovery',
'contact_notify_service_warning',
@ -149,6 +150,20 @@ class Monitoring_ShowController extends Controller
))->where('contact_id', $contact->contact_id);
$this->view->commands = $commands->paginate();
$notifications = $this->backend->select()->from('notification', array(
'host',
'service',
'notification_output',
'notification_contact',
'notification_start_time',
'notification_state'
));
$notifications->where('contact_object_id', $contact->contact_object_id);
$this->view->compact = true;
$this->view->notifications = $notifications->paginate();
}
$this->view->contact = $contact;

View File

@ -53,6 +53,9 @@ $contactHelper = $this->getHelper('ContactFlags');
<?php endforeach; ?>
</ul>
<h4><?= $this->translate('Notifications'); ?>:</h4>
<?= $this->render('list/notifications.phtml') ?>
<?php else: ?>
<?= $this->translate('No such contact'); ?>: <?= $contactName; ?>
<?php endif; ?>

View File

@ -13,6 +13,7 @@ class ContactQuery extends IdoQuery
'contact_alias' => 'c.alias COLLATE latin1_general_ci',
'contact_email' => 'c.email_address COLLATE latin1_general_ci',
'contact_pager' => 'c.pager_address',
'contact_object_id' => 'c.contact_object_id',
'contact_has_host_notfications' => 'c.host_notifications_enabled',
'contact_has_service_notfications' => 'c.service_notifications_enabled',
'contact_can_submit_commands' => 'c.can_submit_commands',

View File

@ -25,7 +25,8 @@ class NotificationQuery extends IdoQuery
'service' => 'o.name2'
),
'contact' => array(
'notification_contact' => 'c_o.name1'
'notification_contact' => 'c_o.name1',
'contact_object_id' => 'c_o.object_id'
),
'command' => array(
'notification_command' => 'cmd_o.name1'

View File

@ -38,6 +38,7 @@ class Contact extends DataView
'contact_notify_host_unreachable',
'contact_notify_host_flapping',
'contact_notify_host_downtime',
'contact_object_id',
'host_object_id',
'host_name',
'service_object_id',