|
35 | 35 |
|
36 | 36 | $title = $_POST['title']; |
37 | 37 | $notes = $_POST['notes']; |
38 | | - $recurring = $_POST['recurring'] ? 1 : 0; |
| 38 | + $recurring = isset($_POST['recurring']) ? 1 : 0; |
39 | 39 | $start_recurring_dt = $_POST['start_recurring_dt']; |
40 | 40 | $end_recurring_dt = $_POST['end_recurring_dt']; |
41 | 41 | $start_recurring_hr = $_POST['start_recurring_hr']; |
42 | 42 | $end_recurring_hr = $_POST['end_recurring_hr']; |
43 | | - $recurring_day = $_POST['recurring_day']; |
44 | 43 | $start = $_POST['start']; |
45 | | - [$duration_hour, $duration_min] = explode(':', $_POST['duration']); |
| 44 | + [$duration_hour, $duration_min] = isset($_POST['duration']) ? explode(':', $_POST['duration']) : [null, null]; |
46 | 45 | $end = $_POST['end']; |
47 | | - $maps = $_POST['maps']; |
| 46 | + $maps = $_POST['maps'] ?? null; |
48 | 47 |
|
49 | 48 | if (isset($duration_hour) && isset($duration_min)) { |
50 | 49 | $end = date('Y-m-d H:i:00', strtotime('+' . intval($duration_hour) . ' hour ' . intval($duration_min) . ' minute', strtotime($start))); |
|
111 | 110 | $end_recurring_hr = '00:00:00'; |
112 | 111 | } |
113 | 112 |
|
114 | | - if (! is_array($_POST['maps'])) { |
| 113 | + if (! is_array($maps)) { |
115 | 114 | $message .= 'Not mapped to any groups or devices<br />'; |
116 | 115 | } |
117 | 116 |
|
|
140 | 139 | dbDelete('alert_schedulables', '`schedule_id`=?', [$alert_schedule->schedule_id]); |
141 | 140 | } |
142 | 141 |
|
143 | | - foreach ($_POST['maps'] as $target) { |
| 142 | + foreach ($maps as $target) { |
144 | 143 | $type = 'device'; |
145 | 144 | if (Str::startsWith($target, 'l')) { |
146 | 145 | $type = 'location'; |
|
0 commit comments