Remove unused private methods and fields
FEA: ItEr62S05BugFixing
This commit is contained in:
parent
b011982c2a
commit
300e002add
42 changed files with 1 additions and 333 deletions
|
|
@ -155,17 +155,6 @@ public class LoadTimeLine {
|
|||
return one.compareTo(other) < 0 ? one : other;
|
||||
}
|
||||
|
||||
private static void allChildrenAreNotEmpty(List<LoadTimeLine> lines) {
|
||||
for (LoadTimeLine l : lines) {
|
||||
if (l.isEmpty()) {
|
||||
throw new IllegalArgumentException(l + " is empty");
|
||||
}
|
||||
if (l.hasChildren()) {
|
||||
allChildrenAreNotEmpty(l.getChildren());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasChildren() {
|
||||
return (!children.isEmpty());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -228,15 +228,6 @@ MutableTreeModel<LoadTimeLine> modelForTree,
|
|||
return result;
|
||||
}
|
||||
|
||||
private static void limitValue(Div parent, Label label, int maxLength) {
|
||||
String originalValue = label.getValue();
|
||||
if (originalValue == null || originalValue.length() <= maxLength) {
|
||||
return;
|
||||
}
|
||||
label.setValue(originalValue.substring(0, maxLength - 3) + "...");
|
||||
label.setTooltip(createPopup(parent, originalValue));
|
||||
}
|
||||
|
||||
private static Popup createPopup(Div parent, String originalValue) {
|
||||
Popup result = new Popup();
|
||||
result.appendChild(new Label(originalValue));
|
||||
|
|
|
|||
|
|
@ -49,11 +49,8 @@ public class ResourceLoadList extends HtmlMacroComponent implements
|
|||
|
||||
private Map<LoadTimeLine, ResourceLoadComponent> fromTimeLineToComponent = new HashMap<LoadTimeLine, ResourceLoadComponent>();
|
||||
|
||||
private final MutableTreeModel<LoadTimeLine> timelinesTree;
|
||||
|
||||
public ResourceLoadList(TimeTracker timeTracker,
|
||||
MutableTreeModel<LoadTimeLine> timelinesTree) {
|
||||
this.timelinesTree = timelinesTree;
|
||||
zoomListener = adjustTimeTrackerSizeListener();
|
||||
timeTracker.addZoomListener(zoomListener);
|
||||
LoadTimeLine current = timelinesTree.getRoot();
|
||||
|
|
|
|||
|
|
@ -101,8 +101,6 @@ public class Order extends OrderLineGroup {
|
|||
|
||||
public static class CurrentVersionInfo {
|
||||
|
||||
private final Scenario scenario;
|
||||
|
||||
private final OrderVersion orderVersion;
|
||||
|
||||
private final boolean modifyingTheOwnerScenario;
|
||||
|
|
@ -115,7 +113,6 @@ public class Order extends OrderLineGroup {
|
|||
private CurrentVersionInfo(Scenario scenario, OrderVersion orderVersion) {
|
||||
Validate.notNull(scenario);
|
||||
Validate.notNull(orderVersion);
|
||||
this.scenario = scenario;
|
||||
this.orderVersion = orderVersion;
|
||||
this.modifyingTheOwnerScenario = orderVersion.isOwnedBy(scenario);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,9 +27,7 @@ import org.hibernate.Criteria;
|
|||
import org.hibernate.criterion.Restrictions;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.navalplanner.business.common.daos.GenericDAOHibernate;
|
||||
import org.navalplanner.business.planner.entities.GenericDayAssignment;
|
||||
import org.navalplanner.business.planner.entities.ResourceAllocation;
|
||||
import org.navalplanner.business.planner.entities.SpecificDayAssignment;
|
||||
import org.navalplanner.business.planner.entities.TaskElement;
|
||||
import org.navalplanner.business.planner.entities.TaskGroup;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
|
|
@ -46,18 +44,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
public class TaskElementDAO extends GenericDAOHibernate<TaskElement, Long>
|
||||
implements ITaskElementDAO {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private List<GenericDayAssignment> findOrphanedGenericDayAssignments() {
|
||||
return getSession().createCriteria(GenericDayAssignment.class).add(
|
||||
Restrictions.isNull("genericResourceAllocation")).list();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private List<SpecificDayAssignment> findOrphanedSpecificDayAssignments() {
|
||||
return getSession().createCriteria(SpecificDayAssignment.class).add(
|
||||
Restrictions.isNull("specificResourceAllocation")).list();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<TaskElement> findChildrenOf(TaskGroup each) {
|
||||
|
|
|
|||
|
|
@ -50,7 +50,6 @@ import org.navalplanner.business.advance.exceptions.DuplicateValueTrueReportGlob
|
|||
import org.navalplanner.business.common.daos.IConfigurationDAO;
|
||||
import org.navalplanner.business.common.exceptions.InstanceNotFoundException;
|
||||
import org.navalplanner.business.orders.daos.IOrderDAO;
|
||||
import org.navalplanner.business.orders.daos.IOrderElementDAO;
|
||||
import org.navalplanner.business.orders.entities.HoursGroup;
|
||||
import org.navalplanner.business.orders.entities.Order;
|
||||
import org.navalplanner.business.orders.entities.OrderElement;
|
||||
|
|
@ -90,9 +89,6 @@ public class AddAdvanceAssignmentsToOrderElementTest {
|
|||
@Autowired
|
||||
private SessionFactory sessionFactory;
|
||||
|
||||
@Autowired
|
||||
private IOrderElementDAO orderElementDao;
|
||||
|
||||
@Autowired
|
||||
private IOrderDAO orderDao;
|
||||
|
||||
|
|
|
|||
|
|
@ -42,13 +42,11 @@ import org.navalplanner.business.orders.entities.Order;
|
|||
import org.navalplanner.business.orders.entities.OrderLine;
|
||||
import org.navalplanner.business.orders.entities.SchedulingDataForVersion;
|
||||
import org.navalplanner.business.orders.entities.TaskSource;
|
||||
import org.navalplanner.business.planner.daos.ITaskElementDAO;
|
||||
import org.navalplanner.business.planner.entities.SpecificResourceAllocation;
|
||||
import org.navalplanner.business.planner.entities.Task;
|
||||
import org.navalplanner.business.planner.entities.TaskElement;
|
||||
import org.navalplanner.business.planner.limiting.entities.LimitingResourceQueueElement;
|
||||
import org.navalplanner.business.scenarios.entities.OrderVersion;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -62,9 +60,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@Transactional
|
||||
public class TaskTest {
|
||||
|
||||
@Autowired
|
||||
private ITaskElementDAO taskElementDAO;
|
||||
|
||||
private static final OrderVersion mockedOrderVersion = mockOrderVersion();
|
||||
|
||||
public static final OrderVersion mockOrderVersion() {
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ import static org.navalplanner.business.test.BusinessGlobalNames.BUSINESS_SPRING
|
|||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.navalplanner.business.common.IAdHocTransactionService;
|
||||
|
|
@ -43,7 +42,6 @@ import org.navalplanner.business.resources.daos.IWorkerDAO;
|
|||
import org.navalplanner.business.resources.entities.Criterion;
|
||||
import org.navalplanner.business.resources.entities.Machine;
|
||||
import org.navalplanner.business.resources.entities.MachineWorkersConfigurationUnit;
|
||||
import org.navalplanner.business.resources.entities.Worker;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.annotation.NotTransactional;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
|
|
@ -71,9 +69,6 @@ public class MachineDAOTest {
|
|||
@Autowired
|
||||
IWorkerDAO workerDAO;
|
||||
|
||||
@Autowired
|
||||
private SessionFactory sessionFactory;
|
||||
|
||||
private Machine createValidMachine() {
|
||||
Machine machine = Machine.create();
|
||||
machine.setCode("code");
|
||||
|
|
@ -82,12 +77,6 @@ public class MachineDAOTest {
|
|||
return machine;
|
||||
}
|
||||
|
||||
private Worker createValidWorker() {
|
||||
Worker worker = Worker.create();
|
||||
worker.setFirstName("FirstName");
|
||||
return worker;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInSpringContainer() {
|
||||
assertNotNull(machineDAO);
|
||||
|
|
|
|||
|
|
@ -266,15 +266,6 @@ public class BaseCalendarCRUDController extends GenericForwardComposer {
|
|||
return visibility;
|
||||
}
|
||||
|
||||
private void reloadCurrentWindow() {
|
||||
if (baseCalendarModel.isEditing()) {
|
||||
Util.reloadBindings(editWindow);
|
||||
} else {
|
||||
Util.reloadBindings(createWindow);
|
||||
}
|
||||
highlightDaysOnCalendar();
|
||||
}
|
||||
|
||||
private void reloadDayInformation() {
|
||||
if (baseCalendarModel.isEditing()) {
|
||||
Util.reloadBindings(editWindow.getFellow("dayInformation"));
|
||||
|
|
|
|||
|
|
@ -289,12 +289,6 @@ public abstract class BaseCalendarEditionController extends
|
|||
return baseCalendarModel.isDerived();
|
||||
}
|
||||
|
||||
private boolean isPast(Date date) {
|
||||
LocalDate localDate = new LocalDate(date);
|
||||
LocalDate currentLocalDate = new LocalDate();
|
||||
return localDate.compareTo(currentLocalDate) <= 0;
|
||||
}
|
||||
|
||||
public List<Days> getHoursPerDay() {
|
||||
return Arrays.asList(Days.values());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,13 +29,6 @@ public enum FilterEnumNone implements IFilterEnum {
|
|||
|
||||
None("...");
|
||||
|
||||
/**
|
||||
* Forces to mark the string as needing translation
|
||||
*/
|
||||
private static String _(String string) {
|
||||
return string;
|
||||
}
|
||||
|
||||
private String description;
|
||||
|
||||
private FilterEnumNone(String description) {
|
||||
|
|
|
|||
|
|
@ -234,10 +234,6 @@ public class ResourceAllocationMultipleFiltersFinder extends
|
|||
return mode.equals(ResourceAllocationFilterEnum.Resource);
|
||||
}
|
||||
|
||||
private boolean isModeCriterion() {
|
||||
return mode.equals(ResourceAllocationFilterEnum.Criterion);
|
||||
}
|
||||
|
||||
private boolean isModeNone() {
|
||||
return mode.equals(FilterEnumNone.None);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@
|
|||
|
||||
package org.navalplanner.web.limitingresources;
|
||||
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -30,15 +28,11 @@ import org.apache.commons.logging.LogFactory;
|
|||
import org.zkoss.ganttz.DependencyList;
|
||||
import org.zkoss.ganttz.TaskComponent;
|
||||
import org.zkoss.ganttz.data.Dependency;
|
||||
import org.zkoss.ganttz.data.DependencyType;
|
||||
import org.zkoss.ganttz.data.Task;
|
||||
import org.zkoss.ganttz.timetracker.TimeTracker;
|
||||
import org.zkoss.ganttz.timetracker.TimeTrackerComponent;
|
||||
import org.zkoss.ganttz.timetracker.zoom.IZoomLevelChangedListener;
|
||||
import org.zkoss.ganttz.timetracker.zoom.ZoomLevel;
|
||||
import org.zkoss.ganttz.util.ComponentsFinder;
|
||||
import org.zkoss.ganttz.util.MenuBuilder.ItemAction;
|
||||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zk.ui.ext.AfterCompose;
|
||||
import org.zkoss.zul.impl.XulElement;
|
||||
|
||||
|
|
@ -47,61 +41,6 @@ import org.zkoss.zul.impl.XulElement;
|
|||
*/
|
||||
public class LimitingDependencyList extends XulElement implements AfterCompose {
|
||||
|
||||
private final class ChangeTypeAction implements
|
||||
ItemAction<LimitingDependencyComponent> {
|
||||
private final DependencyType type;
|
||||
|
||||
private ChangeTypeAction(DependencyType type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEvent(final LimitingDependencyComponent choosen,
|
||||
Event event) {
|
||||
// context.changeType(choosen.getDependency(), type);
|
||||
}
|
||||
}
|
||||
|
||||
private final class DependencyVisibilityToggler implements
|
||||
PropertyChangeListener {
|
||||
private final Task source;
|
||||
private final Task destination;
|
||||
private final LimitingDependencyComponent dependencyComponent;
|
||||
|
||||
private DependencyVisibilityToggler(Task source, Task destination,
|
||||
LimitingDependencyComponent dependencyComponent) {
|
||||
this.source = source;
|
||||
this.destination = destination;
|
||||
this.dependencyComponent = dependencyComponent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
if (!evt.getPropertyName().equals("visible")) {
|
||||
return;
|
||||
}
|
||||
if (dependencyMustBeVisible() != isDependencyNowVisible()) {
|
||||
toggleDependencyExistence(dependencyMustBeVisible());
|
||||
}
|
||||
}
|
||||
|
||||
void toggleDependencyExistence(boolean visible) {
|
||||
if (visible) {
|
||||
appendChild(dependencyComponent);
|
||||
} else {
|
||||
removeChild(dependencyComponent);
|
||||
}
|
||||
}
|
||||
|
||||
boolean isDependencyNowVisible() {
|
||||
return dependencyComponent.getParent() != null;
|
||||
}
|
||||
|
||||
boolean dependencyMustBeVisible() {
|
||||
return source.isVisible() && destination.isVisible();
|
||||
}
|
||||
}
|
||||
|
||||
private static final Log LOG = LogFactory.getLog(DependencyList.class);
|
||||
|
||||
private transient IZoomLevelChangedListener listener;
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@ 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.resourceload.IFilterChangedListener;
|
||||
import org.zkoss.ganttz.timetracker.TimeTracker;
|
||||
import org.zkoss.ganttz.timetracker.zoom.SeveralModificators;
|
||||
import org.zkoss.ganttz.timetracker.zoom.ZoomLevel;
|
||||
|
|
@ -84,8 +83,6 @@ public class LimitingResourcesController extends GenericForwardComposer {
|
|||
|
||||
private List<IToolbarCommand> commands = new ArrayList<IToolbarCommand>();
|
||||
|
||||
private Order filterBy;
|
||||
|
||||
private org.zkoss.zk.ui.Component parent;
|
||||
|
||||
private LimitingResourcesPanel limitingResourcesPanel;
|
||||
|
|
@ -103,8 +100,6 @@ public class LimitingResourcesController extends GenericForwardComposer {
|
|||
private final LimitingResourceQueueElementsRenderer limitingResourceQueueElementsRenderer =
|
||||
new LimitingResourceQueueElementsRenderer();
|
||||
|
||||
private transient IFilterChangedListener filterChangedListener;
|
||||
|
||||
public LimitingResourcesController() {
|
||||
}
|
||||
|
||||
|
|
@ -301,7 +296,6 @@ public class LimitingResourcesController extends GenericForwardComposer {
|
|||
}
|
||||
|
||||
public void filterBy(Order order) {
|
||||
this.filterBy = order;
|
||||
}
|
||||
|
||||
public void saveQueues() {
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ import org.zkoss.zk.ui.Component;
|
|||
import org.zkoss.zk.ui.HtmlMacroComponent;
|
||||
import org.zkoss.zul.Div;
|
||||
import org.zkoss.zul.Label;
|
||||
import org.zkoss.zul.Popup;
|
||||
import org.zkoss.zul.Treecell;
|
||||
import org.zkoss.zul.Treeitem;
|
||||
import org.zkoss.zul.TreeitemRenderer;
|
||||
|
|
@ -36,16 +35,13 @@ import org.zkoss.zul.api.Tree;
|
|||
public class LimitingResourcesLeftPane extends HtmlMacroComponent {
|
||||
|
||||
private MutableTreeModel<LimitingResourceQueue> modelForTree;
|
||||
private final QueueListComponent limitingResourcesList;
|
||||
|
||||
public LimitingResourcesLeftPane(
|
||||
MutableTreeModel<LimitingResourceQueue> treeModel,
|
||||
QueueListComponent resourceLoadList) {
|
||||
this.limitingResourcesList = resourceLoadList;
|
||||
this.modelForTree = treeModel;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void afterCompose() {
|
||||
super.afterCompose();
|
||||
|
|
@ -82,16 +78,6 @@ public class LimitingResourcesLeftPane extends HtmlMacroComponent {
|
|||
};
|
||||
}
|
||||
|
||||
private LimitingResourceQueue getLineByTreeitem(Treeitem child) {
|
||||
LimitingResourceQueue line = null;
|
||||
try {
|
||||
line = (LimitingResourceQueue) child.getValue();
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
return line;
|
||||
}
|
||||
|
||||
private Tree getContainerTree() {
|
||||
return (Tree) getFellow("loadsTree");
|
||||
}
|
||||
|
|
@ -116,12 +102,4 @@ public class LimitingResourcesLeftPane extends HtmlMacroComponent {
|
|||
result.appendChild(label);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
private static Popup createPopup(Div parent, String originalValue) {
|
||||
Popup result = new Popup();
|
||||
result.appendChild(new Label(originalValue));
|
||||
parent.appendChild(result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,8 +44,6 @@ import org.zkoss.ganttz.timetracker.zoom.ZoomLevel;
|
|||
import org.zkoss.ganttz.util.ComponentsFinder;
|
||||
import org.zkoss.ganttz.util.Interval;
|
||||
import org.zkoss.ganttz.util.MutableTreeModel;
|
||||
import org.zkoss.ganttz.util.OnZKDesktopRegistry;
|
||||
import org.zkoss.ganttz.util.script.IScriptsRegister;
|
||||
import org.zkoss.zk.au.out.AuInvoke;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
import org.zkoss.zk.ui.HtmlMacroComponent;
|
||||
|
|
@ -155,7 +153,6 @@ public class LimitingResourcesPanel extends HtmlMacroComponent {
|
|||
treeModel);
|
||||
|
||||
leftPane = new LimitingResourcesLeftPane(treeModel, queueListComponent);
|
||||
registerNeededScripts();
|
||||
}
|
||||
|
||||
public void appendQueueElementToQueue(LimitingResourceQueueElement element) {
|
||||
|
|
@ -236,16 +233,6 @@ public class LimitingResourcesPanel extends HtmlMacroComponent {
|
|||
return toolbar;
|
||||
}
|
||||
|
||||
private void registerNeededScripts() {
|
||||
// getScriptsRegister().register(
|
||||
// ScriptsRequiredByLimitingResourcesPanel.class);
|
||||
}
|
||||
|
||||
private IScriptsRegister getScriptsRegister() {
|
||||
return OnZKDesktopRegistry.getLocatorFor(IScriptsRegister.class)
|
||||
.retrieve();
|
||||
}
|
||||
|
||||
private TimeTrackerComponent timeTrackerForLimitingResourcesPanel(
|
||||
TimeTracker timeTracker) {
|
||||
return new TimeTrackerComponent(timeTracker) {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ import org.apache.commons.lang.Validate;
|
|||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.navalplanner.business.planner.entities.GenericResourceAllocation;
|
||||
import org.navalplanner.business.planner.entities.ResourceAllocation;
|
||||
import org.navalplanner.business.planner.entities.SpecificDayAssignment;
|
||||
import org.navalplanner.business.resources.daos.IResourceDAO;
|
||||
|
|
@ -298,11 +297,6 @@ class QueueTaskGeneratorOnCriterion extends QueueTaskGenerator {
|
|||
return result;
|
||||
}
|
||||
|
||||
private List<GenericResourceAllocation> genericAllocationsOnInterval() {
|
||||
return ResourceAllocation.getOfType(GenericResourceAllocation.class,
|
||||
getAllocationsOnInterval());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getAssignedHoursFor(ResourceAllocation<?> resourceAllocation) {
|
||||
return resourceAllocation.getAssignedHours(start, end);
|
||||
|
|
|
|||
|
|
@ -87,8 +87,6 @@ public class OrderElementTreeController extends TreeController<OrderElement> {
|
|||
|
||||
private Vbox orderElementFilter;
|
||||
|
||||
private Hbox orderFilter;
|
||||
|
||||
private BandboxMultipleSearch bdFiltersOrderElement;
|
||||
|
||||
private Datebox filterStartDateOrderElement;
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@ import org.navalplanner.business.externalcompanies.daos.IExternalCompanyDAO;
|
|||
import org.navalplanner.business.externalcompanies.entities.ExternalCompany;
|
||||
import org.navalplanner.business.labels.daos.ILabelDAO;
|
||||
import org.navalplanner.business.labels.entities.Label;
|
||||
import org.navalplanner.business.orders.daos.IHoursGroupDAO;
|
||||
import org.navalplanner.business.orders.daos.IOrderDAO;
|
||||
import org.navalplanner.business.orders.daos.IOrderElementDAO;
|
||||
import org.navalplanner.business.orders.entities.HoursGroup;
|
||||
|
|
@ -175,9 +174,6 @@ public class OrderModel implements IOrderModel {
|
|||
@Autowired
|
||||
private IOrderVersionDAO orderVersionDAO;
|
||||
|
||||
@Autowired
|
||||
private IHoursGroupDAO hoursGroupDAO;
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public List<Label> getLabels() {
|
||||
|
|
|
|||
|
|
@ -55,10 +55,6 @@ public class AdvanceAssignmentPlanningModel implements
|
|||
|
||||
private TaskElement task;
|
||||
|
||||
private PlanningState planningState;
|
||||
|
||||
private IContextWithPlannerTask<TaskElement> context;
|
||||
|
||||
private OrderElement orderElement;
|
||||
|
||||
@Override
|
||||
|
|
@ -81,10 +77,8 @@ public class AdvanceAssignmentPlanningModel implements
|
|||
public void initAdvancesFor(TaskElement task,
|
||||
IContextWithPlannerTask<TaskElement> context,
|
||||
PlanningState planningState) {
|
||||
this.context = context;
|
||||
initTask(task);
|
||||
initOrderElement();
|
||||
this.planningState = planningState;
|
||||
}
|
||||
|
||||
private void initTask(TaskElement task) {
|
||||
|
|
|
|||
|
|
@ -118,8 +118,6 @@ public class ResourceAllocationController extends GenericForwardComposer {
|
|||
private Label allTotalHours;
|
||||
private Label allConsolidatedHours;
|
||||
|
||||
private Label allocationSelectedItems;
|
||||
|
||||
private Label allTotalResourcesPerDay;
|
||||
private Label allConsolidatedResourcesPerDay;
|
||||
|
||||
|
|
@ -194,10 +192,6 @@ public class ResourceAllocationController extends GenericForwardComposer {
|
|||
};
|
||||
}
|
||||
|
||||
private Datebox getTaskEndDate() {
|
||||
return taskEndDate;
|
||||
}
|
||||
|
||||
private CalculationTypeRadio getCalculationTypeRadio() {
|
||||
if (formBinder != null) {
|
||||
return CalculationTypeRadio.from(formBinder.getCalculatedValue());
|
||||
|
|
|
|||
|
|
@ -50,8 +50,6 @@ public class SubcontractController extends GenericForwardComposer {
|
|||
|
||||
private ISubcontractModel subcontractModel;
|
||||
|
||||
private IContextWithPlannerTask<TaskElement> context;
|
||||
|
||||
@Override
|
||||
public void doAfterCompose(Component comp) throws Exception {
|
||||
super.doAfterCompose(comp);
|
||||
|
|
@ -60,7 +58,6 @@ public class SubcontractController extends GenericForwardComposer {
|
|||
|
||||
public void init(Task task,
|
||||
IContextWithPlannerTask<TaskElement> context) {
|
||||
this.context = context;
|
||||
subcontractModel.init(task, context.getTask());
|
||||
Util.reloadBindings(tabpanel);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,8 +41,6 @@ import org.zkoss.zul.Label;
|
|||
*/
|
||||
public class OrdersTabCreator {
|
||||
|
||||
private final Map<String, String[]> parameters;
|
||||
|
||||
public static ITab create(Mode mode,
|
||||
OrderCRUDController orderCRUDController, Component breadcrumbs,
|
||||
IOrderPlanningGate orderPlanningGate,
|
||||
|
|
@ -88,7 +86,6 @@ public class OrdersTabCreator {
|
|||
this.orderCRUDController = orderCRUDController;
|
||||
this.breadcrumbs = breadcrumbs;
|
||||
this.orderPlanningGate = orderPlanningGate;
|
||||
this.parameters = parameters;
|
||||
}
|
||||
|
||||
private ITab build() {
|
||||
|
|
|
|||
|
|
@ -319,10 +319,6 @@ public class TaskPropertiesController extends GenericForwardComposer {
|
|||
return (ITaskLeafConstraint) currentTaskElement;
|
||||
}
|
||||
|
||||
private Task currentTaskElementAsTask() {
|
||||
return (Task) currentTaskElement;
|
||||
}
|
||||
|
||||
private void hideDurationRow() {
|
||||
hours.getFellow("durationRow").setVisible(false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -216,11 +216,6 @@ public class QualityFormCRUDController extends GenericForwardComposer {
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private List<Row> getRows() {
|
||||
return this.gridQualityFormItems.getRows().getChildren();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates {@link Textbox} checking {@link Constraint}
|
||||
* @param comp
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@ import org.navalplanner.business.costcategories.entities.TypeOfWorkHours;
|
|||
import org.navalplanner.business.labels.daos.ILabelDAO;
|
||||
import org.navalplanner.business.labels.entities.Label;
|
||||
import org.navalplanner.business.orders.daos.IOrderDAO;
|
||||
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.orders.entities.OrderLine;
|
||||
|
|
@ -49,7 +48,6 @@ import org.navalplanner.business.resources.entities.Criterion;
|
|||
import org.navalplanner.business.resources.entities.CriterionType;
|
||||
import org.navalplanner.business.resources.entities.ResourceEnum;
|
||||
import org.navalplanner.business.resources.entities.Worker;
|
||||
import org.navalplanner.business.scenarios.IScenarioManager;
|
||||
import org.navalplanner.business.workreports.entities.WorkReportLine;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
|
|
@ -65,9 +63,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
|
||||
public class OrderCostsPerResourceModel implements IOrderCostsPerResourceModel {
|
||||
|
||||
@Autowired
|
||||
private IOrderElementDAO orderElementDAO;
|
||||
|
||||
@Autowired
|
||||
private IOrderDAO orderDAO;
|
||||
|
||||
|
|
@ -77,9 +72,6 @@ public class OrderCostsPerResourceModel implements IOrderCostsPerResourceModel {
|
|||
@Autowired
|
||||
private ILabelDAO labelDAO;
|
||||
|
||||
@Autowired
|
||||
private IScenarioManager scenarioManager;
|
||||
|
||||
@Autowired
|
||||
private ICriterionTypeDAO criterionTypeDAO;
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ import org.navalplanner.web.common.components.ExtendedJasperreport;
|
|||
import org.navalplanner.web.common.components.bandboxsearch.BandboxSearch;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
import org.zkoss.zk.ui.WrongValueException;
|
||||
import org.zkoss.zul.Combobox;
|
||||
import org.zkoss.zul.Datebox;
|
||||
import org.zkoss.zul.Label;
|
||||
import org.zkoss.zul.Listbox;
|
||||
|
|
@ -69,10 +68,6 @@ public class TimeLineRequiredMaterialController extends
|
|||
|
||||
private Datebox endingDate;
|
||||
|
||||
private Combobox cbStatus;
|
||||
|
||||
private Listbox listStatus;
|
||||
|
||||
private Date filterStartingDate = getDefaultStartingDate();
|
||||
|
||||
private Date filterEndingDate = getDefaultEndingDate();
|
||||
|
|
|
|||
|
|
@ -83,8 +83,6 @@ public class TimeLineRequiredMaterialModel implements
|
|||
|
||||
private Date endingDate;
|
||||
|
||||
private MaterialStatusEnum status;
|
||||
|
||||
private List<MaterialAssignment> listMaterialAssignment = new ArrayList<MaterialAssignment>();
|
||||
|
||||
private MutableTreeModel<Object> allMaterialCategories = MutableTreeModel
|
||||
|
|
|
|||
|
|
@ -33,8 +33,6 @@ import org.apache.commons.lang.Validate;
|
|||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.navalplanner.business.planner.entities.DayAssignment;
|
||||
import org.navalplanner.business.planner.entities.GenericResourceAllocation;
|
||||
import org.navalplanner.business.planner.entities.ResourceAllocation;
|
||||
import org.navalplanner.business.planner.entities.SpecificDayAssignment;
|
||||
import org.navalplanner.business.resources.daos.IResourceDAO;
|
||||
|
|
@ -327,11 +325,6 @@ class LoadPeriodGeneratorOnCriterion extends LoadPeriodGenerator {
|
|||
return result;
|
||||
}
|
||||
|
||||
private List<GenericResourceAllocation> genericAllocationsOnInterval() {
|
||||
return ResourceAllocation.getOfType(GenericResourceAllocation.class,
|
||||
getAllocationsOnInterval());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getAssignedHoursFor(ResourceAllocation<?> resourceAllocation) {
|
||||
return resourceAllocation.getAssignedHours(start, end);
|
||||
|
|
@ -353,22 +346,4 @@ class LoadPeriodGeneratorOnCriterion extends LoadPeriodGenerator {
|
|||
|
||||
private Map<Resource, List<SpecificDayAssignment>> specificByResourceCached = new HashMap<Resource, List<SpecificDayAssignment>>();
|
||||
|
||||
private List<SpecificDayAssignment> getSpecificOrderedAssignmentsFor(
|
||||
Resource resource) {
|
||||
if (!specificByResourceCached.containsKey(resource)) {
|
||||
specificByResourceCached.put(resource, DayAssignment
|
||||
.specific(DayAssignment.orderedByDay(resource
|
||||
.getAssignments())));
|
||||
}
|
||||
return specificByResourceCached.get(resource);
|
||||
}
|
||||
|
||||
private int sum(List<SpecificDayAssignment> specific) {
|
||||
int result = 0;
|
||||
for (SpecificDayAssignment s : specific) {
|
||||
result += s.getHours();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,6 @@ import org.navalplanner.web.common.OnlyOneVisible;
|
|||
import org.navalplanner.web.common.Util;
|
||||
import org.navalplanner.web.common.components.bandboxsearch.BandboxMultipleSearch;
|
||||
import org.navalplanner.web.common.components.finders.FilterPair;
|
||||
import org.navalplanner.web.common.entrypoints.IURLHandlerRegistry;
|
||||
import org.navalplanner.web.costcategories.ResourcesCostCategoryAssignmentController;
|
||||
import org.navalplanner.web.resources.search.ResourcePredicate;
|
||||
import org.navalplanner.web.resources.worker.CriterionsController;
|
||||
|
|
@ -83,8 +82,6 @@ public class MachineCRUDController extends GenericForwardComposer {
|
|||
|
||||
private IMachineModel machineModel;
|
||||
|
||||
private IURLHandlerRegistry URLHandlerRegistry;
|
||||
|
||||
private OnlyOneVisible visibility;
|
||||
|
||||
private IMessagesForUser messagesForUser;
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@ import org.navalplanner.business.common.exceptions.ValidationException;
|
|||
import org.navalplanner.business.planner.daos.IDayAssignmentDAO;
|
||||
import org.navalplanner.business.planner.daos.IResourceAllocationDAO;
|
||||
import org.navalplanner.business.resources.daos.ICriterionDAO;
|
||||
import org.navalplanner.business.resources.daos.ICriterionTypeDAO;
|
||||
import org.navalplanner.business.resources.daos.IMachineDAO;
|
||||
import org.navalplanner.business.resources.daos.IResourceDAO;
|
||||
import org.navalplanner.business.resources.daos.IWorkerDAO;
|
||||
|
|
@ -54,10 +53,8 @@ import org.navalplanner.business.resources.entities.Resource;
|
|||
import org.navalplanner.business.resources.entities.ResourceEnum;
|
||||
import org.navalplanner.business.resources.entities.Worker;
|
||||
import org.navalplanner.business.workreports.daos.IWorkReportLineDAO;
|
||||
import org.navalplanner.web.calendars.IBaseCalendarModel;
|
||||
import org.navalplanner.web.resources.search.ResourcePredicate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -96,8 +93,6 @@ public class MachineModel implements IMachineModel {
|
|||
@Autowired
|
||||
private ICriterionDAO criterionDAO;
|
||||
@Autowired
|
||||
private ICriterionTypeDAO criterionTypeDAO;
|
||||
@Autowired
|
||||
private IWorkerDAO workerDAO;
|
||||
@Autowired
|
||||
private IConfigurationDAO configurationDAO;
|
||||
|
|
@ -111,10 +106,6 @@ public class MachineModel implements IMachineModel {
|
|||
private ClassValidator<Machine> validator = new ClassValidator<Machine>(
|
||||
Machine.class);
|
||||
|
||||
@Autowired
|
||||
@Qualifier("subclass")
|
||||
private IBaseCalendarModel baseCalendarModel;
|
||||
|
||||
private void reattachCriterionsCache() {
|
||||
for (Criterion each: criterions.values()) {
|
||||
criterionDAO.reattachUnmodifiedEntity(each);
|
||||
|
|
|
|||
|
|
@ -54,8 +54,6 @@ public class ResourcePredicate implements IPredicate {
|
|||
|
||||
private Boolean isLimitingResource;
|
||||
|
||||
private List<Resource> assignedResourcesInIntervalDates;
|
||||
|
||||
public ResourcePredicate(List<FilterPair> filters, String personalFilters,
|
||||
LocalDate startDate,
|
||||
LocalDate finishDate,
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ package org.navalplanner.web.scenarios;
|
|||
|
||||
import static org.navalplanner.web.I18nHelper._;
|
||||
|
||||
import java.awt.Window;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
|
@ -68,8 +67,6 @@ public class TransferOrdersController extends GenericForwardComposer {
|
|||
|
||||
private Listbox destinationScenarioOrders;
|
||||
|
||||
private Window transferOrdersWindow;
|
||||
|
||||
@Override
|
||||
public void doAfterCompose(Component comp) throws Exception {
|
||||
super.doAfterCompose(comp);
|
||||
|
|
|
|||
|
|
@ -42,9 +42,9 @@ import org.zkoss.zul.ListitemRenderer;
|
|||
public class AdvancesAssignmentComponent extends HtmlMacroComponent {
|
||||
|
||||
private OrderElementTemplate template;
|
||||
private IOrderTemplatesModel model;
|
||||
|
||||
private ListitemRenderer advancesRenderer = new ListitemRenderer() {
|
||||
|
||||
@Override
|
||||
public void render(Listitem item, Object data) throws Exception {
|
||||
AdvanceAssignmentTemplate assignment = (AdvanceAssignmentTemplate) data;
|
||||
|
|
@ -91,7 +91,6 @@ public class AdvancesAssignmentComponent extends HtmlMacroComponent {
|
|||
|
||||
public void useModel(IOrderTemplatesModel model,
|
||||
OrderElementTemplate template) {
|
||||
this.model = model;
|
||||
this.template = template;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ package org.navalplanner.web.workreports;
|
|||
|
||||
import static org.navalplanner.web.I18nHelper._;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
@ -543,15 +542,6 @@ public class WorkReportCRUDController extends GenericForwardComposer implements
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Locates {@link Textbox} in {@link Row} in the specified position
|
||||
* @param row
|
||||
* @return
|
||||
*/
|
||||
private Textbox getTextboxInPosition(Row row, Integer position) {
|
||||
return (Textbox) row.getChildren().get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void goToList() {
|
||||
if (workReportModel.isListingQuery()) {
|
||||
|
|
@ -838,11 +828,6 @@ public class WorkReportCRUDController extends GenericForwardComposer implements
|
|||
row.appendChild(date);
|
||||
}
|
||||
|
||||
private String getFormatDate(Date value) {
|
||||
return value != null ? (new SimpleDateFormat("dd/MM/yyyy"))
|
||||
.format((Date) value) : new String("");
|
||||
}
|
||||
|
||||
/**
|
||||
* Append a Autocomplete @{link Resource} to row
|
||||
*
|
||||
|
|
|
|||
|
|
@ -80,13 +80,6 @@ public class WorkReportLinePredicate implements IPredicate {
|
|||
date, finishDate));
|
||||
}
|
||||
|
||||
private boolean isInTheRangeWorkReportDates(Date date,
|
||||
WorkReportDTO workReportDTO) {
|
||||
// Check if date is into interval between the startdate and finish date
|
||||
return (isGreaterToStartDate(date, workReportDTO.getDateStart()) && isLowerToFinishDate(
|
||||
date, workReportDTO.getDateFinish()));
|
||||
}
|
||||
|
||||
private boolean isGreaterToStartDate(Date date, Date startDate) {
|
||||
if (startDate == null) {
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ import java.util.Set;
|
|||
import org.apache.commons.lang.Validate;
|
||||
import org.navalplanner.business.common.exceptions.InstanceNotFoundException;
|
||||
import org.navalplanner.business.common.exceptions.ValidationException;
|
||||
import org.navalplanner.business.labels.daos.ILabelDAO;
|
||||
import org.navalplanner.business.labels.daos.ILabelTypeDAO;
|
||||
import org.navalplanner.business.labels.entities.Label;
|
||||
import org.navalplanner.business.labels.entities.LabelType;
|
||||
|
|
@ -70,9 +69,6 @@ public class WorkReportTypeModel implements IWorkReportTypeModel {
|
|||
@Autowired
|
||||
private ILabelTypeDAO labelTypeDAO;
|
||||
|
||||
@Autowired
|
||||
private ILabelDAO labelDAO;
|
||||
|
||||
private WorkReportType workReportType;
|
||||
|
||||
private boolean editing = false;
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ import java.util.UUID;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
|
|
@ -154,10 +153,6 @@ public class OrderModelTest {
|
|||
|
||||
private Criterion criterion;
|
||||
|
||||
private Session getSession() {
|
||||
return sessionFactory.getCurrentSession();
|
||||
}
|
||||
|
||||
private Order createValidOrder() {
|
||||
Order order = Order.create();
|
||||
order.setDescription("description");
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ import org.junit.Test;
|
|||
import org.junit.runner.RunWith;
|
||||
import org.navalplanner.business.calendars.daos.IBaseCalendarDAO;
|
||||
import org.navalplanner.business.calendars.entities.BaseCalendar;
|
||||
import org.navalplanner.business.common.IAdHocTransactionService;
|
||||
import org.navalplanner.ws.calendars.api.BaseCalendarDTO;
|
||||
import org.navalplanner.ws.calendars.api.BaseCalendarListDTO;
|
||||
import org.navalplanner.ws.calendars.api.ICalendarService;
|
||||
|
|
@ -65,9 +64,6 @@ public class CalendarServiceTest {
|
|||
@Autowired
|
||||
private SessionFactory sessionFactory;
|
||||
|
||||
@Autowired
|
||||
private IAdHocTransactionService transactionService;
|
||||
|
||||
private BaseCalendar givenBaseCalendarStored() {
|
||||
BaseCalendar calendar = BaseCalendar.create();
|
||||
calendar.setName("calendar-name");
|
||||
|
|
|
|||
|
|
@ -45,7 +45,6 @@ import org.navalplanner.business.common.IOnTransaction;
|
|||
import org.navalplanner.business.common.exceptions.InstanceNotFoundException;
|
||||
import org.navalplanner.business.materials.bootstrap.UnitTypeBootstrap;
|
||||
import org.navalplanner.business.materials.daos.IMaterialCategoryDAO;
|
||||
import org.navalplanner.business.materials.daos.IMaterialDAO;
|
||||
import org.navalplanner.business.materials.daos.IUnitTypeDAO;
|
||||
import org.navalplanner.business.materials.entities.MaterialCategory;
|
||||
import org.navalplanner.business.materials.entities.UnitType;
|
||||
|
|
@ -83,9 +82,6 @@ public class MaterialServiceTest {
|
|||
@Autowired
|
||||
private IMaterialCategoryDAO materialCategoryDAO;
|
||||
|
||||
@Autowired
|
||||
private IMaterialDAO materialDAO;
|
||||
|
||||
@Autowired
|
||||
private IUnitTypeDAO unitTypeDAO;
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,6 @@ import org.navalplanner.business.common.exceptions.InstanceNotFoundException;
|
|||
import org.navalplanner.business.externalcompanies.daos.IExternalCompanyDAO;
|
||||
import org.navalplanner.business.externalcompanies.entities.ExternalCompany;
|
||||
import org.navalplanner.business.orders.daos.IOrderDAO;
|
||||
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.orders.entities.OrderLine;
|
||||
|
|
@ -119,9 +118,6 @@ public class ReportAdvancesServiceTest {
|
|||
@Autowired
|
||||
private IOrderDAO orderDAO;
|
||||
|
||||
@Autowired
|
||||
private IOrderElementDAO orderElementDAO;
|
||||
|
||||
@Autowired
|
||||
private IConfigurationDAO configurationDAO;
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,6 @@ import org.joda.time.LocalDate;
|
|||
import org.joda.time.LocalTime;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.navalplanner.business.common.IAdHocTransactionService;
|
||||
import org.navalplanner.business.common.exceptions.InstanceNotFoundException;
|
||||
import org.navalplanner.business.costcategories.daos.ITypeOfWorkHoursDAO;
|
||||
import org.navalplanner.business.costcategories.entities.TypeOfWorkHours;
|
||||
|
|
@ -106,9 +105,6 @@ public class WorkReportServiceTest {
|
|||
@Autowired
|
||||
private IWorkReportTypeDAO workReportTypeDAO;
|
||||
|
||||
@Autowired
|
||||
private IAdHocTransactionService adHocTransaction;
|
||||
|
||||
@Autowired
|
||||
private IWorkReportDAO workReportDAO;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue