Skip to content

Commit 7dc3345

Browse files
committed
Merge with master
2 parents 71957ea + 4dde8a9 commit 7dc3345

File tree

11 files changed

+45
-23
lines changed

11 files changed

+45
-23
lines changed

api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<parent>
1616
<groupId>org.openmrs.module</groupId>
1717
<artifactId>legacyui</artifactId>
18-
<version>1.8.2-SNAPSHOT</version>
18+
<version>1.8.3-SNAPSHOT</version>
1919
</parent>
2020

2121
<artifactId>legacyui-api</artifactId>

omod/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<parent>
1616
<groupId>org.openmrs.module</groupId>
1717
<artifactId>legacyui</artifactId>
18-
<version>1.8.2-SNAPSHOT</version>
18+
<version>1.8.3-SNAPSHOT</version>
1919
</parent>
2020

2121
<artifactId>legacyui-omod</artifactId>

omod/src/main/java/org/openmrs/web/dwr/DWRProgramWorkflowService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,10 @@ public void changeToState(Integer patientProgramId, Integer programWorkflowId, I
269269
s.savePatientProgram(pp);
270270
}
271271

272-
public void voidLastState(Integer patientProgramId, String programWorkflowUuid, String voidReason) {
272+
public void voidLastState(Integer patientProgramId, Integer programWorkflowId, String voidReason) {
273273
ProgramWorkflowService s = Context.getProgramWorkflowService();
274274
PatientProgram pp = s.getPatientProgram(patientProgramId);
275-
ProgramWorkflow wf = s.getWorkflowByUuid(programWorkflowUuid);
275+
ProgramWorkflow wf = pp.getProgram().getWorkflow(programWorkflowId);
276276
pp.voidLastState(wf, Context.getAuthenticatedUser(), new Date(), voidReason);
277277
Context.getProgramWorkflowService().savePatientProgram(pp);
278278
}

omod/src/main/webapp/admin/person/include/editPersonInfo.jsp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,11 @@
210210
<c:choose>
211211
<c:when test="${not empty patient}">
212212
<c:set var="voided" value="${patient.voided}" />
213-
<c:set var="voidReason" value="${patient.voidReason}" />
213+
<c:set var="voidReason" value="<c:out value='${patient.voidReason}'/>" />
214214
</c:when>
215215
<c:otherwise>
216216
<c:set var="voided" value="${person.voided}" />
217-
<c:set var="voidReason" value="${person.voidReason}" />
217+
<c:set var="voidReason" value="<c:out value='${person.voidReason}'/>" />
218218
</c:otherwise>
219219
</c:choose>
220220

omod/src/main/webapp/admin/person/personForm.jsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@
249249
<div>
250250
<c:if test="${person.personVoidedBy.personName != null}"><openmrs:message code="general.byPerson"/> <c:out value="${person.personVoidedBy.personName}" /></c:if>
251251
<c:if test="${person.personDateVoided != null}"> <openmrs:message code="general.onDate"/> <openmrs:formatDate date="${person.personDateVoided}" type="long" /> </c:if>
252-
<c:if test="${person.personVoidReason != ''}"> - ${person.personVoidReason} </c:if>
252+
<c:if test="${person.personVoidReason != ''}"> - <c:out value='${person.personVoidReason}'/> </c:if>
253253
</div>
254254
<div>
255255
<form action="" method="post" ><input type="submit" name="action" value="<openmrs:message code="Person.unvoid"/>" /></form></div>

omod/src/main/webapp/admin/users/localHeader.jsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<a href="${pageContext.request.contextPath}/admin/index.htm"><openmrs:message code="admin.title.short"/></a>
44
</li>
55
<openmrs:hasPrivilege privilege="Edit Users">
6-
<li id="legacyui-mangeUsers" <c:if test='<%= request.getRequestURI().contains("users/users") %>'>class="active"</c:if>>
6+
<li id="legacyui-manageUsers" <c:if test='<%= request.getRequestURI().contains("users/users") %>'>class="active"</c:if>>
77
<a href="${pageContext.request.contextPath}/admin/users/users.list">
88
<openmrs:message code="User.manage"/>
99
</a>

omod/src/main/webapp/admin/users/users.jsp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
<td><c:out value="${user.familyName}"/></td>
9191
<td>
9292
<c:if test="${fn:length(userRolesMap[user]) > 3}">
93-
<span title="${userRolesMap[user]}">
93+
<span title="<c:out value='${userRolesMap[user]}'/>">
9494
</c:if>
9595
<c:forEach var="r" items="${userRolesMap[user]}" varStatus="varStatus" end="2">
9696
<c:choose>
@@ -102,14 +102,14 @@
102102
<c:when test="${r != role && role != null}">
103103
<span class='bold_text'>
104104
<c:forEach var="inheritedRole" items="${userInheritanceLineMap[user]}" varStatus="inheritanceStatus">
105-
${inheritedRole} <c:if test="${inheritanceStatus.index ne fn:length(userInheritanceLineMap[user]) - 1}"> -> </c:if>
105+
<c:out value='${inheritedRole}'/> <c:if test="${inheritanceStatus.index ne fn:length(userInheritanceLineMap[user]) - 1}"> -> </c:if>
106106
</c:forEach>
107107
</span>
108108
</c:when>
109-
<c:otherwise>${r}</c:otherwise>
109+
<c:otherwise><c:out value='${r}'/></c:otherwise>
110110
</c:choose>
111111
</c:when>
112-
<c:otherwise>, ${r}</c:otherwise>
112+
<c:otherwise>, <c:out value='${r}'/></c:otherwise>
113113
</c:choose>
114114
</c:forEach>
115115
<c:if test="${fn:length(userRolesMap[user]) > 3}">

omod/src/main/webapp/resources/scripts/dojo/src/widget/openmrs/OpenmrsSearch.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -765,10 +765,11 @@ dojo.widget.defineWidget(
765765
lastItemDisplayed = this.objectsFound.length;
766766
}
767767

768-
this.infoBar.innerHTML = '';
769-
if (this.lastPhraseSearched != null)
770-
this.infoBar.innerHTML = ' &nbsp; ' + omsgs.resultsFor + ' "' + this.lastPhraseSearched + '". &nbsp;';
771-
768+
if (this.lastPhraseSearched != null) {
769+
resultsText = omsgs.resultsFor + ' "' + this.lastPhraseSearched + '".';
770+
this.infoBar.innerHTML = $j('<div/>').text(resultsText).html();
771+
}
772+
772773
if (this.objectsFound.length > 0)
773774
this.infoBar.innerHTML += omsgs.searchResultsViewing + " <b>" + this.firstItemDisplayed + "-" + lastItemDisplayed + "</b> " + omsgs.searchResultsOf + " <b>" + total + "</b> &nbsp; ";
774775

omod/src/test/java/org/openmrs/web/dwr/DWRProgramWorkflowServiceTest.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import static org.junit.Assert.assertFalse;
1414
import static org.junit.Assert.assertNotNull;
1515
import static org.junit.Assert.assertNull;
16+
import static org.junit.Assert.assertTrue;
1617

1718
import java.util.Set;
1819
import java.util.Vector;
@@ -22,6 +23,7 @@
2223
import org.openmrs.Concept;
2324
import org.openmrs.ConceptName;
2425
import org.openmrs.PatientProgram;
26+
import org.openmrs.PatientState;
2527
import org.openmrs.ProgramWorkflow;
2628
import org.openmrs.ProgramWorkflowState;
2729
import org.openmrs.api.context.Context;
@@ -160,4 +162,22 @@ public void getProgramByName_shouldReturnNullWhenThereIsNoProgramWorkflowForGive
160162
assertNull(workflow);
161163
}
162164

165+
@Test
166+
@Verifies(value = "last state should be voided", method = "voidLastState")
167+
public void voidLastState_shouldVoidTheLastState() throws Exception {
168+
executeDataSet(PROGRAM_NEXT_STATES_XML);
169+
170+
Integer programId = 11;
171+
Integer workflowId = 501;
172+
String voidReason = "Remove it";
173+
String patientStateUuid = "e2d62091-7b57-11eb-b6f7-0242c0a82003";
174+
175+
PatientState patientState = Context.getProgramWorkflowService().getPatientStateByUuid(patientStateUuid);
176+
177+
assertFalse(patientState.getVoided());
178+
179+
dwrProgramWorkflowService.voidLastState(programId, workflowId, voidReason);
180+
patientState = Context.getProgramWorkflowService().getPatientStateByUuid(patientStateUuid);
181+
assertTrue(patientState.getVoided());
182+
}
163183
}

omod/src/test/resources/org/openmrs/web/dwr/include/DWRProgramWorkflowServiceTest-initialStates.xml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,16 @@
3131

3232
<program program_id="4" concept_id="9" outcomes_concept_id="25" creator="1" date_created="2008-08-15 16:07:11.0" changed_by="1" date_changed="2008-08-15 17:04:50.0" retired="false" name="HIV Program" description="hiv program" uuid="5dc2a3b0-863c-4074-8f84-45762c3aa04c"/>
3333

34-
<patient_program patient_program_id="11" patient_id="2" program_id="4" creator="1" voided="false" date_created="2012-01-10 12:00:00.0" uuid="9a0533e3-bc52-49e8-b4fe-fc7e96173266"/>
34+
<patient_program patient_program_id="11" patient_id="2" program_id="4" date_enrolled="2012-01-10 12:00:00.0" creator="1" voided="false" date_created="2012-01-10 12:00:00.0" uuid="9a0533e3-bc52-49e8-b4fe-fc7e96173266"/>
3535

3636
<program_workflow program_id="4" program_workflow_id="501" concept_id="9" retired="false" creator="1" date_created="2012-01-10 12:00:00.0" uuid="79fbc48b-215f-41af-982c-5071978be018"/>
37-
38-
<program_workflow_state program_workflow_state_id="1001" program_workflow_id="501" initial="true" terminal="false" concept_id="121" retired="false" creator="1" date_created="2012-01-10 12:00:00.0" uuid="b7257555-2b2e-11e1-bbc8-00218679225a" />
39-
<program_workflow_state program_workflow_state_id="1002" program_workflow_id="501" initial="false" terminal="false" concept_id="122" retired="false" creator="1" date_created="2012-01-10 12:00:00.0" uuid="79fbc48b-215f-41af-982c-5071978be018" />
40-
<program_workflow_state program_workflow_state_id="1003" program_workflow_id="501" initial="false" terminal="false" concept_id="123" retired="false" creator="1" date_created="2012-01-10 12:00:00.0" uuid="8c8d6f7e-4c5d-42b9-a23c-2c4a4202ae56" />
41-
<program_workflow_state program_workflow_state_id="1004" program_workflow_id="501" initial="false" terminal="true" concept_id="124" retired="false" creator="1" date_created="2012-01-10 12:00:00.0" uuid="685882f6-cb7a-4562-9e75-9f2c74619639" />
37+
38+
<program_workflow_state program_workflow_state_id="1001" program_workflow_id="501" initial="true" terminal="false" concept_id="121" retired="false" creator="1" date_created="2012-01-10 12:00:00.0" uuid="b7257555-2b2e-11e1-bbc8-00218679225a" />
39+
<program_workflow_state program_workflow_state_id="1002" program_workflow_id="501" initial="false" terminal="false" concept_id="122" retired="false" creator="1" date_created="2012-01-10 12:00:00.0" uuid="79fbc48b-215f-41af-982c-5071978be018" />
40+
<program_workflow_state program_workflow_state_id="1003" program_workflow_id="501" initial="false" terminal="false" concept_id="123" retired="false" creator="1" date_created="2012-01-10 12:00:00.0" uuid="8c8d6f7e-4c5d-42b9-a23c-2c4a4202ae56" />
41+
<program_workflow_state program_workflow_state_id="1004" program_workflow_id="501" initial="false" terminal="true" concept_id="124" retired="false" creator="1" date_created="2012-01-10 12:00:00.0" uuid="685882f6-cb7a-4562-9e75-9f2c74619639" />
4242

4343
<patient_state patient_state_id="1001" patient_program_id="11" state="1001" start_date="2012-01-11" creator="1" date_created="2012-01-11 12:00:00.0" voided="false" uuid="0f4de7d0-26b1-4b76-afe1-2d307196af68" />
44+
<patient_state patient_state_id="1120" patient_program_id="11" state="1002" start_date="2013-02-10" creator="1" date_created="2013-02-10 13:07:00.0" voided="false" uuid="e2d62091-7b57-11eb-b6f7-0242c0a82003" />
4445

4546
</dataset>

0 commit comments

Comments
 (0)