Package org.libreplan.business.workreports.entities

Examples of org.libreplan.business.workreports.entities.WorkReportType


    public WorkReportDTO(WorkReport workReport) {
        this.workReport = workReport;
        this.dateStart = this.getDateStartWorkReport(workReport);
        this.dateFinish = this.getDateFinishWorkReport(workReport);

        WorkReportType workReportType = workReport.getWorkReportType();
        this.type = workReportType.getName();
        if (workReportType.isPersonalTimesheetsType()) {
            this.type += " - " + workReport.getResource().getShortDescription();
        }

        this.hours = workReport.getTotalEffortDuration();
    }
View Full Code Here


    }

    @Transactional(readOnly = true)
    private WorkReportType getWorkReportTypeFromDB(Long id) {
        try {
            WorkReportType result = workReportTypeDAO.find(id);
            return result;
        } catch (InstanceNotFoundException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

    @Override
    public WorkReportType findUniqueByName(String name)
            throws InstanceNotFoundException, NonUniqueResultException {
        Criteria c = getSession().createCriteria(WorkReportType.class);
        c.add(Restrictions.eq("name", name));
        WorkReportType workReportType = (WorkReportType) c.uniqueResult();

        if (workReportType == null) {
            throw new InstanceNotFoundException(null, "WorkReportType");
        }
        return workReportType;
View Full Code Here

    }

    @Override
    public boolean existsOtherWorkReportTypeByName(WorkReportType workReportType) {
        try {
            WorkReportType t = findUniqueByName(workReportType);
            return (t != null && t != workReportType);
        } catch (InstanceNotFoundException e) {
            return false;
        }
    }
View Full Code Here

    @Override
    public WorkReportType findUniqueByCode(String code)
            throws InstanceNotFoundException, NonUniqueResultException {
        Criteria c = getSession().createCriteria(WorkReportType.class);
        c.add(Restrictions.eq("code", code));
        WorkReportType workReportType = (WorkReportType) c.uniqueResult();

        if (workReportType == null) {
            throw new InstanceNotFoundException(null, "WorkReportType");
        }
        return workReportType;
View Full Code Here

    }

    @Override
    public boolean existsOtherWorkReportTypeByCode(WorkReportType workReportType) {
        try {
            WorkReportType t = findUniqueByCode(workReportType);
            return (t != null && t != workReportType);
        } catch (InstanceNotFoundException e) {
            return false;
        }
    }
View Full Code Here

        }
    }

    private WorkReportType getPersonalTimesheetsWorkReportType() {
        try {
            WorkReportType workReportType = workReportTypeDAO
                    .findUniqueByName(PredefinedWorkReportTypes.PERSONAL_TIMESHEETS
                            .getName());
            return workReportType;
        } catch (NonUniqueResultException e) {
            throw new RuntimeException(e);
View Full Code Here

        return capacity;
    }

    private void forceLoad(WorkReport workReport) {
        if (workReport != null) {
            WorkReportType workReportType = workReport.getWorkReportType();
            workReportType.getLineFields().size();
            workReportType.getWorkReportLabelTypeAssigments().size();
            workReportType.getHeadingFields().size();
        }
    }
View Full Code Here

            }
        };
    }

    private void createPredicate() {
        WorkReportType type = getSelectedType();
        Date startDate = filterStartDate.getValue();
        Date finishDate = filterFinishDate.getValue();
        predicate = new WorkReportPredicate(type, startDate, finishDate);
    }
View Full Code Here

        if (selectedItem == null) {
            throw new WrongValueException(listTypeToAssign,
                    _("please, select a timesheet template type"));
        }

        WorkReportType type = (WorkReportType) selectedItem.getValue();
        if (type == null) {
            throw new WrongValueException(listTypeToAssign,
                    _("please, select a timesheet template type"));
        }
View Full Code Here

TOP

Related Classes of org.libreplan.business.workreports.entities.WorkReportType

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.