Skip to content

Commit

Permalink
ContactQuery: Change timeperiod joins to joinLeft()
Browse files Browse the repository at this point in the history
refs #7020
  • Loading branch information
mxhash committed Aug 28, 2014
1 parent dea7caa commit c4c5bcd
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
Expand Up @@ -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 c4c5bcd

Please sign in to comment.