ItEr60S04ValidacionEProbasFuncionaisItEr59S04: [Bug #593] Adding option to go to resources load of an order from company view.

This commit is contained in:
Manuel Rego Casasnovas 2010-08-16 17:43:36 +02:00
parent c77122a692
commit 3991e79c09
3 changed files with 42 additions and 0 deletions

View file

@ -53,4 +53,6 @@ public interface IGlobalViewEntryPoints {
void goToOrderDetails(Order order);
void goToResourcesLoad(Order order);
}

View file

@ -408,4 +408,10 @@ public class MultipleTabsPlannerController implements Composer,
getTabsRegistry().show(ordersTab);
}
@Override
public void goToResourcesLoad(Order order) {
mode.goToOrderMode(order);
getTabsRegistry().show(resourceLoadTab);
}
}

View file

@ -112,6 +112,8 @@ public class PlanningTabCreator {
commands.add(scheduleCommand);
ICommandOnTask<TaskElement> orderDetailsCommand = buildOrderDetailsCommand();
commands.add(orderDetailsCommand);
ICommandOnTask<TaskElement> resourcesLoadCommand = buildResourcesLoadCommand();
commands.add(resourcesLoadCommand);
companyPlanningController.setAdditional(commands);
companyPlanningController.setTabsController(tabsController);
@ -189,6 +191,38 @@ 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;
mode.goToOrderMode(order);
tabsController.goToResourcesLoad(order);
}
}
@Override
public String getName() {
return _("Resources Load");
}
@Override
public String getIcon() {
return null;
}
@Override
public boolean isApplicableTo(TaskElement task) {
return true;
}
};
}
};
return new CreatedOnDemandTab(_("Projects Planning"),
"company-scheduling",