use of org.mifos.customers.personnel.struts.actionforms.PersonActionForm in project head by mifos.
the class PersonAction method search.
@Override
@TransactionDemarcate(saveToken = true)
public ActionForward search(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
ActionForward actionForward = null;
UserContext userContext = getUserContext(request);
PersonnelBO personnel = this.personnelDao.findPersonnelById(userContext.getId());
String searchString = ((PersonActionForm) form).getSearchString();
addSeachValues(searchString, personnel.getOffice().getOfficeId().toString(), personnel.getOffice().getOfficeName(), request);
searchString = org.mifos.framework.util.helpers.SearchUtils.normalizeSearchString(searchString);
actionForward = super.search(mapping, form, request, response);
SessionUtils.setQueryResultAttribute(Constants.SEARCH_RESULTS, legacyPersonnelDao.search(searchString, userContext.getId()), request);
return actionForward;
}
use of org.mifos.customers.personnel.struts.actionforms.PersonActionForm 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.customers.personnel.struts.actionforms.PersonActionForm in project head by mifos.
the class PersonActionStrutsTest method testLoadWithBranchOffice.
@SuppressWarnings("unchecked")
@Test
public void testLoadWithBranchOffice() throws Exception {
addActionAndMethod(Methods.load.toString());
addRequestParameter("officeId", "3");
actionPerform();
verifyNoActionErrors();
verifyNoActionMessages();
OfficeBO office = (OfficeBO) SessionUtils.getAttribute(PersonnelConstants.OFFICE, request);
Assert.assertNotNull(office);
Assert.assertEquals(3, office.getOfficeId().intValue());
verifyMasterData();
PersonActionForm personActionForm = (PersonActionForm) request.getSession().getAttribute("personActionForm");
Assert.assertNotNull(personActionForm);
// Assert.assertEquals(1, personActionForm.getCustomFields().size());
Assert.assertNotNull(SessionUtils.getAttribute(PersonnelConstants.PERSONNEL_LEVEL_LIST, request));
Assert.assertEquals(2, ((List) SessionUtils.getAttribute(PersonnelConstants.PERSONNEL_LEVEL_LIST, request)).size());
verifyForward(ActionForwards.load_success.toString());
}
use of org.mifos.customers.personnel.struts.actionforms.PersonActionForm in project head by mifos.
the class PersonAction method previous.
@SuppressWarnings("unused")
@TransactionDemarcate(joinToken = true)
public ActionForward previous(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
PersonActionForm personActionForm = (PersonActionForm) form;
personActionForm.setPersonnelRoles(null);
return mapping.findForward(ActionForwards.previous_success.toString());
}
use of org.mifos.customers.personnel.struts.actionforms.PersonActionForm in project head by mifos.
the class PersonAction method previousManage.
@SuppressWarnings("unused")
@TransactionDemarcate(joinToken = true)
public ActionForward previousManage(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
PersonActionForm personActionForm = (PersonActionForm) form;
personActionForm.setPersonnelRoles(null);
return mapping.findForward(ActionForwards.previousManage_success.toString());
}
Aggregations