Search in sources :

Example 1 with IncludePage

use of freemarker.ext.servlet.IncludePage in project head by mifos.

the class SavingsAccountController method showSavingsAccountDetails.

@RequestMapping(value = "/viewSavingsAccountDetails", method = RequestMethod.GET)
public ModelAndView showSavingsAccountDetails(HttpServletRequest request, HttpServletResponse response) {
    ModelAndView modelAndView = new ModelAndView();
    sitePreferenceHelper.resolveSiteType(modelAndView, "viewSavingsAccountDetails", request);
    modelAndView.addObject("include_page", new IncludePage(request, response));
    String globalAccountNum = request.getParameter("globalAccountNum");
    SavingsAccountDetailDto savingsAccountDetailDto = savingsServiceFacade.retrieveSavingsAccountDetails(globalAccountNum);
    modelAndView.addObject("savingsAccountDetailDto", savingsAccountDetailDto);
    boolean containsQGForCloseSavings = false;
    containsQGForCloseSavings = questionnaireServiceFacade.getQuestionGroupInstances(savingsAccountDetailDto.getAccountId(), "Close", "Savings").size() > 0;
    modelAndView.addObject("containsQGForCloseSavings", containsQGForCloseSavings);
    modelAndView.addObject("backPageUrl", UrlHelper.constructCurrentPageUrl(request));
    savingsServiceFacade.putSavingsBusinessKeyInSession(globalAccountNum, request);
    // for mifostabletag
    request.getSession().setAttribute("recentActivityForDetailPage", savingsAccountDetailDto.getRecentActivity());
    return modelAndView;
}
Also used : ModelAndView(org.springframework.web.servlet.ModelAndView) IncludePage(freemarker.ext.servlet.IncludePage) SavingsAccountDetailDto(org.mifos.dto.domain.SavingsAccountDetailDto) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 2 with IncludePage

use of freemarker.ext.servlet.IncludePage in project head by mifos.

the class SavingsAccountController method showSavingsAccountRecentActivity.

@RequestMapping(value = "/viewSavingsAccountRecentActivity", method = RequestMethod.GET)
public ModelAndView showSavingsAccountRecentActivity(HttpServletRequest request, HttpServletResponse response) {
    ModelAndView modelAndView = new ModelAndView();
    sitePreferenceHelper.resolveSiteType(modelAndView, "viewSavingsAccountRecentActivity", request);
    modelAndView.addObject("include_page", new IncludePage(request, response));
    String globalAccountNum = request.getParameter("globalAccountNum");
    SavingsAccountDetailDto savingsAccountDetailDto = savingsServiceFacade.retrieveSavingsAccountDetails(globalAccountNum);
    modelAndView.addObject("savingsAccountDetailDto", savingsAccountDetailDto);
    modelAndView.addObject("currentDate", new Date());
    List<SavingsRecentActivityDto> recentActivity = this.savingsServiceFacade.retrieveRecentSavingsActivities(savingsAccountDetailDto.getAccountId().longValue());
    request.setAttribute("recentActivityList", recentActivity);
    savingsServiceFacade.putSavingsBusinessKeyInSession(globalAccountNum, request);
    return modelAndView;
}
Also used : ModelAndView(org.springframework.web.servlet.ModelAndView) IncludePage(freemarker.ext.servlet.IncludePage) SavingsRecentActivityDto(org.mifos.dto.screen.SavingsRecentActivityDto) SavingsAccountDetailDto(org.mifos.dto.domain.SavingsAccountDetailDto) Date(java.util.Date) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 3 with IncludePage

use of freemarker.ext.servlet.IncludePage in project head by mifos.

the class HomePageController method showPopulatedForm.

@RequestMapping(method = RequestMethod.GET)
@ModelAttribute("customerSearch")
public ModelAndView showPopulatedForm(HttpServletRequest request, HttpServletResponse response, @ModelAttribute("customerSearch") CustomerSearchFormBean customerSearchFormBean) throws MifosException, PersistenceException {
    MifosUser user = (MifosUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    ModelAndView modelAndView = new ModelAndView();
    sitePreferenceHelper.resolveSiteType(modelAndView, "home", request);
    modelAndView.addObject("include_page", new IncludePage(request, response));
    Short userId = (short) user.getUserId();
    UserDetailDto userDetails = this.centerServiceFacade.retrieveUsersDetails(userId);
    modelAndView.addObject("customerSearch", customerSearchFormBean);
    boolean isCenterHierarchyExists = configurationServiceFacade.getBooleanConfig("ClientRules.CenterHierarchyExists");
    modelAndView.addObject("isCenterHierarchyExists", isCenterHierarchyExists);
    if (sitePreferenceHelper.isMobile(request)) {
        List<ValueListElement> availibleClientGenders = clientServiceFacade.getClientGenders();
        modelAndView.addObject("availibleClientGenders", availibleClientGenders);
        HashMap<String, ArrayList<CustomerStatusDetailDto>> customerStates = new HashMap<String, ArrayList<CustomerStatusDetailDto>>();
        customerStates.putAll(customerSearchServiceFacade.getAvailibleCustomerStates());
        modelAndView.addObject("availibleCustomerStates", customerStates);
    }
    if (userDetails.isLoanOfficer()) {
        loadLoanOfficerCustomersHierarchyForSelectedDay(userId, modelAndView, customerSearchFormBean);
        modelAndView.addObject("isLoanOfficer", true);
    } else {
        modelAndView.addObject("isLoanOfficer", false);
    }
    return modelAndView;
}
Also used : CustomerStatusDetailDto(org.mifos.dto.screen.CustomerStatusDetailDto) HashMap(java.util.HashMap) ModelAndView(org.springframework.web.servlet.ModelAndView) ArrayList(java.util.ArrayList) MifosUser(org.mifos.security.MifosUser) UserDetailDto(org.mifos.dto.domain.UserDetailDto) IncludePage(freemarker.ext.servlet.IncludePage) ValueListElement(org.mifos.dto.domain.ValueListElement) ModelAttribute(org.springframework.web.bind.annotation.ModelAttribute) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 4 with IncludePage

use of freemarker.ext.servlet.IncludePage in project head by mifos.

the class ViewLoanAccountDetailsController method showLoanAccountDetails.

@RequestMapping(value = "/viewLoanAccountDetails", method = RequestMethod.GET)
public ModelAndView showLoanAccountDetails(HttpServletRequest request, HttpServletResponse response) throws ApplicationException {
    ModelAndView modelAndView = new ModelAndView();
    sitePreferenceHelper.resolveSiteType(modelAndView, "viewLoanAccountDetails", request);
    modelAndView.addObject("include_page", new IncludePage(request, response));
    String globalAccountNum = request.getParameter("globalAccountNum");
    LoanInformationDto loanInformationDto = loanAccountServiceFacade.retrieveLoanInformation(globalAccountNum);
    modelAndView.addObject("loanInformationDto", loanInformationDto);
    boolean containsQGForCloseLoan = questionnaireServiceFacade.getQuestionGroupInstances(loanInformationDto.getAccountId(), "Close", "Loan").size() > 0;
    modelAndView.addObject("containsQGForCloseLoan", containsQGForCloseLoan);
    // for mifostabletag
    List<LoanActivityDto> activities = loanInformationDto.getRecentAccountActivity();
    for (LoanActivityDto activity : activities) {
        activity.setUserPrefferedDate(DateFormatUtils.format(activity.getActionDate(), "dd/MM/yyyy", personnelServiceFacade.getUserPreferredLocale()));
    }
    request.getSession().setAttribute("recentAccountActivities", loanInformationDto.getRecentAccountActivity());
    request.getSession().setAttribute("guarantyInformation", loanAccountServiceFacade.handleGuaranties(loanInformationDto));
    //for GLIM
    if (configurationServiceFacade.isGlimEnabled() && loanInformationDto.isGroup()) {
        List<LoanAccountDetailsDto> loanAccountsDetails = loanAccountServiceFacade.retrieveLoanAccountDetails(loanInformationDto);
        addEmptyBuisnessActivities(loanAccountsDetails);
        modelAndView.addObject("loanAccountDetailsView");
        request.setAttribute("loanAccountDetailsView", loanAccountsDetails);
    }
    modelAndView.addObject("backPageUrl", UrlHelper.constructCurrentPageUrl(request));
    request.getSession().setAttribute("backPageUrl", request.getAttribute("currentPageUrl"));
    loanAccountServiceFacade.putLoanBusinessKeyInSession(globalAccountNum, request);
    return modelAndView;
}
Also used : LoanActivityDto(org.mifos.dto.domain.LoanActivityDto) ModelAndView(org.springframework.web.servlet.ModelAndView) IncludePage(freemarker.ext.servlet.IncludePage) LoanInformationDto(org.mifos.dto.screen.LoanInformationDto) LoanAccountDetailsDto(org.mifos.dto.domain.LoanAccountDetailsDto) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 5 with IncludePage

use of freemarker.ext.servlet.IncludePage in project head by mifos.

the class ViewLoanAccountDetailsController method showLoanAccountAllActivity.

@RequestMapping(value = "/viewLoanAccountAllActivity", method = RequestMethod.GET)
public ModelAndView showLoanAccountAllActivity(HttpServletRequest request, HttpServletResponse response) {
    ModelAndView modelAndView = new ModelAndView();
    sitePreferenceHelper.resolveSiteType(modelAndView, "viewLoanAccountAllActivity", request);
    modelAndView.addObject("include_page", new IncludePage(request, response));
    String globalAccountNum = request.getParameter("globalAccountNum");
    LoanInformationDto loanInformationDto = loanAccountServiceFacade.retrieveLoanInformation(globalAccountNum);
    modelAndView.addObject("loanInformationDto", loanInformationDto);
    modelAndView.addObject("currentDate", new Date());
    List<LoanActivityDto> allLoanAccountActivities = this.loanAccountServiceFacade.retrieveAllLoanAccountActivities(globalAccountNum);
    request.setAttribute("loanAllActivityView", allLoanAccountActivities);
    this.loanAccountServiceFacade.putLoanBusinessKeyInSession(globalAccountNum, request);
    return modelAndView;
}
Also used : LoanActivityDto(org.mifos.dto.domain.LoanActivityDto) ModelAndView(org.springframework.web.servlet.ModelAndView) IncludePage(freemarker.ext.servlet.IncludePage) LoanInformationDto(org.mifos.dto.screen.LoanInformationDto) Date(java.util.Date) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

IncludePage (freemarker.ext.servlet.IncludePage)15 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)15 ModelAndView (org.springframework.web.servlet.ModelAndView)15 LoanInformationDto (org.mifos.dto.screen.LoanInformationDto)6 SavingsAccountDetailDto (org.mifos.dto.domain.SavingsAccountDetailDto)4 Date (java.util.Date)3 LoanActivityDto (org.mifos.dto.domain.LoanActivityDto)2 OriginalScheduleInfoDto (org.mifos.dto.domain.OriginalScheduleInfoDto)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 AccountingConfigurationDto (org.mifos.config.servicefacade.dto.AccountingConfigurationDto)1 CenterInformationDto (org.mifos.dto.domain.CenterInformationDto)1 LoanAccountDetailsDto (org.mifos.dto.domain.LoanAccountDetailsDto)1 LoanInstallmentDetailsDto (org.mifos.dto.domain.LoanInstallmentDetailsDto)1 UserDetailDto (org.mifos.dto.domain.UserDetailDto)1 ValueListElement (org.mifos.dto.domain.ValueListElement)1 ClientInformationDto (org.mifos.dto.screen.ClientInformationDto)1 CustomerStatusDetailDto (org.mifos.dto.screen.CustomerStatusDetailDto)1 GroupInformationDto (org.mifos.dto.screen.GroupInformationDto)1 SavingsRecentActivityDto (org.mifos.dto.screen.SavingsRecentActivityDto)1