[Bug #980] show warning in "Earned Value" tab for future dates.
FEA: ItEr74S04BugFixing
This commit is contained in:
parent
5c90bf0398
commit
6fc94feca3
2 changed files with 21 additions and 0 deletions
|
|
@ -97,6 +97,7 @@ import org.zkoss.ganttz.timetracker.zoom.IZoomLevelChangedListener;
|
|||
import org.zkoss.ganttz.timetracker.zoom.ZoomLevel;
|
||||
import org.zkoss.ganttz.util.Interval;
|
||||
import org.zkoss.zk.ui.Executions;
|
||||
import org.zkoss.zk.ui.WrongValueException;
|
||||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zk.ui.event.EventListener;
|
||||
import org.zkoss.zk.ui.event.Events;
|
||||
|
|
@ -383,11 +384,21 @@ public abstract class CompanyPlanningModel implements ICompanyPlanningModel {
|
|||
vbox.removeChild(child);
|
||||
vbox.appendChild(getEarnedValueChartConfigurableLegend(
|
||||
earnedValueChartFiller, date));
|
||||
dateInfutureMessage(datebox);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private void dateInfutureMessage(Datebox datebox) {
|
||||
Date value = datebox.getValue();
|
||||
Date today = LocalDate.fromDateFields(new Date())
|
||||
.toDateTimeAtStartOfDay().toDate();
|
||||
if (value != null && (value.compareTo(today) > 0)) {
|
||||
throw new WrongValueException(datebox, _("date in future"));
|
||||
}
|
||||
}
|
||||
|
||||
public static void appendLoadChartAndLegend(Tabpanel loadChartPannel,
|
||||
Timeplot loadChart) {
|
||||
Hbox hbox = new Hbox();
|
||||
|
|
|
|||
|
|
@ -772,6 +772,15 @@ public abstract class OrderPlanningModel implements IOrderPlanningModel {
|
|||
};
|
||||
}
|
||||
|
||||
private void dateInfutureMessage(Datebox datebox) {
|
||||
Date value = datebox.getValue();
|
||||
Date today = LocalDate.fromDateFields(new Date())
|
||||
.toDateTimeAtStartOfDay().toDate();
|
||||
if (value != null && (value.compareTo(today) > 0)) {
|
||||
throw new WrongValueException(datebox, _("date in future"));
|
||||
}
|
||||
}
|
||||
|
||||
private void appendEventListenerToDateboxIndicators(
|
||||
final OrderEarnedValueChartFiller earnedValueChartFiller,
|
||||
final Vbox vbox, final Datebox datebox) {
|
||||
|
|
@ -785,6 +794,7 @@ public abstract class OrderPlanningModel implements IOrderPlanningModel {
|
|||
vbox.removeChild(child);
|
||||
vbox.appendChild(getEarnedValueChartConfigurableLegend(
|
||||
earnedValueChartFiller, date));
|
||||
dateInfutureMessage(datebox);
|
||||
}
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue