136 |
136 |
add_available_filter "estimated_hours", :type => :float
|
137 |
137 |
add_available_filter "done_ratio", :type => :integer
|
138 |
138 |
|
|
139 |
add_available_filter "notes", :type => :text
|
|
140 |
|
139 |
141 |
if User.current.allowed_to?(:set_issues_private, nil, :global => true) ||
|
140 |
142 |
User.current.allowed_to?(:set_own_issues_private, nil, :global => true)
|
141 |
143 |
add_available_filter "is_private",
|
... | ... | |
465 |
467 |
"(#{nl} #{sql_for_field("fixed_version_id", "=", version_ids, Issue.table_name, "fixed_version_id")})"
|
466 |
468 |
end
|
467 |
469 |
|
|
470 |
def sql_for_notes_field(field, operator, value)
|
|
471 |
subquery = "SELECT 1 FROM #{Journal.table_name}" +
|
|
472 |
" WHERE #{Journal.table_name}.journalized_type='Issue' AND #{Journal.table_name}.journalized_id=#{Issue.table_name}.id" +
|
|
473 |
" AND (#{sql_for_field field, operator.ends_with?("~") ? "~" : "*", value, Journal.table_name, 'notes'})" +
|
|
474 |
" AND (#{Journal.visible_notes_condition(User.current, :skip_pre_condition => true)})"
|
|
475 |
"#{operator.starts_with?("!") ? "NOT EXISTS" : "EXISTS"} (#{subquery})"
|
|
476 |
end
|
|
477 |
|
468 |
478 |
def sql_for_is_private_field(field, operator, value)
|
469 |
479 |
op = (operator == "=" ? 'IN' : 'NOT IN')
|
470 |
480 |
va = value.map {|v| v == '0' ? self.class.connection.quoted_false : self.class.connection.quoted_true}.uniq.join(',')
|