added daysOffset to projecteventtemplate

This commit is contained in:
Fredrik Norberg 2011-07-25 16:20:36 +02:00
parent 816f29ee28
commit 3b25bed168
2 changed files with 17 additions and 5 deletions
src/main/java/se/su/dsv/scipro

@ -38,6 +38,9 @@ public class ProjectEventTemplate extends DomainObject implements Comparable<Pro
@Column(nullable=false)
private long estimatedTimeConsumption = 0;
@Column(nullable=false)
private int daysOffset;
@Column(nullable=false)
private boolean requireHandIn = false;
@ -46,6 +49,10 @@ public class ProjectEventTemplate extends DomainObject implements Comparable<Pro
public ProjectEventTemplate(){}
public ProjectEventTemplate(int daysOffset){
this.daysOffset = daysOffset;
}
public Long getId() {
return id;
}
@ -53,6 +60,14 @@ public class ProjectEventTemplate extends DomainObject implements Comparable<Pro
public void setId(Long id) {
this.id = id;
}
public void setdaysOffset(int daysOffset){
this.daysOffset = daysOffset;
}
public int getDaysOffset(){
return daysOffset;
}
public String getTitle() {
return title;

@ -38,6 +38,7 @@ public class TemplateGenerator { //based on ScheduleGenerator
private int templateEstimatedDays = 0;
private int durationInDays = 0;
private int daysOffset;
private DateMidnight startDate;
@ -58,10 +59,6 @@ public class TemplateGenerator { //based on ScheduleGenerator
}else{
this.startDate = new DateMidnight(projectEvents.first().getDueDate());
}
}
public ScheduleTemplate generate(){
@ -93,7 +90,7 @@ public class TemplateGenerator { //based on ScheduleGenerator
pet.setNumberInOrder(counter);
pet.setRequireHandIn(pe.isRequireHandIn());
pet.setScheduleTemplate(template);
måste in daysOffset i projectEventTemplate
datePointer = datePointer.plusDays(durationInDays);
templateEstimatedDays += durationInDays;