Advertisement
Guest User

Untitled

a guest
Sep 7th, 2011
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.12 KB | None | 0 0
  1. <%@ include file="/WEB-INF/template/include.jsp" %>
  2.  
  3. <openmrs:require privilege="View Synchronization Status" otherwise="/login.htm" redirect="/module/sync/history.list" />
  4.  
  5. <%@ include file="/WEB-INF/template/header.jsp" %>
  6.  
  7. <%@ include file="localHeader.jsp" %>
  8.  
  9. <openmrs:htmlInclude file="/dwr/util.js" />
  10. <openmrs:htmlInclude file="/moduleResources/sync/sync.css" />
  11. <script type="text/javascript">
  12. function reloadPage(firstRecordId){
  13.  
  14. var dropdown = document.getElementById("itemsPerPage");
  15. var index = dropdown.selectedIndex;
  16. var ddVal = dropdown.options[index].value;
  17.  
  18. // var firstRecordId = $('#firstRecordId').val();
  19. alert(firstRecordId);
  20. document.location = "?firstRecordId=" + firstRecordId + "&size=" + ddVal;
  21. }
  22.  
  23. </script>
  24.  
  25. <h2><spring:message code="sync.history.title"/></h2>
  26.  
  27. <b class="boxHeader"> </b>
  28. <div class="box">
  29. <select id="itemsPerPage" name="itemsPerPage" onchange="reloadPage(${firstRecordId})">
  30. <option value="2" selected="selected">1</option>
  31. <option value="5">5</option>
  32. <option value="10">10</option>
  33. </select>
  34. <c:if test="${syncRecords[0].recordId != latestRecordId}">
  35. <a href="?firstRecordId=${firstRecordId + size}&size=${size}" disabled="disabled">&larr; <spring:message code="sync.general.newer"/></a>
  36. </c:if>
  37. <c:if test="${isEarliestRecord != true}">
  38. <a href="?firstRecordId=${firstRecordId - size}&size=${size}"><spring:message code="sync.general.older"/> &rarr;</a> |
  39. </c:if>
  40. <a href="historyNextError.list?recordId=${firstRecordId}&size=${size}"><spring:message code="sync.general.nextError"/> &rarr;</a>
  41.  
  42. <table id="syncChangesTable" cellpadding="7" cellspacing="0">
  43. <thead>
  44. <tr>
  45. <th><spring:message code="sync.status.itemTypeAndUuid" /></th>
  46. <%--
  47. <th colspan="2" style="text-align: center;"><spring:message code="sync.status.timestamp" /></th>
  48. <th nowrap style="text-align: center;"><spring:message code="sync.status.itemState" /></th>
  49. <th nowrap style="text-align: center;"><spring:message code="sync.status.recordState" /></th>
  50. <th nowrap style="text-align: center;"><spring:message code="sync.status.retryCount" /></th>
  51. --%>
  52. <c:if test="${not empty servers}">
  53. <c:forEach items="${servers}" var="server">
  54. <th style="text-align: center; <c:if test="${server.serverType == 'PARENT'}">background-color: #eef;</c:if>">
  55. ${server.nickname}
  56. <c:if test="${server.serverType == 'PARENT'}">(<spring:message code="${server.serverType}" />)</c:if>
  57. </th>
  58. </c:forEach>
  59. </c:if>
  60. <c:if test="${empty servers}">
  61. <th style="font-weight: normal;"><i><spring:message code="sync.status.servers.none" /></i></th>
  62. </c:if>
  63. </tr>
  64. </thead>
  65. <tbody id="globalPropsList">
  66. <c:if test="${not empty syncRecords}">
  67. <c:set var="bgStyle" value="eee" />
  68. <c:set var="bgStyleParent" value="dde" />
  69. <c:forEach var="syncRecord" items="${syncRecords}" varStatus="status">
  70. <%--<c:forEach var="syncItem" items="${syncRecord.items}" varStatus="itemStatus">--%>
  71. <tr>
  72. <td valign="middle" nowrap style="background-color: #${bgStyle};">
  73. <b><a href="viewrecord.form?uuid=${syncRecord.uuid}">${recordTypes[syncRecord.uuid]}</a></b>
  74. <c:if test="${not empty recordText[syncRecord.uuid]}">
  75. (${recordText[syncRecord.uuid]})
  76. </c:if>
  77. <br>
  78. <span style="color: #bbb">
  79. <spring:message code="sync.item.state_${recordChangeType[syncRecord.uuid]}" /> -
  80. <openmrs:formatDate date="${syncRecord.timestamp}" format="${syncDateDisplayFormat}" />
  81. <%--<c:if test="${not empty itemInfo[syncItem.key.keyValue]}">(${itemInfo[syncItem.key.keyValue]})</c:if></b>--%>
  82. </span>
  83. </td>
  84. <c:if test="${not empty servers}">
  85. <c:forEach items="${servers}" var="server">
  86. <td valign="middle" nowrap style="background-color: #<c:if test="${server.serverType == 'PARENT'}">${bgStyleParent}</c:if><c:if test="${server.serverType != 'PARENT'}">${bgStyle}</c:if>;" align="center">
  87. <c:choose>
  88. <c:when test="${server.serverType == 'PARENT'}">
  89. <span class="sync${syncRecord.state}"><spring:message code="sync.record.state_${syncRecord.state}" /></span>
  90. </c:when>
  91. <c:otherwise>
  92. <c:if test="${not empty syncRecord.remoteRecords[server]}">
  93. <span class="sync${syncRecord.remoteRecords[server].state}"><spring:message code="sync.record.state_${syncRecord.remoteRecords[server].state}" /></span>
  94. </c:if>
  95. <c:if test="${empty syncRecord.remoteRecords[server]}">
  96. <span style="color: #bbb"><i><spring:message code="sync.record.server.didNotExist" /></i></span>
  97. </c:if>
  98. </c:otherwise>
  99. </c:choose>
  100. </td>
  101. </c:forEach>
  102. </c:if>
  103. <c:if test="${empty servers}">
  104. <td></td>
  105. </c:if>
  106. </tr>
  107. <c:choose>
  108. <c:when test="${bgStyle == 'eee'}">
  109. <c:set var="bgStyle" value="fff" />
  110. <c:set var="bgStyleParent" value="eef" />
  111. </c:when>
  112. <c:otherwise>
  113. <c:set var="bgStyle" value="eee" />
  114. <c:set var="bgStyleParent" value="dde" />
  115. </c:otherwise>
  116. </c:choose>
  117. <%--</c:forEach>--%>
  118.  
  119. </c:forEach>
  120. </c:if>
  121. <c:if test="${empty syncRecords}">
  122. <tr>
  123. <td colspan="5" align="left">
  124. <i><spring:message code="sync.history.noItems" /></i>
  125. </td>
  126. </tr>
  127. </c:if>
  128. </tbody>
  129. </table>
  130. <!-- mine -->
  131.  
  132. <c:if test="${syncRecords[0].recordId != latestRecordId}">
  133. <a href="?firstRecordId=${firstRecordId + param.itemsPerPage}&size=${param.itemsPerPage}" disabled="disabled">&larr; <spring:message code="sync.general.newer"/></a>
  134. </c:if>
  135. <c:if test="${isEarliestRecord != true}">
  136. <a href="?firstRecordId=${firstRecordId - param.itemsPerPage}&size=${param.itemsPerPage}"><spring:message code="sync.general.older"/> &rarr;</a>
  137. </c:if>
  138. <a href="historyNextError.list?recordId=${firstRecordId}&size=${size}"><spring:message code="sync.general.nextError"/> &rarr;</a>
  139. </div>
  140.  
  141. <%@ include file="/WEB-INF/template/footer.jsp" %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement