summaryrefslogtreecommitdiffstats
path: root/modules/monitoring/application/views/scripts/show/components/contacts.phtml
blob: 5661c1a3ec479a4a9513859bac020d24199debc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php

if ($object->contacts->hasResult()) {

    $list = array();
    foreach ($object->contacts as $contact) {
        $list[] = $this->qlink(
            $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))
        );
    }

    printf(
        "<tr><th>%s</th><td class=\"go-ahead\">%s</td></tr>\n",
        $this->translate('Contacts'),
        implode(', ', $list)
    );
}

if ($object->contactgroups->hasResult()) {
    $list = array();
    foreach ($object->contactgroups as $contactgroup) {
        $list[] = $this->qlink(
            $contactgroup->contactgroup_alias,
            'monitoring/list/contactgroups',
            array('contactgroup_name' => $contactgroup->contactgroup_name),
            array('title' => sprintf($this->translate('List contacts in contact-group "%s"'), $contactgroup->contactgroup_alias))
        );
    }

    printf(
        "<tr><th>%s</th><td class=\"go-ahead\">%s</td></tr>\n",
        $this->translate('Contactgroups'),
        implode(', ', $list)
    );
}