use of org.mifos.customers.struts.actionforms.CustSearchActionForm in project head by mifos.
the class CustSearchAction method loadSearch.
@TransactionDemarcate(saveToken = true)
public ActionForward loadSearch(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
CustSearchActionForm actionForm = (CustSearchActionForm) form;
actionForm.setSearchString(null);
if (request.getParameter("perspective") != null) {
request.setAttribute("perspective", request.getParameter("perspective"));
}
cleanUpSearch(request);
return mapping.findForward(ActionForwards.loadSearch_success.toString());
}
use of org.mifos.customers.struts.actionforms.CustSearchActionForm in project head by mifos.
the class CustSearchAction method loadAllBranches.
@TransactionDemarcate(saveToken = true)
public ActionForward loadAllBranches(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
CustSearchActionForm actionForm = (CustSearchActionForm) form;
actionForm.setOfficeId("0");
UserContext userContext = getUserContext(request);
SessionUtils.setAttribute("isCenterHierarchyExists", ClientRules.getCenterHierarchyExists(), request);
loadMasterData(userContext.getId(), request, actionForm);
return mapping.findForward(CustomerSearchConstants.LOADALLBRANCHES_SUCCESS);
}
use of org.mifos.customers.struts.actionforms.CustSearchActionForm 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.struts.actionforms.CustSearchActionForm 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);
}
use of org.mifos.customers.struts.actionforms.CustSearchActionForm 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);
}
Aggregations