[Bug #729] Fix bug

The problem persisted because the dates were being copied directly
from TaskDTO. Now this is avoided.

FEA: ItEr63S03BugFixing
This commit is contained in:
Óscar González Fernández 2010-11-18 14:11:51 +01:00
parent 265327a7ef
commit ed77a8ad45
2 changed files with 14 additions and 5 deletions

View file

@ -71,7 +71,13 @@ public class TaskEditFormComposer extends GenericForwardComposer {
public void accept() {
if (currentTask != null) {
copyFromDTO(taskDTO, currentTask);
copyFromDTO(taskDTO, currentTask, true);
}
}
public void acceptWithoutCopyingDates() {
if (currentTask != null) {
copyFromDTO(taskDTO, currentTask, false);
}
}
@ -105,10 +111,13 @@ public class TaskEditFormComposer extends GenericForwardComposer {
return result;
}
private void copyFromDTO(TaskDTO taskDTO, Task currentTask) {
private void copyFromDTO(TaskDTO taskDTO, Task currentTask,
boolean copyDates) {
currentTask.setName(taskDTO.name);
currentTask.setBeginDate(GanttDate.createFrom(taskDTO.beginDate));
currentTask.resizeTo(GanttDate.createFrom(taskDTO.endDate));
if (copyDates) {
currentTask.setBeginDate(GanttDate.createFrom(taskDTO.beginDate));
currentTask.resizeTo(GanttDate.createFrom(taskDTO.endDate));
}
currentTask.setNotes(taskDTO.notes);
currentTask.setDeadline(taskDTO.deadlineDate);
}

View file

@ -408,7 +408,7 @@ public class TaskPropertiesController extends GenericForwardComposer {
ok = saveConstraintChanges();
}
if (ok) {
taskEditFormComposer.accept();
taskEditFormComposer.acceptWithoutCopyingDates();
}
}