| 470 |
|
drawbar(es, ef, plancolor, 6, rect.height-12)
|
| 471 |
|
|
| 472 |
|
# asd = task.get('ActualStartDate')
|
| 473 |
|
# aed = task.get('ActualEndDate') or Data.Today()
|
| 474 |
|
# if asd: drawbar(DateInfo[DateConv[asd]][1], DateInfo[DateConv[ase]][1], actualcolor, 4, 4)
|
| 475 |
|
|
| 476 |
|
# bsd = task.get('BaseStartDate')
|
| 477 |
|
# bed = task.get('BaseEndDate')
|
| 478 |
|
# if asd: drawbar(DateInfo[DateConv[asd]][1], DateInfo[DateConv[ase]][1], actualcolor, 20, 4)
|
| |
473 |
reportid = rr.get('ReportID')
|
| |
474 |
bars = Data.Database['Report'][reportid].get('Bars') or 'Cab' # could be 'pab'
|
| |
475 |
|
| |
476 |
if len(bars) == 3: # 'pab' p
|
| |
477 |
bar_height = (rect.height-12) // 3
|
| |
478 |
y_offset = gap = 3
|
| |
479 |
elif len(bars) == 2:
|
| |
480 |
bar_height = (rect.height-12) // 2
|
| |
481 |
y_offset = gap = 4
|
| |
482 |
else: # == 1
|
| |
483 |
bar_height = (rect.height-12)
|
| |
484 |
y_offset = gap = 6
|
| |
485 |
|
| |
486 |
if 'p' in bars or 'c' in bars or 'C' in bars:
|
| |
487 |
drawbar(
|
| |
488 |
es, ef, plancolor,
|
| |
489 |
y_offset, bar_height)
|
| |
490 |
if 'c' in bars or 'C' in bars: # completion percent
|
| |
491 |
if task.get("ActualEndDate"):
|
| |
492 |
pc = 100
|
| |
493 |
position = ef
|
| |
494 |
elif task.get("PercentComplete"): # is this cell end past current position in task
|
| |
495 |
pc = task.get("PercentComplete")
|
| |
496 |
position = es + (pc * (ef-es) / 100) # current position of task
|
| |
497 |
else:
|
| |
498 |
pc = 0
|
| |
499 |
if pc > 0:
|
| |
500 |
if 'c' in bars: # half height completion bar
|
| |
501 |
drawbar(
|
| |
502 |
es, position, completioncolor,
|
| |
503 |
y_offset + bar_height//2, bar_height//2)
|
| |
504 |
elif 'C' in bars: # full height completion bar
|
| |
505 |
drawbar(
|
| |
506 |
es, position, completioncolor,
|
| |
507 |
y_offset, bar_height)
|
| |
508 |
y_offset += bar_height + gap
|
| |
509 |
|
| |
510 |
asd = task.get('ActualStartDate')
|
| |
511 |
if 'a' in bars:
|
| |
512 |
if asd:
|
| |
513 |
ash = task.get('ActualStartHour') or 0
|
| |
514 |
aed = task.get('ActualEndDate') or Data.TodayString()
|
| |
515 |
aeh = task.get('ActualEndHour') or 0
|
| |
516 |
drawbar(
|
| |
517 |
Data.DateInfo[Data.DateConv[asd]][1] + ash,
|
| |
518 |
Data.DateInfo[Data.DateConv[aed]][1] + aeh, actualcolor,
|
| |
519 |
y_offset, bar_height)
|
| |
520 |
y_offset += bar_height + gap
|
| |
521 |
|
| |
522 |
bsd = task.get('BaseStartDate')
|
| |
523 |
if 'b' in bars and bsd:
|
| |
524 |
bsh = task.get('BaseStartHour') or 0
|
| |
525 |
bed = task.get('BaseEndDate') or bad
|
| |
526 |
beh = task.get('BaseEndHour') or 0
|
| |
527 |
drawbar(
|
| |
528 |
Data.DateInfo[Data.DateConv[bsd]][1] + bsh,
|
| |
529 |
Data.DateInfo[Data.DateConv[bed]][1] + beh, basecolor,
|
| |
530 |
y_offset, bar_height)
|