ItEr28S14RFVistaGraficaInformacionAvance: Showing basic info about hours advance at planner.
This commit is contained in:
parent
3f8a18915d
commit
aa68949061
8 changed files with 47 additions and 7 deletions
|
|
@ -183,7 +183,8 @@ public class DataForPlanner {
|
|||
private DefaultFundamentalProperties createTask(String name, Date now,
|
||||
Date end) {
|
||||
return new DefaultFundamentalProperties(name, end, end.getTime()
|
||||
- now.getTime(), "bla", new BigDecimal(0.5));
|
||||
- now.getTime(), "bla", new BigDecimal(0.25), new BigDecimal(
|
||||
0.5));
|
||||
}
|
||||
|
||||
private void addNewTask(IContext<ITaskFundamentalProperties> context) {
|
||||
|
|
|
|||
|
|
@ -296,10 +296,14 @@ public class TaskComponent extends Div implements AfterCompose {
|
|||
}
|
||||
|
||||
private void updateCompletion() {
|
||||
BigDecimal hoursAdvancePercentage = task.getHoursAdvancePercentage()
|
||||
.multiply(new BigDecimal(100));
|
||||
response(null, new AuInvoke(this, "resizeCompletionAdvance",
|
||||
hoursAdvancePercentage.intValue() + "%"));
|
||||
|
||||
BigDecimal advancePercentage = task.getAdvancePercentage().multiply(
|
||||
new BigDecimal(100));
|
||||
|
||||
response(null, new AuInvoke(this, "resizeCompletionAdvance",
|
||||
response(null, new AuInvoke(this, "resizeCompletion2Advance",
|
||||
advancePercentage.intValue() + "%"));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,17 +16,21 @@ public class DefaultFundamentalProperties implements ITaskFundamentalProperties
|
|||
|
||||
private String notes;
|
||||
|
||||
private BigDecimal hoursAdvancePercentage;
|
||||
|
||||
private BigDecimal advancePercentage;
|
||||
|
||||
public DefaultFundamentalProperties() {
|
||||
}
|
||||
|
||||
public DefaultFundamentalProperties(String name, Date beginDate,
|
||||
long lengthMilliseconds, String notes, BigDecimal advancePercentage) {
|
||||
long lengthMilliseconds, String notes,
|
||||
BigDecimal hoursAdvancePercentage, BigDecimal advancePercentage) {
|
||||
this.name = name;
|
||||
this.beginDate = beginDate;
|
||||
this.lengthMilliseconds = lengthMilliseconds;
|
||||
this.notes = notes;
|
||||
this.hoursAdvancePercentage = hoursAdvancePercentage;
|
||||
this.advancePercentage = advancePercentage;
|
||||
}
|
||||
|
||||
|
|
@ -66,6 +70,11 @@ public class DefaultFundamentalProperties implements ITaskFundamentalProperties
|
|||
this.notes = notes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getHoursAdvancePercentage() {
|
||||
return hoursAdvancePercentage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getAdvancePercentage() {
|
||||
return advancePercentage;
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@ public interface ITaskFundamentalProperties {
|
|||
|
||||
public void setNotes(String notes);
|
||||
|
||||
public BigDecimal getHoursAdvancePercentage();
|
||||
|
||||
public BigDecimal getAdvancePercentage();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -139,9 +139,14 @@ public abstract class Task implements ITaskFundamentalProperties {
|
|||
setVisible(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getHoursAdvancePercentage() {
|
||||
return fundamentalProperties.getHoursAdvancePercentage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getAdvancePercentage() {
|
||||
return fundamentalProperties.getAdvancePercentage();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -406,6 +406,11 @@ zkTask.getElementsByAttribute = function(oElm, strTagName, strAttributeName,
|
|||
}
|
||||
|
||||
zkTask.resizeCompletionAdvance = function(cmp, width) {
|
||||
var completionDiv = YAHOO.util.Selector.query('.completion', cmp, true);
|
||||
completionDiv["style"].width = width;
|
||||
}
|
||||
|
||||
zkTask.resizeCompletion2Advance = function(cmp, width) {
|
||||
var completionDiv = YAHOO.util.Selector.query('.completion2', cmp, true);
|
||||
completionDiv["style"].width = width;
|
||||
}
|
||||
|
|
@ -538,6 +543,7 @@ zkTaskContainer.setClass = function(cmp, newclass) {
|
|||
};
|
||||
|
||||
zkTaskContainer.resizeCompletionAdvance = zkTask.resizeCompletionAdvance;
|
||||
zkTaskContainer.resizeCompletion2Advance = zkTask.resizeCompletion2Advance;
|
||||
|
||||
/* We will not allow taskcontainer move or resize untill its behaviour its
|
||||
* clearly specified
|
||||
|
|
|
|||
|
|
@ -351,7 +351,8 @@ public class DataForPlanner {
|
|||
private DefaultFundamentalProperties createTask(String name, Date now,
|
||||
Date end) {
|
||||
return new DefaultFundamentalProperties(name, end, end.getTime()
|
||||
- now.getTime(), _("bla"), new BigDecimal(0.5));
|
||||
- now.getTime(), _("bla"), new BigDecimal(0.25),
|
||||
new BigDecimal(0.5));
|
||||
}
|
||||
|
||||
private void addNewTask(IContext<ITaskFundamentalProperties> context) {
|
||||
|
|
|
|||
|
|
@ -8,10 +8,13 @@ import java.util.Collection;
|
|||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.navalplanner.business.orders.daos.IOrderElementDAO;
|
||||
import org.navalplanner.business.orders.entities.Order;
|
||||
import org.navalplanner.business.orders.entities.OrderElement;
|
||||
import org.navalplanner.business.planner.entities.Dependency;
|
||||
import org.navalplanner.business.planner.entities.TaskElement;
|
||||
import org.navalplanner.business.planner.entities.Dependency.Type;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
|
@ -32,6 +35,9 @@ public class TaskElementAdapter implements ITaskElementAdapter {
|
|||
|
||||
private Order order;
|
||||
|
||||
@Autowired
|
||||
private IOrderElementDAO orderElementDAO;
|
||||
|
||||
@Override
|
||||
public void setOrder(Order order) {
|
||||
this.order = order;
|
||||
|
|
@ -98,6 +104,12 @@ public class TaskElementAdapter implements ITaskElementAdapter {
|
|||
+ this.lengthMilliseconds));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getHoursAdvancePercentage() {
|
||||
OrderElement orderElement = taskElement.getOrderElement();
|
||||
return orderElementDAO.getHoursAdvancePercentage(orderElement);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getAdvancePercentage() {
|
||||
return taskElement.getOrderElement().getAdvancePercentage();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue