ContactQuery: Change timeperiod joins to joinLeft()

refs #7020
This commit is contained in:
Marius Hein 2014-08-28 13:39:49 +02:00
parent dea7caa633
commit c4c5bcdd48
3 changed files with 20 additions and 9 deletions

View File

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