comparison lib/redmine/export/.svn/text-base/pdf.rb.svn-base @ 1:cca12e1c1fd4

* Update to Redmine trunk (SVN revisions 3860-3892)
author Chris Cannam
date Wed, 28 Jul 2010 12:08:28 +0100
parents 513646585e45
children 40f7cfd4df19
comparison
equal deleted inserted replaced
0:513646585e45 1:cca12e1c1fd4
323 pdf.SetX(15) 323 pdf.SetX(15)
324 pdf.Cell(70, 20, project.to_s) 324 pdf.Cell(70, 20, project.to_s)
325 pdf.Ln 325 pdf.Ln
326 pdf.SetFontStyle('B',9) 326 pdf.SetFontStyle('B',9)
327 327
328 subject_width = 70 328 subject_width = 100
329 header_heigth = 5 329 header_heigth = 5
330 330
331 headers_heigth = header_heigth 331 headers_heigth = header_heigth
332 show_weeks = false 332 show_weeks = false
333 show_days = false 333 show_days = false
339 show_days = true 339 show_days = true
340 headers_heigth = 3*header_heigth 340 headers_heigth = 3*header_heigth
341 end 341 end
342 end 342 end
343 343
344 g_width = 210 344 g_width = 280 - subject_width
345 zoom = (g_width) / (gantt.date_to - gantt.date_from + 1) 345 zoom = (g_width) / (gantt.date_to - gantt.date_from + 1)
346 g_height = 120 346 g_height = 120
347 t_height = g_height + headers_heigth 347 t_height = g_height + headers_heigth
348 348
349 y_start = pdf.GetY 349 y_start = pdf.GetY
413 pdf.SetFontStyle('B',7) 413 pdf.SetFontStyle('B',7)
414 gantt.events.each do |i| 414 gantt.events.each do |i|
415 pdf.SetY(top) 415 pdf.SetY(top)
416 pdf.SetX(15) 416 pdf.SetX(15)
417 417
418 text = ""
418 if i.is_a? Issue 419 if i.is_a? Issue
419 pdf.Cell(subject_width-15, 5, "#{i.tracker} #{i.id}: #{i.subject}".sub(/^(.{30}[^\s]*\s).*$/, '\1 (...)'), "LR") 420 text = "#{i.tracker} #{i.id}: #{i.subject}"
420 else 421 else
421 pdf.Cell(subject_width-15, 5, "#{l(:label_version)}: #{i.name}", "LR") 422 text = i.name
422 end 423 end
423 424 text = "#{i.project} - #{text}" unless project && project == i.project
424 pdf.SetY(top) 425 pdf.Cell(subject_width-15, 5, text, "LR")
426
427 pdf.SetY(top + 0.2)
425 pdf.SetX(subject_width) 428 pdf.SetX(subject_width)
426 pdf.Cell(g_width, 5, "", "LR") 429 pdf.SetFillColor(255, 255, 255)
427 430 pdf.Cell(g_width, 4.6, "", "LR", 0, "", 1)
428 pdf.SetY(top+1.5) 431 pdf.SetY(top+1.5)
429 432
430 if i.is_a? Issue 433 if i.is_a? Issue
431 i_start_date = (i.start_date >= gantt.date_from ? i.start_date : gantt.date_from ) 434 i_start_date = (i.start_date >= gantt.date_from ? i.start_date : gantt.date_from )
432 i_end_date = (i.due_before <= gantt.date_to ? i.due_before : gantt.date_to ) 435 i_end_date = (i.due_before <= gantt.date_to ? i.due_before : gantt.date_to )