From f9a274d0790a5c8abfba38457794c08d08081013 Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Fri, 18 Jul 2014 11:48:26 +0200 Subject: [PATCH] Add contact detail view refs #4804 refs #6514 --- .../controllers/ShowController.php | 34 +++++++++++ .../views/scripts/show/contact.phtml | 56 +++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 modules/monitoring/application/views/scripts/show/contact.phtml diff --git a/modules/monitoring/application/controllers/ShowController.php b/modules/monitoring/application/controllers/ShowController.php index d7d14ce15..d503ba512 100644 --- a/modules/monitoring/application/controllers/ShowController.php +++ b/modules/monitoring/application/controllers/ShowController.php @@ -103,6 +103,40 @@ class Monitoring_ShowController extends Controller )); } + public function contactAction() + { + $contact = $this->getParam('contact'); + if (! $contact) { + throw new Zend_Controller_Action_Exception( + $this->translate('The parameter `contact\' is required'), + 404 + ); + } + $query = $this->backend->select()->from('contact', array( + 'contact_name', + 'contact_id', + 'contact_alias', + 'contact_email', + 'contact_pager', + 'contact_notify_service_timeperiod', + 'contact_notify_service_recovery', + 'contact_notify_service_warning', + 'contact_notify_service_critical', + 'contact_notify_service_unknown', + 'contact_notify_service_flapping', + 'contact_notify_service_downtime', + 'contact_notify_host_timeperiod', + 'contact_notify_host_recovery', + 'contact_notify_host_down', + 'contact_notify_host_unreachable', + 'contact_notify_host_flapping', + 'contact_notify_host_downtime', + )); + $query->where('contact_name', $contact); + $this->view->contacts = $query->paginate(); + $this->view->contact_name = $contact; + } + /** * Creating tabs for this controller * @return Tabs diff --git a/modules/monitoring/application/views/scripts/show/contact.phtml b/modules/monitoring/application/views/scripts/show/contact.phtml new file mode 100644 index 000000000..609bbbc69 --- /dev/null +++ b/modules/monitoring/application/views/scripts/show/contact.phtml @@ -0,0 +1,56 @@ +getHelper('ContactFlags'); +?> +
+ + + + + + + + + + + + + contact_pager): ?> + + + + + + + + + + + + + + + + + + + + + + +
+ contact_name) ?> (contact_alias) + ?>) +
%1$s', + htmlspecialchars($contact->contact_email) + ); ?>
contact_pager) ?>
contactFlags($contact, 'service')) ?>
contactFlags($contact, 'host')) ?>
contact_notify_service_timeperiod) ?>
contact_notify_host_timeperiod) ?>
+ +