use of org.mifos.dto.screen.OnlyBranchOfficeHierarchyDto in project head by mifos.
the class GroupCustAction method chooseOffice.
@TransactionDemarcate(saveToken = true)
public ActionForward chooseOffice(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
OnlyBranchOfficeHierarchyDto officeHierarchy = customerServiceFacade.retrieveBranchOnlyOfficeHierarchy();
SessionUtils.setAttribute(OnlyBranchOfficeHierarchyDto.IDENTIFIER, officeHierarchy, request);
return mapping.findForward(ActionForwards.chooseOffice_success.toString());
}
use of org.mifos.dto.screen.OnlyBranchOfficeHierarchyDto in project head by mifos.
the class CustomerServiceFacadeWebTier method retrieveBranchOnlyOfficeHierarchy.
@Override
public OnlyBranchOfficeHierarchyDto retrieveBranchOnlyOfficeHierarchy() {
MifosUser user = (MifosUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
UserContext userContext = toUserContext(user);
OfficeDto office = officeDao.findOfficeDtoById(userContext.getBranchId());
List<OfficeBO> branchParents = officeDao.findBranchsOnlyWithParentsMatching(office.getSearchId());
List<OfficeDetailsDto> levels = officeDao.findActiveOfficeLevels();
List<OfficeHierarchyDto> branchOnlyOfficeHierarchy = OfficeBO.convertToBranchOnlyHierarchyWithParentsOfficeHierarchy(branchParents);
return new OnlyBranchOfficeHierarchyDto(userContext.getPreferredLocale(), levels, office.getSearchId(), branchOnlyOfficeHierarchy);
}
use of org.mifos.dto.screen.OnlyBranchOfficeHierarchyDto in project head by mifos.
the class CenterCustAction method chooseOffice.
@TransactionDemarcate(saveToken = true)
public ActionForward chooseOffice(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
OnlyBranchOfficeHierarchyDto officeHierarchy = customerServiceFacade.retrieveBranchOnlyOfficeHierarchy();
SessionUtils.setAttribute(OnlyBranchOfficeHierarchyDto.IDENTIFIER, officeHierarchy, request);
SessionUtils.setAttribute(CustomerConstants.URL_MAP, null, request.getSession(false));
return mapping.findForward(ActionForwards.chooseOffice_success.toString());
}
use of org.mifos.dto.screen.OnlyBranchOfficeHierarchyDto in project head by mifos.
the class OfficeListTag method doStartTag.
@Override
public int doStartTag() throws JspException {
try {
String officeListString = "";
OnlyBranchOfficeHierarchyDto officeHierarchyDto = (OnlyBranchOfficeHierarchyDto) pageContext.getAttribute(OnlyBranchOfficeHierarchyDto.IDENTIFIER);
if (officeHierarchyDto != null) {
officeListString = getOfficeList(officeHierarchyDto);
} else {
// FIXME - #00006 - keithw - personnel creation use this still
UserContext userContext = (UserContext) pageContext.getSession().getAttribute(Constants.USERCONTEXT);
OfficePersistence officePersistence = new OfficePersistence();
OfficeBO officeBO = officePersistence.getOffice(userContext.getBranchId());
List<OfficeDetailsDto> levels = officePersistence.getActiveLevels();
OfficeBO loggedInOffice = officePersistence.getOffice(userContext.getBranchId());
List<OfficeBO> branchParents = officePersistence.getBranchParents(officeBO.getSearchId());
List<OfficeHierarchyDto> officeHierarchy = OfficeBO.convertToBranchOnlyHierarchyWithParentsOfficeHierarchy(branchParents);
List<OfficeBO> officesTillBranchOffice = officePersistence.getOfficesTillBranchOffice(officeBO.getSearchId());
officeListString = getOfficeList(userContext.getPreferredLocale(), levels, loggedInOffice.getSearchId(), officeHierarchy, officesTillBranchOffice);
}
TagUtils.getInstance().write(pageContext, officeListString);
} catch (Exception e) {
/**
* This turns into a (rather ugly) error 500. TODO: make it more reasonable.
*/
throw new JspException(e);
}
return EVAL_PAGE;
}
use of org.mifos.dto.screen.OnlyBranchOfficeHierarchyDto in project head by mifos.
the class PictureFormFile method chooseOffice.
@TransactionDemarcate(saveToken = true)
public ActionForward chooseOffice(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
ClientCustActionForm actionForm = (ClientCustActionForm) form;
actionForm.setGroupFlag(ClientConstants.NO);
OnlyBranchOfficeHierarchyDto officeHierarchy = customerServiceFacade.retrieveBranchOnlyOfficeHierarchy();
SessionUtils.setAttribute(OnlyBranchOfficeHierarchyDto.IDENTIFIER, officeHierarchy, request);
return mapping.findForward(ActionForwards.chooseOffice_success.toString());
}
Aggregations