Merge branch 'maint/7.0'
[ninja.git] / application / views / showlog / showlog.php
blob46f8c57c05230b905ba84c40d8a0aac38a5809df
1 <?php defined('SYSPATH') or die('No direct access allowed.');
2 $date_format = cal::get_calendar_format(true);
3 echo form::open('showlog/'.Router::$method, array('id' => 'summary_form', 'method' => 'get'));
4 ?>
5 <div>
6 <table class="showlog no-borders padd-table">
7 <tr>
8 <td class="showlog_options">
9 <h3><?php echo _('General options'); ?></h3>
10 <label><?php echo form::checkbox('hide_flapping', 1, isset($options['hide_flapping'])).' '._('Hide flapping alerts'); ?></label><br />
11 <label><?php echo form::checkbox('hide_downtime', 1, isset($options['hide_downtime'])).' '._('Hide downtime alerts'); ?></label><br />
12 <?php echo $is_authorized ? '<label>'.form::checkbox('hide_process', 1, isset($options['hide_process'])).' '._('Hide process messages').'</label><br />' : ''; ?>
13 <label><?php echo form::checkbox('hide_initial', 1, isset($options['hide_initial'])).' '._('Hide initial and current states'); ?></label><br />
14 <label><?php echo form::checkbox('hide_logrotation', 1, isset($options['hide_logrotation'])).' '._('Hide logrotation messages'); ?></label><br />
15 <?php echo $is_authorized ? '<label>'.form::checkbox('hide_commands', 1, isset($options['hide_commands'])).' '._('Hide external commands').'</label><br />' : ''; ?>
16 <label><?php echo form::checkbox('parse_forward', 1, isset($options['parse_forward'])).' '._('Older entries first'); ?>
17 </td>
18 <td class="showlog_options">
19 <table>
20 <tr>
21 <td style="border: none">
22 <h3><?php echo _('First time') ?></h3> (<em id="start_time_tmp"><?php echo _('Click calendar to select date') ?></em>)<br />
23 <input type="text" value="<?php echo isset($options['first']) && !empty($options['first']) ? date($date_format, $options['first']) : ''; ?>" id="cal_start" name="cal_start" maxlength="10" autocomplete="off" class="date-pick datepick-start" title="<?php echo _('Start date') ?>" />
24 <input type="text" maxlength="5" name="time_start" id="time_start" class="time_start" value="<?php echo isset($options['first']) && !empty($options['first']) ? date('H:i', $options['first']) : ''; ?>">
25 </td>
26 </tr>
27 <tr>
28 <td style="border: none">
29 <h3><?php echo _('Last time') ?></h3> (<em id="end_time_tmp"><?php echo _('Click calendar to select date') ?></em>)<br />
30 <input type="text" value="<?php echo isset($options['last']) && !empty($options['last']) ? date($date_format, $options['last']) : ''; ?>" id="cal_end" name="cal_end" maxlength="10" autocomplete="off" class="date-pick datepick-end" title="<?php echo _('Start date') ?>" />
31 <input type="text" maxlength="5" name="time_end" id="time_end" class="time_end" value="<?php echo isset($options['last']) && !empty($options['last']) ? date('H:i', $options['last']) : ''; ?>">
32 </td>
33 </tr>
34 </table>
35 </td>
36 <td class="showlog_options">
37 <h3><?php echo _('Service state options'); ?></h3>
38 <?php
39 $i = 0;
40 foreach ($service_state_options as $k => $v) {
41 $set = isset($options['service_state_options'][$v]);
42 $i++;
43 $name = 'service_state_options[' . $v . ']';
44 //echo ($i%2 == 0) ? '': '<tr>';
45 echo '<label>'.form::checkbox($name,1, $set).' '.$k.'</label><br />';
46 //echo ($i%2 == 0) ? '</tr>': ''."\n";
49 </td><td class="showlog_options">
50 <h3><?php echo _('Host state options'); ?></h3>
51 <?php
52 $i = 0;
53 foreach ($host_state_options as $k => $v) {
54 $i++;
55 $set = isset($options['host_state_options'][$v]);
56 $name = 'host_state_options[' . $v . ']';
57 //echo ($i%2 == 0) ? '': '<tr>';
58 echo "<label>".form::checkbox($name, 1, $set).' '.$k.'</label><br />';
59 //echo ($i%2 == 0) ? '</tr>': ''."\n";
62 </td>
63 <td class="showlog_options" style="border: none">
64 <h3><?php echo _('State type options'); ?></h3>
65 <label><?php echo form::checkbox('state_type[soft]', 1, isset($options['state_type']['soft'])).' '._('Soft states'); ?></label><br />
66 <label><?php echo form::checkbox('state_type[hard]', 1, isset($options['state_type']['hard'])).' '._('Hard states'); ?></label>
67 </td>
68 </tr>
69 <tr>
70 <td colspan="4">
71 <?php
72 echo form::hidden('first', '');
73 echo form::hidden('last', '');
74 if (isset($options['host'])) {
75 foreach ($options['host'] as $h)
76 echo form::hidden('host[]', $h);
78 if (isset($options['service'])) {
79 foreach ($options['service'] as $s) {
80 echo form::hidden('service[]', $s);
83 echo form::submit('Update', 'Update');
85 </td>
86 </tr>
87 </table>
88 <?php echo form::close(); ?>
89 </div>
90 <div class="long_output">
91 <?php
92 # this hidden thing marks "no options chosen" as a chosen set of options
93 # so we avoid overriding "no options" with the default ones
95 $this->_show_log_entries();
97 </div>