Skip to content

Commit

Permalink
Merge branch 'bugfix/icinga2-contacts-7020'
Browse files Browse the repository at this point in the history
fixes #7020
  • Loading branch information
mxhash committed Aug 28, 2014
2 parents dea7caa + 0a2b504 commit 0da16e4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
Expand Up @@ -18,7 +18,7 @@ $contactHelper = $this->getHelper('ContactFlags');
}
foreach ($contacts as $contact): ?>
<div class="contact">
<img src="<?= $this->href('/static/gravatar', array('email' => $contact->contact_email )) ?>" />
<img style="width: 60px; height: 60px;" src="<?= $this->href('/static/gravatar', array('email' => $contact->contact_email )) ?>" />
<a href="<?= $this->href(
'monitoring/show/contact',
array('contact' => $contact->contact_name)
Expand All @@ -36,14 +36,18 @@ $contactHelper = $this->getHelper('ContactFlags');
<?php endif; ?>
<div style="clear: both;"></div>
<div class="notification-periods">
<?php if ($contact->contact_notify_service_timeperiod): ?>
<div>
<?= t('Service notification period') ?>:
<?= $this->escape($contact->contact_notify_service_timeperiod) ?>
</div>
<?php endif; ?>
<?php if ($contact->contact_notify_host_timeperiod): ?>
<div>
<?= t('Host notification period') ?>:
<?= $this->escape($contact->contact_notify_host_timeperiod) ?>
</div>
<?php endif; ?>
</div>
</div>
<?php
Expand Down
21 changes: 14 additions & 7 deletions modules/monitoring/application/views/scripts/show/contact.phtml
Expand Up @@ -46,15 +46,22 @@ $contactHelper = $this->getHelper('ContactFlags');
</tbody>
</table>

<h4><?= $this->translate('Commands'); ?>:</h4>
<ul>
<?php foreach ($commands as $command): ?>
<li><?= $command->command_name; ?></li>
<?php endforeach; ?>
</ul>
<?php if (count($commands)): ?>
<h4><?= $this->translate('Commands'); ?>:</h4>
<ul>
<?php foreach ($commands as $command): ?>
<li><?= $command->command_name; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>


<h4><?= $this->translate('Notifications'); ?>:</h4>
<?= $this->render('list/notifications.phtml') ?>
<?php if (count($notifications)): ?>
<?= $this->render('list/notifications.phtml') ?>
<?php else: ?>
<p><?= $this->translate('No notifications for this contact'); ?></p>
<?php endif; ?>

<?php else: ?>
<?= $this->translate('No such contact'); ?>: <?= $contactName; ?>
Expand Down
Expand Up @@ -95,12 +95,12 @@ protected function joinServices()

protected function joinTimeperiods()
{
$this->select->join(
$this->select->joinLeft(
array('ht' => $this->prefix . 'timeperiods'),
'ht.timeperiod_object_id = c.host_timeperiod_object_id',
array()
);
$this->select->join(
$this->select->joinLeft(
array('st' => $this->prefix . 'timeperiods'),
'st.timeperiod_object_id = c.service_timeperiod_object_id',
array()
Expand Down

0 comments on commit 0da16e4

Please sign in to comment.