Package org.libreplan.business.planner.entities

Examples of org.libreplan.business.planner.entities.Task$ModificationsResult


                createStubAllocationReturning(SpecificResourceAllocation.class,
                        null), ResourcesPerDay.amount(2)));
    }

    private void givenAllocationsBelongingToDifferentTasks() {
        Task task = createStubTask();
        allocations.add(ResourcesPerDayModification.create(
                createStubAllocationReturning(SpecificResourceAllocation.class,
                        task), ResourcesPerDay.amount(2)));
        allocations.add(ResourcesPerDayModification.create(
                createStubAllocationReturning(SpecificResourceAllocation.class,
                        task), ResourcesPerDay.amount(2)));
        Task other = createStubTask();
        allocations.add(ResourcesPerDayModification.create(
                createStubAllocationReturning(SpecificResourceAllocation.class,
                        other), ResourcesPerDay.amount(2)));
    }
View Full Code Here


                createStubAllocationReturning(SpecificResourceAllocation.class,
                        other), ResourcesPerDay.amount(2)));
    }

    private Task createStubTask() {
        Task task = createNiceMock(Task.class);
        replay(task);
        return task;
    }
View Full Code Here

        }
        return order;
    }

    private static String createTooltiptext(LimitingResourceQueueElement element) {
        final Task task = element.getResourceAllocation().getTask();
        final OrderElement order = getRootOrder(task);

        StringBuilder result = new StringBuilder();
        result.append(_("Project: {0}", order.getName()) + " ");
        result.append(_("Task: {0}", task.getName()) + " ");
        result.append(_("Completed: {0}%", element.getAdvancePercentage().multiply(new BigDecimal(100))) + " ");

        final ResourceAllocation<?> resourceAllocation = element.getResourceAllocation();
        if (resourceAllocation instanceof SpecificResourceAllocation) {
            final SpecificResourceAllocation specific = (SpecificResourceAllocation) resourceAllocation;
View Full Code Here

    }

    private static QueueTask createDivForElement(IDatesMapper datesMapper,
            LimitingResourceQueueElement queueElement) {

        final Task task = queueElement.getResourceAllocation().getTask();
        final OrderElement order = getRootOrder(task);

        QueueTask result = new QueueTask(queueElement);
        String cssClass = "queue-element";
        result.setTooltiptext(createTooltiptext(queueElement));

        int startPixels = getStartPixels(datesMapper, queueElement);
        result.setLeft(forCSS(startPixels));
        if (startPixels < 0) {
            cssClass += " truncated-start ";
        }

        int taskWidth = getWidthPixels(datesMapper, queueElement);
        if ((startPixels + taskWidth) > datesMapper.getHorizontalSize()) {
            taskWidth = datesMapper.getHorizontalSize() - startPixels;
            cssClass += " truncated-end ";
        } else {
            result.appendChild(generateNonWorkableShade(datesMapper,
                    queueElement));
        }
        result.setWidth(forCSS(taskWidth));

        LocalDate deadlineDate = task.getDeadline();
        boolean isOrderDeadline = false;
        if (deadlineDate == null) {
            Date orderDate = order.getDeadline();
            if (orderDate != null) {
                deadlineDate = LocalDate.fromDateFields(orderDate);
View Full Code Here

                assertNull(directAdvanceAssignmentSubcontractor);

                int currentCommunications = subcontractorCommunicationDAO.getAll().size();
                assertThat((previousCommunications + 1), equalTo(currentCommunications));

                Task task = (Task) orderElement.getTaskSource().getTask();
                SubcontractedTaskData subcontractedTaskData = task.getSubcontractedTaskData();
                assertNotNull(subcontractedTaskData);
                assertThat(subcontractedTaskData.getEndDatesCommunicatedFromSubcontractor().size(),
                        equalTo(1));
                } catch (InstanceNotFoundException e) {
                    throw new RuntimeException();
View Full Code Here

                    }

                    int currentCommunications = subcontractorCommunicationDAO.getAll().size();
                    assertThat((previousCommunications + 2), equalTo(currentCommunications));

                    Task task = (Task) orderElement.getTaskSource().getTask();
                    SubcontractedTaskData subcontractedTaskData = task.getSubcontractedTaskData();
                    assertNotNull(subcontractedTaskData);
                    assertThat(subcontractedTaskData.getEndDatesCommunicatedFromSubcontractor()
                            .size(), equalTo(1));
                } catch (InstanceNotFoundException e) {
                    throw new RuntimeException();
View Full Code Here

        orderLine.getCurrentSchedulingData().requestedCreationOf(taskSource);

        TaskSourceSynchronization mustAdd = TaskSource.mustAdd(taskSource);
        mustAdd.apply(TaskSource.persistTaskSources(taskSourceDAO));

        Task task = (Task) taskSource.getTask();
        return task;
    }
View Full Code Here

        return task;
    }

    public SubcontractedTaskData createValidSubcontractedTaskData(final String name,
            final OrderLine orderLine) {
        Task task = createValidTask(orderLine);
        SubcontractedTaskData subcontractedTaskData = SubcontractedTaskData.create(task);
        subcontractedTaskData.addRequiredDeliveringDates(SubcontractorDeliverDate
                .create(new Date(),new Date(), null));
        subcontractedTaskData.setExternalCompany(getSubcontractorExternalCompanySaved());

        task.setSubcontractedTaskData(subcontractedTaskData);
        taskElementDAO.save(task);
        task.dontPoseAsTransientObjectAnymore();
        taskElementDAO.flush();

        subcontractedTaskDataDAO.save(subcontractedTaskData);
        return subcontractedTaskData;
    }
View Full Code Here

    private List<Task> sortTasks(Order order, List<Task> tasks) {
        List<Task> sortTasks = new ArrayList<Task>();
        final List<OrderElement> orderElements = order.getAllChildren();
        for (OrderElement orderElement : orderElements) {
            Task task = findOrderElementInTasks(orderElement, tasks);
            if (task != null) {
                sortTasks.add(task);
            }
        }
        return sortTasks;
View Full Code Here

    private List<Task> sortTasks(Order order, List<Task> tasks) {
        List<Task> sortTasks = new ArrayList<Task>();
        final List<OrderElement> orderElements = order.getAllChildren();
        for (OrderElement orderElement : orderElements) {
            Task task = findOrderElementInTasks(orderElement, tasks);
            if (task != null) {
                sortTasks.add(task);
            }
        }
        return sortTasks;
View Full Code Here

TOP

Related Classes of org.libreplan.business.planner.entities.Task$ModificationsResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.