Added vertical line in scheduling perspective to display project start date
FEA: ItEr76S04BugFixing
This commit is contained in:
parent
1e12364bb3
commit
d91016f532
5 changed files with 47 additions and 7 deletions
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Copyright (C) 2009-2010 Fundación para o Fomento da Calidade Industrial e
|
||||
* Desenvolvemento Tecnolóxico de Galicia
|
||||
* Copyright (C) 2010-2011 Igalia, S.L.
|
||||
* Copyright (C) 2010-2012 Igalia, S.L.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
|
|
@ -50,6 +50,9 @@ public final class DetailItem {
|
|||
private boolean currentPeriod;
|
||||
private int currentDayOffset;
|
||||
|
||||
private boolean projectStart = false;
|
||||
private int projectStartOffset = 0;
|
||||
|
||||
private boolean deadlinePeriod;
|
||||
private int deadlineOffset;
|
||||
|
||||
|
|
@ -103,6 +106,17 @@ public final class DetailItem {
|
|||
}
|
||||
}
|
||||
|
||||
public void markProjectStart(DateTime projectStart) {
|
||||
if (!this.startDate.isAfter(projectStart)
|
||||
&& projectStart.isBefore(endDate)) {
|
||||
int offsetInPx = Math.round((((float) Days.daysBetween(
|
||||
this.startDate, projectStart).getDays()) / ((float) Days
|
||||
.daysBetween(this.startDate, this.endDate).getDays()))
|
||||
* this.size);
|
||||
this.markprojectStart(Math.min(this.size - 1, offsetInPx));
|
||||
}
|
||||
}
|
||||
|
||||
public void markDeadlineDay(DateTime deadline) {
|
||||
if (!this.startDate.isAfter(deadline) && deadline.isBefore(endDate)) {
|
||||
int offsetInPx = Math.round((((float) Days.daysBetween(
|
||||
|
|
@ -144,6 +158,11 @@ public final class DetailItem {
|
|||
this.deadlineOffset = offset;
|
||||
}
|
||||
|
||||
public void markprojectStart(int offset) {
|
||||
this.projectStart = true;
|
||||
this.projectStartOffset = offset;
|
||||
}
|
||||
|
||||
public boolean isEven() {
|
||||
return even;
|
||||
}
|
||||
|
|
@ -164,6 +183,14 @@ public final class DetailItem {
|
|||
return currentDayOffset;
|
||||
}
|
||||
|
||||
public boolean isProjectStart() {
|
||||
return projectStart;
|
||||
}
|
||||
|
||||
public int getProjectStartOffset() {
|
||||
return projectStartOffset;
|
||||
}
|
||||
|
||||
public boolean isDeadlinePeriod() {
|
||||
return deadlinePeriod;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
Copyright (C) 2009-2010 Fundación para o Fomento da Calidade Industrial e
|
||||
Desenvolvemento Tecnolóxico de Galicia
|
||||
Copyright (C) 2010-2011 Igalia, S.L.
|
||||
Copyright (C) 2010-2012 Igalia, S.L.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
|
|
@ -32,6 +32,7 @@
|
|||
<n:td class="${(top.weekLevel)?'week-level':''} timetracker_column${(each.even)?'_even':''}${(each.bankHoliday?' bankHoliday':'')}"
|
||||
forEach="${top.detailsSecondLevel}"
|
||||
style="width: ${each.size}px;background-position: ${each.bankHolidayWeek}; ">
|
||||
<n:div if="${each.projectStart}" class="timetracker_column_start" style="background-position: ${each.projectStartOffset}px;" />
|
||||
<n:div if="${each.currentPeriod and !(each.deadlinePeriod)}" class="timetracker_column_today" style="background-position: ${each.currentDayOffset}px; width:auto;height:100%" />
|
||||
<n:div if="${each.deadlinePeriod and !(each.currentPeriod)}" class="timetracker_column_deadline" style="background-position: ${each.deadlineOffset}px; width:auto;height:100%" />
|
||||
<n:div if="${each.currentPeriod and each.deadlinePeriod}" class="timetracker_column_today_deadline" style="background-position: ${each.currentDayOffset}px 0, ${each.deadlineOffset}px 0; width:auto;height:100%" />
|
||||
|
|
|
|||
|
|
@ -151,6 +151,7 @@ import org.zkoss.zul.Vbox;
|
|||
/**
|
||||
* @author Óscar González Fernández <ogonzalez@igalia.com>
|
||||
* @author Manuel Rego Casasnovas <rego@igalia.com>
|
||||
* @author Lorenzo Tilve Álvaro <ltilve@igalia.com>
|
||||
*/
|
||||
@Component
|
||||
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
|
||||
|
|
@ -709,24 +710,26 @@ public class OrderPlanningModel implements IOrderPlanningModel {
|
|||
configuration.setSecondLevelModificators(SeveralModificators
|
||||
.create(BankHolidaysMarker.create(orderReloaded
|
||||
.getCalendar()),
|
||||
createDeadlineShower(orderReloaded.getDeadline())));
|
||||
createStartAndDeadlineMarker(orderReloaded)));
|
||||
} else {
|
||||
configuration.setSecondLevelModificators(BankHolidaysMarker.create(orderReloaded.getCalendar()));
|
||||
}
|
||||
}
|
||||
|
||||
private IDetailItemModificator createDeadlineShower(Date orderDeadline) {
|
||||
final DateTime deadline = new DateTime(orderDeadline);
|
||||
IDetailItemModificator deadlineMarker = new IDetailItemModificator() {
|
||||
private IDetailItemModificator createStartAndDeadlineMarker(Order order) {
|
||||
final DateTime deadline = new DateTime(order.getDeadline());
|
||||
final DateTime projectStart = new DateTime(order.getInitDate());
|
||||
IDetailItemModificator startAndDeadlineMarker = new IDetailItemModificator() {
|
||||
|
||||
@Override
|
||||
public DetailItem applyModificationsTo(DetailItem item,
|
||||
ZoomLevel zoomlevel) {
|
||||
item.markDeadlineDay(deadline);
|
||||
item.markProjectStart(projectStart);
|
||||
return item;
|
||||
}
|
||||
};
|
||||
return deadlineMarker;
|
||||
return startAndDeadlineMarker;
|
||||
}
|
||||
|
||||
private void selectTab(String tabName) {
|
||||
|
|
|
|||
|
|
@ -424,6 +424,15 @@ div.box.limiting-unassigned {
|
|||
background-repeat: repeat-y;
|
||||
}
|
||||
|
||||
#watermark .timetracker_column_start {
|
||||
background-image: url("../img/watermark_start.png");
|
||||
background-repeat: repeat-y;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
float: left;
|
||||
}
|
||||
|
||||
|
||||
#watermark .timetracker_column_deadline {
|
||||
background-image:
|
||||
url("../../zkau/web/ganttz/img/pixel.gif");
|
||||
|
|
|
|||
BIN
libreplan-webapp/src/main/webapp/planner/img/watermark_start.png
Normal file
BIN
libreplan-webapp/src/main/webapp/planner/img/watermark_start.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 186 B |
Loading…
Add table
Reference in a new issue