TicketVO ticketVO = new TicketVO();
TicketForm ticketForm = (TicketForm) form;
SupportFacadeHome supportFacade = (SupportFacadeHome) CVUtility.getHomeObject("com.centraview.support.supportfacade.SupportFacadeHome",
"SupportFacade");
SupportFacade remote = supportFacade.create();
remote.setDataSource(dataSource);
ticketVO.setId(Integer.parseInt(ticketForm.getId()));
ticketVO.setTitle(ticketForm.getSubject());
ticketVO.setDetail(ticketForm.getDetail());
ticketVO.setPriorityId(Integer.parseInt(ticketForm.getPriority()));
ticketVO.setStatusId(Integer.parseInt(ticketForm.getStatus()));
if (ticketForm.getId() != null) {
int ticketID = Integer.parseInt(ticketForm.getId());
int statusID = ticketVO.getStatusId();
String closeTicketParam = request.getParameter("closeTicket");
// If the Status select was set to 2 (MAGIC NUMBER for closed) or
// closeTicket=true was appended to the request then ...
boolean closeTicket = ((statusID == 2) || (closeTicketParam != null && closeTicketParam.equals("true")));
if (closeTicket) {
ticketVO.setStatusId(2);
remote.closeTicket(individualID, ticketID);
request.setAttribute("OCStatus", TicketConstantKeys.TK_OCSTATUS_CLOSE);
}
}
if ((ticketForm.getManagerid() != null) || (ticketForm.getManagerid().length() != 0)) {
if (!(ticketForm.getManagerid().equals(""))) {
ticketVO.setManagerId(Integer.parseInt(ticketForm.getManagerid()));
}
}
if ((ticketForm.getAssignedtoid() != null) || (ticketForm.getAssignedtoid().length() != 0)) {
if (!(ticketForm.getAssignedtoid().equals(""))) {
ticketVO.setAssignedToId(Integer.parseInt(ticketForm.getAssignedtoid()));
}
}
if ((ticketForm.getEntityid() != null) || (ticketForm.getEntityid().length() != 0)) {
if (!(ticketForm.getEntityid().equals(""))) {
ticketVO.setRefEntityId(Integer.parseInt(ticketForm.getEntityid()));
}
}
if ((ticketForm.getContactid() != null) || (ticketForm.getContactid().length() != 0)) {
if (!(ticketForm.getContactid().equals(""))) {
ticketVO.setRefIndividualId(Integer.parseInt(ticketForm.getContactid()));
}
}
ticketVO.setModifiedBy(individualID);
ticketVO.setCustomField(getCustomFieldVO(request));
String operationType = request.getParameter("TYPEOFOPERATION");
if (operationType.equalsIgnoreCase("EDIT")) {
remote.updateTicket(individualID, ticketVO);
} else if (operationType.equalsIgnoreCase("DUPLICATE")) {
remote.duplicateTicket(individualID, ticketVO);
}
FORWARD_final = FORWARD_editsavefile;
String closeornew = request.getParameter("closeornew");
if (closeornew.equals("close")) {