Skip to content

Commit

Permalink
Merge with master
Browse files Browse the repository at this point in the history
  • Loading branch information
Parth59 committed Mar 13, 2021
2 parents 71957ea + 4dde8a9 commit 7dc3345
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 23 deletions.
2 changes: 1 addition & 1 deletion api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<parent>
<groupId>org.openmrs.module</groupId>
<artifactId>legacyui</artifactId>
<version>1.8.2-SNAPSHOT</version>
<version>1.8.3-SNAPSHOT</version>
</parent>

<artifactId>legacyui-api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion omod/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<parent>
<groupId>org.openmrs.module</groupId>
<artifactId>legacyui</artifactId>
<version>1.8.2-SNAPSHOT</version>
<version>1.8.3-SNAPSHOT</version>
</parent>

<artifactId>legacyui-omod</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,10 @@ public void changeToState(Integer patientProgramId, Integer programWorkflowId, I
s.savePatientProgram(pp);
}

public void voidLastState(Integer patientProgramId, String programWorkflowUuid, String voidReason) {
public void voidLastState(Integer patientProgramId, Integer programWorkflowId, String voidReason) {
ProgramWorkflowService s = Context.getProgramWorkflowService();
PatientProgram pp = s.getPatientProgram(patientProgramId);
ProgramWorkflow wf = s.getWorkflowByUuid(programWorkflowUuid);
ProgramWorkflow wf = pp.getProgram().getWorkflow(programWorkflowId);
pp.voidLastState(wf, Context.getAuthenticatedUser(), new Date(), voidReason);
Context.getProgramWorkflowService().savePatientProgram(pp);
}
Expand Down
4 changes: 2 additions & 2 deletions omod/src/main/webapp/admin/person/include/editPersonInfo.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,11 @@
<c:choose>
<c:when test="${not empty patient}">
<c:set var="voided" value="${patient.voided}" />
<c:set var="voidReason" value="${patient.voidReason}" />
<c:set var="voidReason" value="<c:out value='${patient.voidReason}'/>" />
</c:when>
<c:otherwise>
<c:set var="voided" value="${person.voided}" />
<c:set var="voidReason" value="${person.voidReason}" />
<c:set var="voidReason" value="<c:out value='${person.voidReason}'/>" />
</c:otherwise>
</c:choose>

Expand Down
2 changes: 1 addition & 1 deletion omod/src/main/webapp/admin/person/personForm.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
<div>
<c:if test="${person.personVoidedBy.personName != null}"><openmrs:message code="general.byPerson"/> <c:out value="${person.personVoidedBy.personName}" /></c:if>
<c:if test="${person.personDateVoided != null}"> <openmrs:message code="general.onDate"/> <openmrs:formatDate date="${person.personDateVoided}" type="long" /> </c:if>
<c:if test="${person.personVoidReason != ''}"> - ${person.personVoidReason} </c:if>
<c:if test="${person.personVoidReason != ''}"> - <c:out value='${person.personVoidReason}'/> </c:if>
</div>
<div>
<form action="" method="post" ><input type="submit" name="action" value="<openmrs:message code="Person.unvoid"/>" /></form></div>
Expand Down
2 changes: 1 addition & 1 deletion omod/src/main/webapp/admin/users/localHeader.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<a href="${pageContext.request.contextPath}/admin/index.htm"><openmrs:message code="admin.title.short"/></a>
</li>
<openmrs:hasPrivilege privilege="Edit Users">
<li id="legacyui-mangeUsers" <c:if test='<%= request.getRequestURI().contains("users/users") %>'>class="active"</c:if>>
<li id="legacyui-manageUsers" <c:if test='<%= request.getRequestURI().contains("users/users") %>'>class="active"</c:if>>
<a href="${pageContext.request.contextPath}/admin/users/users.list">
<openmrs:message code="User.manage"/>
</a>
Expand Down
8 changes: 4 additions & 4 deletions omod/src/main/webapp/admin/users/users.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
<td><c:out value="${user.familyName}"/></td>
<td>
<c:if test="${fn:length(userRolesMap[user]) > 3}">
<span title="${userRolesMap[user]}">
<span title="<c:out value='${userRolesMap[user]}'/>">
</c:if>
<c:forEach var="r" items="${userRolesMap[user]}" varStatus="varStatus" end="2">
<c:choose>
Expand All @@ -102,14 +102,14 @@
<c:when test="${r != role && role != null}">
<span class='bold_text'>
<c:forEach var="inheritedRole" items="${userInheritanceLineMap[user]}" varStatus="inheritanceStatus">
${inheritedRole} <c:if test="${inheritanceStatus.index ne fn:length(userInheritanceLineMap[user]) - 1}"> -> </c:if>
<c:out value='${inheritedRole}'/> <c:if test="${inheritanceStatus.index ne fn:length(userInheritanceLineMap[user]) - 1}"> -> </c:if>
</c:forEach>
</span>
</c:when>
<c:otherwise>${r}</c:otherwise>
<c:otherwise><c:out value='${r}'/></c:otherwise>
</c:choose>
</c:when>
<c:otherwise>, ${r}</c:otherwise>
<c:otherwise>, <c:out value='${r}'/></c:otherwise>
</c:choose>
</c:forEach>
<c:if test="${fn:length(userRolesMap[user]) > 3}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -765,10 +765,11 @@ dojo.widget.defineWidget(
lastItemDisplayed = this.objectsFound.length;
}

this.infoBar.innerHTML = '';
if (this.lastPhraseSearched != null)
this.infoBar.innerHTML = ' &nbsp; ' + omsgs.resultsFor + ' "' + this.lastPhraseSearched + '". &nbsp;';

if (this.lastPhraseSearched != null) {
resultsText = omsgs.resultsFor + ' "' + this.lastPhraseSearched + '".';
this.infoBar.innerHTML = $j('<div/>').text(resultsText).html();
}

if (this.objectsFound.length > 0)
this.infoBar.innerHTML += omsgs.searchResultsViewing + " <b>" + this.firstItemDisplayed + "-" + lastItemDisplayed + "</b> " + omsgs.searchResultsOf + " <b>" + total + "</b> &nbsp; ";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

import java.util.Set;
import java.util.Vector;
Expand All @@ -22,6 +23,7 @@
import org.openmrs.Concept;
import org.openmrs.ConceptName;
import org.openmrs.PatientProgram;
import org.openmrs.PatientState;
import org.openmrs.ProgramWorkflow;
import org.openmrs.ProgramWorkflowState;
import org.openmrs.api.context.Context;
Expand Down Expand Up @@ -160,4 +162,22 @@ public void getProgramByName_shouldReturnNullWhenThereIsNoProgramWorkflowForGive
assertNull(workflow);
}

@Test
@Verifies(value = "last state should be voided", method = "voidLastState")
public void voidLastState_shouldVoidTheLastState() throws Exception {
executeDataSet(PROGRAM_NEXT_STATES_XML);

Integer programId = 11;
Integer workflowId = 501;
String voidReason = "Remove it";
String patientStateUuid = "e2d62091-7b57-11eb-b6f7-0242c0a82003";

PatientState patientState = Context.getProgramWorkflowService().getPatientStateByUuid(patientStateUuid);

assertFalse(patientState.getVoided());

dwrProgramWorkflowService.voidLastState(programId, workflowId, voidReason);
patientState = Context.getProgramWorkflowService().getPatientStateByUuid(patientStateUuid);
assertTrue(patientState.getVoided());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,16 @@

<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"/>

<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"/>
<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"/>

<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"/>
<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" />
<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" />
<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" />
<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" />

<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" />
<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" />
<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" />
<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" />

<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" />
<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" />

</dataset>
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<groupId>org.openmrs.module</groupId>
<artifactId>legacyui</artifactId>
<version>1.8.2-SNAPSHOT</version>
<version>1.8.3-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Legacy UI Module</name>
<description>Provides the legacy UI which was removed from the platform since version 2.0</description>
Expand Down

0 comments on commit 7dc3345

Please sign in to comment.