Redmine 4.1.7
This commit is contained in:
parent
55458d3479
commit
3ca3c37487
103 changed files with 2426 additions and 431 deletions
|
@ -51,7 +51,7 @@ class QueryColumn
|
|||
|
||||
# Returns true if the column is sortable, otherwise false
|
||||
def sortable?
|
||||
!@sortable.nil?
|
||||
@sortable.present?
|
||||
end
|
||||
|
||||
def sortable
|
||||
|
@ -501,7 +501,7 @@ class Query < ActiveRecord::Base
|
|||
if has_filter?(field) || !filter.remote
|
||||
options[:values] = filter.values
|
||||
if options[:values] && values_for(field)
|
||||
missing = Array(values_for(field)).select(&:present?) - options[:values].map(&:last)
|
||||
missing = Array(values_for(field)).select(&:present?) - options[:values].map{|v| v[1]}
|
||||
if missing.any? && respond_to?(method = "find_#{field}_filter_values")
|
||||
options[:values] += send(method, missing)
|
||||
end
|
||||
|
@ -609,13 +609,18 @@ class Query < ActiveRecord::Base
|
|||
if project
|
||||
project.rolled_up_custom_fields
|
||||
else
|
||||
IssueCustomField.all
|
||||
IssueCustomField.sorted
|
||||
end
|
||||
end
|
||||
|
||||
# Returns a scope of project custom fields that are available as columns or filters
|
||||
def project_custom_fields
|
||||
ProjectCustomField.all
|
||||
ProjectCustomField.sorted
|
||||
end
|
||||
|
||||
# Returns a scope of time entry custom fields that are available as columns or filters
|
||||
def time_entry_custom_fields
|
||||
TimeEntryCustomField.sorted
|
||||
end
|
||||
|
||||
# Returns a scope of project statuses that are available as columns or filters
|
||||
|
@ -866,10 +871,10 @@ class Query < ActiveRecord::Base
|
|||
|
||||
def project_statement
|
||||
project_clauses = []
|
||||
active_subprojects_ids = []
|
||||
subprojects_ids = []
|
||||
|
||||
active_subprojects_ids = project.descendants.active.map(&:id) if project
|
||||
if active_subprojects_ids.any?
|
||||
subprojects_ids = project.descendants.where.not(status: Project::STATUS_ARCHIVED).ids if project
|
||||
if subprojects_ids.any?
|
||||
if has_filter?("subproject_id")
|
||||
case operator_for("subproject_id")
|
||||
when '='
|
||||
|
@ -878,7 +883,7 @@ class Query < ActiveRecord::Base
|
|||
project_clauses << "#{Project.table_name}.id IN (%s)" % ids.join(',')
|
||||
when '!'
|
||||
# exclude the selected subprojects
|
||||
ids = [project.id] + active_subprojects_ids - values_for("subproject_id").map(&:to_i)
|
||||
ids = [project.id] + subprojects_ids - values_for("subproject_id").map(&:to_i)
|
||||
project_clauses << "#{Project.table_name}.id IN (%s)" % ids.join(',')
|
||||
when '!*'
|
||||
# main project only
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue