Package org.libreplan.business.users.entities

Examples of org.libreplan.business.users.entities.User


        profileBootstrap.loadRequiredData();
        usersBootstrap.loadRequiredData();

        for (PredefinedUsers u : PredefinedUsers.values()) {

            User user = userDAO.findByLoginName(u.getLoginName());

            assertEquals(u.getLoginName(), user.getLoginName());
            assertEquals(u.getInitialRoles(), user.getRoles());

        }
    }
View Full Code Here


        }

        String encodedPassword = dbPasswordEncoderService.encodePassword(
                password, loginName);

        User newUser = User.create(loginName, encodedPassword,
                emailTextbox.getValue());

        Worker worker = getWorker();
        newUser.setFirstName(worker.getFirstName());
        newUser.setLastName(worker.getSurname());

        return newUser;
    }
View Full Code Here

                .getFellow("workerFirstname");
        workerFirstname.focus();
    }

    private void updateUserBindingComponents() {
        User user = getBoundUser();
        if (user == null) {
            userBindingRadiogroup.setSelectedIndex(UserBindingOption.NOT_BOUND
                    .ordinal());
        } else {
            userBindingRadiogroup
View Full Code Here

            if (Messagebox.OK != status) {
                return;
            }

            boolean removeBoundUser = false;
            User user = workerModel.getBoundUserFromDB(worker);
            if (user != null && !user.isSuperuser()) {
                removeBoundUser = Messagebox.show(
                        _("Do you want to remove bound user \"{0}\" too?",
                                user.getLoginName()), _("Delete bound user"),
                        Messagebox.YES | Messagebox.NO, Messagebox.QUESTION) == Messagebox.YES;
            }

            workerModel.confirmRemove(worker, removeBoundUser);
            messages.showMessage(Level.INFO,
View Full Code Here

    public boolean isUserSelected() {
        return userBandbox.getSelectedElement() != null;
    }

    public String getLoginName() {
        User user = getBoundUser();
        if (user != null) {
            return user.getLoginName();
        }
        return "";
    }
View Full Code Here

        }
        return "";
    }

    public String getEmail() {
        User user = getBoundUser();
        if (user != null) {
            return user.getEmail();
        }
        return "";
    }
View Full Code Here

        }
        return false;
    }

    public void goToUserEdition() {
        User user = getWorker().getUser();
        if (user != null) {
            if (showConfirmUserEditionDialog() == Messagebox.OK) {
                userCRUD.goToEditForm(user);
            }
        }
View Full Code Here

                    _("You do not have permissions to edit this timesheet"));
        }
    }

    private boolean belongsToCurrentUser(WorkReportLine line) {
        User user = UserUtil.getUserFromSession();
        return line.getResource().getId().equals(user.getWorker().getId());
    }
View Full Code Here

        // Only by dates and bandbox filter on global resources load
        if (filterBy == null) {
        LocalDate startDate = FilterUtils.readResourceLoadsStartDate();
        LocalDate endDate = FilterUtils.readResourceLoadsEndDate();

        User user = resourceLoadModel.getUser();

        // Calculate filter based on user preferences
        if (user != null) {
                if (startDate == null
                        && !FilterUtils.hasResourceLoadsStartDateChanged()) {
                if (user.getResourcesLoadFilterPeriodSince() != null) {
                    startDate = new LocalDate().minusMonths(user
                            .getResourcesLoadFilterPeriodSince());
                } else {
                    // Default filter start
                    startDate = new LocalDate().minusDays(1);
                }
            }
                if ((endDate == null)
                        && !FilterUtils.hasResourceLoadsEndDateChanged()
                    && (user.getResourcesLoadFilterPeriodTo() != null)) {
                endDate = new LocalDate().plusMonths(user
                        .getResourcesLoadFilterPeriodTo());
            }
        }

        result.add(new ByDatesFilter(onChange, filterBy, startDate, endDate));

        List<FilterPair> filterPairs = (List<FilterPair>) FilterUtils
                .readResourceLoadsBandbox();
        if ((filterPairs == null || filterPairs.isEmpty())
                && user.getResourcesLoadFilterCriterion() != null) {
            filterPairs = new ArrayList<FilterPair>();
            filterPairs.add(new FilterPair(
                    ResourceAllocationFilterEnum.Criterion, user
                            .getResourcesLoadFilterCriterion()
                            .getFinderPattern(), user
                            .getResourcesLoadFilterCriterion()));
        }

        WorkersOrCriteriaBandbox bandbox = new WorkersOrCriteriaBandbox(
                onChange, filterBy, filterTypeChanger, resourcesSearcher, filterPairs);
View Full Code Here

            ICommandOnTask<TaskElement> doubleClickCommand,
            TaskGroupPredicate predicate) {
        currentScenario = scenarioManager.getCurrent();
        final PlannerConfiguration<TaskElement> configuration = createConfiguration(predicate);

        User user;
        try {
            user = this.userDAO.findByLoginName(SecurityUtils
                    .getSessionUserLoginName());
        } catch (InstanceNotFoundException e) {
            throw new RuntimeException(e);
        }
        boolean expandPlanningViewChart = user
                .isExpandCompanyPlanningViewCharts();
        configuration.setExpandPlanningViewCharts(expandPlanningViewChart);

        final Tabbox chartComponent = new Tabbox();
        chartComponent.setOrient("vertical");
View Full Code Here

TOP

Related Classes of org.libreplan.business.users.entities.User

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.