[Bug #792] Fix bug
If the first level loaded is not the five the calendar was not loaded at all. Now it's always ensured that it's loaded. FEA: ItEr67S04BugFixing
This commit is contained in:
parent
75a69ede67
commit
23aac9824f
5 changed files with 19 additions and 13 deletions
|
|
@ -204,7 +204,7 @@ public class LimitingResourcesController extends GenericForwardComposer {
|
||||||
return timeTracker = new TimeTracker(limitingResourceQueueModel
|
return timeTracker = new TimeTracker(limitingResourceQueueModel
|
||||||
.getViewInterval(), ZoomLevel.DETAIL_THREE,
|
.getViewInterval(), ZoomLevel.DETAIL_THREE,
|
||||||
SeveralModificators.create(),
|
SeveralModificators.create(),
|
||||||
SeveralModificators.create(new BankHolidaysMarker(getDefaultCalendar())),parent);
|
SeveralModificators.create(BankHolidaysMarker.create(getDefaultCalendar())),parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
private BaseCalendar getDefaultCalendar() {
|
private BaseCalendar getDefaultCalendar() {
|
||||||
|
|
|
||||||
|
|
@ -288,8 +288,7 @@ public abstract class CompanyPlanningModel implements ICompanyPlanningModel {
|
||||||
OrderPlanningModel.configureInitialZoomLevelFor(planner,
|
OrderPlanningModel.configureInitialZoomLevelFor(planner,
|
||||||
defaultZoomLevel);
|
defaultZoomLevel);
|
||||||
|
|
||||||
configuration.setSecondLevelModificators(new BankHolidaysMarker(
|
configuration.setSecondLevelModificators(BankHolidaysMarker.create(getDefaultCalendar()));
|
||||||
getDefaultCalendar()));
|
|
||||||
planner.setConfiguration(configuration);
|
planner.setConfiguration(configuration);
|
||||||
|
|
||||||
if(expandPlanningViewChart) {
|
if(expandPlanningViewChart) {
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ import org.apache.commons.lang.Validate;
|
||||||
import org.navalplanner.business.calendars.entities.BaseCalendar;
|
import org.navalplanner.business.calendars.entities.BaseCalendar;
|
||||||
import org.navalplanner.business.calendars.entities.ICalendar;
|
import org.navalplanner.business.calendars.entities.ICalendar;
|
||||||
import org.navalplanner.business.workingday.IntraDayDate.PartialDay;
|
import org.navalplanner.business.workingday.IntraDayDate.PartialDay;
|
||||||
|
import org.navalplanner.web.calendars.BaseCalendarModel;
|
||||||
import org.zkoss.ganttz.timetracker.zoom.DetailItem;
|
import org.zkoss.ganttz.timetracker.zoom.DetailItem;
|
||||||
import org.zkoss.ganttz.timetracker.zoom.IDetailItemModificator;
|
import org.zkoss.ganttz.timetracker.zoom.IDetailItemModificator;
|
||||||
import org.zkoss.ganttz.timetracker.zoom.ZoomLevel;
|
import org.zkoss.ganttz.timetracker.zoom.ZoomLevel;
|
||||||
|
|
@ -33,14 +34,21 @@ import org.zkoss.ganttz.timetracker.zoom.ZoomLevel;
|
||||||
public final class BankHolidaysMarker implements
|
public final class BankHolidaysMarker implements
|
||||||
IDetailItemModificator {
|
IDetailItemModificator {
|
||||||
|
|
||||||
private final ICalendar calendar;
|
public static BankHolidaysMarker create(BaseCalendar calendar) {
|
||||||
|
BaseCalendarModel.forceLoadBaseCalendar(calendar);
|
||||||
public BankHolidaysMarker(ICalendar calendar) {
|
return new BankHolidaysMarker(calendar);
|
||||||
Validate.notNull(calendar);
|
|
||||||
this.calendar = calendar;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public BankHolidaysMarker(BaseCalendar calendar) {
|
private final ICalendar calendar;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <strong>Important: </strong>Make sure that the provided calendar has all
|
||||||
|
* its associated data loaded.
|
||||||
|
*
|
||||||
|
* @param calendar
|
||||||
|
*/
|
||||||
|
public BankHolidaysMarker(ICalendar calendar) {
|
||||||
|
Validate.notNull(calendar);
|
||||||
this.calendar = calendar;
|
this.calendar = calendar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -568,12 +568,11 @@ public abstract class OrderPlanningModel implements IOrderPlanningModel {
|
||||||
PlannerConfiguration<TaskElement> configuration) {
|
PlannerConfiguration<TaskElement> configuration) {
|
||||||
if (orderReloaded.getDeadline() != null) {
|
if (orderReloaded.getDeadline() != null) {
|
||||||
configuration.setSecondLevelModificators(SeveralModificators
|
configuration.setSecondLevelModificators(SeveralModificators
|
||||||
.create(new BankHolidaysMarker(orderReloaded
|
.create(BankHolidaysMarker.create(orderReloaded
|
||||||
.getCalendar()),
|
.getCalendar()),
|
||||||
createDeadlineShower(orderReloaded.getDeadline())));
|
createDeadlineShower(orderReloaded.getDeadline())));
|
||||||
} else {
|
} else {
|
||||||
configuration.setSecondLevelModificators(new BankHolidaysMarker(
|
configuration.setSecondLevelModificators(BankHolidaysMarker.create(orderReloaded.getCalendar()));
|
||||||
orderReloaded.getCalendar()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -268,7 +268,7 @@ public class ResourceLoadController implements Composer {
|
||||||
private BankHolidaysMarker createBankHolidaysMarker() {
|
private BankHolidaysMarker createBankHolidaysMarker() {
|
||||||
BaseCalendar defaultCalendar = configurationDAO.getConfiguration()
|
BaseCalendar defaultCalendar = configurationDAO.getConfiguration()
|
||||||
.getDefaultCalendar();
|
.getDefaultCalendar();
|
||||||
return new BankHolidaysMarker(defaultCalendar);
|
return BankHolidaysMarker.create(defaultCalendar);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void buildResourcesLoadPanel() {
|
private void buildResourcesLoadPanel() {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue