histogram: Make histograms crash less
[ninja.git] / application / views / extinfo / scheduling_queue.php
blob7d15f0556a70cc40bf671e714aaa240d3a3b8a54
1 <div>
2 <?php if(!$data) { ?>
3 <p><?php echo _('Nothing scheduled'); ?></p>
4 <?php
5 // abort early; returning from this scope will bubble up to post-render,
6 // in contrary to exit()
7 return;
8 } ?>
9 <table id="hostcomments_table">
10 <tr>
11 <?php foreach($header_links as $column => $title) { ?>
12 <th>
13 <?php echo $title; ?>
14 </th>
15 <?php } ?>
16 <th><?php echo _('Type'); ?></th>
17 <th><?php echo _('Active checks'); ?></th>
18 <th><?php echo _('Actions'); ?></th>
19 </tr>
20 <?php
21 $check_types = array(
22 nagstat::CHECK_OPTION_NONE => _('Normal'),
23 nagstat::CHECK_OPTION_FORCE_EXECUTION => _('Forced'),
24 nagstat::CHECK_OPTION_FRESHNESS_CHECK => _('Freshness'),
25 nagstat::CHECK_OPTION_ORPHAN_CHECK => _('Orphan')
28 /**
29 * @return object $row | false
31 $total_rows_printed = -1;
32 foreach( $data as $row ) {
33 $total_rows_printed++;
34 $host = isset($row->host_name) ? $row->host_name : $row->name;
36 <tr class="<?php echo $total_rows_printed%2 == 0 ? 'odd' : 'even'; ?>">
37 <td><a href="<?php echo url::base(true); ?>/extinfo/details/host/<?php echo $host ?>"><?php echo $host ?></a></td>
38 <td style="white-space: normal"><?php if(isset($row->description)) {echo html::anchor('extinfo/details/service/'.$row->host_name.'/?service='.$row->description, $row->description);} ?>&nbsp;</td>
39 <td><?php echo $row->last_check ? date($date_format_str,$row->last_check) : _('Never checked'); ?></td>
40 <td><?php echo $row->next_check ? date($date_format_str,$row->next_check) : _('No check scheduled'); ?></td>
41 <td>
42 <?php
43 $types = array();
44 foreach($check_types as $option => $text) {
45 if(($row->check_type == 0 && $option == 0) || $row->check_type & $option) {
46 $types[] = $text;
49 echo implode(", ", $types);
51 </td>
52 <td><span class="<?php echo ($row->active_checks_enabled ? 'enabled' : 'disabled');?>"><?php echo $row->active_checks_enabled ? _('ENABLED') : _('DISABLED');?></span></td>
53 <td class="icon">
54 <?php
55 if(isset($row->description)) {
56 if ($row->active_checks_enabled == true)
57 echo html::anchor('command/submit?cmd_typ=DISABLE_SVC_CHECK&host='.urlencode($host).'&service='.urlencode($row->description), html::image($this->add_path('icons/16x16/disable-active-checks.png'), array('alt' => _('Disable active checks of this service'), 'title' => _('Disable active checks of this service'))),array('style' => 'border: 0px')).'&nbsp; ';
58 else
59 echo html::anchor('command/submit?cmd_typ=ENABLE_SVC_CHECK&host='.urlencode($host).'&service='.urlencode($row->description), html::image($this->add_path('icons/16x16/enable.png'), array('alt' => _('Enable active checks of this service'), 'title' => _('Enable active checks of this service'))),array('style' => 'border: 0px')).'&nbsp; ';
61 echo html::anchor('command/submit?cmd_typ=SCHEDULE_SVC_CHECK&host='.urlencode($host).'&service='.urlencode($row->description), html::image($this->add_path('icons/16x16/re-schedule.png'), array('alt' => _('Re-schedule this service check'), 'title' => _('Re-schedule this service check'))),array('style' => 'border: 0px'));
62 } else {
63 if ($row->active_checks_enabled == true)
64 echo html::anchor('command/submit?cmd_typ=DISABLE_HOST_CHECK&host='.urlencode($host),html::image($this->add_path('icons/16x16/disable-active-checks.png'), array('alt' => _('Disable active checks of this host'), 'title' => _('Disable active checks of this host'))),array('style' => 'border: 0px')).'&nbsp; ';
65 else
66 echo html::anchor('command/submit?cmd_typ=ENABLE_HOST_CHECK&host='.urlencode($host),html::image($this->add_path('icons/16x16/enable.png'), array('alt' => _('Enable active checks of this host'), 'title' => _('Enable active checks of this host'))),array('style' => 'border: 0px')).'&nbsp; ';
68 echo html::anchor('command/submit?cmd_typ=SCHEDULE_HOST_CHECK&host='.urlencode($host),html::image($this->add_path('icons/16x16/re-schedule.png'), array('alt' => _('Re-schedule this host check'), 'title' => _('Re-schedule this host check'))),array('style' => 'border: 0px'));
71 </td>
72 </tr>
73 <?php } ?>
74 </table>
75 </div>