summaryrefslogtreecommitdiffstats
path: root/modules-available/eventlog/pages/rules.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2025-01-16 14:46:59 +0100
committerSimon Rettberg2025-01-16 14:46:59 +0100
commit15f49de80fad83306c9cc3fc7cf0059eb145d521 (patch)
tree6b755efac813288caa4382d6e1fb70509494e57b /modules-available/eventlog/pages/rules.inc.php
parent[eventlog] Filters: Add two more examples (diff)
downloadslx-admin-15f49de80fad83306c9cc3fc7cf0059eb145d521.tar.gz
slx-admin-15f49de80fad83306c9cc3fc7cf0059eb145d521.tar.xz
slx-admin-15f49de80fad83306c9cc3fc7cf0059eb145d521.zip
[eventlog] Cosmetic changes; nicer UI, sorting, warning, etc.HEADmaster
Diffstat (limited to 'modules-available/eventlog/pages/rules.inc.php')
-rw-r--r--modules-available/eventlog/pages/rules.inc.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/modules-available/eventlog/pages/rules.inc.php b/modules-available/eventlog/pages/rules.inc.php
index 7b43cfdb..ca39b15b 100644
--- a/modules-available/eventlog/pages/rules.inc.php
+++ b/modules-available/eventlog/pages/rules.inc.php
@@ -96,12 +96,13 @@ class SubPage
} else {
// LIST
$data = [];
- $data['filters'] = Database::queryAll('SELECT ruleid, type, title, datafilter,
+ $data['filters'] = Database::queryAll('SELECT ruleid, type, title, description, datafilter,
Count(transportid) AS useCount
FROM notification_rule
LEFT JOIN notification_rule_x_transport sfxb USING (ruleid)
GROUP BY ruleid, title
- ORDER BY title, ruleid');
+ ORDER BY SIGN(Count(transportid)) DESC, title, ruleid');
+ //usort($data['filters'])
Permission::addGlobalTags($data['perms'], null, ['filter.rules.edit']);
Render::addTemplate('page-filters-rules', $data);
}
@@ -117,15 +118,17 @@ class SubPage
$filterIdx = 0;
$knownIdxList = [];
if ($id !== 0) {
- $data = Database::queryFirst('SELECT ruleid, title, description, type, datafilter, subject, message
+ $data = Database::queryFirst('SELECT ruleid, title, description, type, datafilter, subject, message, predefid
FROM notification_rule WHERE ruleid = :id', ['id' => $id]);
if ($data === false) {
Message::addError('invalid-rule-id', $id);
Util::redirect('?do=eventlog&show=rules');
}
+ $data['edit_warn'] = $data['predefid'] !== null;
if (Request::get('copy', false, 'bool')) {
$data['ruleid'] = 0;
$data['title'] = '';
+ $data['edit_warn'] = false;
}
$list = json_decode($data['datafilter'], true);
if (!is_array($list['list'])) {