Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 5a0d02dd2ca19e399ef7410669e2e3d5fa798ab5 2 parents b5852be + bc1b2d6
Chris Schlaeger scrapper authored
26 lib/taskjuggler/TaskScenario.rb
View
@@ -956,7 +956,7 @@ def propagateDate(date, atEnd, ignoreEffort = false)
"to task #{@property.id}")
thisEnd = atEnd ? 'end' : 'start'
otherEnd = atEnd ? 'start' : 'end'
- #puts "Propagating #{thisEnd} date #{date} of #{@property.fullId} " +
+ #puts "Propagating #{thisEnd} date #{date} to #{@property.fullId} " +
# "#{ignoreEffort ? "ignoring effort" : "" }"
# These flags are just used to avoid duplicate calls of this function
@@ -1898,19 +1898,13 @@ def bookResource(resource)
# slot.
if @effort > 0 && @assignedresources.empty?
if @forward
- @start = @project.idxToDate(@currentSlotIdx)
+ propagateDate(@project.idxToDate(@currentSlotIdx), false, true)
Log.msg { "Task #{@property.fullId} first assignment: " +
"#{period_to_s}" }
- @startsuccs.each do |task, onEnd|
- task.propagateDate(@scenarioIdx, @start, false, true)
- end
else
- @end = @project.idxToDate(@currentSlotIdx + 1)
+ propagateDate(@project.idxToDate(@currentSlotIdx + 1), true, true)
Log.msg { "Task #{@property.fullId} last assignment: " +
"#{period_to_s}" }
- @endpreds.each do |task, onEnd|
- task.propagateDate(@scenarioIdx, @end, true, true)
- end
end
end
@@ -2091,8 +2085,8 @@ def bookBookings
requestedLength = @project.slotsToDays(@length)
warning('overbooked_length',
"The total length (#{length}d) of the provided bookings " +
- "for task #{@property.fullId} exceeds the specified length of " +
- "#{requestedLength}d.")
+ "for task #{@property.fullId} exceeds the specified length " +
+ "of #{requestedLength}d.")
end
if @duration > 0 && @doneDuration > @duration
duration = @doneDuration * @project['scheduleGranularity'] /
@@ -2104,6 +2098,16 @@ def bookBookings
"for task #{@property.fullId} exceeds the specified duration " +
"of #{requestedDuration}d.")
end
+
+ # If a task has only bookings but no effort, length or duration and is
+ # not a milestone but marked as being scheduled, we set the start and
+ # end date according to the first/last booking date unless the date has
+ # been set already.
+ if @scheduled && @effort == 0 && @length == 0 && @duration == 0 &&
+ !@milestone
+ @start = @project.idxToDate(firstSlotIdx) unless @start
+ @end = @project.idxToDate(lastSlotIdx + 1) unless @end
+ end
end
def rollbackBookings
39 lib/taskjuggler/TjpSyntaxRules.rb
View
@@ -5926,9 +5926,10 @@ def rule_taskDepAttributes
@taskDependency.gapDuration = @val[1]
})
doc('gapduration', <<'EOT'
-Specifies the minimum required gap between the end of a preceding task and the
-start of this task, or the start of a following task and the end of this task.
-This is calendar time, not working time. 7d means one week.
+Specifies the minimum required gap between the start or end of a preceding
+task and the start of this task, or the start or end of a following task and
+the end of this task. This is calendar time, not working time. 7d means one
+week.
EOT
)
@@ -5936,11 +5937,11 @@ def rule_taskDepAttributes
@taskDependency.gapLength = @val[1]
})
doc('gaplength', <<'EOT'
-Specifies the minimum required gap between the end of a preceding task and the
-start of this task, or the start of a following task and the end of this task.
-This is working time, not calendar time. 7d means 7 working days, not one
-week. Whether a day is considered a working day or not depends on the defined
-working hours and global leaves.
+Specifies the minimum required gap between the start or end of a preceding
+task and the start of this task, or the start or end of a following task and
+the end of this task. This is working time, not calendar time. 7d means 7
+working days, not one week. Whether a day is considered a working day or not
+depends on the defined working hours and global leaves.
EOT
)
@@ -6541,7 +6542,8 @@ def rule_taskScenarioAttributes
@property['end', @scenarioIdx].nil?) ||
(!@property['milestone', @scenarioIdx] &&
(@property['start', @scenarioIdx].nil? ||
- @property['end', @scenarioIdx].nil?))
+ @property['end', @scenarioIdx].nil?) &&
+ @property['booking', @scenarioIdx].empty?)
error('not_scheduled',
"Task #{@property.fullId} is marked as scheduled but does not " +
'have a fixed start and end date.',
@@ -6550,10 +6552,13 @@ def rule_taskScenarioAttributes
@property['scheduled', @scenarioIdx] = true
})
doc('scheduled', <<'EOT'
-This is mostly for internal use. It specifies that the task should be ignored
-for scheduling in the scenario. This option only makes sense if you provide
-all resource [[booking.resource|bookings]] manually. Without booking
-statements, the task will be reported with 0 effort and no resources assigned.
+It specifies that the task can be ignored for scheduling in the scenario. This
+option only makes sense if you provide all resource
+[[booking.resource|bookings]] manually. Without booking statements, the task
+will be reported with 0 effort and no resources assigned. If the task is not a
+milestone, has no effort, length or duration criteria, the start and end date
+will be derived from the first and last booking in case those dates are not
+supplied.
EOT
)
@@ -7064,6 +7069,10 @@ def rule_traceReport
all kinds of values that are being tracked. Report formats that don't support
a mix of different values will just show the values of the second column.
+The values in the CSV files are fixed units and cannot be formated. Effort
+values are always in resource-days. This allows other software to interpret
+the file without any need for additional context information.
+
The HTML version generates SVG graphs that are embedded in the HTML page.
These graphs are only visble if the web browser supports HTML5. This is true
for the latest generation of browsers, but older browsers may not support this
@@ -7132,6 +7141,7 @@ def rule_tsNewTaskHeader
})
arg(1, 'task', 'ID of the new task')
end
+
def rule_tsReportHeader
pattern(%w( _timesheetreport !optionalID $STRING ), lambda {
newReport(@val[1], @val[2], :timeSheet, @sourceFileInfo[0]) do
@@ -7143,7 +7153,8 @@ def rule_tsReportHeader
end
@property.set('scenarios', [ scenarioIdx ])
# Show all tasks, sorted by seqno-up.
- @property.set('hideTask', LogicalExpression.new(LogicalOperation.new(0)))
+ @property.set('hideTask',
+ LogicalExpression.new(LogicalOperation.new(0)))
@property.set('sortTasks', [ [ 'seqno', true, -1 ] ])
# Show all resources, sorted by seqno-up.
@property.set('hideResource',
17 test/TestSuite/Scheduler/Correct/Depends.tjp
View
@@ -2,6 +2,9 @@ project test "Test" "1.0" 2007-04-02 +3m
include "checks.tji"
+resource r1 "R1"
+resource r2 "R2"
+
task t1 "T1" {
start ${projectstart}
duration 1w
@@ -38,6 +41,20 @@ task t6 "T6" {
${FixTask "2007-05-11-17:00" "2007-05-18-17:00"}
}
+task t7 "T7" {
+ start ${projectstart}
+ effort 1w
+ allocate r1
+ ${FixEnd "2007-04-06-17:00"}
+}
+
+task t8 "T8" {
+ depends t7 { onstart gaplength 1w }
+ effort 1w
+ allocate r2
+ ${FixTask "2007-04-9-9:00" "2007-04-13-17:00"}
+}
+
taskreport depends "Depends" {
formats html
columns name, start, end, daily
17 test/TestSuite/Scheduler/Correct/Precedes.tjp
View
@@ -2,6 +2,9 @@ project test "Test" "1.0" 2007-04-02 - 2007-07-01
include "checks.tji"
+resource r1 "R1"
+resource r2 "R2"
+
task t1 "T1" {
end ${projectend}
duration 1w
@@ -38,6 +41,20 @@ task t6 "T6" {
${FixTask "2007-05-14-9:00" "2007-05-21-9:00"}
}
+task t7 "T7" {
+ end ${projectend}
+ effort 1w
+ allocate r1
+ ${FixStart "2007-06-25-9:00"}
+}
+
+task t8 "T8" {
+ precedes t7 { onend gaplength 1w }
+ effort 1w
+ allocate r2
+ ${FixTask "2007-06-18-9:00" "2007-06-22-17:00"}
+}
+
taskreport preceds "Precedes" {
formats html
columns name, start, end, daily
11 test/TestSuite/Scheduler/Correct/Scheduled.tjp
View
@@ -0,0 +1,11 @@
+project "Test" 2013-08-18 +1m
+
+include "checks.tji"
+
+resource r "R"
+
+task "Foo" {
+ booking r 2013-08-19-9:00 +8h
+ scheduled
+ ${FixTask "2013-08-19-9:00" "2013-08-19-17:00"}
+}
Please sign in to comment.
Something went wrong with that request. Please try again.