Merge branch 'bugfix/icinga2-contacts-7020'

fixes #7020
This commit is contained in:
Marius Hein 2014-08-28 13:42:16 +02:00
commit 0da16e4c68
3 changed files with 21 additions and 10 deletions

View File

@ -18,7 +18,7 @@ $contactHelper = $this->getHelper('ContactFlags');
} }
foreach ($contacts as $contact): ?> foreach ($contacts as $contact): ?>
<div class="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( <a href="<?= $this->href(
'monitoring/show/contact', 'monitoring/show/contact',
array('contact' => $contact->contact_name) array('contact' => $contact->contact_name)
@ -36,14 +36,18 @@ $contactHelper = $this->getHelper('ContactFlags');
<?php endif; ?> <?php endif; ?>
<div style="clear: both;"></div> <div style="clear: both;"></div>
<div class="notification-periods"> <div class="notification-periods">
<?php if ($contact->contact_notify_service_timeperiod): ?>
<div> <div>
<?= t('Service notification period') ?>: <?= t('Service notification period') ?>:
<?= $this->escape($contact->contact_notify_service_timeperiod) ?> <?= $this->escape($contact->contact_notify_service_timeperiod) ?>
</div> </div>
<?php endif; ?>
<?php if ($contact->contact_notify_host_timeperiod): ?>
<div> <div>
<?= t('Host notification period') ?>: <?= t('Host notification period') ?>:
<?= $this->escape($contact->contact_notify_host_timeperiod) ?> <?= $this->escape($contact->contact_notify_host_timeperiod) ?>
</div> </div>
<?php endif; ?>
</div> </div>
</div> </div>
<?php <?php

View File

@ -46,15 +46,22 @@ $contactHelper = $this->getHelper('ContactFlags');
</tbody> </tbody>
</table> </table>
<?php if (count($commands)): ?>
<h4><?= $this->translate('Commands'); ?>:</h4> <h4><?= $this->translate('Commands'); ?>:</h4>
<ul> <ul>
<?php foreach ($commands as $command): ?> <?php foreach ($commands as $command): ?>
<li><?= $command->command_name; ?></li> <li><?= $command->command_name; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?>
<h4><?= $this->translate('Notifications'); ?>:</h4> <h4><?= $this->translate('Notifications'); ?>:</h4>
<?php if (count($notifications)): ?>
<?= $this->render('list/notifications.phtml') ?> <?= $this->render('list/notifications.phtml') ?>
<?php else: ?>
<p><?= $this->translate('No notifications for this contact'); ?></p>
<?php endif; ?>
<?php else: ?> <?php else: ?>
<?= $this->translate('No such contact'); ?>: <?= $contactName; ?> <?= $this->translate('No such contact'); ?>: <?= $contactName; ?>

View File

@ -95,12 +95,12 @@ class ContactQuery extends IdoQuery
protected function joinTimeperiods() protected function joinTimeperiods()
{ {
$this->select->join( $this->select->joinLeft(
array('ht' => $this->prefix . 'timeperiods'), array('ht' => $this->prefix . 'timeperiods'),
'ht.timeperiod_object_id = c.host_timeperiod_object_id', 'ht.timeperiod_object_id = c.host_timeperiod_object_id',
array() array()
); );
$this->select->join( $this->select->joinLeft(
array('st' => $this->prefix . 'timeperiods'), array('st' => $this->prefix . 'timeperiods'),
'st.timeperiod_object_id = c.service_timeperiod_object_id', 'st.timeperiod_object_id = c.service_timeperiod_object_id',
array() array()