[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
|
||||
.getViewInterval(), ZoomLevel.DETAIL_THREE,
|
||||
SeveralModificators.create(),
|
||||
SeveralModificators.create(new BankHolidaysMarker(getDefaultCalendar())),parent);
|
||||
SeveralModificators.create(BankHolidaysMarker.create(getDefaultCalendar())),parent);
|
||||
}
|
||||
|
||||
private BaseCalendar getDefaultCalendar() {
|
||||
|
|
|
|||
|
|
@ -288,8 +288,7 @@ public abstract class CompanyPlanningModel implements ICompanyPlanningModel {
|
|||
OrderPlanningModel.configureInitialZoomLevelFor(planner,
|
||||
defaultZoomLevel);
|
||||
|
||||
configuration.setSecondLevelModificators(new BankHolidaysMarker(
|
||||
getDefaultCalendar()));
|
||||
configuration.setSecondLevelModificators(BankHolidaysMarker.create(getDefaultCalendar()));
|
||||
planner.setConfiguration(configuration);
|
||||
|
||||
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.ICalendar;
|
||||
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.IDetailItemModificator;
|
||||
import org.zkoss.ganttz.timetracker.zoom.ZoomLevel;
|
||||
|
|
@ -33,14 +34,21 @@ import org.zkoss.ganttz.timetracker.zoom.ZoomLevel;
|
|||
public final class BankHolidaysMarker implements
|
||||
IDetailItemModificator {
|
||||
|
||||
private final ICalendar calendar;
|
||||
|
||||
public BankHolidaysMarker(ICalendar calendar) {
|
||||
Validate.notNull(calendar);
|
||||
this.calendar = calendar;
|
||||
public static BankHolidaysMarker create(BaseCalendar calendar) {
|
||||
BaseCalendarModel.forceLoadBaseCalendar(calendar);
|
||||
return new BankHolidaysMarker(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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -568,12 +568,11 @@ public abstract class OrderPlanningModel implements IOrderPlanningModel {
|
|||
PlannerConfiguration<TaskElement> configuration) {
|
||||
if (orderReloaded.getDeadline() != null) {
|
||||
configuration.setSecondLevelModificators(SeveralModificators
|
||||
.create(new BankHolidaysMarker(orderReloaded
|
||||
.create(BankHolidaysMarker.create(orderReloaded
|
||||
.getCalendar()),
|
||||
createDeadlineShower(orderReloaded.getDeadline())));
|
||||
} else {
|
||||
configuration.setSecondLevelModificators(new BankHolidaysMarker(
|
||||
orderReloaded.getCalendar()));
|
||||
configuration.setSecondLevelModificators(BankHolidaysMarker.create(orderReloaded.getCalendar()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -268,7 +268,7 @@ public class ResourceLoadController implements Composer {
|
|||
private BankHolidaysMarker createBankHolidaysMarker() {
|
||||
BaseCalendar defaultCalendar = configurationDAO.getConfiguration()
|
||||
.getDefaultCalendar();
|
||||
return new BankHolidaysMarker(defaultCalendar);
|
||||
return BankHolidaysMarker.create(defaultCalendar);
|
||||
}
|
||||
|
||||
private void buildResourcesLoadPanel() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue