use of org.mifos.dto.domain.UserDetailDto in project head by mifos.
the class DashboardServiceFacadeWebTier method getLoanOfficerId.
private Short getLoanOfficerId() {
MifosUser user = (MifosUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
Short uId = new Short((short) user.getUserId());
UserDetailDto uDetails = centerServiceFacade.retrieveUsersDetails(uId);
Short loanOfficerId = null;
if (uDetails.isLoanOfficer()) {
loanOfficerId = uId;
}
return loanOfficerId;
}
use of org.mifos.dto.domain.UserDetailDto 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.dto.domain.UserDetailDto in project head by mifos.
the class CustSearchAction method getHomePage.
@TransactionDemarcate(saveToken = true)
public ActionForward getHomePage(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
CustSearchActionForm actionForm = (CustSearchActionForm) form;
actionForm.setSearchString(null);
cleanUpSearch(request);
UserContext userContext = getUserContext(request);
UserDetailDto userDetails = this.centerServiceFacade.retrieveUsersDetails(userContext.getId());
SessionUtils.setAttribute("isCenterHierarchyExists", ClientRules.getCenterHierarchyExists(), request);
loadMasterData(userContext.getId(), request, actionForm);
if (userDetails.isLoanOfficer()) {
loadLoanOfficerCustomersHierarchyForSelectedDay(userContext.getId(), request, actionForm);
}
DashboardDto dashboardDto = dashboardServiceFacade.getDashboardDto();
SessionUtils.setAttribute("dashboard", dashboardDto, 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(CustomerConstants.GETHOMEPAGE_SUCCESS);
}
use of org.mifos.dto.domain.UserDetailDto in project head by mifos.
the class PersonAction method create.
@TransactionDemarcate(validateAndResetToken = true)
public ActionForward create(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
PersonActionForm personActionForm = (PersonActionForm) form;
CreateOrUpdatePersonnelInformation perosonnelInfo = translateFormToCreatePersonnelInformationDto(request, personActionForm);
try {
UserDetailDto userDetails = this.personnelServiceFacade.createPersonnelInformation(perosonnelInfo);
String globalPersonnelNum = userDetails.getSystemId();
Name name = new Name(personActionForm.getFirstName(), personActionForm.getMiddleName(), personActionForm.getSecondLastName(), personActionForm.getLastName());
request.setAttribute("displayName", name.getDisplayName());
request.setAttribute("globalPersonnelNum", globalPersonnelNum);
createGroupQuestionnaire.saveResponses(request, personActionForm, userDetails.getId());
return mapping.findForward(ActionForwards.create_success.toString());
} catch (BusinessRuleException e) {
throw new PersonnelException(e.getMessageKey(), e, e.getMessageValues());
}
}
use of org.mifos.dto.domain.UserDetailDto in project head by mifos.
the class SystemUserSearchController method displaySystemUsers.
@RequestMapping(method = RequestMethod.GET)
public ModelAndView displaySystemUsers(ModelMap model) {
ModelAndView mav = new ModelAndView("viewSystemUsers");
SystemUserSearchFormBean formBean = (SystemUserSearchFormBean) model.get("searchResults");
SystemUserSearchResultsDto result = (SystemUserSearchResultsDto) model.get("pagedResults");
if (result == null) {
List<UserDetailDto> pagedUserDetails = new ArrayList<UserDetailDto>();
result = new SystemUserSearchResultsDto(0, 0, 0, 0, pagedUserDetails);
formBean = new SystemUserSearchFormBean();
}
mav.addObject("searchResults", formBean);
mav.addObject("pagedResults", result);
return mav;
}
Aggregations