use of org.jmesa.view.html.HtmlBuilder in project OpenClinica by OpenClinica.
the class ListStudySubjectTableFactory method eventDivBuilder.
private String eventDivBuilder(SubjectBean subject, Integer rowCount, List<StudyEventBean> studyEvents, StudyEventDefinitionBean sed, StudySubjectBean studySubject) {
String studySubjectLabel = studySubject.getLabel();
String divWidth = studyEvents.size() >= 3 ? "565" : studyEvents.size() == 2 ? "395" : "180";
HtmlBuilder eventDiv = new HtmlBuilder();
eventDiv.table(0).border("0").cellpadding("0").cellspacing("0").close();
// Lock Div
eventDiv.div().id("Lock_" + studySubjectLabel + "_" + sed.getId() + "_" + rowCount).style("position: absolute; visibility: hidden; z-index: 3; width: 50px; height: 30px; top: 0px;").close();
if (studyEvents.size() > 1) {
repeatingLockLinkBuilder(eventDiv, studySubjectLabel, rowCount, studyEvents, sed);
} else {
lockLinkBuilder(eventDiv, studySubjectLabel, rowCount, studyEvents, sed);
}
eventDiv.divEnd();
eventDiv.tr(0).valign("top").close().td(0).close();
// Event Div
eventDiv.div().id("Event_" + studySubjectLabel + "_" + sed.getId() + "_" + rowCount).style("position: absolute; visibility: hidden; z-index: 3;width:" + divWidth + "px; top: 0px; float: left;").close();
eventDiv.div().styleClass("box_T").close().div().styleClass("box_L").close().div().styleClass("box_R").close().div().styleClass("box_B").close().div().styleClass("box_TL").close().div().styleClass("box_TR").close().div().styleClass("box_BL").close().div().styleClass("box_BR").close();
eventDiv.div().styleClass("tablebox_center").close();
eventDiv.div().styleClass("ViewSubjectsPopup").style("color: rgb(91, 91, 91);").close();
eventDiv.table(0).border("0").cellpadding("0").cellspacing("0").close();
eventDiv.tr(0).valign("top").close();
if (studyEvents.size() > 1) {
repeatingEventDivBuilder(eventDiv, subject, rowCount, studyEvents, sed, studySubject);
} else {
singleEventDivBuilder(eventDiv, subject, rowCount, studyEvents, sed, studySubject);
}
return eventDiv.toString();
}
use of org.jmesa.view.html.HtmlBuilder in project OpenClinica by OpenClinica.
the class SDVUtil method getCRFStatusIconPath.
private String getCRFStatusIconPath(int statusId, HttpServletRequest request, int studySubjectId, int eventDefinitionCRFId, int crfVersionId) {
HtmlBuilder html = new HtmlBuilder();
html.a().onclick("openDocWindow('" + request.getContextPath() + "/ViewSectionDataEntry?eventDefinitionCRFId=&ecId=" + eventDefinitionCRFId + "&tabId=1&studySubjectId=" + studySubjectId + "');");
html.href("#").close();
StringBuilder builderHref = new StringBuilder("<a href='javascript:void(0)' onclick=\"");
//ViewSectionDataEntry?eventDefinitionCRFId=127&crfVersionId=682&tabId=1&studySubjectId=203
builderHref.append("document.location.href='").append(request.getContextPath()).append("/");
builderHref.append("ViewSectionDataEntry?eventDefinitionCRFId=").append(eventDefinitionCRFId);
builderHref.append("&crfVersionId=").append(crfVersionId).append("&tabId=1&studySubjectId=").append(studySubjectId).append("'\">");
StringBuilder builder = new StringBuilder(html.toString()).append(getIconForCrfStatusPrefix());
String imgName = "";
StringBuilder input = new StringBuilder("<input type=\"hidden\" statusId=\"");
input.append(statusId).append("\" />");
if (statusId > 0 && statusId < 8) {
builder.append(CRF_STATUS_ICONS.get(statusId));
} else {
builder.append(CRF_STATUS_ICONS.get(0));
}
builder.append(ICON_FORCRFSTATUS_SUFFIX);
//"<input type=\"hidden\" statusId=\"1\" />"
builder.append("</a>");
builder.append(" ");
builder.append(input.toString());
return builder.toString();
}
use of org.jmesa.view.html.HtmlBuilder in project OpenClinica by OpenClinica.
the class ListSubjectTableFactory method restoreSubjectLink.
private String restoreSubjectLink(Integer subjectId) {
HtmlBuilder builder = new HtmlBuilder();
builder.a().href("RestoreSubject?action=confirm&id=" + subjectId);
builder.onmouseout("javascript:setImage('bt_Restor3','images/bt_Restore_d.gif');");
builder.onmouseover("javascript:setImage('bt_Restore3','images/bt_Restore.gif');");
builder.close();
builder.img().name("bt_Restore3").src("images/bt_Restore.gif").border("0").alt(resword.getString("restore")).title(resword.getString("restore")).align("left").append("hspace=\"6\"").close();
builder.aEnd();
return builder.toString();
}
use of org.jmesa.view.html.HtmlBuilder in project OpenClinica by OpenClinica.
the class ListSubjectTableFactory method updateSubjectLink.
private String updateSubjectLink(Integer subjectId) {
HtmlBuilder builder = new HtmlBuilder();
builder.a().href("UpdateSubject?action=show&id=" + subjectId);
builder.onmouseout("javascript:setImage('bt_Edit1','images/bt_Edit_d.gif');");
builder.onmouseover("javascript:setImage('bt_Edit1','images/bt_Edit.gif');");
builder.close();
builder.img().name("bt_Edit1").src("images/bt_Edit.gif").border("0").alt(resword.getString("edit")).title(resword.getString("edit")).align("left").append("hspace=\"6\"").close();
builder.aEnd();
return builder.toString();
}
use of org.jmesa.view.html.HtmlBuilder in project OpenClinica by OpenClinica.
the class ListDiscNotesSubjectTableFactory method restoreStudySubjectLinkBuilder.
private String restoreStudySubjectLinkBuilder(StudySubjectBean studySubject) {
HtmlBuilder actionLink = new HtmlBuilder();
actionLink.a().href("RestoreStudySubject?action=confirm&id=" + studySubject.getId() + "&subjectId=" + studySubject.getSubjectId() + "&studyId=" + studySubject.getStudyId());
actionLink.append("onMouseDown=\"javascript:setImage('bt_Restor3','images/bt_Restore_d.gif');\"");
actionLink.append("onMouseUp=\"javascript:setImage('bt_Restor3','images/bt_Restore_d.gif');\"").close();
actionLink.img().name("bt_Restore1").src("images/bt_Remove.gif").border("0").alt(resword.getString("restore")).title(resword.getString("restore")).align("left").append("hspace=\"6\"").end().aEnd();
return actionLink.toString();
}
Aggregations