Revert "ContactQuery: Provide ci query columns for aliases and email addresses"
This reverts commit f00adc2138
.
Conflicts:
modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactQuery.php
This commit is contained in:
parent
03c8de5d7b
commit
0fe59aa519
|
@ -350,8 +350,8 @@ class Monitoring_ListController extends Controller
|
|||
$query = $this->backend->select()->from('contact', array(
|
||||
'contact_name',
|
||||
'contact_id',
|
||||
'contact_alias_name',
|
||||
'contact_email_address',
|
||||
'contact_alias',
|
||||
'contact_email',
|
||||
'contact_pager',
|
||||
'contact_notify_service_timeperiod',
|
||||
'contact_notify_service_recovery',
|
||||
|
@ -365,18 +365,18 @@ class Monitoring_ListController extends Controller
|
|||
'contact_notify_host_down',
|
||||
'contact_notify_host_unreachable',
|
||||
'contact_notify_host_flapping',
|
||||
'contact_notify_host_downtime'
|
||||
'contact_notify_host_downtime',
|
||||
));
|
||||
$this->filterQuery($query);
|
||||
$this->view->contacts = $query->paginate();
|
||||
|
||||
$this->setupSortControl(array(
|
||||
'contact_name' => $this->translate('Name'),
|
||||
'contact_alias_name' => $this->translate('Alias'),
|
||||
'contact_email_address' => $this->translate('Email'),
|
||||
'contact_pager' => $this->translate('Pager Address / Number'),
|
||||
'contact_name' => $this->translate('Name'),
|
||||
'contact_alias' => $this->translate('Alias'),
|
||||
'contact_email' => $this->translate('Email'),
|
||||
'contact_pager' => $this->translate('Pager Address / Number'),
|
||||
'contact_notify_service_timeperiod' => $this->translate('Service Notification Timeperiod'),
|
||||
'contact_notify_host_timeperiod' => $this->translate('Host Notification Timeperiod')
|
||||
'contact_notify_host_timeperiod' => $this->translate('Host Notification Timeperiod')
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
@ -124,8 +124,8 @@ class Monitoring_ShowController extends Controller
|
|||
$query = $this->backend->select()->from('contact', array(
|
||||
'contact_name',
|
||||
'contact_id',
|
||||
'contact_alias_name',
|
||||
'contact_email_address',
|
||||
'contact_alias',
|
||||
'contact_email',
|
||||
'contact_pager',
|
||||
'contact_object_id',
|
||||
'contact_notify_service_timeperiod',
|
||||
|
@ -140,7 +140,7 @@ class Monitoring_ShowController extends Controller
|
|||
'contact_notify_host_down',
|
||||
'contact_notify_host_unreachable',
|
||||
'contact_notify_host_flapping',
|
||||
'contact_notify_host_downtime'
|
||||
'contact_notify_host_downtime',
|
||||
));
|
||||
|
||||
$query->where('contact_name', $contactName);
|
||||
|
|
|
@ -14,19 +14,19 @@
|
|||
}
|
||||
foreach ($contacts as $contact): ?>
|
||||
<div class="contact">
|
||||
<?= $this->img('/static/gravatar', array('email' => $contact->contact_email_address)); ?>
|
||||
<?= $this->img('/static/gravatar', array('email' => $contact->contact_email)); ?>
|
||||
<strong><?= $this->qlink(
|
||||
$contact->contact_name,
|
||||
'monitoring/show/contact',
|
||||
array('contact_name' => $contact->contact_name),
|
||||
array('title' => sprintf(
|
||||
$this->translate('Show detailed information about %s'),
|
||||
$contact->contact_alias_name
|
||||
$contact->contact_alias
|
||||
))
|
||||
); ?></strong> (<?= $contact->contact_alias_name; ?>)
|
||||
); ?></strong> (<?= $contact->contact_alias; ?>)
|
||||
<div>
|
||||
<?= $this->translate('Email'); ?>: <a href="mailto:<?= $contact->contact_email_address; ?>" title="<?= sprintf($this->translate('Send a mail to %s'), $contact->contact_alias_name); ?>" aria-label="<?= sprintf($this->translate('Send a mail to %s'), $contact->contact_alias_name); ?>">
|
||||
<?= $this->escape($contact->contact_email_address); ?>
|
||||
<?= $this->translate('Email'); ?>: <a href="mailto:<?= $contact->contact_email; ?>" title="<?= sprintf($this->translate('Send a mail to %s'), $contact->contact_alias); ?>" aria-label="<?= sprintf($this->translate('Send a mail to %s'), $contact->contact_alias); ?>">
|
||||
<?= $this->escape($contact->contact_email); ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php if ($contact->contact_pager): ?>
|
||||
|
|
|
@ -5,10 +5,10 @@ if (! empty($object->contacts)) {
|
|||
$list = array();
|
||||
foreach ($object->contacts as $contact) {
|
||||
$list[] = $this->qlink(
|
||||
$contact->contact_alias_name,
|
||||
$contact->contact_alias,
|
||||
'monitoring/show/contact',
|
||||
array('contact_name' => $contact->contact_name),
|
||||
array('title' => sprintf($this->translate('Show detailed information about %s'), $contact->contact_alias_name))
|
||||
array('title' => sprintf($this->translate('Show detailed information about %s'), $contact->contact_alias))
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<?= $this->tabs ?>
|
||||
<h1><?= $this->translate('Contact details') ?></h1>
|
||||
<div class="circular" style="background-image: url('<?=
|
||||
$this->href('static/gravatar', array('email' => $contact->contact_email_address))
|
||||
$this->href('static/gravatar', array('email' => $contact->contact_email))
|
||||
?>')"></div>
|
||||
|
||||
<?php if (! $contact): ?>
|
||||
|
@ -15,14 +15,14 @@
|
|||
<tbody>
|
||||
<tr>
|
||||
<th style="width: 20%"></th>
|
||||
<td><strong><?= $this->escape($contact->contact_alias_name) ?></strong> (<?= $contact->contact_name ?>)</td>
|
||||
<td><strong><?= $this->escape($contact->contact_alias) ?></strong> (<?= $contact->contact_name ?>)</td>
|
||||
</tr>
|
||||
<?php if ($contact->contact_email_address): ?>
|
||||
<?php if ($contact->contact_email): ?>
|
||||
<tr>
|
||||
<th><?= $this->translate('Email') ?></th>
|
||||
<td>
|
||||
<a href="mailto:<?= $contact->contact_email_address; ?>" title="<?= sprintf($this->translate('Send a mail to %s'), $contact->contact_alias_name); ?>" aria-label="<?= sprintf($this->translate('Send a mail to %s'), $contact->contact_alias_name); ?>">
|
||||
<?= $this->escape($contact->contact_email_address); ?>
|
||||
<a href="mailto:<?= $contact->contact_email; ?>" title="<?= sprintf($this->translate('Send a mail to %s'), $contact->contact_alias); ?>" aria-label="<?= sprintf($this->translate('Send a mail to %s'), $contact->contact_alias); ?>">
|
||||
<?= $this->escape($contact->contact_email); ?>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -10,10 +10,8 @@ class ContactQuery extends IdoQuery
|
|||
'contact_id' => 'c.contact_id',
|
||||
'contact' => 'co.name1 COLLATE latin1_general_ci',
|
||||
'contact_name' => 'co.name1',
|
||||
'alias' => 'c.alias COLLATE latin1_general_ci',
|
||||
'contact_alias_name' => 'c.alias',
|
||||
'email' => 'c.email_address COLLATE latin1_general_ci',
|
||||
'contact_email_address' => 'c.email_address',
|
||||
'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',
|
||||
|
|
|
@ -17,8 +17,8 @@ class Contact extends DataView
|
|||
{
|
||||
return array(
|
||||
'contact_name',
|
||||
'contact_alias_name',
|
||||
'contact_email_address',
|
||||
'contact_alias',
|
||||
'contact_email',
|
||||
'contact_pager',
|
||||
'contact_notify_hosts',
|
||||
'contact_notify_services',
|
||||
|
@ -53,7 +53,7 @@ class Contact extends DataView
|
|||
public function getSortRules()
|
||||
{
|
||||
return array(
|
||||
'contact_alias_name' => array(
|
||||
'contact_alias' => array(
|
||||
'order' => self::SORT_DESC
|
||||
)
|
||||
);
|
||||
|
|
|
@ -185,10 +185,10 @@ abstract class MonitoredObject implements Filterable
|
|||
$this->contacts = array();
|
||||
foreach (preg_split('~,~', $this->properties->host_contacts) as $contact) {
|
||||
$this->contacts[] = (object) array(
|
||||
'contact_name' => $contact,
|
||||
'contact_alias_name' => $contact,
|
||||
'contact_email_address' => null,
|
||||
'contact_pager' => null
|
||||
'contact_name' => $contact,
|
||||
'contact_alias' => $contact,
|
||||
'contact_email' => null,
|
||||
'contact_pager' => null,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -385,9 +385,9 @@ abstract class MonitoredObject implements Filterable
|
|||
|
||||
$contacts = $this->backend->select()->from('contact', array(
|
||||
'contact_name',
|
||||
'contact_alias_name',
|
||||
'contact_email_address',
|
||||
'contact_pager'
|
||||
'contact_alias',
|
||||
'contact_email',
|
||||
'contact_pager',
|
||||
));
|
||||
if ($this->type === self::TYPE_SERVICE) {
|
||||
$contacts
|
||||
|
|
Loading…
Reference in New Issue