histogram: Make histograms crash less
[ninja.git] / application / views / recurring_downtime / setup.php
blob5f2314b0face2a8750c888c272d4e2528862311b
1 <?php defined('SYSPATH') OR die('No direct access allowed.'); ?>
3 <div id="response"></div>
4 <div id="recurring_downtime_error">
5 <?php
6 if (isset($error)) {
7 echo _('<strong>ERROR: </strong>' . $error);
9 ?>
10 </div>
11 <form class="report-page-setup" method="POST" action="">
12 <div class="report-block">
13 <h2><?php echo _('Report Mode'); ?></h2>
14 <hr/>
15 <?php if (isset($schedule_id) && !empty($schedule_id)) {
16 # show link to create new recurring schedule
17 echo '&nbsp'.html::anchor('recurring_downtime/', _('Add New Downtime Schedule')).'<br /><br />';
20 if (isset($schedule_id) && !empty($schedule_id)) {?>
21 <input type="hidden" name="schedule_id" value="<?php echo $schedule_id ?>" />
22 <?php }?>
23 <table summary="Select object type" class="setup-tbl">
25 <tr>
26 <td colspan="3">
27 <select name="downtime_type" id="downtime_type">
28 <option value="hostgroups" <?php echo $schedule_info->get_downtime_type() === 'hostgroups' ? 'selected="selected"' : ''; ?>><?php echo _('Hostgroups') ?></option>
29 <option value="hosts" <?php echo $schedule_info->get_downtime_type() === 'hosts' ? 'selected="selected"' : ''; ?>><?php echo _('Hosts') ?></option>
30 <option value="servicegroups" <?php echo $schedule_info->get_downtime_type() === 'servicegroups' ? 'selected="selected"' : ''; ?>><?php echo _('Servicegroups') ?></option>
31 <option value="services" <?php echo $schedule_info->get_downtime_type() === 'services' ? 'selected="selected"' : ''; ?>><?php echo _('Services') ?></option>
32 </select>
33 <input type="button" id="sel_downtime_type" class="button select20" value="<?php echo _('Select') ?>" />
34 <div id="progress"></div>
35 &nbsp;
36 </td>
37 </tr>
38 <tr id="filter_row">
39 <td colspan="3">
40 <?php echo _('Filter:') ?><br />
41 <input type="text" name="filter_field" id="filter_field" autocomplete=off size="10" value="">
42 <input type="button" name="clear_filter" id="clear_filter" value="<?php echo _('Clear') ?>">
43 </td>
44 </tr>
45 <tr>
46 <td colspan="3">
48 <div class="left" style="width: 40%">
49 <?php echo _('Available <span class="object-list-type">hostgroups</span>') ?><br />
50 <select id="objects_tmp" multiple="multiple" size='8' style="width: 100%;" class="multiple">
51 </select>
52 </div>
53 <div class="left" style="padding-top: 16px;">
54 <input type="button" value="&gt;" id="mv_hg_r" class="button arrow-right" /><br />
55 <input type="button" value="&lt;" id="mv_hg_l" class="button arrow-left" />
56 </div>
57 <div class="left" style="width: 40%">
58 <?php echo _('Selected <span class="object-list-type">hostgroups</span>') ?><br />
59 <select name="objects[]" id="objects" multiple="multiple" size="8" style="width: 100%;" class="multiple">
60 </select>
61 </div>
62 <div class="clear"></div>
63 </td>
64 </tr>
65 </table>
66 </div>
68 <div class="report-block">
69 <h2><?php echo _('Report Settings'); ?></h2>
70 <hr />
71 <table class="setup-tbl">
72 <tr>
73 <td colspan="3">
74 <?php echo _('Comment') ?><br />
75 <textarea cols="40" rows="4" name="comment" width="100%"><?php echo $schedule_info->get_comment() ?></textarea>
76 </td>
77 </tr>
78 <tr>
79 <td style="vertical-align: top;">
80 <input type="checkbox" name="fixed" id="fixed" value="1"<?php if ($schedule_info->get_fixed()) { ?> checked=checked<?php } ?>> <?php echo _('Fixed') ?>
81 </td>
82 <td id="triggered_row" style="display:none">
83 <?php echo _('Duration') ?> (hh:mm or hh:mm:ss)<br />
84 <input class="time-entry" type='text' id="duration" name='duration' value='<?php echo $schedule_info->get_duration_string() ?>'>
85 </td>
86 <td>&nbsp;</td>
87 <td>&nbsp;</td>
88 </tr>
89 <tr>
90 <td>
91 <?php echo _('Start Time') ?> (hh:mm or hh:mm:ss)<br />
92 <input class="time-entry" type='text' name='start_time' id="start_time_input" value='<?php echo $schedule_info->get_start_time_string() ?>'>
93 </td>
94 <td>
95 <?php echo _('End Time') ?> (hh:mm or hh:mm:ss)<br />
96 <input class="time-entry" type='text' name='end_time' id="end_time_input" value='<?php echo $schedule_info->get_end_time_string() ?>'>
97 </td>
98 <td>&nbsp;</td>
99 </tr>
100 <tr>
101 <td colspan="3">
102 <?php echo _('Days of week') ?> <button type="button" id="select-all-days" value="">Select all</button> <button type="button" id="deselect-all-days">Deselect all</button><br />
103 <table style="margin-top: 5px;width: 560px; border-collapse: collapse; border-spacing: 0px">
104 <tr>
105 <?php foreach ($day_index as $i) {
106 $checked = '';
107 if (in_array($i, $schedule_info->get_weekdays())) {
108 $checked = 'checked=checked';
109 } ?>
111 <td style="width: 80px"><input type="checkbox" <?php echo $checked ?> name="weekdays[]" class="recurring_day" value="<?php echo $i ?>" id="<?php echo $day_names[$i];?>"> <label for="<?php echo $day_names[$i];?>"><?php echo $day_names[$i] ?></label></td>
112 <?php } ?>
113 </tr>
114 </table>
115 <br>
116 </td>
117 </tr>
118 <tr>
119 <td colspan="3">
120 <?php echo _('Months') ?> <button type="button" id="select-all-months">Select all</button> <button type="button" id="deselect-all-months">Deselect all</button><br />
121 <table style="margin-top: 5px; width: 480px; border-collapse: collapse; border-spacing: 0px">
122 <tr>
123 <?php $i = 0;
124 foreach($month_names as $month) {
125 $i++;
126 $checked = '';
127 if (in_array($i, $schedule_info->get_months())) {
128 $checked = 'checked=checked';
129 } ?>
130 <td style="width: 80px"><input type="checkbox" <?php echo $checked ?> name="months[]" class="recurring_month" value="<?php echo $i ?>" id="<?php echo $month; ?>"> <label for="<?php echo $month; ?>"><?php echo $month ?></label></td>
131 <?php if ($i == 6) {
132 echo "</tr><tr>";
134 } ?>
135 </tr>
136 </table>
137 <br>
138 </td>
139 </tr>
140 </table>
141 </div>
143 <div class="setup-table">
144 <input id="reports_submit_button" type="submit" name="" value="<?php echo $schedule_id ? _('Update schedule') : _('Add Schedule') ?>" class="button create-report" />
145 </div>
146 </form>
147 </div>