Disable tasks movement for tasks updated from timesheets
Mark updatedFromTimesheets is reseted before adapting the planing in order to move the tasks if needed. FEA: ItEr77S12AdaptPlanningAccordingTimesheets
This commit is contained in:
parent
2c98e99d63
commit
62d9221e6f
6 changed files with 23 additions and 4 deletions
|
|
@ -308,4 +308,9 @@ public class DefaultFundamentalProperties implements ITaskFundamentalProperties
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUpdatedFromTimesheets() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,4 +125,6 @@ public interface ITaskFundamentalProperties {
|
|||
|
||||
public boolean isRoot();
|
||||
|
||||
boolean isUpdatedFromTimesheets();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -548,4 +548,9 @@ public abstract class Task implements ITaskFundamentalProperties {
|
|||
getBeginDate());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUpdatedFromTimesheets() {
|
||||
return fundamentalProperties.isUpdatedFromTimesheets();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public class TaskLeaf extends Task {
|
|||
@Override
|
||||
public boolean canBeExplicitlyMoved() {
|
||||
return !(isSubcontracted() || isLimitingAndHasDayAssignments()
|
||||
|| hasConsolidations() || isManualAnyAllocation());
|
||||
|| hasConsolidations() || isManualAnyAllocation() || isUpdatedFromTimesheets());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1223,6 +1223,11 @@ _(
|
|||
return taskElement.isRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUpdatedFromTimesheets() {
|
||||
return taskElement.isUpdatedFromTimesheets();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -63,10 +63,11 @@ public class AdaptPlanningCommand implements IAdaptPlanningCommand {
|
|||
.getAllChildren();
|
||||
for (TaskElement taskElement : taskElements) {
|
||||
OrderElement orderElement = taskElement.getOrderElement();
|
||||
taskElement.setUpdatedFromTimesheets(orderElement
|
||||
.hasTimesheetsReportingHours());
|
||||
// Reset status to allow move the task if needed while adapting the
|
||||
// planning
|
||||
taskElement.setUpdatedFromTimesheets(false);
|
||||
|
||||
if (taskElement.isUpdatedFromTimesheets()) {
|
||||
if (orderElement.hasTimesheetsReportingHours()) {
|
||||
setStartDateAndConstraint(taskElement, orderElement
|
||||
.getSumChargedEffort().getFirstTimesheetDate());
|
||||
Date lastTimesheetDate = orderElement.getSumChargedEffort()
|
||||
|
|
@ -80,6 +81,7 @@ public class AdaptPlanningCommand implements IAdaptPlanningCommand {
|
|||
removeTimesheetsProgressIfAny(orderElement);
|
||||
}
|
||||
|
||||
taskElement.setUpdatedFromTimesheets(true);
|
||||
updateTask(context, taskElement);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue