Skip to content

Commit

Permalink
fix #40 : show on chart resources on leave during chart period
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanMazinSaidiCodra committed Dec 5, 2024
1 parent 8886eec commit 4fcb061
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions planning/gantt.py
Original file line number Diff line number Diff line change
Expand Up @@ -2546,9 +2546,12 @@ def make_svg_for_resources(

cday += datetime.timedelta(days=1)

nb_tasks = 0
nb_tasks = 0 # includes all resource's tasks in chart period, although he's on leave
# nb_tasks_with_presence = 0
for t in self.get_tasks():
if t.get_resources() is not None and r in t.get_resources():
if t.start_date() >= start_date or t.end_date() <= end_date:
nb_tasks += 1
psvg, void = t.svg(
prev_y=nline,
start=start_date,
Expand All @@ -2560,21 +2563,21 @@ def make_svg_for_resources(
)
if psvg is not None:
ldwg.add(psvg)
nb_tasks += 1
# nb_tasks_with_presence += 1
if not one_line_for_tasks:
nline += 1

if nb_tasks == 0:
nline -= 1
elif nb_tasks >= 0:
else:
# print(r.fullname, nb_tasks)
if resource_on_left or show_title:
ldwg.add(ress)
if show_vacations:
ldwg.add(vac)
if show_conflicts:
ldwg.add(conflicts)
if resource_on_left or not show_title:
if nline > 0 and resource_on_left or not show_title:
nline -= 1

if not one_line_for_tasks:
Expand Down

0 comments on commit 4fcb061

Please sign in to comment.