Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ include file="/WEB-INF/template/include.jsp"%>
- <%@ include file="/WEB-INF/template/header.jsp"%>
- <%@ include file="localInclude.jsp" %>
- <openmrs:require privilege="Manage Report Templates" otherwise="/login.htm" redirect="/module/integration/manageReportTemplates.form" />
- <script type="text/javascript" charset="utf-8">
- $j(document).ready(function() {
- $j('#report-table').dataTable( {
- "bPaginate": false,
- "iDisplayLength": 8,
- "bLengthChange": false,
- "bFilter": false,
- "bSort": true,
- "bInfo": true,
- "bAutoWidth": false,
- "bScrollY" : true,
- } );
- $j('.edit').click(function() {
- var reportId = $j(this).attr('id').substring(4); // strip 'edit'
- alert(reportId);
- $("#id").val(reportId);
- $("#reportName").val($j.trim($j("#name"+reportId).html()));
- $("#mappedReport").val($j.trim($j("#mappedReport"+reportId).html()));
- $("#baseCohort").val($j.trim($j("#baseCohort"+reportId).html()));
- $('#editReportTemplateMapping').dialog('open');
- } );
- $j('.mapDE').click(function() {
- var reportId = $j(this).attr('id').substring(5); // strip 'mapDE'
- alert(reportId);
- var url = "showDataElements.form?reportTemplateId=${reportId}&server=${server.serverName}";
- alert(url);
- window.location = url;
- } );
- $j('.mapOS').click(function() {
- var reportId = $j(this).attr('id').substring(5); // strip 'mapOS'
- alert(reportId);
- var url = "showOptions.form?reportTemplateId=${reportId}&server=${server.serverName}";
- alert(url);
- window.location = url;
- } );
- $j('.reportRow').click(function() {
- var reportId = $j(this).attr('id').substring(4); // strip 'name'
- alert("reportId: " + reportId);
- $j('#combo-table').fnFilter($j("name${reportId}.value"),0,false,false,false,true);
- } );
- $j('#editReportTemplateMapping').dialog({
- autoOpen: false,
- modal: true,
- title: '<openmrs:message code="integration.general.reportMappedTo" javaScriptEscape="true" />',
- width: '90%'
- } );
- $j(".cancel").click( function() {
- $j('#editReportTemplateMapping').dialog('close');
- } );
- $j('#combo-table').dataTable( {
- "bPaginate": false,
- "iDisplayLength": 8,
- "bLengthChange": false,
- "bFilter": false,
- "bSort": true,
- "bInfo": true,
- "bAutoWidth": false,
- "bScrollY" : true,
- } );
- $j('.deText').click(function()) {
- var deId = $j(this).attr('id');
- alert("DE: " + deId);
- } );
- $j('.osText').click(function()) {
- var osId = $j(this).attr('id');
- alert("OS: " + osId);
- } );
- // emulate a click on the first row of the report table
- var rid = $j(".reportRow"[0]).attr('id');
- $j('#combo-table').fnFilter($j("name${rid}.value"),0,false,false,false,true);
- } );
- </script>
- <style>
- .small { font-size: x-small; }
- .oddRow { background-color: white; }
- .evenRow { background-color: whitesmoke; }
- .deText { border-style: none; font-style: italic;}
- .osText { border-style: none; font-style: italic;}
- </style>
- <div id="breadCrumbs">
- <a href="integrationServerAdmin.form">
- <openmrs:message code="integration.return.serverAdministration"/>
- </a>|
- </div>
- <h2>
- <openmrs:message code="integration.general.reportTemplatesFor"/> <openmrs:message code="integration.serverAdmin"/> : ${server.serverName}
- </h2>
- <div id="base-page"><form>
- <div >
- <br/>
- <table id="report-table" width="90%">
- <thead>
- <tr>
- <th><openmrs:message code="integration.general.name"/></th>
- <th><openmrs:message code="integration.general.code"/></th>
- <th><openmrs:message code="integration.general.frequency"/></th>
- <th><openmrs:message code="integration.general.baseCohort"/></th>
- <th><openmrs:message code="integration.general.reportMappedTo"/></th>
- <th align="center" width="1%"><openmrs:message code="integration.general.actions"/></th>
- </tr>
- </thead>
- <tbody>
- <c:forEach items="${reportTemplates}" var="reportTemplate" varStatus="rtstatus">
- <tr id="${reportTemplate.id}" style="background-color:${rtstatus.index % 2 == 0 ? 'white' : 'whitesmoke'}" >
- <td width="20%" id="name${reportTemplate.id}" class="reportRow">
- ${reportTemplate.name}
- </td>
- <td width="10%" id="code${reportTemplate.id}">
- ${reportTemplate.code}
- </td>
- <td width="10%" id="frequency${reportTemplate.id}">
- ${reportTemplate.frequency}
- </td>
- <td width="10%" id="baseCohort${reportTemplate.id}">
- ${uuidToReportDefinitionMap[reportTemplate.mappedReportUuid].baseCohortDefinition}
- </td>
- <td width="10%" id="mappedReport${reportTemplate.id}">
- ${uuidToReportDefinitionMap[reportTemplate.mappedReportUuid].name}
- </td>
- <td align="center" nowrap>
- <button type="button" class="edit" id="edit${reportTemplate.id}">
- <openmrs:message code="integration.button.editReports"/>
- </button>
- <button type="button" class="mapeDE" id="mapDE${reportTemplate.id}">
- <openmrs:message code="integration.button.mapDataElement"/>
- </button>
- <button type="button" class="mapOS" "mapOS${reportTemplate.id}">
- <openmrs:message code="integration.button.mapOptionSets"/>
- </button>
- </td>
- </tr>
- </c:forEach>
- </tbody>
- </table>
- </div>
- <div id="report-mapping">
- <br/>
- <table id="combo-table" width="90%">
- <thead>
- <tr>
- <th><openmrs:message code="integration.dhis.dataElement"/></th>
- <th><openmrs:message code="integration.dhis.categoryCombo"/></th>
- <th><openmrs:message code="integration.dhis.optionSet"/></th>
- </tr>
- </thead>
- <tbody>
- <c:forEach items="${reportMapDisplay}" var="rd" varStatus="rdstatus">
- <tr id={$rd.reportId} style="background-color:${rdstatus.index % 2 == 0 ? 'white' : 'whitesmoke'}; padding:20" >
- <td>
- <c:forEach items="${rd.elements}" var="de">
- <c:if test="${!de.mapped}">
- <img src="<c:url value='/images/alert.gif'/>" border="0" />
- </c:if>
- <button type="button" id="${de.id }" class="deText">
- ${de.name}
- </button>
- <c:if test="${de.mapped}">
- <img src="<c:url value='/images/checkmark.png'/>" border="0" />
- </c:if>
- <br/>
- </c:forEach>
- </td>
- <td id="${rd.comboId }">
- ${rd.comboName }
- </td>
- <td>
- <c:forEach items="${rd.optionSets}" var="os">
- <c:if test="${!os.mapped}">
- <img src="<c:url value='/images/alert.gif'/>" border="0" />
- </c:if>
- <button type="button" id="${os.id}" class="osText">
- ${os.name}
- </button>
- <c:if test="${os.mapped}">
- <img src="<c:url value='/images/checkmark.png'/>" border="0" />
- </c:if>
- <br/>
- </c:forEach>
- </td>
- </c:forEach>
- </tbody>
- </table>
- </div>
- </form></div>
- <div id="editReportTemplateMapping">
- <form method="post" id="detailsedit" action="saveReportTemplateMapping.form">
- <table>
- <tbody>
- <tr>
- <td><openmrs:message code="integration.general.name"/></td>
- <td>:</td>
- <td>
- <input id="id" type="hidden"/>
- <input id="reportName" type="text" width="50" input="disabled" />
- </td>
- </tr>
- <tr>
- <td><openmrs:message code="integration.general.reportMappedTo"/></td>
- <td>:</td>
- <td> <input id="mappedReport" type="text" size="40" /></td>
- </tr>
- <tr>
- <td><openmrs:message code="integration.general.baseCohort"/></td>
- <td>:</td>
- <td><input id="baseCohort" type="text" size="40" /></td>
- </tr>
- <tr></tr>
- <tr>
- <td></td>
- <td></td>
- <td>
- <input type="submit" name="submit" value='<openmrs:message code="integration.button.save"/>' javaScriptEscape="true" />
- <input type="reset" id="cancel" value='<openmrs:message code="integration.button.cancel" javaScriptEscape="true"/>' class="cancel">
- </td>
- </tr>
- </tbody>
- </table>
- </form>
- </div>
- <%@ include file="/WEB-INF/template/footer.jsp"%>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement