プロジェクト

全般

プロフィール

Vote #66954

未完了

Gantt to PDF not working with subtasking

Admin Redmine さんが約2年前に追加. 約2年前に更新.

ステータス:
Confirmed
優先度:
通常
担当者:
-
カテゴリ:
Gantt_34
対象バージョン:
-
開始日:
2010/03/29
期日:
進捗率:

70%

予定工数:
category_id:
34
version_id:
0
issue_org_id:
5211
author_id:
3992
assigned_to_id:
0
comments:
7
status_id:
9
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
63
ステータス-->[Confirmed]

説明

When export a gantt chart to PDF, there's no black bar for the parent-issue, and subtasks are not idented.

Since the limitation of characters for the issue title in PDF is shorter than in HTML, maybe instead of identing you could use symbols for sub-levels.

# Parente Task
+ 1st level subtask
- 2nd level subtask
. 3rd level subtask

journals

Confirmed with 1.0-RC1

I would stick to the spaces as it is just easier to visualize. Maybe just two spaces per indentation?
--------------------------------------------------------------------------------
Simple quick and dirty fix.

in lib/redmine/export/pdf.rb, find the # Tasks comment then change the following (about 6 lines down)

<pre>
if i.is_a? Issue
text = "#{i.tracker} #{i.id}: #{i.subject}"
else
</pre>
to
<pre>
if i.is_a? Issue
text << (" " * i.level)
text << "#{i.tracker} #{i.id}: #{i.subject}"
else
</pre>

that will give you one space of indentation per level.
--------------------------------------------------------------------------------
To change the colour of parent tasks change the following (Near the bottom of the file).

<pre>
l_width = ((i_late_date - i_start_date+1)*zoom) if i_late_date
l_width ||= 0

pdf.SetX(subject_width + i_left)
pdf.SetFillColor(100,100,100) # CHANGE HERE

pdf.Cell(i_width, 2, "", 0, 0, "", 1)
</pre>

<pre>
l_width = ((i_late_date - i_start_date+1)*zoom) if i_late_date
l_width ||= 0

pdf.SetX(subject_width + i_left)

if i.leaf?
pdf.SetFillColor(200,200,200) # Normal colour
else
pdf.SetFillColor(100,100,100) # Parent colour, change to fit your preferences
end

pdf.Cell(i_width, 2, "", 0, 0, "", 1)
</pre>

Note that this doesn't put the downward pointy bits (That is a technical term) on the parent bars, just changes the colour which is good enough for me at the moment.
--------------------------------------------------------------------------------
I suppose those two fixes up solves most of the problem.

Just tests and the downward pointy bits left

--------------------------------------------------------------------------------
I could confirm that this isn't fixed in Redmine 2.2.1.

Any news on this?
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

Admin Redmine さんが約2年前に更新

  • カテゴリGantt_34 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0