use of org.mifos.customers.personnel.business.PersonnelBO in project head by mifos.
the class PersonnelSettingsAction method update.
@CloseSession
@TransactionDemarcate(validateAndResetToken = true)
public ActionForward update(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
PersonnelSettingsActionForm personnelSettingsActionForm = (PersonnelSettingsActionForm) form;
PersonnelBO personnel = (PersonnelBO) SessionUtils.getAttribute(Constants.BUSINESS_KEY, request);
AddressDto address = null;
if (personnelSettingsActionForm.getAddress() != null) {
address = Address.toDto(personnelSettingsActionForm.getAddress());
}
this.personnelServiceFacade.updateUserSettings(personnel.getPersonnelId(), personnelSettingsActionForm.getEmailId(), personnelSettingsActionForm.getName(), personnelSettingsActionForm.getMaritalStatusValue(), personnelSettingsActionForm.getGenderValue(), address, personnelSettingsActionForm.getPreferredLocaleValue(), personnelSettingsActionForm.getPreferredSiteTypeId());
MifosUser user = (MifosUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
(new SitePreferenceHelper()).setSitePreferenceCookie(personnelServiceFacade.retrieveSitePreference(user.getUserId()), response);
return mapping.findForward(ActionForwards.updateSettings_success.toString());
}
use of org.mifos.customers.personnel.business.PersonnelBO in project head by mifos.
the class PersonnelSettingsAction method get.
@TransactionDemarcate(saveToken = true)
public ActionForward get(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
Short userId = getUserContext(request).getId();
PersonnelBO personnel = this.personnelDao.findPersonnelById(userId);
SessionUtils.removeAttribute(Constants.BUSINESS_KEY, request);
SessionUtils.setAttribute(Constants.BUSINESS_KEY, personnel, request);
UserSettingsDto userSettings = this.personnelServiceFacade.retrieveUserSettings();
SessionUtils.setAttribute(PersonnelConstants.GENDER, userSettings.getGender(), request);
SessionUtils.setAttribute(PersonnelConstants.MARITALSTATUS, userSettings.getMartialStatus(), request);
SessionUtils.setAttribute(MasterConstants.LANGUAGE, userSettings.getLanguage(), request);
SessionUtils.setAttribute(PersonnelConstants.SITE_TYPE_PREFERRED, userSettings.getSitePreference(), request);
SessionUtils.setCollectionAttribute(PersonnelConstants.GENDER_LIST, userSettings.getGenders(), request);
SessionUtils.setCollectionAttribute(PersonnelConstants.MARITAL_STATUS_LIST, userSettings.getMartialStatuses(), request);
SessionUtils.setCollectionAttribute(PersonnelConstants.LANGUAGE_LIST, userSettings.getLanguages(), request);
SessionUtils.setCollectionAttribute(PersonnelConstants.SITE_TYPES_LIST, userSettings.getSitePreferenceTypes(), request);
SessionUtils.removeAttribute(PersonnelConstants.PERSONNEL_AGE, request);
SessionUtils.setAttribute(PersonnelConstants.PERSONNEL_AGE, userSettings.getAge(), request);
return mapping.findForward(ActionForwards.get_success.toString());
}
use of org.mifos.customers.personnel.business.PersonnelBO in project head by mifos.
the class PersonnelSettingsAction method manage.
@TransactionDemarcate(joinToken = true)
public ActionForward manage(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
PersonnelBO personnel = (PersonnelBO) SessionUtils.getAttribute(Constants.BUSINESS_KEY, request);
// FIXME - provide all details through userDetailDto
UserDetailDto userInfo = this.personnelServiceFacade.retrieveUserInformation(personnel.getPersonnelId());
PersonnelSettingsActionForm form1 = (PersonnelSettingsActionForm) form;
form1.setFirstName(userInfo.getFirstName());
form1.setMiddleName(personnel.getPersonnelDetails().getName().getMiddleName());
form1.setSecondLastName(personnel.getPersonnelDetails().getName().getSecondLastName());
form1.setLastName(userInfo.getLastName());
form1.setGender(getStringValue(personnel.getPersonnelDetails().getGender()));
form1.setUserName(personnel.getUserName());
form1.setEmailId(personnel.getEmailId());
form1.setGovernmentIdNumber(personnel.getPersonnelDetails().getGovernmentIdNumber());
form1.setAddress(personnel.getPersonnelDetails().getAddress());
form1.setDob(personnel.getPersonnelDetails().getDob().toString());
form1.setPreferredLocale(personnel.getPreferredLocale().toString());
form1.setPreferredSiteTypeId(personnel.getSitePreference());
form1.setMaritalStatus(getStringValue(personnel.getPersonnelDetails().getMaritalStatus()));
return mapping.findForward(ActionForwards.manage_success.toString());
}
use of org.mifos.customers.personnel.business.PersonnelBO in project head by mifos.
the class CustSearchAction method preview.
@TransactionDemarcate(conditionToken = true)
public ActionForward preview(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
CustSearchActionForm actionForm = (CustSearchActionForm) form;
if (StringUtils.isNotBlank(actionForm.getOfficeId())) {
List<PersonnelBO> personnelList = legacyPersonnelDao.getActiveLoanOfficersUnderOffice(getShortValue(actionForm.getOfficeId()));
SessionUtils.setCollectionAttribute(CustomerSearchConstants.LOANOFFICERSLIST, personnelList, request);
}
UserContext userContext = getUserContext(request);
Short userBranchId = userContext.getBranchId();
String officeName = retrieveOfficeName(actionForm, userBranchId);
SessionUtils.setAttribute(CustomerSearchConstants.OFFICE, officeName, request);
SessionUtils.setAttribute("isCenterHierarchyExists", ClientRules.getCenterHierarchyExists(), request);
SessionUtils.setAttribute(CustomerSearchConstants.LOADFORWARD, CustomerSearchConstants.LOADFORWARDNONLOANOFFICER, request);
HashMap<String, ArrayList<CustomerStatusDetailDto>> customerStates = new HashMap<String, ArrayList<CustomerStatusDetailDto>>();
customerStates.putAll(customerSearchServiceFacade.getAvailibleCustomerStates());
SessionUtils.setMapAttribute("availibleCustomerStates", customerStates, request);
List<ValueListElement> availibleClientGenders = clientServiceFacade.getClientGenders();
SessionUtils.setCollectionAttribute("availibleClientGenders", availibleClientGenders, request);
return mapping.findForward(CustomerSearchConstants.LOADFORWARDNONLOANOFFICER_SUCCESS);
}
use of org.mifos.customers.personnel.business.PersonnelBO in project head by mifos.
the class CustSearchAction method get.
@TransactionDemarcate(joinToken = true)
public ActionForward get(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
CustSearchActionForm actionForm = (CustSearchActionForm) form;
boolean isCenterHierarchyExist = ClientRules.getCenterHierarchyExists();
if (StringUtils.isNotBlank(actionForm.getLoanOfficerId())) {
Short loanOfficerId = Short.valueOf(actionForm.getLoanOfficerId());
List<CustomerDetailDto> customerList = this.centerServiceFacade.retrieveCustomersUnderUser(loanOfficerId);
SessionUtils.setCollectionAttribute(CustomerSearchConstants.CUSTOMERLIST, customerList, request);
SessionUtils.setAttribute("GrpHierExists", isCenterHierarchyExist, request);
SessionUtils.setAttribute(CustomerSearchConstants.LOADFORWARD, CustomerSearchConstants.LOADFORWARDLOANOFFICER, request);
}
if (StringUtils.isNotBlank(actionForm.getOfficeId())) {
List<PersonnelBO> personnelList = legacyPersonnelDao.getActiveLoanOfficersUnderOffice(getShortValue(actionForm.getOfficeId()));
SessionUtils.setCollectionAttribute(CustomerSearchConstants.LOANOFFICERSLIST, personnelList, request);
}
UserContext userContext = getUserContext(request);
Short userBranchId = userContext.getBranchId();
String officeName = retrieveOfficeName(actionForm, userBranchId);
SessionUtils.setAttribute("isCenterHierarchyExists", isCenterHierarchyExist, request);
SessionUtils.setAttribute(CustomerSearchConstants.OFFICE, officeName, request);
SessionUtils.setAttribute(CustomerSearchConstants.LOADFORWARD, CustomerSearchConstants.LOADFORWARDNONLOANOFFICER, request);
HashMap<String, ArrayList<CustomerStatusDetailDto>> customerStates = new HashMap<String, ArrayList<CustomerStatusDetailDto>>();
customerStates.putAll(customerSearchServiceFacade.getAvailibleCustomerStates());
SessionUtils.setMapAttribute("availibleCustomerStates", customerStates, request);
List<ValueListElement> availibleClientGenders = clientServiceFacade.getClientGenders();
SessionUtils.setCollectionAttribute("availibleClientGenders", availibleClientGenders, request);
return mapping.findForward(CustomerSearchConstants.LOADFORWARDLOANOFFICER_SUCCESS);
}
Aggregations