Search in sources :

Example 11 with ListElement

use of org.mifos.dto.screen.ListElement in project head by mifos.

the class SavingsProductFormBeanAssembler method populateFrequencyPeriodDropdown.

private void populateFrequencyPeriodDropdown(SavingsProductFormDto referenceData, SavingsProductFormBean formBean) {
    Map<String, String> frequencyPeriods = new LinkedHashMap<String, String>();
    for (ListElement option : referenceData.getInterestTimePeriodTypes()) {
        frequencyPeriods.put(option.getId().toString(), option.getName());
    }
    formBean.setFrequencyPeriodOptions(frequencyPeriods);
}
Also used : ListElement(org.mifos.dto.screen.ListElement) LinkedHashMap(java.util.LinkedHashMap)

Example 12 with ListElement

use of org.mifos.dto.screen.ListElement in project head by mifos.

the class SavingsProductFormBeanAssembler method populateInterestBalanceDropdown.

private void populateInterestBalanceDropdown(SavingsProductFormDto referenceData, SavingsProductFormBean formBean) {
    Map<String, String> interestBalanceTypes = new LinkedHashMap<String, String>();
    for (ListElement option : referenceData.getInterestBalanceTypes()) {
        interestBalanceTypes.put(option.getId().toString(), option.getName());
    }
    formBean.setInterestCaluclationOptions(interestBalanceTypes);
}
Also used : ListElement(org.mifos.dto.screen.ListElement) LinkedHashMap(java.util.LinkedHashMap)

Example 13 with ListElement

use of org.mifos.dto.screen.ListElement in project head by mifos.

the class SystemUserController method createUserFormBean.

public UserFormBean createUserFormBean(final Long officeId, final UserFormBean formBean) {
    OfficeDto selectedOffice = this.officeServiceFacade.retrieveOfficeById(officeId.shortValue());
    formBean.setOfficeId(officeId);
    formBean.setOfficeName(selectedOffice.getName());
    MandatoryHiddenFieldsDto dtoFields = this.adminServiceFacade.retrieveHiddenMandatoryFields();
    formBean.getAddress().setAddress1Mandatory(dtoFields.isMandatorySystemAddress1());
    formBean.getAddress().setAddress2Hidden(dtoFields.isHideSystemAddress2());
    formBean.getAddress().setAddress3Hidden(dtoFields.isHideSystemAddress3());
    formBean.getAddress().setCityDistrictHidden(dtoFields.isHideSystemCity());
    formBean.getAddress().setStateHidden(dtoFields.isHideSystemState());
    formBean.getAddress().setCountryHidden(dtoFields.isHideSystemCountry());
    formBean.getAddress().setPostalCodeHidden(dtoFields.isHideSystemPostalCode());
    DefinePersonnelDto userRefData = this.personnelServiceFacade.retrieveInfoForNewUserDefinition(officeId.shortValue());
    Map<String, String> genderOptions = new LinkedHashMap<String, String>();
    for (ListElement option : userRefData.getGenderList()) {
        genderOptions.put(option.getId().toString(), option.getName());
    }
    formBean.setGenderOptions(genderOptions);
    Map<String, String> maritalStatusOptions = new LinkedHashMap<String, String>();
    for (ListElement option : userRefData.getMaritalStatusList()) {
        maritalStatusOptions.put(option.getId().toString(), option.getName());
    }
    formBean.setMaritalStatusOptions(maritalStatusOptions);
    Map<String, String> preferredLanguageOptions = new LinkedHashMap<String, String>();
    for (ListElement option : userRefData.getLanguageList()) {
        preferredLanguageOptions.put(option.getId().toString(), option.getName());
    }
    formBean.setPreferredLanguageOptions(preferredLanguageOptions);
    Map<String, String> userTitleOptions = new LinkedHashMap<String, String>();
    for (ListElement option : userRefData.getTitleList()) {
        userTitleOptions.put(option.getId().toString(), option.getName());
    }
    formBean.setUserTitleOptions(userTitleOptions);
    Map<String, String> userHierarchyOptions = new LinkedHashMap<String, String>();
    for (ListElement option : userRefData.getPersonnelLevelList()) {
        userHierarchyOptions.put(option.getId().toString(), option.getName());
    }
    formBean.setUserHierarchyOptions(userHierarchyOptions);
    Map<String, String> availableRolesOptions = new LinkedHashMap<String, String>();
    for (ListElement option : userRefData.getRolesList()) {
        availableRolesOptions.put(option.getId().toString(), option.getName());
    }
    formBean.setAvailableRolesOptions(availableRolesOptions);
    formBean.setSelectedRolesOptions(new LinkedHashMap<String, String>());
    DateTime today = new DateTime();
    formBean.setMfiJoiningDateDay(today.getDayOfMonth());
    formBean.setMfiJoiningDateMonth(today.getMonthOfYear());
    formBean.setMfiJoiningDateYear(today.getYearOfEra());
    return formBean;
}
Also used : OfficeDto(org.mifos.dto.domain.OfficeDto) ListElement(org.mifos.dto.screen.ListElement) MandatoryHiddenFieldsDto(org.mifos.dto.domain.MandatoryHiddenFieldsDto) DefinePersonnelDto(org.mifos.dto.screen.DefinePersonnelDto) DateTime(org.joda.time.DateTime) LinkedHashMap(java.util.LinkedHashMap)

Example 14 with ListElement

use of org.mifos.dto.screen.ListElement in project head by mifos.

the class LoanProductFormBeanAssembler method populateCurrenciesDropdown.

private void populateCurrenciesDropdown(LoanProductFormDto loanProductRefData, LoanProductFormBean loanProductFormBean) {
    Map<String, String> currencyOptions = new LinkedHashMap<String, String>();
    for (ListElement currency : loanProductRefData.getCurrencyOptions()) {
        currencyOptions.put(currency.getId().toString(), currency.getName());
    }
    loanProductFormBean.setCurrencyOptions(currencyOptions);
    loanProductFormBean.setMultiCurrencyEnabled(loanProductRefData.isMultiCurrencyEnabled());
}
Also used : ListElement(org.mifos.dto.screen.ListElement) LinkedHashMap(java.util.LinkedHashMap)

Example 15 with ListElement

use of org.mifos.dto.screen.ListElement in project head by mifos.

the class LoanProductFormBeanAssembler method populateGracePeriodDrowdown.

private void populateGracePeriodDrowdown(LoanProductFormDto loanProductRefData, LoanProductFormBean loanProductFormBean) {
    Map<String, String> gracePeriodTypeOptions = new LinkedHashMap<String, String>();
    for (ListElement gracePeriod : loanProductRefData.getGracePeriodTypes()) {
        gracePeriodTypeOptions.put(gracePeriod.getId().toString(), gracePeriod.getName());
    }
    loanProductFormBean.setGracePeriodTypeOptions(gracePeriodTypeOptions);
    loanProductFormBean.setSelectedGracePeriodType("1");
}
Also used : ListElement(org.mifos.dto.screen.ListElement) LinkedHashMap(java.util.LinkedHashMap)

Aggregations

ListElement (org.mifos.dto.screen.ListElement)41 ArrayList (java.util.ArrayList)20 LinkedHashMap (java.util.LinkedHashMap)17 MifosRuntimeException (org.mifos.core.MifosRuntimeException)14 ValueListElement (org.mifos.dto.domain.ValueListElement)7 PersistenceException (org.mifos.framework.exceptions.PersistenceException)7 AddressDto (org.mifos.dto.domain.AddressDto)5 StatesInitializationException (org.mifos.framework.exceptions.StatesInitializationException)5 MifosUser (org.mifos.security.MifosUser)5 UserContext (org.mifos.security.util.UserContext)5 DateTime (org.joda.time.DateTime)4 OfficeBO (org.mifos.customers.office.business.OfficeBO)4 RoleBO (org.mifos.security.rolesandpermission.business.RoleBO)4 BusinessRuleException (org.mifos.service.BusinessRuleException)4 SavingsBO (org.mifos.accounts.savings.business.SavingsBO)3 CustomerStatusEntity (org.mifos.customers.business.CustomerStatusEntity)3 CreateOrUpdatePersonnelInformation (org.mifos.dto.domain.CreateOrUpdatePersonnelInformation)3 Address (org.mifos.framework.business.util.Address)3 LocalDate (org.joda.time.LocalDate)2 AccountStateEntity (org.mifos.accounts.business.AccountStateEntity)2