Skip to content

Commit

Permalink
Merge pull request #25 from reliatec-gmbh/issue_20_view_discrepancy_n…
Browse files Browse the repository at this point in the history
…ote_within_record

Issue 20 view discrepancy note within record
  • Loading branch information
chae-reliatec authored May 29, 2019
2 parents 8c7f81a + 91f8191 commit ec65a64
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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()));
Expand Down Expand Up @@ -279,6 +285,7 @@ protected void processRequest() throws Exception {

}

request.setAttribute(ATTR_RESOLVE_DN, true);
forwardPage(p);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 5 additions & 2 deletions web/src/main/webapp/WEB-INF/jsp/submit/initialDataEntryNw.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@


</head>
<body class="aka_bodywidth" onload=" document.getElementById('here').style.display='none'; document.getElementById('CRF_infobox_closed').style.display='block';document.getElementById('CRF_infobox_open').style.display='none';" onunload="javascript:clsWin();" >
<body class="aka_bodywidth" onload="<c:if test='${popUpURL != ""}'>openDNoteWindow('<c:out value="${popUpURL}" />');</c:if> document.getElementById('CRF_infobox_closed').style.display='block';document.getElementById('CRF_infobox_open').style.display='none';" onunload="javascript:clsWin();" >

<c:import url="../submit/showItemInputToolTipsJS.jsp"></c:import>

Expand Down Expand Up @@ -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();};
//-->
</script>
Expand Down

0 comments on commit ec65a64

Please sign in to comment.