Removed access to ResourcesLoad and AdvancedAllocation from company view context menu

This patch should be reverted if the Save and Cancel commands are properly refactored
and can be called from a single point to add the buttons on those perspectives, if
the user has not passed throug order gantt and the state is explicitly set.

FEA: ItEr75S04BugFixing
This commit is contained in:
Lorenzo Tilve Álvaro 2011-10-26 11:31:47 +02:00
parent 71bcda9af8
commit 5751692b9c

View file

@ -113,10 +113,9 @@ public class PlanningTabCreator {
commands.add(scheduleCommand);
ICommandOnTask<TaskElement> orderDetailsCommand = buildOrderDetailsCommand();
commands.add(orderDetailsCommand);
ICommandOnTask<TaskElement> resourcesLoadCommand = buildResourcesLoadCommand();
commands.add(resourcesLoadCommand);
ICommandOnTask<TaskElement> advancedAllocationCommand = buildAdvancedAllocationCommand();
commands.add(advancedAllocationCommand);
// TODO: Revert removal of ResourcesLoad and AdvancedAllocation
// context entries when save and cancel commands are refactored
companyPlanningController.setAdditional(commands);
companyPlanningController.setTabsController(tabsController);
@ -193,68 +192,6 @@ public class PlanningTabCreator {
};
}
private ICommandOnTask<TaskElement> buildResourcesLoadCommand() {
return new ICommandOnTask<TaskElement>() {
@Override
public void doAction(
IContextWithPlannerTask<TaskElement> context,
TaskElement task) {
OrderElement orderElement = task.getOrderElement();
if (orderElement instanceof Order) {
Order order = (Order) orderElement;
tabsController.goToResourcesLoad(order);
}
}
@Override
public String getName() {
return _("Resources Load");
}
@Override
public String getIcon() {
return "/common/img/ico_menu_order-load.png";
}
@Override
public boolean isApplicableTo(TaskElement task) {
return true;
}
};
}
private ICommandOnTask<TaskElement> buildAdvancedAllocationCommand() {
return new ICommandOnTask<TaskElement>() {
@Override
public void doAction(
IContextWithPlannerTask<TaskElement> context,
TaskElement task) {
OrderElement orderElement = task.getOrderElement();
if (orderElement instanceof Order) {
Order order = (Order) orderElement;
tabsController.goToAdvancedAllocation(order);
}
}
@Override
public String getName() {
return _("Advanced Allocation");
}
@Override
public String getIcon() {
return "/common/img/ico_menu_advanced-assignment.png";
}
@Override
public boolean isApplicableTo(TaskElement task) {
return true;
}
};
}
};
return new CreatedOnDemandTab(_("Projects Planning"),
"company-scheduling",