Package com.gcrm.domain

Examples of com.gcrm.domain.User


            salutation = salutationService.getEntityById(Salutation.class,
                    salutationID);
        }
        contact.setSalutation(salutation);

        User user = null;
        if (this.getAssignedToID() != null) {
            user = userService
                    .getEntityById(User.class, this.getAssignedToID());
        }
        contact.setAssigned_to(user);

        User owner = null;
        if (this.getOwnerID() != null) {
            owner = userService.getEntityById(User.class, this.getOwnerID());
        }
        contact.setOwner(owner);
View Full Code Here


        if (originalContact != null) {
            ActionContext context = ActionContext.getContext();
            Map<String, Object> session = context.getSession();
            String entityName = Contact.class.getSimpleName();
            Integer recordID = contact.getId();
            User loginUser = (User) session
                    .get(AuthenticationSuccessListener.LOGIN_USER);
            changeLogs = new ArrayList<ChangeLog>();

            String oldSalutation = getOptionValue(originalContact
                    .getSalutation());
            String newSalutation = getOptionValue(contact.getSalutation());
            createChangeLog(changeLogs, entityName, recordID,
                    "menu.salutation.title", oldSalutation, newSalutation,
                    loginUser);

            String oldFirstName = CommonUtil.fromNullToEmpty(originalContact
                    .getFirst_name());
            String newFirstName = CommonUtil.fromNullToEmpty(contact
                    .getFirst_name());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.first_name.label", oldFirstName, newFirstName,
                    loginUser);

            String oldLastName = CommonUtil.fromNullToEmpty(originalContact
                    .getLast_name());
            String newLastName = CommonUtil.fromNullToEmpty(contact
                    .getLast_name());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.last_name.label", oldLastName, newLastName,
                    loginUser);

            String oldOfficePhone = CommonUtil.fromNullToEmpty(originalContact
                    .getOffice_phone());
            String newOfficePhone = CommonUtil.fromNullToEmpty(contact
                    .getOffice_phone());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.office_phone.label", oldOfficePhone,
                    newOfficePhone, loginUser);

            String oldTitle = CommonUtil.fromNullToEmpty(originalContact
                    .getTitle());
            String newTitle = CommonUtil.fromNullToEmpty(contact.getTitle());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.title.label", oldTitle, newTitle, loginUser);

            String oldMobile = CommonUtil.fromNullToEmpty(originalContact
                    .getMobile());
            String newMobile = CommonUtil.fromNullToEmpty(contact.getMobile());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.mobile.label", oldMobile, newMobile, loginUser);

            String oldDepartment = CommonUtil.fromNullToEmpty(originalContact
                    .getDepartment());
            String newDepartment = CommonUtil.fromNullToEmpty(contact
                    .getDepartment());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.department.label", oldDepartment, newDepartment,
                    loginUser);

            String oldFax = CommonUtil
                    .fromNullToEmpty(originalContact.getFax());
            String newWFax = CommonUtil.fromNullToEmpty(contact.getFax());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.fax.label", oldFax, newWFax, loginUser);

            String oldSkypeId = CommonUtil.fromNullToEmpty(originalContact
                    .getSkype_id());
            String newSkypeId = CommonUtil.fromNullToEmpty(contact
                    .getSkype_id());
            createChangeLog(changeLogs, entityName, recordID,
                    "contact.skype_id.label", oldSkypeId, newSkypeId, loginUser);

            String oldWebsite = CommonUtil.fromNullToEmpty(originalContact
                    .getWebsite());
            String newWebsite = CommonUtil
                    .fromNullToEmpty(contact.getWebsite());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.website.label", oldWebsite, newWebsite, loginUser);

            String oldPrimaryStreet = CommonUtil
                    .fromNullToEmpty(originalContact.getPrimary_street());
            String newPrimaryStreet = CommonUtil.fromNullToEmpty(contact
                    .getPrimary_street());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.primary_street.label", oldPrimaryStreet,
                    newPrimaryStreet, loginUser);

            String oldPrimaryState = CommonUtil.fromNullToEmpty(originalContact
                    .getPrimary_state());
            String newPrimaryState = CommonUtil.fromNullToEmpty(contact
                    .getPrimary_state());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.primary_state.label", oldPrimaryState,
                    newPrimaryState, loginUser);

            String oldPrimaryPostalCode = CommonUtil
                    .fromNullToEmpty(originalContact.getPrimary_postal_code());
            String newPrimaryPostalCode = CommonUtil.fromNullToEmpty(contact
                    .getPrimary_postal_code());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.primary_postal_code.label", oldPrimaryPostalCode,
                    newPrimaryPostalCode, loginUser);

            String oldPrimaryCountry = CommonUtil
                    .fromNullToEmpty(originalContact.getPrimary_country());
            String newPrimaryCountry = CommonUtil.fromNullToEmpty(contact
                    .getPrimary_country());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.primary_country.label", oldPrimaryCountry,
                    newPrimaryCountry, loginUser);

            String oldOtherStreet = CommonUtil.fromNullToEmpty(originalContact
                    .getOther_street());
            String newOtherStreet = CommonUtil.fromNullToEmpty(contact
                    .getOther_street());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.other_street.label", oldOtherStreet,
                    newOtherStreet, loginUser);

            String oldOtherState = CommonUtil.fromNullToEmpty(originalContact
                    .getOther_state());
            String newOtherState = CommonUtil.fromNullToEmpty(contact
                    .getOther_state());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.other_state.label", oldOtherState, newOtherState,
                    loginUser);

            String oldOtherPostalCode = CommonUtil
                    .fromNullToEmpty(originalContact.getOther_postal_code());
            String newOtherPostalCode = CommonUtil.fromNullToEmpty(contact
                    .getOther_postal_code());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.other_postal_code.label", oldOtherPostalCode,
                    newOtherPostalCode, loginUser);

            String oldOtherCountry = CommonUtil.fromNullToEmpty(originalContact
                    .getOther_country());
            String newOtherCountry = CommonUtil.fromNullToEmpty(contact
                    .getOther_country());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.other_country.label", oldOtherCountry,
                    newOtherCountry, loginUser);

            String oldEmail = CommonUtil.fromNullToEmpty(originalContact
                    .getEmail());
            String newEmail = CommonUtil.fromNullToEmpty(contact.getEmail());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.email.label", oldEmail, newEmail, loginUser);

            String oldOrigo = CommonUtil.fromNullToEmpty(originalContact
                    .getOrigo());
            String newOrigo = CommonUtil.fromNullToEmpty(contact.getOrigo());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.origo.label", oldOrigo, newOrigo, loginUser);

            String oldHeight = String.valueOf(originalContact.getHeight());
            String newHeight = String.valueOf(contact.getHeight());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.height.label", oldHeight, newHeight, loginUser);

            String oldWeight = String.valueOf(originalContact.getWeight());
            String newWeight = String.valueOf(contact.getWeight());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.weight.label", oldWeight, newWeight, loginUser);

            String oldRelationship = CommonUtil.fromNullToEmpty(originalContact
                    .getRelationship());
            String newRelationship = CommonUtil.fromNullToEmpty(contact
                    .getRelationship());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.relationship.label", oldRelationship,
                    newRelationship, loginUser);

            String oldCharacter = CommonUtil.fromNullToEmpty(originalContact
                    .getCharacter());
            String newCharacter = CommonUtil.fromNullToEmpty(contact
                    .getCharacter());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.character.label", oldCharacter, newCharacter,
                    loginUser);

            String oldInterest = CommonUtil.fromNullToEmpty(originalContact
                    .getInterest());
            String newInterest = CommonUtil.fromNullToEmpty(contact
                    .getInterest());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.interest.label", oldInterest, newInterest,
                    loginUser);

            String oldTaboo = CommonUtil.fromNullToEmpty(originalContact
                    .getTaboo());
            String newTaboo = CommonUtil.fromNullToEmpty(contact.getTaboo());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.taboo.label", oldTaboo, newTaboo, loginUser);

            String oldReligious = getOptionValue(originalContact.getReligious());
            String newReligious = getOptionValue(contact.getReligious());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.religious.label", oldReligious, newReligious,
                    loginUser);

            String oldHabit = CommonUtil.fromNullToEmpty(originalContact
                    .getHabit());
            String newHabit = CommonUtil.fromNullToEmpty(contact.getHabit());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.habit.label", oldHabit, newHabit, loginUser);

            String oldDiet = CommonUtil.fromNullToEmpty(originalContact
                    .getDiet());
            String newDiet = CommonUtil.fromNullToEmpty(contact.getDiet());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.diet.label", oldDiet, newDiet, loginUser);

            String oldNotes = CommonUtil.fromNullToEmpty(originalContact
                    .getNotes());
            String newNotes = CommonUtil.fromNullToEmpty(contact.getNotes());
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.notes.label", oldNotes, newNotes, loginUser);

            String oldReportToName = "";
            Contact oldReportTo = originalContact.getReport_to();
            if (oldReportTo != null) {
                oldReportToName = CommonUtil.fromNullToEmpty(oldReportTo
                        .getName());
            }
            String newReportToName = "";
            Contact newReportTo = contact.getReport_to();
            if (newReportTo != null) {
                newReportToName = CommonUtil.fromNullToEmpty(newReportTo
                        .getName());
            }
            createChangeLog(changeLogs, entityName, recordID,
                    "contact.report_to.label", oldReportToName,
                    newReportToName, loginUser);

            String oldAccountName = "";
            Account oldAccount = originalContact.getAccount();
            if (oldAccount != null) {
                oldAccountName = CommonUtil.fromNullToEmpty(oldAccount
                        .getName());
            }
            String newAccountName = "";
            Account newAccount = contact.getAccount();
            if (newAccount != null) {
                newAccountName = CommonUtil.fromNullToEmpty(newAccount
                        .getName());
            }
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.account.label", oldAccountName, newAccountName,
                    loginUser);

            boolean oldNotCall = originalContact.isNot_call();

            boolean newNotCall = contact.isNot_call();
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.not_call.label", String.valueOf(oldNotCall),
                    String.valueOf(newNotCall), loginUser);

            String oldLeadSource = getOptionValue(originalContact
                    .getLeadSource());
            String newLeadSource = getOptionValue(contact.getLeadSource());
            createChangeLog(changeLogs, entityName, recordID,
                    "menu.leadSource.title", oldLeadSource, newLeadSource,
                    loginUser);

            String oldCampaignName = "";
            Campaign oldCampaign = originalContact.getCampaign();
            if (oldCampaign != null) {
                oldCampaignName = oldCampaign.getName();
            }
            String newCampaignName = "";
            Campaign newCampaign = contact.getCampaign();
            if (newCampaign != null) {
                newCampaignName = newCampaign.getName();
            }
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.campaign.label",
                    CommonUtil.fromNullToEmpty(oldCampaignName),
                    CommonUtil.fromNullToEmpty(newCampaignName), loginUser);

            String oldAssignedToName = "";
            User oldAssignedTo = originalContact.getAssigned_to();
            if (oldAssignedTo != null) {
                oldAssignedToName = oldAssignedTo.getName();
            }
            String newAssignedToName = "";
            User newAssignedTo = contact.getAssigned_to();
            if (newAssignedTo != null) {
                newAssignedToName = newAssignedTo.getName();
            }
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.assigned_to.label",
                    CommonUtil.fromNullToEmpty(oldAssignedToName),
                    CommonUtil.fromNullToEmpty(newAssignedToName), loginUser);
View Full Code Here

        UserUtil.permissionCheck("view_account");

        Map<String, String> fieldTypeMap = new HashMap<String, String>();
        fieldTypeMap.put("created_on", Constant.DATA_TYPE_DATETIME);
        fieldTypeMap.put("updated_on", Constant.DATA_TYPE_DATETIME);
        User loginUser = UserUtil.getLoginUser();
        SearchCondition searchCondition = getSearchCondition(fieldTypeMap,
                loginUser.getScope_account(), loginUser);
        SearchResult<Account> result = baseService.getPaginationObjects(CLAZZ,
                searchCondition);
        Iterator<Account> accounts = result.getResult().iterator();
        long totalRecords = result.getTotalRecords();
        getListJson(accounts, totalRecords, searchCondition, true);
View Full Code Here

            int id = instance.getId();
            String name = CommonUtil.fromNullToEmpty(instance.getName());
            String officePhone = CommonUtil.fromNullToEmpty(instance
                    .getOffice_phone());
            String email = CommonUtil.fromNullToEmpty(instance.getEmail());
            User user = instance.getAssigned_to();
            if (user != null) {
                assignedTo = CommonUtil.fromNullToEmpty(user.getName());
            } else {
                assignedTo = "";
            }

            String billStreet = CommonUtil.fromNullToEmpty(instance
                    .getBill_street());
            String billCity = CommonUtil.fromNullToEmpty(instance
                    .getBill_city());
            String billCountry = CommonUtil.fromNullToEmpty(instance
                    .getBill_country());
            String billState = CommonUtil.fromNullToEmpty(instance
                    .getBill_state());
            String billPostalCode = CommonUtil.fromNullToEmpty(instance
                    .getBill_postal_code());
            if (isList) {
                jsonBuilder.append("{\"cell\":[\"").append(id).append("\",\"")
                        .append(name).append("\",\"").append(officePhone)
                        .append("\",\"").append(email).append("\"");
                String website = CommonUtil.fromNullToEmpty(instance
                        .getWebsite());
                String fax = CommonUtil.fromNullToEmpty(instance.getFax());
                String shipStreet = CommonUtil.fromNullToEmpty(instance
                        .getShip_street());
                String shipCity = CommonUtil.fromNullToEmpty(instance
                        .getBill_city());
                String shipState = CommonUtil.fromNullToEmpty(instance
                        .getBill_state());
                String shipPostalCode = CommonUtil.fromNullToEmpty(instance
                        .getShip_postal_code());
                String shipCountry = CommonUtil.fromNullToEmpty(instance
                        .getShip_country());
                String sicCode = CommonUtil.fromNullToEmpty(instance
                        .getSic_code());
                String ticketSymbol = CommonUtil.fromNullToEmpty(instance
                        .getTicket_symbol());
                Account manager = instance.getManager();
                String managerName = "";
                if (manager != null) {
                    managerName = CommonUtil.fromNullToEmpty(manager.getName());
                }
                User createdBy = instance.getCreated_by();
                String createdByName = "";
                if (createdBy != null) {
                    createdByName = CommonUtil.fromNullToEmpty(createdBy
                            .getName());
                }
                User updatedBy = instance.getUpdated_by();
                String updatedByName = "";
                if (updatedBy != null) {
                    updatedByName = CommonUtil.fromNullToEmpty(updatedBy
                            .getName());
                }
                SimpleDateFormat dateFormat = new SimpleDateFormat(
                        Constant.DATE_TIME_FORMAT);
                Date createdOn = instance.getCreated_on();
View Full Code Here

                    String assignedToID = row
                            .get(getText("entity.assigned_to_id.label"));
                    if (CommonUtil.isNullOrEmpty(assignedToID)) {
                        account.setAssigned_to(null);
                    } else {
                        User assignedTo = userService.getEntityById(User.class,
                                Integer.parseInt(assignedToID));
                        account.setAssigned_to(assignedTo);
                    }
                    baseService.makePersistent(account);
                    successfulNum++;
View Full Code Here

            if (documents == null) {
                documents = new HashSet<Document>();
            }
            documents.add(document);
        }
        User loginUser = this.getLoginUser();
        final Collection<ChangeLog> changeLogs = changeLog(originalAccount,
                account, loginUser);
        account = getBaseService().makePersistent(account);
        this.setId(account.getId());
        this.setSaveFlag("true");
View Full Code Here

        saveEntity();
        String[] fieldNames = this.massUpdate;
        if (fieldNames != null) {
            String[] selectIDArray = this.seleteIDs.split(",");
            Collection<Account> accounts = new ArrayList<Account>();
            final User loginUser = this.getLoginUser();
            User user = userService
                    .getEntityById(User.class, loginUser.getId());
            final List<Account> originalAccounts = new ArrayList<Account>();
            final List<Account> currentAccounts = new ArrayList<Account>();
            for (String IDString : selectIDArray) {
                int id = Integer.parseInt(IDString);
View Full Code Here

            industry = industryService
                    .getOptionById(Industry.class, industryID);
        }
        account.setIndustry(industry);

        User assignedTo = null;
        if (this.getAssignedToID() != null) {
            assignedTo = userService.getEntityById(User.class,
                    this.getAssignedToID());
        }
        account.setAssigned_to(assignedTo);

        User owner = null;
        if (this.getOwnerID() != null) {
            owner = userService.getEntityById(User.class, this.getOwnerID());
        }
        account.setOwner(owner);
View Full Code Here

            createChangeLog(changeLogs, entityName, recordID,
                    "account.manager.label", oldManagerName, newManagerName,
                    loginUser);

            String oldAssignedToName = "";
            User oldAssignedTo = originalAccount.getAssigned_to();
            if (oldAssignedTo != null) {
                oldAssignedToName = oldAssignedTo.getName();
            }
            String newAssignedToName = "";
            User newAssignedTo = account.getAssigned_to();
            if (newAssignedTo != null) {
                newAssignedToName = newAssignedTo.getName();
            }
            createChangeLog(changeLogs, entityName, recordID,
                    "entity.assigned_to.label",
                    CommonUtil.fromNullToEmpty(oldAssignedToName),
                    CommonUtil.fromNullToEmpty(newAssignedToName), loginUser);
View Full Code Here

            Industry industry = account.getIndustry();
            if (industry != null) {
                industryID = industry.getId();
            }

            User assignedTo = account.getAssigned_to();
            if (assignedTo != null) {
                this.setAssignedToID(assignedTo.getId());
                this.setAssignedToText(assignedTo.getName());
            }

            Account manager = account.getManager();
            if (manager != null) {
                managerID = manager.getId();
View Full Code Here

TOP

Related Classes of com.gcrm.domain.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.