-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathescalation.php
executable file
·582 lines (544 loc) · 23.1 KB
/
escalation.php
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
<?php
/*
Lilac - A Nagios Configuration Tool
Copyright (C) 2007 Taylor Dondich
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/*
* escalation.php
* Author: Taylor Dondich (tdondich at gmail.com)
* Description:
* Provides interface to maintain escalations
*
*/
include_once('includes/config.inc');
if(!isset($_GET['id'])) {
header("Location: welcome.php");
exit();
}
else {
$escalation = NagiosEscalationPeer::retrieveByPK($_GET['id']);
if(!$escalation) {
header("Location: welcome.php");
exit();
}
}
// Data preparation
if(!isset($_GET['section']))
$_GET['section'] = 'general';
if(isset($_GET['temp_host_id'])) {
$tempData['escalation_manage']['target_host_id'] = NULL;
}
if(isset($_GET['escalation_add'])) {
$sublink = "?escalation_add=1";
if(isset($_GET['host_id']))
$sublink .= "&host_id=".$_GET['host_id'];
if(isset($_GET['hostgroup_id']))
$sublink .= "&hostgroup_id=".$_GET['hostgroup_id'];
if(isset($_GET['host_template_id']))
$sublink .= "&host_template_id=".$_GET['host_template_id'];
if(isset($_GET['service_id']))
$sublink .= "&service_id=".$_GET['service_id'];
if(isset($_GET['service_template_id']))
$sublink .= "&service_template_id=".$_GET['service_template_id'];
}
$period_list = array();
$lilac->return_period_list($tempList);
foreach($tempList as $period) {
$period_list[] = array("timeperiod_id" => $period->getId(), "timeperiod_name" => $period->getName());
}
if(isset($_GET['request'])) {
if($_GET['request'] == "delete" && $_GET['section'] == 'contacts') {
if(!empty($_GET['contactgroup_id'])) {
$membership = NagiosEscalationContactgroupPeer::retrieveByPK($_GET['contactgroup_id']);
if($membership) {
$membership->delete();
$success = "Contact Group Deleted";
}
}
else if(!empty($_GET['contact_id'])) {
$c = new Criteria();
$c->add(NagiosEscalationContactPeer::ESCALATION, $_GET['id']);
$c->add(NagiosEscalationContactPeer::CONTACT, $_GET['contact_id']);
$membership = NagiosEscalationContactPeer::doSelectOne($c);
if($membership) {
$membership->delete();
$success = "Contact deleted.";
}
}
unset($_GET['request']);
}
}
// Action Handlers
if(isset($_POST['request'])) {
if($_POST['request'] == 'escalation_modify_general') {
// Field Error Checking
if(count($_POST['escalation_manage'])) {
foreach($_POST['escalation_manage'] as $tempVariable)
$tempVariable = trim($tempVariable);
}
if((isset($_POST['escalation_manage_enablers']['first_notification']) && !is_numeric($_POST['escalation_manage']['first_notification'])) ||
(isset($_POST['escalation_manage_enablers']['first_notification']) && !($_POST['escalation_manage']['first_notification'] >= 1)) ||
(isset($_POST['escalation_manage_enablers']['last_notification']) && !is_numeric($_POST['escalation_manage']['last_notification'])) ||
(isset($_POST['escalation_manage_enablers']['last_notification']) && !($tempData['service_manage']['last_notification'] >= 1)) ||
(isset($_POST['escalation_manage_enablers']['notification_interval']) && !is_numeric($tempData['service_manage']['notification_interval'])) ||
(isset($_POST['escalation_manage_enablers']['notification_interval']) && !($tempData['service_manage']['notification_interval'] >= 1)) ) {
$error = "Incorrect values for fields. Please verify.";
}
if($escalation) {
$escalation->setDescription($_POST['escalation_manage']['escalation_description']);
$escalation->setFirstNotification($_POST['escalation_manage']['first_notification']);
$escalation->setLastNotification($_POST['escalation_manage']['last_notification']);
$escalation->setNotificationInterval($_POST['escalation_manage']['notification_interval']);
$escalation->setEscalationPeriod($_POST['escalation_manage']['escalation_period']);
if(isset($_POST['escalation_manage']['escalation_options_down'])) {
$escalation->setEscalationOptionsDown(true);
}
else {
$escalation->setEscalationOptionsDown(false);
}
if(isset($_POST['escalation_manage']['escalation_options_unreachable'])) {
$escalation->setEscalationOptionsUnreachable(true);
}
else {
$escalation->setEscalationOptionsUnreachable(false);
}
if(isset($_POST['escalation_manage']['escalation_options_ok'])) {
$escalation->setEscalationOptionsOk(true);
}
else {
$escalation->setEscalationOptionsOk(false);
}
if(isset($_POST['escalation_manage']['escalation_options_up'])) {
$escalation->setEscalationOptionsUp(true);
}
else {
$escalation->setEscalationOptionsUp(false);
}
if(isset($_POST['escalation_manage']['escalation_options_warning'])) {
$escalation->setEscalationOptionsWarning(true);
}
else {
$escalation->setEscalationOptionsWarning(false);
}
if(isset($_POST['escalation_manage']['escalation_options_unknown'])) {
$escalation->setEscalationOptionsUnknown(true);
}
else {
$escalation->setEscalationOptionsUnknown(false);
}
if(isset($_POST['escalation_manage']['escalation_options_critical'])) {
$escalation->setEscalationOptionsCritical(true);
}
else {
$escalation->setEscalationOptionsCritical(false);
}
$escalation->save();
$success = "Escalation modified.";
unset($_GET['edit']);
}
}
else if($_POST['request'] == 'add_contactgroup_command') {
if($lilac->escalation_has_contactgroup($_GET['id'], $_POST['escalation_manage']['contactgroup_add']['contactgroup_id'])) {
$error = "That contact group already exists in that list!";
unset($_POST['escalation_manage']);
}
else {
$membership = new NagiosEscalationContactgroup();
$membership->setNagiosEscalation($escalation);
$membership->setContactgroup($_POST['escalation_manage']['contactgroup_add']['contactgroup_id']);
$membership->save();
$success = "New Escalation Contact Group Link added.";
unset($_POST['escalation_manage']);
}
}
else if($_POST['request'] == 'add_contact_command') {
$c = new Criteria();
$c->add(NagiosEscalationContactPeer::ESCALATION, $_GET['id']);
$c->add(NagiosEscalationContactPeer::CONTACT, $_POST['escalation_manage']['contact_add']['contact_id']);
$membership = NagiosEscalationContactPeer::doSelectOne($c);
if($membership) {
$error = "That contact already exists in that list!";
}
else {
$tempContact = NagiosContactPeer::retrieveByPk($_POST['escalation_manage']['contact_add']['contact_id']);
if($tempContact) {
$membership = new NagiosEscalationContact();
$membership->setEscalation($_GET['id']);
$membership->setNagiosContact($tempContact);
$membership->save();
$success = "New Escalation Contact Link added.";
}
else {
$error = "That contact is not found.";
}
}
}
}
if(isset($_GET['id'])) {
if(!$lilac->get_escalation($_GET['id'], $escalation)) {
header("Location: welcome.php");
die();
}
}
$title = '';
if($escalation->getNagiosService() || $escalation->getNagiosServiceTemplate()) {
$title .= "Service ";
if($escalation->getNagiosServiceTemplate()) {
$title .= "Template <i>" . $escalation->getNagiosServiceTemplate()->getName() . "</i>";
$sublink = "service_template.php?id=" . $escalation->getNagiosServiceTemplate()->getId();
$subText = "Return To Service Template " . $escalation->getNagiosServiceTemplate()->getName();
}
else {
$title .= "<i>" . $escalation->getNagiosService()->getDescription() . "</i> On ";
if($escalation->getNagiosService()->getNagiosHostTemplate()) {
$title .= " Host Template <i>" . $escalation->getNagiosService()->getNagiosHostTemplate()->getName() . "</i>";
}
else if($escalation->getNagiosService()->getNagiosHost()) {
$title .= "Host " . "<i>" . $escalation->getNagiosService()->getNagiosHost()->getName() . "</i>";
}
$sublink = "service.php?id=" . $escalation->getNagiosService()->getId();
$subText = "Return To Service " . $escalation->getNagiosService()->getDescription();
}
}
else {
if($escalation->getNagiosHostTemplate()) {
$title .= "Host Template <i>" . $escalation->getNagiosHostTemplate()->getName() . "</i>";
$sublink = "host_template.php?id=" . $escalation->getNagiosHostTemplate()->getId();
$subText = "Return To Host Template " . $escalation->getNagiosHostTemplate()->getName();
}
else if($escalation->getNagiosHost()) {
$title .= "Host <i>" . $escalation->getNagiosHost()->getName() . "</i>";
$sublink = "hosts.php?id=" . $escalation->getNagiosHost()->getId();
$subText = "Return To Host " . $escalation->getNagiosHost()->getName();
}
else if($escalation->getNagiosHostgroup()) {
$title .= "Hostgroup <i>" . $escalation->getNagiosHostgroup()->getName() . "</i>";
$sublink = "hostgroups.php?id=" . $escalation->getNagiosHostgroup()->getId();
$subText = "Return To Hostgroup " . $escalation->getNagiosHostgroup()->getName();
}
}
// Build subnav
$subnav = array(
'general' => 'General',
'contacts' => 'Contacts'
);
print_header("Escalation Editor for " . $title);
?>
<?php
// Show service information table if selected
if($_GET['id']) {
print_window_header($escalation->getDescription() . " Escalation Information", "100%");
print_subnav($subnav, $_GET['section'], "section", $_SERVER['PHP_SELF'] . "?id=" . $_GET['id']);
if($_GET['section'] == 'general') {
if(!$escalation->getService() && !$escalation->getServiceTemplate())
$escalation_image = $path_config['image_root'] . "server.gif";
else
$escalation_image = $path_config['image_root'] . "services.gif";
?>
<table width="100%" border="0">
<tr>
<td width="100" align="center" valign="top">
<img src="<?php echo $escalation_image;?>" />
</td>
<td valign="top">
<?php
if(isset($_GET['edit'])) { // We're editing general information
?>
<form name="escalation_manage" method="post" action="escalation.php?id=<?php echo $_GET['id'];?>§ion=general&edit=1">
<input type="hidden" name="request" value="escalation_modify_general" />
<b>Escalation Description:</b> <input type="text" name="escalation_manage[escalation_description]" value="<?php echo $escalation->getDescription();?>" /><br />
<?php echo $lilac->element_desc("escalation_description", "nagios_escalations_desc"); ?><br />
<br />
<b>First Notification:</b> <input type="text" name="escalation_manage[first_notification]" value="<?php echo $escalation->getFirstNotification();?>" size="2" maxlength="2" /><br />
<?php echo $lilac->element_desc("first_notification", "nagios_escalations_desc"); ?><br />
<br />
<b>Last Notification:</b> <input type="text" name="escalation_manage[last_notification]" value="<?php echo $escalation->getLastNotification();?>" size="2" maxlength="2" /><br />
<?php echo $lilac->element_desc("last_notification", "nagios_escalations_desc"); ?><br />
<br />
<b>Notification Interval:</b> <input type="text" name="escalation_manage[notification_interval]" value="<?php echo $escalation->getNotificationInterval();?>" size="8" maxlength="8" /><br />
<?php echo $lilac->element_desc("notification_interval", "nagios_escalations_desc"); ?><br />
<br />
<b>Escalation Period:</b> <?php print_select("escalation_manage[escalation_period]", $period_list, "timeperiod_id", "timeperiod_name",($escalation->getEscalationPeriod() != null) ? $escalation->getEscalationPeriod() : '');?><br />
<?php echo $lilac->element_desc("escalation_period", "nagios_escalations_desc"); ?><br />
<br />
<?php
?>
<table width="100%" border="0">
<tr>
<td colspan="2">
<b>Execution Failure Criteria</b>
</td>
</tr>
<tr>
<td width="150" valign="top">
<?php
if(($escalation->getService()) || $escalation->getServiceTemplate()) { // It's a service escalation
?>
<input type="checkbox" <?php echo (($escalation->getEscalationOptionsOk() == 1) ? "CHECKED" : '');?> name="escalation_manage[escalation_options_ok]" value="1">Ok<br />
<input type="checkbox" <?php echo (($escalation->getEscalationOptionsWarning() == 1) ? "CHECKED" : '');?> name="escalation_manage[escalation_options_warning]" value="1">Warning<br />
<input type="checkbox" <?php echo (($escalation->getEscalationOptionsUnknown() == 1) ? "CHECKED" : '');?> name="escalation_manage[escalation_options_unknown]" value="1">Unknown<br />
<input type="checkbox" <?php echo (($escalation->getEscalationOptionsCritical() == 1) ? "CHECKED" : '');?> name="escalation_manage[escalation_options_critical]" value="1">Critical<br />
<?php
}
else {
?>
<input type="checkbox" <?php echo (($escalation->getEscalationOptionsUp() == 1) ? "CHECKED" : '');?> name="escalation_manage[escalation_options_up]" value="1">Up<br />
<input type="checkbox" <?php echo (($escalation->getEscalationOptionsDown() == 1) ? "CHECKED" : '');?> name="escalation_manage[escalation_options_down]" value="1">Down<br />
<input type="checkbox" <?php echo (($escalation->getEscalationOptionsUnreachable() == 1) ? "CHECKED" : '');?> name="escalation_manage[escalation_options_unreachable]" value="1">Unreachable<br />
<?php
}
?>
</td>
<td valign="middle"><?php echo $lilac->element_desc("escalation_options", "nagios_escalations_desc"); ?></td>
</tr>
</table>
<br />
<br />
<input type="submit" value="Update General" /> [ <a href="escalation.php?id=<?php echo $_GET['id'];?>§ion=general">Cancel</a> ]
<?php
}
else {
?>
<b>Attached To <?php
if($escalation->getHost() !== null && !($escalation->getService() !== null))
print("Host:</b> " . $escalation->getNagiosHost()->getName());
else if($escalation->getHostTemplate())
print("Host Template:</b> " . $escalation->getNagiosHostTemplate()->getName());
else if($escalation->getService()) {
if($escalation->getNagiosService()->getNagiosHost() !== null)
print("Service:</b> " . $escalation->getNagiosService()->getDescription() . " On " . $escalation->getNagiosService()->getNagiosHost()->getName());
else
print("Service:</b> " . $escalation->getNagiosService()->getDescription() . " On Host Template " . $escalation->getNagiosService()->getNagiosHostTemplate()->getName());
}
else if($escalation->getServiceTemplate()) {
print("Service Template:</b> " . $escalation->getNagiosServiceTemplate()->getName());
}
else if($escalation->getHostgroup() !== null) {
print("Hostgroup:</b> " . $escalation->getNagiosHostgroup()->getName());
}
?><br />
<b>Description:</b> <?php echo $escalation->getDescription();?><br />
<br />
<b>Included In Definition:</b></br >
<?php
if($escalation->getFirstNotification() != null) {
?>
<b>First Notification:</b> #<?php echo $escalation->getFirstNotification();?> Notification<br />
<?php
}
if($escalation->getLastNotification() != null) {
?>
<b>Last Notification:</b> #<?php echo $escalation->getLastNotification();?> Notification<br />
<?php
}
if($escalation->getNotificationInterval() != null) {
?>
<b>Notification Interval:</b> <?php echo $escalation->getNotificationInterval();?> Time-Units<br />
<?php
}
if($escalation->getEscalationPeriod()) {
?>
<b>Escalation Period:</b> <?php echo $lilac->return_period_name($escalation->getEscalationPeriod());?><br />
<?php
}
if($escalation->getEscalationOptionsUp() != null || $escalation->getEscalationOptionsDown() != null || $escalation->getEscalationOptionsUnreachable() != null || $escalation->getEscalationOptionsOk() != null || $escalation->getEscalationOptionsWarning() != null || $escalation->getEscalationOptionsUnknown() != null || $escalation->getEscalationOptionsCritical() != null) {
?>
<b>Escalation Options:</b>
<?php
if($escalation->getEscalationOptionsUp()) {
print("Up");
if($escalation->getEscalationOptionsDown() || $escalation->getEscalationOptionsUnreachable() || $escalation->getEscalationOptionsOk() || $escalation->getEscalationOptionsWarning() || $escalation->getEscalationOptionsUnknown() || $escalation->getEscalationOptionsCritical() )
print(",");
}
if($escalation->getEscalationOptionsDown()) {
print("Down");
if($escalation->getEscalationOptionsUnreachable() || $escalation->getEscalationOptionsOk() || $escalation->getEscalationOptionsWarning() || $escalation->getEscalationOptionsUnknown() || $escalation->getEscalationOptionsCritical() )
print(",");
}
if($escalation->getEscalationOptionsUnreachable()) {
print("Unreachable");
if($escalation->getEscalationOptionsOk() || $escalation->getEscalationOptionsWarning() || $escalation->getEscalationOptionsUnknown() || $escalation->getEscalationOptionsCritical() )
print(",");
}
if($escalation->getEscalationOptionsOk()) {
print("Ok");
if($escalation->getEscalationOptionsWarning() || $escalation->getEscalationOptionsUnknown() || $escalation->getEscalationOptionsCritical() )
print(",");
}
if($escalation->getEscalationOptionsWarning()) {
print("Warning");
if($escalation->getEscalationOptionsUnknown() || $escalation->getEscalationOptionsCritical() )
print(",");
}
if($escalation->getEscalationOptionsUnknown()) {
print("Unknown");
if($escalation->getEscalationOptionsCritical() )
print(",");
}
if($escalation->getEscalationOptionsCritical()) {
print("Critical");
}
print("<br />");
}
?>
<br />
[ <a href="escalation.php?id=<?php echo $_GET['id'];?>§ion=general&edit=1">Edit</a> ]
<?php
}
?>
</td>
</tr>
</table>
<br />
<?php
}
else if($_GET['section'] == "contacts") {
$contacts_list = $escalation->getNagiosEscalationContacts();
$numOfContacts = count($contacts_list);
?>
<table width="100%" border="0">
<tr>
<td width="100" align="center" valign="top">
<img src="<?php echo $path_config['image_root'];?>contact.gif" />
</td>
<td valign="top">
<table width="100%" align="center" cellspacing="0" cellpadding="2" border="0">
<tr class="altTop">
<td colspan="2">Contacts Explicitly Linked to This Escalation:</td>
</tr>
<?php
for($counter = 0; $counter < $numOfContacts; $counter++) {
if($counter % 2) {
?>
<tr class="altRow1">
<?php
}
else {
?>
<tr class="altRow2">
<?php
}
?>
<td height="20" width="80" nowrap="nowrap" class="altLeft"> [ <a href="escalation.php?id=<?php echo $_GET['id'];?>§ion=contacts&request=delete&contact_id=<?php echo $contacts_list[$counter]->getNagiosContact()->getId();?>" onClick="javascript:return confirmDelete();">Delete</a> ]</td>
<td height="20" class="altRight"><b><?php echo $contacts_list[$counter]->getNagiosContact()->getName();?>:</b> <?php echo $contacts_list[$counter]->getNagiosContact()->getAlias();?></td>
</tr>
<?php
}
?>
</table>
<?php
$lilac->get_contact_list($temp_list);
$contacts_list = array();
foreach($temp_list as $tempContact) {
$contacts_list[] = array('contact_name' => $tempContact->getName(), 'contact_id' => $tempContact->getId());
}
?>
<br />
<br />
<form name="escalation_contact_add" method="post" action="escalation.php?id=<?php echo $_GET['id'];?>§ion=contacts">
<input type="hidden" name="request" value="add_contact_command" />
<b>Add New Contact:</b> <?php
if(!count($contacts_list)) {
?><strong>No Contacts Available</strong><br /><?php
}
else {
print_select("escalation_manage[contact_add][contact_id]", $contacts_list, "contact_id", "contact_name", "0");?> <input type="submit" value="Add Contact"><br /><?php
}
?>
<?php echo $lilac->element_desc("contact_groups", "nagios_escalations_desc"); ?><br />
<br />
</form>
</td>
</tr>
</table>
<?php
$contactgroups_list = array();
$lilac->return_escalation_contactgroups_list($_GET['id'], $tempList);
foreach($tempList as $contactgroup) {
$contactgroups_list[] = array("contactgroup_id" => $contactgroup->getId(), "contactgroup_name" => $contactgroup->getName());
}
$numOfContactGroups = count($contactgroups_list);
?>
<table width="100%" border="0">
<tr>
<td width="100" align="center" valign="top">
<img src="<?php echo $path_config['image_root'];?>contact.gif" />
</td>
<td valign="top">
<table width="100%" align="center" cellspacing="0" cellpadding="2" border="0">
<tr class="altTop">
<td colspan="2">Contact Groups Explicitly Linked to This Escalation:</td>
</tr>
<?php
for($counter = 0; $counter < $numOfContactGroups; $counter++) {
if($counter % 2) {
?>
<tr class="altRow1">
<?php
}
else {
?>
<tr class="altRow2">
<?php
}
?>
<td height="20" width="80" nowrap="nowrap" class="altLeft"> [ <a href="escalation.php?id=<?php echo $_GET['id'];?>§ion=contacts&request=delete&contactgroup_id=<?php echo $contactgroups_list[$counter]['contactgroup_id'];?>">Delete</a> ]</td>
<td height="20" class="altRight"><b><?php echo $lilac->return_contactgroup_name($contactgroups_list[$counter]['contactgroup_id']);?>:</b> <?php echo $lilac->return_contactgroup_alias($contactgroups_list[$counter]['contactgroup_id']);?></td>
</tr>
<?php
}
?>
</table>
<?php
$contactgroups_list = array();
$lilac->get_contactgroup_list($tempList);
foreach($tempList as $contactgroup) {
$contactgroups_list[] = array("contactgroup_id" => $contactgroup->getId(), "contactgroup_name" => $contactgroup->getName());
}
?>
<br />
<br />
<form name="service_template_contactgroup_add" method="post" action="escalation.php?id=<?php echo $_GET['id'];?>§ion=contacts">
<input type="hidden" name="request" value="add_contactgroup_command" />
<input type="hidden" name="escalation_manage[contactgroup_add][escalation_id]" value="<?php echo $_GET['id'];?>" />
<b>Add New Contact Group:</b> <?php
if(!count($contactgroups_list)) {
?><strong>No Contact Groups Available</strong><br /><?php
}
else {
print_select("escalation_manage[contactgroup_add][contactgroup_id]", $contactgroups_list, "contactgroup_id", "contactgroup_name", "0");?> <input type="submit" value="Add Contact Group"><br /><?php
}
?>
<?php echo $lilac->element_desc("contact_groups", "nagios_escalations_desc"); ?><br />
<br />
</form>
</td>
</tr>
</table>
<?php
}
?>
<a href="<?php echo $sublink;?>"><?php echo $subText;?></a>
<?php
print_window_footer();
?>
<br />
<br />
<?php
}
?>
<br />
<?php
print_footer();
?>