Permalink
Browse files

Merge branch 'master' of github.com:taskjuggler/TaskJuggler

  • Loading branch information...
2 parents 1b8bddb + 5ba2e62 commit 976aaf5a256052a107305ef61c59c5da13ebf2fe @scrapper scrapper committed Jun 13, 2013
Showing with 22 additions and 12 deletions.
  1. +10 −2 lib/taskjuggler/TaskScenario.rb
  2. +11 −9 lib/taskjuggler/TjpSyntaxRules.rb
  3. +1 −1 test/TestSuite/Export-Reports/refs/Shift.tjp
@@ -1755,7 +1755,7 @@ def scheduleSlot
when :lengthTask
bookResources
# The doneLength is only increased for global working time slots.
- @doneLength += 1 if @project.isWorkingTime(@currentSlotIdx)
+ @doneLength += 1 if onShift?(@currentSlotIdx)
# If we have reached the specified duration or lengths, we set the end
# or start date and propagate the value to neighbouring tasks.
@@ -1947,6 +1947,14 @@ def bookResource(resource)
booked
end
+ def onShift?(sbIdx)
+ if @shifts && @shifts.assigned?(sbIdx)
+ return @shifts.onShift?(sbIdx)
+ else
+ return @project.isWorkingTime(sbIdx)
+ end
+ end
+
# Check if all of the task limits are not exceded at the given _sbIdx_. If
# a _resource_ is provided, the limit for that particular resource is
# checked. If no resource is provided, only non-resource-specific limits
@@ -2045,7 +2053,7 @@ def bookBookings
startIdx = @project.dateToIdx(date = @start)
endIdx = @project.dateToIdx(@project['now'])
startIdx.upto(endIdx) do |idx|
- @doneLength += 1 if @project.isWorkingTime(idx)
+ @doneLength += 1 if onShift?(idx)
date += slotDuration
# Continue not only until the @length has been reached, but also
# the tentativeEnd date. This allows us to detect overbookings.
@@ -6327,9 +6327,9 @@ def rule_taskScenarioAttributes
setDurationAttribute('length', @val[1])
})
doc('length', <<'EOT'
-Specifies the global working time to be used for this task. The value is
-specified in working time, not calendar time. 7d means 7 working days, or 7
-times 8 hours (assuming default settings), not one week.
+Specifies the duration of this task as working time, not calendar time. 7d
+means 7 working days, or 7 times 8 hours (assuming default settings), not one
+week.
A task with a length specification may have resource allocations. Resources
are allocated when they are available. There is no guarantee that the task
@@ -6338,12 +6338,14 @@ def rule_taskScenarioAttributes
is available is still considered working time, if there is no global vacation
and global working hours are defined accordingly.
-For the length calculation, only the global working hours and the global
-leaves matter. If a resource has additinal working hours defined, it's
-quite possible that a task with a length of 5d will have an allocated effort
-larger than 40 hours. Resource working hours only have an impact on whether an
-allocation is made or not for a particular time slot. They don't effect the
-resulting duration of the task.
+For the length calculation, the global working hours and the global leaves
+matter unless the task has [[shifts.task|shifts]] assigned. In the latter case
+the working hours and leaves of the shift apply for the specified period to
+determine if a slot is working time or not. If a resource has additinal
+working hours defined, it's quite possible that a task with a length of 5d
+will have an allocated effort larger than 40 hours. Resource working hours
+only have an impact on whether an allocation is made or not for a particular
+time slot. They don't effect the resulting duration of the task.
Tasks may not have subtasks if this attribute is used. Setting this attribute
will reset the [[duration]], [[effort]] and [[milestone]] attributes.
@@ -57,7 +57,7 @@ resource r2 "Resource2"
task t1 "Task1" {
start 2000-01-01-07:00-+0000
- end 2000-02-05-00:00-+0000
+ end 2000-02-08-20:00-+0000
scheduling asap
scheduled
}

0 comments on commit 976aaf5

Please sign in to comment.