Merge branch 'maint/7.0'
[ninja.git] / application / views / recurring_downtime / setup.php
blob3831825ac6f3befd37703057b01e3806353f7185
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" id="setup_form" 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 obj_selector">
24 <tr>
25 <td colspan="3">
26 <select id="report_type" name="report_type">
27 <option value="hostgroups" <?php echo $schedule_info->get_downtime_type() === 'hostgroups' ? 'selected="selected"' : ''; ?>><?php echo _('Hostgroups') ?></option>
28 <option value="hosts" <?php echo $schedule_info->get_downtime_type() === 'hosts' ? 'selected="selected"' : ''; ?>><?php echo _('Hosts') ?></option>
29 <option value="servicegroups" <?php echo $schedule_info->get_downtime_type() === 'servicegroups' ? 'selected="selected"' : ''; ?>><?php echo _('Servicegroups') ?></option>
30 <option value="services" <?php echo $schedule_info->get_downtime_type() === 'services' ? 'selected="selected"' : ''; ?>><?php echo _('Services') ?></option>
31 </select>
32 <input type="button" id="sel_report_type" class="button select20" value="<?php echo _('Select') ?>" />
33 &nbsp;
34 </td>
35 </tr>
36 <tr>
37 <td colspan="3">
38 <select data-filterable data-type="hostgroup" name="objects[]" id="objects" multiple="multiple">
39 </select>
40 </td>
41 </tr>
42 </table>
44 <!--table summary="Select object type" class="setup-tbl">
46 <tr>
47 <td colspan="3">
48 <select name="downtime_type" id="downtime_type">
49 <option value="hostgroups" <?php echo $schedule_info->get_downtime_type() === 'hostgroups' ? 'selected="selected"' : ''; ?>><?php echo _('Hostgroups') ?></option>
50 <option value="hosts" <?php echo $schedule_info->get_downtime_type() === 'hosts' ? 'selected="selected"' : ''; ?>><?php echo _('Hosts') ?></option>
51 <option value="servicegroups" <?php echo $schedule_info->get_downtime_type() === 'servicegroups' ? 'selected="selected"' : ''; ?>><?php echo _('Servicegroups') ?></option>
52 <option value="services" <?php echo $schedule_info->get_downtime_type() === 'services' ? 'selected="selected"' : ''; ?>><?php echo _('Services') ?></option>
53 </select>
54 <input type="button" id="sel_downtime_type" class="button select20" value="<?php echo _('Select') ?>" />
55 <div id="progress"></div>
56 &nbsp;
57 </td>
58 </tr>
59 <tr id="filter_row">
60 <td colspan="3">
61 <?php echo _('Filter:') ?><br />
62 <input type="text" name="filter_field" id="filter_field" autocomplete=off size="10" value="">
63 <input type="button" name="clear_filter" id="clear_filter" value="<?php echo _('Clear') ?>">
64 </td>
65 </tr>
66 <tr>
67 <td colspan="3">
69 <div class="left" style="width: 40%">
70 <?php echo _('Available <span class="object-list-type">hostgroups</span>') ?><br />
71 <select id="objects_tmp" multiple="multiple" size='8' style="width: 100%;" class="multiple">
72 </select>
73 </div>
74 <div class="left" style="padding-top: 16px;">
75 <input type="button" value="&gt;" id="mv_hg_r" class="button arrow-right" /><br />
76 <input type="button" value="&lt;" id="mv_hg_l" class="button arrow-left" />
77 </div>
78 <div class="left" style="width: 40%">
79 <?php echo _('Selected <span class="object-list-type">hostgroups</span>') ?><br />
80 <select name="objects[]" id="objects" multiple="multiple" size="8" style="width: 100%;" class="multiple">
81 </select>
82 </div>
83 <div class="clear"></div>
84 </td>
85 </tr>
86 </table-->
87 </div>
89 <div class="report-block">
90 <h2><?php echo _('Report Settings'); ?></h2>
91 <hr />
92 <table class="setup-tbl">
93 <tr>
94 <td colspan="3">
95 <?php echo _('Comment') . " *" ?><br />
96 <textarea cols="40" rows="4" name="comment" width="100%"><?php echo $schedule_info->get_comment() ?></textarea>
97 </td>
98 </tr>
99 <tr>
100 <td style="vertical-align: top;">
101 <input type="checkbox" name="fixed" id="fixed" value="1"<?php if ($schedule_info->get_fixed()) { ?> checked=checked<?php } ?>> <?php echo _('Fixed') ?>
102 </td>
103 <td id="triggered_row" style="display:none">
104 <?php echo _('Duration') . " *" ?> (hh:mm or hh:mm:ss)<br />
105 <input class="time-entry" type='text' id="duration" name='duration' value='<?php echo $schedule_info->get_duration_string() ?>'>
106 </td>
107 <td>&nbsp;</td>
108 <td>&nbsp;</td>
109 </tr>
110 <tr>
111 <td>
112 <?php echo _('Start Time') . " *" ?> (hh:mm or hh:mm:ss)<br />
113 <input class="time-entry" type='text' name='start_time' id="start_time_input" value='<?php echo $schedule_info->get_start_time_string() ?>'>
114 </td>
115 <td>
116 <?php echo _('End Time') . " *" ?> (hh:mm or hh:mm:ss)<br />
117 <input class="time-entry" type='text' name='end_time' id="end_time_input" value='<?php echo $schedule_info->get_end_time_string() ?>'>
118 </td>
119 <td>&nbsp;</td>
120 </tr>
121 <tr>
122 <td colspan="3">
123 <?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 />
124 <table style="margin-top: 5px;width: 560px; border-collapse: collapse; border-spacing: 0px">
125 <tr>
126 <?php foreach ($day_index as $i) {
127 $checked = '';
128 if (in_array($i, $schedule_info->get_weekdays())) {
129 $checked = 'checked=checked';
130 } ?>
132 <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>
133 <?php } ?>
134 </tr>
135 </table>
136 <br>
137 </td>
138 </tr>
139 <tr>
140 <td colspan="3">
141 <?php echo _('Months') . " *" ?> <button type="button" id="select-all-months">Select all</button> <button type="button" id="deselect-all-months">Deselect all</button><br />
142 <table style="margin-top: 5px; width: 480px; border-collapse: collapse; border-spacing: 0px">
143 <tr>
144 <?php $i = 0;
145 foreach($month_names as $month) {
146 $i++;
147 $checked = '';
148 if (in_array($i, $schedule_info->get_months())) {
149 $checked = 'checked=checked';
150 } ?>
151 <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>
152 <?php if ($i == 6) {
153 echo "</tr><tr>";
155 } ?>
156 </tr>
157 </table>
158 <br>
159 </td>
160 </tr>
161 </table>
162 </div>
164 <div class="setup-table">
165 <input id="reports_submit_button" type="submit" name="" value="<?php echo $schedule_id ? _('Update schedule') : _('Add Schedule') ?>" class="button create-report" />
166 </div>
167 </form>
168 </div>