diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2018-12-12 19:52:28 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2018-12-12 19:52:28 +0000 |
commit | e647e99b741ce0360ee479925009076f48d0d8a5 (patch) | |
tree | e4f9bf27a97cbae1842e7e3448c3055cfe5dad48 /lib/redmine | |
parent | 72980f41751a4d09c965733638572f799146e3e3 (diff) | |
download | redmine-e647e99b741ce0360ee479925009076f48d0d8a5.tar.gz redmine-e647e99b741ce0360ee479925009076f48d0d8a5.zip |
Allow issues grouping by creation, update and closing date (#13803).
Implemented for PostgreSQL only for now.
git-svn-id: http://svn.redmine.org/redmine/trunk@17724 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine')
-rw-r--r-- | lib/redmine/database.rb | 13 | ||||
-rw-r--r-- | lib/redmine/export/pdf/issues_pdf_helper.rb | 2 |
2 files changed, 14 insertions, 1 deletions
diff --git a/lib/redmine/database.rb b/lib/redmine/database.rb index 02580d160..c18470a41 100644 --- a/lib/redmine/database.rb +++ b/lib/redmine/database.rb @@ -64,6 +64,19 @@ module Redmine end end + # Returns a SQL statement to cast a timestamp column to a date given a time zone + # Returns nil if not implemented for the current database + def timestamp_to_date(column, time_zone) + if postgresql? + if time_zone + identifier = ActiveSupport::TimeZone.find_tzinfo(time_zone.name).identifier + "(#{column}::timestamptz AT TIME ZONE '#{identifier}')::date" + else + "#{column}::date" + end + end + end + # Resets database information def reset @postgresql_unaccent = nil diff --git a/lib/redmine/export/pdf/issues_pdf_helper.rb b/lib/redmine/export/pdf/issues_pdf_helper.rb index 7e2c8a85f..3a6183893 100644 --- a/lib/redmine/export/pdf/issues_pdf_helper.rb +++ b/lib/redmine/export/pdf/issues_pdf_helper.rb @@ -303,7 +303,7 @@ module Redmine issue_list(issues) do |issue, level| if query.grouped? && - (group = query.group_by_column.value(issue)) != previous_group + (group = query.group_by_column.group_value(issue)) != previous_group pdf.SetFontStyle('B',10) group_label = group.blank? ? 'None' : group.to_s.dup group_label << " (#{result_count_by_group[group]})" |