dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #25370
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12571: Add options to select Orgunit search type in advanced-search, includes options Selected, All orgu...
------------------------------------------------------------
revno: 12571
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-10-11 13:50:09 +0700
message:
Add options to select Orgunit search type in advanced-search, includes options Selected, All orgunits, User orgunits, Selected and all below.
modified:
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SearchPatientAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SearchPatientAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SearchPatientAction.java 2013-10-11 03:57:57 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SearchPatientAction.java 2013-10-11 06:50:09 +0000
@@ -217,7 +217,7 @@
{
Collection<Integer> orgunitIds = organisationUnitService.getOrganisationUnitHierarchy().getChildren(
organisationUnit.getId() );
-
+ orgunits.add( organisationUnit );
orgunits.addAll( organisationUnitService.getOrganisationUnits( orgunitIds ) );
}
else if ( facilityLB.equals( SEARCH_IN_ALL_ORGUNITS ) )
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties 2013-10-11 06:38:40 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties 2013-10-11 06:50:09 +0000
@@ -314,7 +314,6 @@
are_you_sure=Are you sure?
loading = Loading
save_favorite = Save favorite
-search_in_all_facilities = Search in all facilities
first_name = First name
middle_name = Middle name
last_name = Last name
@@ -644,7 +643,6 @@
event_registration = Event registration
add_patient_related_the_seleced_event = Add person related to the selected event
related_patient = Related person
-search_by_user_orgunits = Search by user orgunits
show_data = Show data
name_in_use = Name is in use
incomplete_confirm_message = Are you sure this event is incompleted?
@@ -686,4 +684,7 @@
hide_search_criteria = Hide search criteria
there_are_active_search_filter_click_on_arrow_to_show_them = there are active search filter, click on arrow to show them.
add_relative = Add relative
-orgunit_search_type = Orgunit search type"
\ No newline at end of file
+orgunit_search_type = Orgunit search type
+all_orgunits = All orgunits
+user_orgunits = User orgunits
+selected_and_all_below = Selected and all below
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js 2013-10-11 06:38:40 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js 2013-10-11 06:50:09 +0000
@@ -235,7 +235,8 @@
var startDueDate = getFieldValue('startDueDate');
var orgunitid = getFieldValue('orgunitId');
- if( byId('searchInAllFacility').checked ) {
+ var facilityLB = getFieldValue('facilityLB');
+ if( facilityLB=='searchInAllOrgunits') {
orgunitid = 0;
}
@@ -277,9 +278,7 @@
}
});
- var searchInAllFacility = byId('searchInAllFacility').checked;
-
- if( getFieldValue('searchByProgramStage') == "false" && !searchInAllFacility ) {
+ if( getFieldValue('searchByProgramStage') == "false" && getFieldValue('facilityLB')!='searchInAllOrgunits' ) {
p += "_" + getFieldValue('orgunitId');
}
@@ -288,16 +287,7 @@
params += '&listAll=false';
- params += '&facilityLB=';
- if( byId('searchInAllFacility').checked ) {
- params += getFieldValue('searchInAllFacility');
- }
- else if( byId('searchInUserOrgunits').checked ) {
- params += getFieldValue('searchInUserOrgunits');
- }
- else if( byId('searchBelowOrgunit').checked ) {
- params += getFieldValue('searchBelowOrgunit');
- }
+ params += '&facilityLB=' + getFieldValue('facilityLB');
return params;
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm 2013-10-09 06:40:18 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm 2013-10-11 06:50:09 +0000
@@ -86,25 +86,17 @@
</td>
</tr>
<tr id='searchBySelectedUnitTD'>
- #if( $auth.hasAccess( "dhis-web-caseentry", "searchAllFacilities" ) )
- <td>
- $i18n.getString('search_in_all_facilities')
- <input type='checkbox' id='searchInAllFacility' name='searchInAllFacility' value='searchInAllOrgunits' />
- </td>
- #else
- <input type='checkbox' class='hidden' id='searchInAllFacility' name='searchInAllFacility' value='searchInAllOrgunits' />
- #end
-
- <td class='hidden'>
- $i18n.getString('search_by_user_orgunits')
- <input type='checkbox' id='searchInUserOrgunits' name='searchInUserOrgunits' value='searchInUserOrgunits' />
- </td>
-
+ <td>$i18n.getString('orgunit_search_type')</td>
<td>
- $i18n.getString('search_all_below_selected_orgunit')
- <input type='checkbox' id='searchBelowOrgunit' name='searchBelowOrgunit' value='searchInBelowSelectedOrgunit' />
+ <select id='facilityLB' name='facilityLB'>
+ <option value='' />$i18n.getString('selected')</option>
+ #if( $auth.hasAccess( "dhis-web-caseentry", "searchAllFacilities" ) )
+ <option value='searchInAllOrgunits' />$i18n.getString('all_orgunits')</option>
+ #end
+ <option value='searchInUserOrgunits' />$i18n.getString('user_orgunits')</option>
+ <option value='searchBelowOrgunit' />$i18n.getString('selected_and_all_below')</option>
+ </select>
</td>
-
</tr>
<tr id='enrollmentSelectTR' class='hidden' >
<td>$i18n.getString('show')</td>