这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions omod/src/main/java/org/openmrs/web/dwr/DWRPersonService.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.openmrs.api.PersonService;
import org.openmrs.api.UserService;
import org.openmrs.api.context.Context;
import org.openmrs.web.WebUtil;

/**
* DWR methods for ajaxy effects on {@link Person} objects.
Expand Down Expand Up @@ -271,14 +272,22 @@ public Vector<Object> findBatchOfPeopleByRoles(String searchPhrase, boolean incl
// if no roles were given, search for normal people
PersonService ps = Context.getPersonService();
for (Person p : ps.getPeople(searchPhrase, null, includeVoided)) {
personList.add(PersonListItem.createBestMatch(p));
PersonListItem personListItem = PersonListItem.createBestMatch(p);
personListItem.setGivenName(WebUtil.escapeHTML(personListItem.getGivenName()));
personListItem.setMiddleName(WebUtil.escapeHTML(personListItem.getMiddleName()));
personListItem.setFamilyName(WebUtil.escapeHTML(personListItem.getFamilyName()));
personList.add(personListItem);
}

// also search on patient identifier if the query contains a number
if (searchPhrase.matches(".*\\d+.*")) {
PatientService patientService = Context.getPatientService();
for (Patient p : patientService.getPatients(searchPhrase, null, null, false)) {
personList.add(PersonListItem.createBestMatch(p));
PersonListItem personListItem = PersonListItem.createBestMatch(p);
personListItem.setGivenName(WebUtil.escapeHTML(personListItem.getGivenName()));
personListItem.setMiddleName(WebUtil.escapeHTML(personListItem.getMiddleName()));
personListItem.setFamilyName(WebUtil.escapeHTML(personListItem.getFamilyName()));
personList.add(personListItem);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ function OpenmrsSearch(div, showIncludeVoided, searchHandler, selectionHandler,
$j('#openmrsSearchTable_paginate').show();
}

this._updatePageInfo($j('<div/>').text(searchText).html());
this._updatePageInfo(searchText);
if(matchCount == 0){
if($j('#openmrsSearchTable_info').is(":visible"))
$j('#openmrsSearchTable_info').hide();
Expand All @@ -841,7 +841,7 @@ function OpenmrsSearch(div, showIncludeVoided, searchHandler, selectionHandler,
var data = rowData[c.fieldName];
if(data == null)
data = " ";
return $j('<div/>').text(data).html();
return data;
});

//include the attributes
Expand Down