Defect #31637 » 0001-Fix-timespan-format-of-PDF-download.patch
| lib/redmine/export/pdf/issues_pdf_helper.rb | ||
|---|---|---|
|
module Export
|
||
|
module PDF
|
||
|
module IssuesPdfHelper
|
||
|
include Redmine::I18n
|
||
|
# Returns a PDF string of a single issue
|
||
|
def issue_to_pdf(issue, assoc={})
|
||
|
pdf = ITCPDF.new(current_language)
|
||
| ... | ... | |
|
value = " " * level + value
|
||
|
when :attachments
|
||
|
value = value.to_a.map {|a| a.filename}.join("\n")
|
||
|
when :hours, :estimated_hours, :total_estimated_hours, :spent_hours, :total_spent_hours
|
||
|
value = format_hours(value)
|
||
|
end
|
||
|
if value.is_a?(Date)
|
||
|
format_date(value)
|
||
| test/unit/lib/redmine/export/pdf/issues_pdf_test.rb | ||
|---|---|---|
|
include Redmine::Export::PDF::IssuesPdfHelper
|
||
|
def test_fetch_row_values_should_round_float_values
|
||
|
def test_fetch_row_values_should_follow_timestamp_format_setting
|
||
|
query = IssueQuery.new(:project => Project.find(1), :name => '_')
|
||
|
query.column_names = [:subject, :spent_hours]
|
||
|
issue = Issue.find(2)
|
||
| ... | ... | |
|
time_entry = TimeEntry.create!(:spent_on => Date.today, :hours => 4.3432, :user => user, :author => user,
|
||
|
:project_id => 1, :issue => issue, :activity => TimeEntryActivity.first)
|
||
|
results = fetch_row_values(issue, query, 0)
|
||
|
assert_equal ["2", "Add ingredients categories", "4.34"], results
|
||
|
with_settings timespan_format: 'decimal' do
|
||
|
results = fetch_row_values(issue, query, 0)
|
||
|
assert_equal ["2", "Add ingredients categories", "4.34"], results
|
||
|
end
|
||
|
with_settings timespan_format: 'minutes' do
|
||
|
results = fetch_row_values(issue, query, 0)
|
||
|
assert_equal ["2", "Add ingredients categories", "4:21"], results
|
||
|
end
|
||
|
end
|
||
|
def test_fetch_row_values_should_be_able_to_handle_parent_issue_subject
|
||
- « Previous
- 1
- 2
- Next »