Advertisement
Guest User

Untitled

a guest
Oct 25th, 2012
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.54 KB | None | 0 0
  1. <%@ include file="/WEB-INF/template/include.jsp"%>
  2.  
  3. <openmrs:require privilege="Manage Jasper Reports"
  4. otherwise="/login.htm" redirect="/module/@MODULE_ID@/jreportEdit.form" />
  5.  
  6. <openmrs:htmlInclude file="/scripts/calendar/calendar.js" />
  7.  
  8. <%@ include file="/WEB-INF/template/header.jsp"%>
  9. <%@ include file="localHeader.jsp"%>
  10.  
  11. <h2><spring:message code="@MODULE_ID@.edit.title" /></h2>
  12.  
  13. <spring:hasBindErrors name="jreport">
  14. <spring:message code="fix.error" />
  15. <div class="error"><c:forEach items="${errors.allErrors}"
  16. var="error">
  17. <spring:message code="${error.code}" text="${error.code}" />
  18. <br />
  19. <!-- ${error} -->
  20. </c:forEach></div>
  21. </spring:hasBindErrors>
  22.  
  23. <br />
  24.  
  25. <form method="post" enctype="multipart/form-data">
  26. <table width="100%">
  27. <tr>
  28. <td><spring:message code="general.name" /></td>
  29. <td><spring:bind path="jreport.name">
  30. <input type="text" name="${status.expression}"
  31. value="${status.value}" size="35" />
  32. <c:if test="${status.errorMessage != ''}">
  33. <c:if test="${status.errorMessage != ''}">
  34. <span class="error">${status.errorMessage}</span>
  35. </c:if>
  36. </c:if>
  37. </spring:bind></td>
  38. </tr>
  39. <tr>
  40. <td><spring:message code="general.description" /></td>
  41. <td><spring:bind path="jreport.description">
  42. <textarea name="${status.expression}" rows="3" cols="65" type="_moz">${status.value}</textarea>
  43. <c:if test="${status.errorMessage != ''}">
  44. <c:if test="${status.errorMessage != ''}">
  45. <span class="error">${status.errorMessage}</span>
  46. </c:if>
  47. </c:if>
  48. </spring:bind></td>
  49. </tr>
  50. <tr>
  51. <td><spring:message code="jasperReport.filename" /></td>
  52. <td><spring:bind path="jreport.fileName">
  53. <input type="text" name="${status.expression}"
  54. value="${status.value}" size="35" />
  55. <c:if test="${status.errorMessage != ''}">
  56. <c:if test="${status.errorMessage != ''}">
  57. <span class="error">${status.errorMessage}</span>
  58. </c:if>
  59. </c:if>
  60. </spring:bind></td>
  61. </tr>
  62. <tr>
  63. <td><spring:message code="jasperReport.archive" /></td>
  64. <td><c:if test="${archiveExists}">
  65. <a
  66. href="${pageContext.request.contextPath}/moduleServlet/@MODULE_ID@/jreportDownload?reportId=${jreport.reportId}">${jreport.reportId}.zip</a>&nbsp; &nbsp;
  67. <spring:message code="@MODULE_ID@.archive.upload.new" />
  68. </c:if> <c:if test="${!archiveExists}">
  69. <spring:message code="@MODULE_ID@.archive.upload" />
  70. </c:if> <input type="file" name="report_archive" size="30" /></td>
  71. </tr>
  72. <tr>
  73. <td><spring:message code="@MODULE_ID@.published" /></td>
  74. <td><spring:bind path="jreport.published">
  75. <input type="hidden" name="_${status.expression}">
  76. <input type="checkbox" name="${status.expression}"
  77. id="${status.expression}"
  78. <c:if test="${status.value == true}">checked</c:if> />
  79. </spring:bind></td>
  80. </tr>
  81. </table>
  82. <br />
  83. <c:if test="${jreport.reportId != null && archiveExists}">
  84. <b class="boxHeader"><spring:message
  85. code="@MODULE_ID@.edit.parameters" /></b>
  86. <table id="parameters" class="box">
  87. <tr align="left">
  88. <th><spring:message code="@MODULE_ID@.displayName" /></th>
  89. <th><spring:message code="@MODULE_ID@.default_value" /></th>
  90. <th><spring:message code="general.name" /></th>
  91. <th><spring:message code="@MODULE_ID@.class" /></th>
  92. <th><spring:message code="@MODULE_ID@.class.mapped" /></th>
  93. <th><spring:message code="@MODULE_ID@.visible" /></th>
  94. </tr>
  95. <tbody id="parametersTbody">
  96. <c:forEach var="parameter" items="${jreport.parameters}"
  97. varStatus="varStatus">
  98. <tr
  99. class="<c:choose><c:when test="${varStatus.index % 2 == 0}">evenRow</c:when><c:otherwise>oddRow</c:otherwise></c:choose>">
  100. <spring:nestedPath path="jreport.parameters[${varStatus.index}]">
  101. <td><spring:bind path="displayName">
  102. <input type="text" name="${status.expression}"
  103. value="${status.value}" size="25" />
  104. <c:if test="${status.errorMessage != ''}">
  105. <span class="error">${status.errorMessage}</span>
  106. </c:if>
  107. </spring:bind></td>
  108. <td><c:choose>
  109. <c:when
  110. test="${parameter.interfaceClass == 'class java.lang.Boolean'}">
  111. <spring:bind path="valueBoolean">
  112. <select name="${status.expression}" id="valueBooleanSelect">
  113. <option value=""
  114. <c:if test="${empty status.value}">selected="selected"</c:if> />
  115. <option value="true"
  116. <c:if test="${status.value == true}">selected="selected"</c:if>><spring:message
  117. code="general.true" /></option>
  118. <option value="false"
  119. <c:if test="${status.value == false}">selected="selected"</c:if>><spring:message
  120. code="general.false" /></option>
  121. </select>
  122. <c:if test="${status.errorMessage != ''}">
  123. <span class="error">${status.errorMessage}</span>
  124. </c:if>
  125. </spring:bind>
  126. </c:when>
  127. <c:when
  128. test="${parameter.interfaceClass == 'class org.openmrs.Concept'}">
  129. <spring:bind path="valueConcept">
  130. <openmrs:fieldGen type="org.openmrs.Concept"
  131. formFieldName="${status.expression}" val="${status.value}"
  132. parameters="isNullable=true" />
  133. <c:if test="${status.errorMessage != ''}">
  134. <span class="error">${status.errorMessage}</span>
  135. </c:if>
  136. </spring:bind>
  137. </c:when>
  138. <c:when
  139. test="${parameter.interfaceClass == 'class java.util.Date'}">
  140. <spring:bind path="valueDate">
  141. <input type="text" name="${status.expression}" size="10"
  142. value="${status.value}" onClick="showCalendar(this)"
  143. id="${status.expression}" />
  144. <span class="datePatternHint">(${datePattern})</span>
  145. <c:if test="${status.errorMessage != ''}">
  146. <span class="error">${status.errorMessage}</span>
  147. </c:if>
  148. </spring:bind>
  149. </c:when>
  150. <c:when
  151. test="${parameter.interfaceClass == 'class org.openmrs.Location'}">
  152. <spring:bind path="valueLocation">
  153. <select name="${status.expression}">
  154. <option value=""
  155. <c:if test="${status.value == null}">selected="selected"</c:if>></option>
  156. <openmrs:forEachRecord name="location">
  157. <option value="${record.locationId}"
  158. <c:if test="${status.value == record.locationId}">selected="selected"</c:if>>${record.name}</option>
  159. </openmrs:forEachRecord>
  160. </select>
  161. <c:if test="${status.errorMessage != ''}">
  162. <span class="error">${status.errorMessage}</span>
  163. </c:if>
  164. </spring:bind>
  165. </c:when>
  166. <c:otherwise>
  167. <spring:bind path="default_value">
  168. <input type="text" name="${status.expression}"
  169. value="${status.value}" size="10" />
  170. <c:if test="${status.errorMessage != ''}">
  171. <span class="error">${status.errorMessage}</span>
  172. </c:if>
  173. </spring:bind>
  174. </c:otherwise>
  175. </c:choose></td>
  176. <td><c:out value="${parameter.name}" /></td>
  177. <td><c:out value="${parameter.valueClass.name}" /></td>
  178. <td><c:if
  179. test="${parameter.valueClass == 'class java.lang.Integer'}">
  180. <spring:bind path="mappedClass">
  181. <select name="${status.expression}">
  182. <c:forEach var="clazz" items="${classes}">
  183. <option value="${clazz.name}"
  184. <c:if test="${parameter.mappedClass == clazz}">selected="selected"</c:if>>${clazz.name}</option>
  185. </c:forEach>
  186. </select>
  187. <c:if test="${status.errorMessage != ''}">
  188. <c:if test="${status.errorMessage != ''}">
  189. <span class="error">${status.errorMessage}</span>
  190. </c:if>
  191. </c:if>
  192. </spring:bind>
  193. </c:if></td>
  194. <td><spring:bind path="visible">
  195. <input type="hidden" name="_${status.expression}">
  196. <input type="checkbox" name="${status.expression}"
  197. id="${status.expression}"
  198. <c:if test="${status.value == true}">checked</c:if> />
  199. </spring:bind></td>
  200. </spring:nestedPath>
  201. </tr>
  202. </c:forEach>
  203. </tbody>
  204. </table>
  205. </c:if> <br />
  206. <input type="submit" name="action"
  207. value="<spring:message code="@MODULE_ID@.save"/>"> <c:if
  208. test="${jreport.reportId != null}">
  209. <openmrs:hasPrivilege privilege="Manage Jasper Reports">
  210. &nbsp; &nbsp; &nbsp;
  211. <input type="submit" name="action"
  212. value="<spring:message code="@MODULE_ID@.delete"/>"
  213. onclick="return confirm('Are you sure you want to delete this entire report and all sub-reports?')" />
  214. </openmrs:hasPrivilege>
  215. </c:if></form>
  216.  
  217. <%@ include file="/WEB-INF/template/footer.jsp"%>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement