ItEr38S05ValidacionEProbasFuncionaisItEr37S06: [Bug #133] Use order calendar if TaskElement has not an assigned calendar.

This commit is contained in:
Manuel Rego Casasnovas 2009-12-09 16:43:38 +01:00 committed by Javier Moran Rua
parent 3e213cdaf6
commit bd8f5802a1
2 changed files with 16 additions and 0 deletions

View file

@ -688,4 +688,16 @@ public abstract class OrderElement extends BaseEntity {
return result;
}
public Order getOrder() {
if (this instanceof Order) {
return (Order) this;
}
if (parent != null) {
return parent.getOrder();
}
return null;
}
}

View file

@ -304,6 +304,10 @@ public abstract class TaskElement extends BaseEntity {
}
public BaseCalendar getCalendar() {
if (calendar == null) {
return getOrderElement().getOrder().getCalendar();
}
return calendar;
}