ItEr57S14AdaptacionAsignacionConsolidacion: Disables movement on Gantt diagram.
Disables movement on Gantt diagram of the tasks which have got consolidations.
This commit is contained in:
parent
5e244f9b67
commit
c8b1b37cb9
13 changed files with 41 additions and 2 deletions
|
|
@ -83,7 +83,7 @@ public class CommandOnTaskContextualized<T> {
|
|||
return new ItemAction<TaskComponent>() {
|
||||
@Override
|
||||
public void onEvent(TaskComponent choosen, Event event) {
|
||||
doAction(choosen.getTask());
|
||||
doAction(choosen);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -180,6 +180,10 @@ public class DefaultFundamentalProperties implements ITaskFundamentalProperties
|
|||
return true;
|
||||
}
|
||||
|
||||
public boolean hasConsolidations() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAssignedStatus() {
|
||||
return "unassigned";
|
||||
|
|
|
|||
|
|
@ -82,6 +82,8 @@ public interface ITaskFundamentalProperties {
|
|||
|
||||
public boolean isLimitingAndHasDayAssignments();
|
||||
|
||||
public boolean hasConsolidations();
|
||||
|
||||
public boolean canBeExplicitlyResized();
|
||||
|
||||
public String getAssignedStatus();
|
||||
|
|
|
|||
|
|
@ -365,6 +365,10 @@ public abstract class Task implements ITaskFundamentalProperties {
|
|||
return fundamentalProperties.isLimitingAndHasDayAssignments();
|
||||
}
|
||||
|
||||
public boolean hasConsolidations() {
|
||||
return fundamentalProperties.hasConsolidations();
|
||||
}
|
||||
|
||||
public boolean canBeExplicitlyResized() {
|
||||
return fundamentalProperties.canBeExplicitlyResized();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ public class TaskLeaf extends Task {
|
|||
|
||||
@Override
|
||||
public boolean canBeExplicitlyMoved() {
|
||||
return !(isSubcontracted() || isLimitingAndHasDayAssignments());
|
||||
return !(isSubcontracted() || isLimitingAndHasDayAssignments() || hasConsolidations());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -608,4 +608,7 @@ public class Task extends TaskElement {
|
|||
|
||||
}
|
||||
|
||||
public boolean hasConsolidations() {
|
||||
return ((consolidation != null) && (!consolidation.isEmpty()));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -417,6 +417,11 @@ public abstract class TaskElement extends BaseEntity {
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean hasConsolidations() {
|
||||
// Just Task could be consolidated
|
||||
return false;
|
||||
}
|
||||
|
||||
public TaskElement getTopMost() {
|
||||
TaskElement result = this;
|
||||
while (result.getParent() != null) {
|
||||
|
|
|
|||
|
|
@ -103,4 +103,9 @@ public class CalculatedConsolidation extends Consolidation {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
return consolidatedValues.isEmpty();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -34,6 +34,8 @@ public abstract class Consolidation extends BaseEntity {
|
|||
|
||||
public abstract boolean isCalculated();
|
||||
|
||||
public abstract boolean isEmpty();
|
||||
|
||||
private Task task;
|
||||
|
||||
protected Consolidation() {
|
||||
|
|
|
|||
|
|
@ -104,4 +104,8 @@ public class NonCalculatedConsolidation extends Consolidation {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
return consolidatedValues.isEmpty();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -571,6 +571,10 @@ public class TaskElementAdapter implements ITaskElementAdapter {
|
|||
return taskElement.isLimitingAndHasDayAssignments();
|
||||
}
|
||||
|
||||
public boolean hasConsolidations() {
|
||||
return taskElement.hasConsolidations();
|
||||
}
|
||||
|
||||
private void stepsBeforePossibleReallocation() {
|
||||
taskDAO.reattach(taskElement);
|
||||
reattachAllResourcesForTask();
|
||||
|
|
|
|||
|
|
@ -937,6 +937,7 @@ public abstract class OrderPlanningModel implements IOrderPlanningModel {
|
|||
if (each.getCalendar() != null) {
|
||||
BaseCalendarModel.forceLoadBaseCalendar(each.getCalendar());
|
||||
}
|
||||
each.hasConsolidations();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ import org.navalplanner.web.planner.taskedition.TaskPropertiesController.Resourc
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.zkoss.ganttz.TaskComponent;
|
||||
import org.zkoss.ganttz.extensions.IContextWithPlannerTask;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
import org.zkoss.zk.ui.util.GenericForwardComposer;
|
||||
|
|
@ -304,6 +305,10 @@ public class EditTaskController extends GenericForwardComposer {
|
|||
if (context != null) {
|
||||
context.getTask().reloadResourcesText();
|
||||
context.reloadCharts();
|
||||
|
||||
if (context.getRelativeTo() instanceof TaskComponent) {
|
||||
((TaskComponent) context.getRelativeTo()).invalidate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue