summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2023-04-16 08:02:30 +0000
committerGo MAEDA <maeda@farend.jp>2023-04-16 08:02:30 +0000
commit0f6507a607c10fbc971f4bb148594cb0de5c2e71 (patch)
tree49f2bfa1f04dfca60c2e60e1e26cf3d05db87156 /app
parent3c8b9535a38a2675d6f41ab34c6def38f98a7421 (diff)
downloadredmine-0f6507a607c10fbc971f4bb148594cb0de5c2e71.tar.gz
redmine-0f6507a607c10fbc971f4bb148594cb0de5c2e71.zip
Change the notation of "contains any of" filter operator to "*~" (#38435).
git-svn-id: https://svn.redmine.org/redmine/trunk@22197 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/models/issue_query.rb10
-rw-r--r--app/models/query.rb10
2 files changed, 10 insertions, 10 deletions
diff --git a/app/models/issue_query.rb b/app/models/issue_query.rb
index 2aa60fcea..5c66800f9 100644
--- a/app/models/issue_query.rb
+++ b/app/models/issue_query.rb
@@ -614,8 +614,8 @@ class IssueQuery < Query
when "*", "!*"
e = (operator == "*" ? "EXISTS" : "NOT EXISTS")
"#{e} (SELECT 1 FROM #{Attachment.table_name} a WHERE a.container_type = 'Issue' AND a.container_id = #{Issue.table_name}.id)"
- when "~", "!~", "|~"
- c = sql_contains("a.filename", value.first, :all_words => (operator != "|~"))
+ when "~", "!~", "*~"
+ c = sql_contains("a.filename", value.first, :all_words => (operator != "*~"))
e = (operator == "!~" ? "NOT EXISTS" : "EXISTS")
"#{e} (SELECT 1 FROM #{Attachment.table_name} a WHERE a.container_type = 'Issue' AND a.container_id = #{Issue.table_name}.id AND (#{c}))"
when "^", "$"
@@ -630,9 +630,9 @@ class IssueQuery < Query
case operator
when '*', '!*'
(operator == '*' ? cond_description : "NOT (#{cond_description})")
- when '~', '!~', '|~'
+ when '~', '!~', '*~'
(operator == '~' ? '' : "#{cond_description} AND ") +
- sql_contains('a.description', value.first, :match => (operator != '!~'), :all_words => (operator != '|~'))
+ sql_contains('a.description', value.first, :match => (operator != '!~'), :all_words => (operator != '*~'))
when '^', '$'
sql_contains('a.description', value.first, (operator == '^' ? :starts_with : :ends_with) => true)
else
@@ -794,7 +794,7 @@ class IssueQuery < Query
is_all_words =
case operator
when '~' then true
- when '|~', '!~' then false
+ when '*~', '!~' then false
end
fetcher = Redmine::Search::Fetcher.new(
diff --git a/app/models/query.rb b/app/models/query.rb
index 10bd23adf..7764fede1 100644
--- a/app/models/query.rb
+++ b/app/models/query.rb
@@ -306,7 +306,7 @@ class Query < ActiveRecord::Base
"t-" => :label_ago,
"~" => :label_contains,
"!~" => :label_not_contains,
- "|~" => :label_contains_any_of,
+ "*~" => :label_contains_any_of,
"^" => :label_starts_with,
"$" => :label_ends_with,
"=p" => :label_any_issues_in_project,
@@ -324,9 +324,9 @@ class Query < ActiveRecord::Base
:list_subprojects => [ "*", "!*", "=", "!" ],
:date => [ "=", ">=", "<=", "><", "<t+", ">t+", "><t+", "t+", "nd", "t", "ld", "nw", "w", "lw", "l2w", "nm", "m", "lm", "y", ">t-", "<t-", "><t-", "t-", "!*", "*" ],
:date_past => [ "=", ">=", "<=", "><", ">t-", "<t-", "><t-", "t-", "t", "ld", "w", "lw", "l2w", "m", "lm", "y", "!*", "*" ],
- :string => [ "~", "|~", "=", "!~", "!", "^", "$", "!*", "*" ],
- :text => [ "~", "|~", "!~", "^", "$", "!*", "*" ],
- :search => [ "~", "|~", "!~" ],
+ :string => [ "~", "*~", "=", "!~", "!", "^", "$", "!*", "*" ],
+ :text => [ "~", "*~", "!~", "^", "$", "!*", "*" ],
+ :search => [ "~", "*~", "!~" ],
:integer => [ "=", ">=", "<=", "><", "!*", "*" ],
:float => [ "=", ">=", "<=", "><", "!*", "*" ],
:relation => ["=", "!", "=p", "=!p", "!p", "*o", "!o", "!*", "*"],
@@ -1432,7 +1432,7 @@ class Query < ActiveRecord::Base
sql = sql_contains("#{db_table}.#{db_field}", value.first)
when "!~"
sql = sql_contains("#{db_table}.#{db_field}", value.first, :match => false)
- when "|~"
+ when "*~"
sql = sql_contains("#{db_table}.#{db_field}", value.first, :all_words => false)
when "^"
sql = sql_contains("#{db_table}.#{db_field}", value.first, :starts_with => true)