Skip to content

Commit 2082d92

Browse files
sindurwluyima
authored andcommittedMay 31, 2013
Sindu,Sanjana|fixed dropdown of visit types to show the retired visit types too
1 parent b598f28 commit 2082d92

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed
 

‎web/src/main/java/org/openmrs/web/controller/visit/VisitFormController.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ public String purgeVisit(WebRequest request, @ModelAttribute(value = "visit") Vi
326326

327327
@ModelAttribute("visitTypes")
328328
public List<VisitType> getVisitTypes() throws Exception {
329-
return Context.getVisitService().getAllVisitTypes(false);
329+
return Context.getVisitService().getAllVisitTypes(true);
330330
}
331331

332332
@ModelAttribute("attributeTypes")

‎webapp/src/main/webapp/WEB-INF/messages.properties

+1
Original file line numberDiff line numberDiff line change
@@ -2483,6 +2483,7 @@ Visit.noVisitAssigned=No visit assigned
24832483
Visit.cannotPurgeVisitWithEncounters=Can't purge a visit that has encounters associated to it
24842484
Visit.encounter.search.placeholder=Enter encounter id, provider identifier, location, form, encounter type or provider name
24852485

2486+
Visit.type.retired=Retired
24862487
Visit.configure.startCloseVisitsTask=Start auto close visits task
24872488
Visit.configure.closeVisitsTask.failedToStart=Failed to start task
24882489
Visit.configure.closeVisitsTask.failedToStop=Failed to stop task

‎webapp/src/main/webapp/WEB-INF/view/admin/visits/visitForm.jsp

+8
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,21 @@ $j(document).ready( function() {
198198
<th><openmrs:message code="Visit.visitType"/><span class="required"> *</span></th>
199199
<td>
200200
<spring:bind path="visitType">
201+
<c:set var="groupOpen" value="false" />
201202
<select name="${status.expression}">
202203
<option value=""></option>
203204
<c:forEach items="${visitTypes}" var="visitType">
205+
<c:if test="${visitType.retired && !groupOpen}">
206+
<optgroup label="<openmrs:message code="Visit.type.retired"/>">
207+
<c:set var="groupOpen" value="true" />
208+
</c:if>
204209
<option value="${visitType.visitTypeId}" <c:if test="${visitType.visitTypeId == status.value}">selected="selected"</c:if>>
205210
${visitType.name}
206211
</option>
207212
</c:forEach>
213+
<c:if test="${groupOpen}">
214+
</optgroup>
215+
</c:if>
208216
</select>
209217
<c:if test="${status.errorMessage != ''}"><span class="error">${status.errorMessage}</span></c:if>
210218
</spring:bind>

0 commit comments

Comments
 (0)
Please sign in to comment.