Apply fixes from StyleCI (#12124)

This commit is contained in:
Jellyfrog
2020-09-21 15:59:34 +02:00
committed by GitHub
parent 0d56bbd946
commit 29f45ca352
816 changed files with 5038 additions and 5038 deletions

View File

@@ -31,19 +31,19 @@ if (Auth::user()->hasGlobalAdmin()) {
echo "<button type='button' class='btn btn-primary btn-sm' data-toggle='modal' data-target='#edit-alert-transport'><i class='fa fa-plus'></i> Create alert transport</button>";
}
echo "</td>";
echo '</td>';
// Iterate through each alert transport
$query = "SELECT `transport_id` AS `id`, `transport_name` AS `name`, `transport_type` AS `type`, `is_default`, `transport_config` AS `config` FROM `alert_transports`";
$query = 'SELECT `transport_id` AS `id`, `transport_name` AS `name`, `transport_type` AS `type`, `is_default`, `transport_config` AS `config` FROM `alert_transports`';
foreach (dbFetchRows($query) as $transport) {
echo "<tr id=\"alert-transport-{$transport['id']}\">";
echo "<td><i>#" . ((int) $transport['id']) . "</i></td>";
echo "<td>" . $transport['name'] . "</td>";
echo "<td>" . $transport['type'] . "</td>";
echo '<td><i>#' . ((int) $transport['id']) . '</i></td>';
echo '<td>' . $transport['name'] . '</td>';
echo '<td>' . $transport['type'] . '</td>';
if ($transport['is_default'] == true) {
echo "<td>Yes</td>";
echo '<td>Yes</td>';
} else {
echo "<td>No</td>";
echo '<td>No</td>';
}
echo "<td class='col-sm-4'>";
@@ -71,11 +71,11 @@ foreach (dbFetchRows($query) as $transport) {
$val = array_search($val, $item['options']);
}
echo "<i>" . $item['title'] . ": " . $val . "<br/></i>";
echo '<i>' . $item['title'] . ': ' . $val . '<br/></i>';
}
echo "</td>";
echo "<td>";
echo '</td>';
echo '<td>';
// Add action buttons for admin users only
if (Auth::user()->hasGlobalAdmin()) {
@@ -83,9 +83,9 @@ foreach (dbFetchRows($query) as $transport) {
echo "<button type='button' class='btn btn-primary' data-toggle='modal' data-target='#edit-alert-transport' data-transport_id='" . $transport['id'] . "' name='edit-alert-rule' data-container='body' data-toggle='popover' data-content='Edit transport'><i class='fa fa-lg fa-pencil' aria-hidden='true'></i></button> ";
echo "<button type='button' class='btn btn-danger' aria-label='Delete' data-toggle='modal' data-target='#delete-alert-transport' data-transport_id='" . $transport['id'] . "' name='delete-alert-transport' data-container='body' data-toggle='popover' data-content='Delete transport'><i class='fa fa-lg fa-trash' aria-hidden='true'></i></button>";
echo "<button type='button' class='btn btn-warning' data-transport_id='" . $transport['id'] . "' data-transport='{$transport['type']}' name='test-transport' id='test-transport' data-toggle='popover' data-content='Test transport'><i class='fa fa-lg fa-check' aria-hidden='true'></i></button> ";
echo "</div>";
echo '</div>';
}
echo "</td>";
echo '</td>';
echo "</tr>\r\n";
}
?>
@@ -105,33 +105,33 @@ foreach (dbFetchRows($query) as $transport) {
if (Auth::user()->hasGlobalAdmin()) {
echo "<button type='button' class='btn btn-primary btn-sm' data-toggle='modal' data-target='#edit-transport-group'><i class='fa fa-plus'></i> Create transport group</button>";
}
echo "</td>";
echo '</td>';
//Iterate through alert groups
$query = "SELECT `transport_group_id` AS `id`, `transport_group_name` AS `name` FROM `alert_transport_groups`";
$query = 'SELECT `transport_group_id` AS `id`, `transport_group_name` AS `name` FROM `alert_transport_groups`';
foreach (dbFetchRows($query) as $group) {
echo "<tr id=\"alert-transport-group-{$group['id']}\">";
echo "<td><i>#" . ((int) $group['id']) . "</i></td>";
echo "<td>" . $group['name'] . "</td>";
echo '<td><i>#' . ((int) $group['id']) . '</i></td>';
echo '<td>' . $group['name'] . '</td>';
//List out the members of each group
$query = "SELECT `transport_type`, `transport_name` FROM `transport_group_transport` AS `a` LEFT JOIN `alert_transports` AS `b` ON `a`.`transport_id`=`b`.`transport_id` WHERE `transport_group_id`=?";
$query = 'SELECT `transport_type`, `transport_name` FROM `transport_group_transport` AS `a` LEFT JOIN `alert_transports` AS `b` ON `a`.`transport_id`=`b`.`transport_id` WHERE `transport_group_id`=?';
$members = dbFetchRows($query, [$group['id']]);
echo "<td>" . sizeof($members) . "</td>";
echo "<td>";
echo '<td>' . sizeof($members) . '</td>';
echo '<td>';
foreach ($members as $member) {
echo "<i>" . ucfirst($member['transport_type']) . ": " . $member['transport_name'] . "<br /></i>";
echo '<i>' . ucfirst($member['transport_type']) . ': ' . $member['transport_name'] . '<br /></i>';
}
echo "</td>";
echo "<td>";
echo '</td>';
echo '<td>';
if (Auth::user()->hasGlobalAdmin()) {
echo "<div class='btn-group btn-group-sm' role='group'>";
echo "<button type='button' class='btn btn-primary' data-toggle='modal' data-target='#edit-transport-group' data-group_id='" . $group['id'] . "' data-container='body' data-toggle='popover' data-content='Edit transport group'><i class='fa fa-lg fa-pencil' aria-hidden='true'></i></button> ";
echo "<button type='button' class='btn btn-danger' aria-label='Delete' data-toggle='modal' data-target='#delete-transport-group' data-group_id='" . $group['id'] . "' data-container='body' data-toggle='popover' data-content='Delete transport group'><i class='fa fa-lg fa-trash' aria-hidden='true'></i></button>";
echo "</div>";
echo '</div>';
}
echo "</td>";
echo "</tr>";
echo '</td>';
echo '</tr>';
}
?>
</table>