summaryrefslogtreecommitdiff
path: root/classes/pref
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2015-08-17 12:33:07 +0300
committerAndrew Dolgov <[email protected]>2015-08-17 12:33:07 +0300
commite17079dcef4be49082353d71d21918f1722ff039 (patch)
tree4f1bd88e089fe48607b030b8d8946909b33d8bfd /classes/pref
parent961cae85a4ed14647c3b4a616c3c63873c7bc5e0 (diff)
make disabled filter rules easier to discern
show if filter set match_any_rule on the overview
Diffstat (limited to 'classes/pref')
-rw-r--r--classes/pref/filters.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/classes/pref/filters.php b/classes/pref/filters.php
index efa82afc2..a371fcff4 100644
--- a/classes/pref/filters.php
+++ b/classes/pref/filters.php
@@ -1070,20 +1070,22 @@ class Pref_Filters extends Handler_Protected {
private function getFilterName($id) {
$result = $this->dbh->query(
- "SELECT title,COUNT(DISTINCT r.id) AS num_rules,COUNT(DISTINCT a.id) AS num_actions
+ "SELECT title,match_any_rule,COUNT(DISTINCT r.id) AS num_rules,COUNT(DISTINCT a.id) AS num_actions
FROM ttrss_filters2 AS f LEFT JOIN ttrss_filters2_rules AS r
ON (r.filter_id = f.id)
LEFT JOIN ttrss_filters2_actions AS a
- ON (a.filter_id = f.id) WHERE f.id = '$id' GROUP BY f.title");
+ ON (a.filter_id = f.id) WHERE f.id = '$id' GROUP BY f.title, f.match_any_rule");
$title = $this->dbh->fetch_result($result, 0, "title");
$num_rules = $this->dbh->fetch_result($result, 0, "num_rules");
$num_actions = $this->dbh->fetch_result($result, 0, "num_actions");
+ $match_any_rule = sql_bool_to_bool($this->dbh->fetch_result($result, 0, "match_any_rule"));
if (!$title) $title = __("[No caption]");
$title = sprintf(_ngettext("%s (%d rule)", "%s (%d rules)", $num_rules), $title, $num_rules);
+
$result = $this->dbh->query(
"SELECT * FROM ttrss_filters2_actions WHERE filter_id = '$id' ORDER BY id LIMIT 1");
@@ -1096,6 +1098,8 @@ class Pref_Filters extends Handler_Protected {
$num_actions -= 1;
}
+ if ($match_any_rule) $title .= " (" . __("matches any rule") . ")";
+
if ($num_actions > 0)
$actions = sprintf(_ngettext("%s (+%d action)", "%s (+%d actions)", $num_actions), $actions, $num_actions);