dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #18738
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7926: Load program-stage-list by selected program when select other orgunit in SMS Reminder.
------------------------------------------------------------
revno: 7926
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-08-17 16:17:56 +0700
message:
Load program-stage-list by selected program when select other orgunit in SMS Reminder.
modified:
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/GetOutboundSmsListAction.java
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/smsReminder.js
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/smsPatientRecords.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/smsReminderSelect.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/reminder/GetOutboundSmsListAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/GetOutboundSmsListAction.java 2012-08-17 07:24:13 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/GetOutboundSmsListAction.java 2012-08-17 09:17:56 +0000
@@ -74,9 +74,7 @@
private ProgramStageInstance programStageInstance;
private List<OutboundSms> outboundSms;
-
- private Map<String, String> gatewayMap;
-
+
private List<Comment> comments;
private String currentUsername;
=== 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 2012-08-16 13:46:23 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js 2012-08-17 09:17:56 +0000
@@ -188,7 +188,6 @@
{
hideById( 'listPatientDiv' );
var flag = true;
- var params = '';
var dateOperator = '';
if (getFieldValue('searchByProgramStage') == "false"){
jQuery("#searchDiv :input").each( function( i, item )
@@ -211,8 +210,8 @@
function getSearchParams()
{
var params = "";
- if( getFieldValue('searchByProgramStage') == "true"){
- var programStageId = jQuery('#programStageAddPatientTR [id=programStageAddPatient_' + getFieldValue('programIdAddPatient') + ']').val();
+ var programStageId = jQuery('#programStageAddPatient').val();
+ if( getFieldValue('searchByProgramStage') == "true" && programStageId!=''){
var statusEvent = jQuery('#programStageAddPatientTR [id=statusEvent]:checked').val();
params += '&searchTexts=prgst_' + programStageId + '_' + statusEvent;
}
@@ -434,32 +433,44 @@
function enableBtn(){
var programIdAddPatient = getFieldValue('programIdAddPatient');
- jQuery('#programStageAddPatientTR [name=programStageAddPatient]').addClass("hidden");
- jQuery('#programStageAddPatientTR [id=programStageAddPatient_' + programIdAddPatient + ']').removeClass("hidden");
-
if( programIdAddPatient!='' ){
- enable('listPatientBtn');
- enable('addPatientBtn');
- enable('advancedSearchBtn');
- jQuery('#advanced-search :input').each( function( idx, item ){
- enable(this.id);
+ $.getJSON( 'loadReportProgramStages.action',
+ {
+ programId: getFieldValue('programIdAddPatient')
+ }, function( json )
+ {
+ clearListById('programStageAddPatient');
+ $('#programStageAddPatient').append("<option value=''>" + i18n_please_select_program_stage + "</option>");
+ for ( i in json.programStages )
+ {
+ $('#programStageAddPatient').append("<option value='" + json.programStages[i].id + "'>" + json.programStages[i].name + "</option>");
+ }
+ enable('listPatientBtn');
+ enable('addPatientBtn');
+ enable('advancedSearchBtn');
+ jQuery('#advanced-search :input').each( function( idx, item ){
+ enable(this.id);
+ });
+ jQuery('#programStageAddPatientTR [name=statusEvent]').attr("disabled", true);
});
- jQuery('#programStageAddPatientTR [name=statusEvent]').attr("disabled", true);
}
else
{
- disable('listPatientBtn');
- disable('addPatientBtn');
- disable('advancedSearchBtn');
- jQuery('#advanced-search :input').each( function( idx, item ){
- disable(this.id);
- });
+
+
+ disable('listPatientBtn');
+ disable('addPatientBtn');
+ disable('advancedSearchBtn');
+ jQuery('#advanced-search :input').each( function( idx, item ){
+ disable(this.id);
+ });
+
}
}
function enableRadioButton( programId )
{
- var prorgamStageId = jQuery('#programStageAddPatientTR [id=programStageAddPatient_' + programId + ']').val();
+ var prorgamStageId = jQuery('#programStageAddPatient').val();
if( prorgamStageId== ''){
jQuery('#programStageAddPatientTR [name=statusEvent]').attr("disabled", true);
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js 2012-08-17 06:42:32 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js 2012-08-17 09:17:56 +0000
@@ -4,6 +4,7 @@
hideById("listPatientDiv");
clearListById('programIdAddPatient');
$('#contentDataRecord').html('');
+ setFieldValue('orgunitName', orgUnitNames[0]);
jQuery.get("getPrograms.action",{},
function(json)
{
=== 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 2012-08-16 16:31:03 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm 2012-08-17 09:17:56 +0000
@@ -29,19 +29,14 @@
<div id='advanced-search' class='hidden'>
<table id='advancedSearchTB'>
<thead>
- <tr id='programStageAddPatientTR' class='hidden'>
+ <tr id='programStageAddPatientTR'>
<td>
- <select id='programStageAddPatient_' name='programStageAddPatient' disabled>
- <option value=''>[$i18n.getString('please_select_program_stage')]</option>
+ <select id='programStageAddPatient' name='programStageAddPatient' onchange='enableRadioButton();'>
+ <option value=''>[$i18n.getString('')]</option>
+ #foreach($programStage in $program.programStages)
+ <option value="$programStage.id">$programStage.name</option>
+ #end
</select>
- #foreach($program in $programs)
- <select id='programStageAddPatient_$program.id' name='programStageAddPatient' onchange='enableRadioButton($program.id);' class='hidden'>
- <option value=''>[$i18n.getString('please_select_program_stage')]</option>
- #foreach($programStage in $program.programStages)
- <option value="$programStage.id">$programStage.name</option>
- #end
- </select>
- #end
</td>
<td colspan='2'>
<input type="radio" disabled id="statusEvent" name="statusEvent" value='1' checked> $i18n.getString("completed")
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/smsPatientRecords.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/smsPatientRecords.vm 2012-08-16 13:46:23 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/smsPatientRecords.vm 2012-08-17 09:17:56 +0000
@@ -96,7 +96,7 @@
#if($!listAll)
#else
var programId = jQuery("#programIdAddPatient").val();
- var programStageId = jQuery("#programStageAddPatientTR [id=programStageAddPatient_" + programId + "]").val();
+ var programStageId = jQuery("#programStageAddPatient").val();
var status = jQuery('#programStageAddPatientTR [id=statusEvent]:checked').val();
jQuery("#patientList [programStageId=" + programStageId + "][status=" + status + "]" ).addClass("stage-object-selected");
#end
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/smsReminderSelect.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/smsReminderSelect.vm 2012-08-17 06:42:32 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/smsReminderSelect.vm 2012-08-17 09:17:56 +0000
@@ -49,6 +49,6 @@
var i18n_specify_search_criteria = '$encoder.jsEscape( $i18n.getString( "specify_search_criteria" ) , "'")';
var i18n_color_quick_help = '$encoder.jsEscape( $i18n.getString( "color_quick_help" ) , "'")';
var i18n_patient_details_and_history = '$encoder.jsEscape( $i18n.getString( "patient_details_and_history" ) , "'")';
-
+ var i18n_please_select_program_stage = '[' + '$encoder.jsEscape( $i18n.getString( "please_select_program_stage" ) , "'")' + ']';
var searchTextBox = '<input type="text" id="searchText" name="searchText">';
</script>