Location based Alert Rule (#11128)

* Location base Alert Rule

* travis fix
This commit is contained in:
SourceDoctor
2020-02-12 19:53:26 +01:00
committed by GitHub
parent dfd6f2d3b6
commit 5bfc44f812
9 changed files with 100 additions and 25 deletions

View File

@@ -35,6 +35,10 @@ if (is_numeric($alert_id) && $alert_id > 0) {
foreach ($groups as $group) {
$maps[] = ['id' => 'g' . $group['group_id'], 'text' => $group['name']];
}
$locations = dbFetchRows('SELECT `location_id`, `location` FROM `alert_location_map` LEFT JOIN `locations` ON `locations`.`id`=`alert_location_map`.`location_id` WHERE `rule_id`=?', [$alert_id]);
foreach ($locations as $location) {
$maps[] = ['id' => 'l' . $location['location_id'], 'text' => $location['location']];
}
$transports = [];
$members = dbFetchRows('SELECT `transport_or_group_id`, `transport_name`, `transport_type` FROM `alert_transport_map` LEFT JOIN `alert_transports` ON `transport_or_group_id` = `transport_id` WHERE `target_type`="single" AND `rule_id`=?', [$alert_id]);