ItEr30S15RFVisualizacionMultiplesProxectosItEr29S18: Removing command to switch view to resource load from order's tasks planning view
This commit is contained in:
parent
4c46bff526
commit
cefe9e9ff2
5 changed files with 0 additions and 145 deletions
|
|
@ -19,19 +19,15 @@
|
|||
*/
|
||||
package org.navalplanner.web.common;
|
||||
|
||||
import static org.navalplanner.web.I18nHelper._;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.navalplanner.web.planner.allocation.AdvancedAllocationController;
|
||||
import org.navalplanner.web.planner.allocation.AllocationResult;
|
||||
import org.navalplanner.web.planner.allocation.AdvancedAllocationController.IAdvanceAllocationResultReceiver;
|
||||
import org.navalplanner.web.resourceload.ResourceLoadController;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.zkoss.ganttz.resourceload.ResourcesLoadPanel.IToolbarCommand;
|
||||
import org.zkoss.zk.ui.util.Composer;
|
||||
|
||||
/**
|
||||
|
|
@ -79,36 +75,4 @@ public class ViewSwitcher implements Composer {
|
|||
planningOrder.restore();
|
||||
isInPlanningOrder = true;
|
||||
}
|
||||
|
||||
public void goToResourceLoad(ResourceLoadController resourceLoadController) {
|
||||
addCommands(resourceLoadController);
|
||||
planningOrder = ComponentsReplacer.replaceAllChildren(parent,
|
||||
"../resourceload/resourceloadfororder.zul",
|
||||
argsForResourceLoad(resourceLoadController));
|
||||
isInPlanningOrder = false;
|
||||
}
|
||||
|
||||
private void addCommands(ResourceLoadController resourceLoadController) {
|
||||
resourceLoadController.add(new IToolbarCommand() {
|
||||
|
||||
@Override
|
||||
public void doAction() {
|
||||
goToPlanningOrderView();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLabel() {
|
||||
return _("Back to Order Planning View");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private Map<String, Object> argsForResourceLoad(
|
||||
ResourceLoadController resourceLoadController) {
|
||||
Map<String, Object> result = new HashMap<String, Object>();
|
||||
result.put("resourceLoadController", resourceLoadController);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,34 +0,0 @@
|
|||
/*
|
||||
* This file is part of ###PROJECT_NAME###
|
||||
*
|
||||
* Copyright (C) 2009 Fundación para o Fomento da Calidade Industrial e
|
||||
* Desenvolvemento Tecnolóxico de Galicia
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.navalplanner.web.planner;
|
||||
|
||||
import org.navalplanner.business.planner.entities.TaskElement;
|
||||
import org.navalplanner.web.common.ViewSwitcher;
|
||||
import org.zkoss.ganttz.extensions.ICommand;
|
||||
|
||||
/**
|
||||
* @author Óscar González Fernández <ogonzalez@igalia.com>
|
||||
*
|
||||
*/
|
||||
public interface IResourceLoadForOrderCommand extends ICommand<TaskElement>{
|
||||
|
||||
public void initialize(ViewSwitcher switcher, PlanningState planningState);
|
||||
|
||||
}
|
||||
|
|
@ -124,7 +124,6 @@ public abstract class OrderPlanningModel implements IOrderPlanningModel {
|
|||
PlannerConfiguration<TaskElement> configuration = createConfiguration(orderReloaded);
|
||||
|
||||
configuration.addGlobalCommand(buildSaveCommand());
|
||||
configuration.addGlobalCommand(buildResourceLoadForOrderCommand(switcher));
|
||||
|
||||
configuration.addCommandOnTask(buildResourceAllocationCommand(resourceAllocationController));
|
||||
configuration.addCommandOnTask(buildSplitCommand(splittingController));
|
||||
|
|
@ -186,13 +185,6 @@ public abstract class OrderPlanningModel implements IOrderPlanningModel {
|
|||
return resourceAllocationCommand;
|
||||
}
|
||||
|
||||
private IResourceLoadForOrderCommand buildResourceLoadForOrderCommand(
|
||||
ViewSwitcher switcher) {
|
||||
IResourceLoadForOrderCommand resourceLoadForOrderCommand = getResourceLoadForOrderCommand();
|
||||
resourceLoadForOrderCommand.initialize(switcher, planningState);
|
||||
return resourceLoadForOrderCommand;
|
||||
}
|
||||
|
||||
private ISaveCommand buildSaveCommand() {
|
||||
ISaveCommand saveCommand = getSaveCommand();
|
||||
saveCommand.setState(planningState);
|
||||
|
|
@ -313,8 +305,6 @@ public abstract class OrderPlanningModel implements IOrderPlanningModel {
|
|||
|
||||
protected abstract ICalendarAllocationCommand getCalendarAllocationCommand();
|
||||
|
||||
protected abstract IResourceLoadForOrderCommand getResourceLoadForOrderCommand();
|
||||
|
||||
private Order reload(Order order) {
|
||||
try {
|
||||
return orderDAO.find(order.getId());
|
||||
|
|
|
|||
|
|
@ -1,64 +0,0 @@
|
|||
/*
|
||||
* This file is part of ###PROJECT_NAME###
|
||||
*
|
||||
* Copyright (C) 2009 Fundación para o Fomento da Calidade Industrial e
|
||||
* Desenvolvemento Tecnolóxico de Galicia
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.navalplanner.web.planner;
|
||||
|
||||
import static org.navalplanner.web.I18nHelper._;
|
||||
|
||||
import org.navalplanner.business.planner.entities.TaskElement;
|
||||
import org.navalplanner.web.common.ViewSwitcher;
|
||||
import org.navalplanner.web.resourceload.ResourceLoadController;
|
||||
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;
|
||||
import org.zkoss.ganttz.extensions.IContext;
|
||||
/**
|
||||
* @author Óscar González Fernández <ogonzalez@igalia.com>
|
||||
*
|
||||
*/
|
||||
@Component
|
||||
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
|
||||
public class ResourceLoadForOrderCommand implements
|
||||
IResourceLoadForOrderCommand {
|
||||
|
||||
private PlanningState planningState;
|
||||
private ViewSwitcher switcher;
|
||||
|
||||
@Autowired
|
||||
private ResourceLoadController resourceLoadController;
|
||||
|
||||
@Override
|
||||
public void initialize(ViewSwitcher switcher, PlanningState planningState) {
|
||||
this.switcher = switcher;
|
||||
this.planningState = planningState;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doAction(IContext<TaskElement> context) {
|
||||
resourceLoadController.filterBy(planningState);
|
||||
switcher.goToResourceLoad(resourceLoadController);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return _("Resource Load");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -32,7 +32,6 @@
|
|||
<lookup-method name="getEditTaskCommand" bean="editTaskCommand"/>
|
||||
<lookup-method name="getCalendarAllocationCommand" bean="calendarAllocationCommand"/>
|
||||
<lookup-method name="getAddMilestoneCommand" bean="addMilestoneCommand"/>
|
||||
<lookup-method name="getResourceLoadForOrderCommand" bean="resourceLoadForOrderCommand"/>
|
||||
</bean>
|
||||
|
||||
<bean class="org.navalplanner.web.planner.CompanyPlanningModel" scope="prototype">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue