diff --git a/web/src/main/java/org/akaza/openclinica/control/managestudy/ResolveDiscrepancyServlet.java b/web/src/main/java/org/akaza/openclinica/control/managestudy/ResolveDiscrepancyServlet.java index 10aaa6251c5..3afeee36365 100755 --- a/web/src/main/java/org/akaza/openclinica/control/managestudy/ResolveDiscrepancyServlet.java +++ b/web/src/main/java/org/akaza/openclinica/control/managestudy/ResolveDiscrepancyServlet.java @@ -61,6 +61,8 @@ public class ResolveDiscrepancyServlet extends SecureController { private static final String RESOLVING_NOTE = "resolving_note"; private static final String RETURN_FROM_PROCESS_REQUEST = "returnFromProcess"; + + public static final String ATTR_RESOLVE_DN = "resolveDiscrepancy"; public Page getPageForForwarding(DiscrepancyNoteBean note, boolean isCompleted) { String entityType = note.getEntityType().toLowerCase(); @@ -93,9 +95,11 @@ public Page getPageForForwarding(DiscrepancyNoteBean note, boolean isCompleted) } // UpdateStudyEvent?event_id=12&ss_id=12 } else if ("itemdata".equalsIgnoreCase(entityType) || "eventcrf".equalsIgnoreCase(entityType)) { - if (currentRole.getRole().equals(Role.MONITOR) || !isCompleted) { + if (currentRole.getRole().equals(Role.MONITOR)) { return Page.VIEW_SECTION_DATA_ENTRY_SERVLET; // ViewSectionDataEntry?eventDefinitionCRFId=&ecId=1&tabId=1&studySubjectId=1 + } else if(!isCompleted) { + return Page.INITIAL_DATA_ENTRY_SERVLET; } else { return Page.ADMIN_EDIT_SERVLET; } @@ -158,7 +162,9 @@ else if ("itemdata".equalsIgnoreCase(entityType)) { StudyEventBean seb = (StudyEventBean) sedao.findByPK(id); request.setAttribute(EVENT_CRF_ID, String.valueOf(idb.getEventCRFId())); request.setAttribute(STUDY_SUB_ID, String.valueOf(seb.getStudySubjectId())); - + request.setAttribute(DataEntryServlet.INPUT_EVENT_CRF_ID, String.valueOf(idb.getEventCRFId())); + request.setAttribute(DataEntryServlet.INPUT_SECTION_ID, String.valueOf(ifmb.getSectionId())); + } else { request.setAttribute(DataEntryServlet.INPUT_EVENT_CRF_ID, String.valueOf(idb.getEventCRFId())); request.setAttribute(DataEntryServlet.INPUT_SECTION_ID, String.valueOf(ifmb.getSectionId())); @@ -279,6 +285,7 @@ protected void processRequest() throws Exception { } + request.setAttribute(ATTR_RESOLVE_DN, true); forwardPage(p); } diff --git a/web/src/main/java/org/akaza/openclinica/control/managestudy/ViewSectionDataEntryServlet.java b/web/src/main/java/org/akaza/openclinica/control/managestudy/ViewSectionDataEntryServlet.java index 3da44bca7ac..dd11f7d6426 100755 --- a/web/src/main/java/org/akaza/openclinica/control/managestudy/ViewSectionDataEntryServlet.java +++ b/web/src/main/java/org/akaza/openclinica/control/managestudy/ViewSectionDataEntryServlet.java @@ -133,7 +133,24 @@ public void processRequest(HttpServletRequest request, HttpServletResponse respo request.setAttribute("exitTo", fp.getString("exitTo")); } int crfVersionId = fp.getInt("crfVersionId", true); - int sectionId = fp.getInt("sectionId"); + int sectionId; + { + String attrResolveDiscrepancy = String + .valueOf(request.getAttribute(ResolveDiscrepancyServlet.ATTR_RESOLVE_DN)); + boolean resolveDiscrepancy = Boolean.valueOf(attrResolveDiscrepancy); + if (resolveDiscrepancy) { + /* + * use the modification only when the request comes from the + * resolvediscrepancy page this is necessary to limit the test + * effort to requests send from the resolvediscrepancy page, for + * other requests no tests are needed since there are no side + * effects + */ + sectionId = fp.getInt("sectionId", true); + } else { + sectionId = fp.getInt("sectionId"); + } + } int eventCRFId = fp.getInt(EVENT_CRF_ID, true); int studySubjectId = fp.getInt("studySubjectId", true); String action = fp.getString("action"); @@ -531,7 +548,11 @@ public void processRequest(HttpServletRequest request, HttpServletResponse respo int tabNum = 1; if ("".equalsIgnoreCase(fp.getString("tabId"))) { - tabNum = 1; + if(sb != null && sb.getOrdinal() > 0) { + tabNum = sb.getOrdinal(); + } else { + tabNum = 1; + } } else { tabNum = fp.getInt("tabId"); } diff --git a/web/src/main/java/org/akaza/openclinica/control/submit/DataEntryServlet.java b/web/src/main/java/org/akaza/openclinica/control/submit/DataEntryServlet.java index bc92f735639..f1091d0f2b6 100755 --- a/web/src/main/java/org/akaza/openclinica/control/submit/DataEntryServlet.java +++ b/web/src/main/java/org/akaza/openclinica/control/submit/DataEntryServlet.java @@ -2249,7 +2249,11 @@ protected void getInputBeans(HttpServletRequest request) throws InsufficientPerm int tabId = fp.getInt("tab", true); if (tabId <= 0) { - tabId = 1; + if(sb != null && sb.getOrdinal() > 0) { + tabId = sb.getOrdinal(); + } else { + tabId = 1; + } } request.setAttribute(INPUT_TAB, new Integer(tabId)); request.setAttribute(SECTION_BEAN, sb); diff --git a/web/src/main/webapp/WEB-INF/jsp/submit/initialDataEntryNw.jsp b/web/src/main/webapp/WEB-INF/jsp/submit/initialDataEntryNw.jsp index 115fa815e86..ae86577261b 100644 --- a/web/src/main/webapp/WEB-INF/jsp/submit/initialDataEntryNw.jsp +++ b/web/src/main/webapp/WEB-INF/jsp/submit/initialDataEntryNw.jsp @@ -56,7 +56,7 @@ - +openDNoteWindow(''); document.getElementById('CRF_infobox_closed').style.display='block';document.getElementById('CRF_infobox_open').style.display='none';" onunload="javascript:clsWin();" > @@ -387,7 +387,10 @@ function initmb(){ } -window.onload = initmb; +// this is neccessary since body.onload is overwritten +// by window.onload +oldOnload = document.body.onload; +window.onload = function(){oldOnload(); initmb();}; //-->