← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5951: (patient) Don't hide Provided Elsewhere column with anonymous program.

 

------------------------------------------------------------
revno: 5951
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-03-01 14:44:57 +0700
message:
  (patient) Don't hide Provided Elsewhere column with anonymous program. 
modified:
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramDataEntryService.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/AddProgramAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/UpdateProgramAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.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-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramDataEntryService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramDataEntryService.java	2012-02-13 07:42:56 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramDataEntryService.java	2012-03-01 07:44:57 +0000
@@ -728,28 +728,9 @@
                 
                 if ( dataElement.getOptionSet() != null )
                 {
-
                    appendCode += jsCodeForOptions;
                    
                    appendCode = appendCode.replace( "$OPTIONS", dataElement.getOptionSet().getOptions().toString() ); 
- 
-                    /*appendCode = appendCode.replaceFirst( "input", "select options='true'" );
-                    appendCode = appendCode.replace( "name=\"entryfield\"", jsCodeForInputs );
-
-                    appendCode += ">";
-                    appendCode += "<option value=\"\">" + i18n.getString( "select_value" ) + "</option>";
-                    for ( String option :  )
-                    {
-                        appendCode += "<option value=\"" + option + "\">" + option + "</option>";
-                    }
-
-                    if ( patientDataValue != null )
-                    {
-                        appendCode = appendCode.replace( "<option value=\"" + patientDataValue.getValue() + "\">",
-                            "<option value=\"" + patientDataValue.getValue() + "\" selected=\"selected\">" );
-                    }
-
-                    appendCode += "</select>";*/
                 }
                 else
                 {
@@ -1096,7 +1077,8 @@
     private String addProvidedByOtherFacilityCheckbox( String appendCode, PatientDataValue patientDataValue,
         ProgramStage programStage )
     {
-        appendCode += "<label style=\"display:$DISPLAY;\" for=\"$PROGRAMSTAGEID_$DATAELEMENTID_facility\" title=\"is provided by another Facility ?\" ></label><input name=\"providedByAnotherFacility\"  title=\"is provided by another Facility ?\"  id=\"$PROGRAMSTAGEID_$DATAELEMENTID_facility\"  type=\"checkbox\" ";
+        appendCode += "<label style=\"display:$DISPLAY;\" for=\"$PROGRAMSTAGEID_$DATAELEMENTID_facility\" title=\"is provided by another Facility ?\" >" +
+        		"<input name=\"providedByAnotherFacility\"  title=\"is provided by another Facility ?\"  id=\"$PROGRAMSTAGEID_$DATAELEMENTID_facility\"  type=\"checkbox\" ";
 
         if ( patientDataValue != null && patientDataValue.isProvidedByAnotherFacility() )
         {
@@ -1104,8 +1086,9 @@
         }
         appendCode += "onChange=\"updateProvidingFacility( $DATAELEMENTID, this )\"  >";
 
-        String display = (programStage.getProgram().getDisplayProvidedOtherFacility() ) ? "none" : "block";
+        String display = (programStage.getProgram().getDisplayProvidedOtherFacility() ) ? "block" : "none";
         appendCode = appendCode.replace( "$DISPLAY", display );
+        appendCode += "</label>";
 
         return appendCode;
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm	2012-02-13 07:42:56 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm	2012-03-01 07:44:57 +0000
@@ -55,14 +55,14 @@
 			<col id="noCol">
 			<col id="deCol">    
 			<col id="entryCol">
-			#if( $programStageInstance.programInstance.program.displayProvidedOtherFacility == 'false' )
+			#if( $programStageInstance.programInstance.program.displayProvidedOtherFacility == 'true' )
 			<col id="facilityCol">       
 			#end
 			<tr>
 				<th>$i18n.getString( "nr" )</th>
 				<th>$i18n.getString( "data_element" )</th>                   
 				<th>$i18n.getString( "entry" )</th>
-				#if( $programStageInstance.programInstance.program.displayProvidedOtherFacility == 'false' )
+				#if( $programStageInstance.programInstance.program.displayProvidedOtherFacility == 'true' )
 					<th>$i18n.getString( "provided_elsewhere" )</th>             
 				#end
 			</tr>
@@ -115,7 +115,7 @@
 				
 				##providedByAnotherFacility 
 				#set( $id = $programStageDataElement.programStage.id + '_' + $programStageDataElement.dataElement.id + '_facility' )
-				#if($programStageInstance.programInstance.program.displayProvidedOtherFacility == 'false') 					
+				#if($programStageInstance.programInstance.program.displayProvidedOtherFacility == 'true') 					
 				<td>   
 					#if ( $patientDataValue.value )        
 						#if( !$patientDataValue.providedByAnotherFacility )

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/AddProgramAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/AddProgramAction.java	2012-02-13 02:41:24 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/AddProgramAction.java	2012-03-01 07:44:57 +0000
@@ -141,7 +141,7 @@
     {
         singleEvent = (singleEvent == null) ? false : singleEvent;
         anonymous = (anonymous == null) ? false : anonymous;
-        displayProvidedOtherFacility = (displayProvidedOtherFacility == null) ? false : displayProvidedOtherFacility;
+        displayProvidedOtherFacility = (displayProvidedOtherFacility == null) ? true : displayProvidedOtherFacility;
         
         Program program = new Program();
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/UpdateProgramAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/UpdateProgramAction.java	2012-02-13 02:41:24 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/UpdateProgramAction.java	2012-03-01 07:44:57 +0000
@@ -138,7 +138,7 @@
     {
         singleEvent = (singleEvent == null) ? false : singleEvent;
         anonymous = (anonymous == null) ? false : anonymous;
-        displayProvidedOtherFacility = (displayProvidedOtherFacility == null) ? false : displayProvidedOtherFacility;
+        displayProvidedOtherFacility = (displayProvidedOtherFacility == null) ? true : displayProvidedOtherFacility;
 
         Program program = programService.getProgram( id );
         program.setName( name );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties	2012-02-14 03:26:52 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties	2012-03-01 07:44:57 +0000
@@ -401,5 +401,5 @@
 condition = Condition
 no_date_data_element_in_selected_program_stage = No data elements with date-type in the selected program stage
 shown_on_reports = Shown on reports 
-display_provided_other_facility = Display provided other facility
+hide_provided_other_facility = Hide provided other facility
 suggested_values = Suggested values
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm	2012-02-13 02:41:24 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm	2012-03-01 07:44:57 +0000
@@ -46,8 +46,8 @@
 		</tr>
 		
 		<tr>
-			<td><label>$i18n.getString( "display_provided_other_facility" )</label></td>
-			<td><input type="checkbox" id="displayProvidedOtherFacility" name="displayProvidedOtherFacility" value='true'></td>
+			<td><label>$i18n.getString( "hide_provided_other_facility" )</label></td>
+			<td><input type="checkbox" id="displayProvidedOtherFacility" name="displayProvidedOtherFacility" value='false'></td>
 			<td></td>
 		</tr>
 		

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm	2012-02-13 02:41:24 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm	2012-03-01 07:44:57 +0000
@@ -50,8 +50,8 @@
 	 </tr>
 		
 	<tr>
-		<td><label>$i18n.getString( "display_provided_other_facility" )</label></td>
-		<td><input type="checkbox" id="displayProvidedOtherFacility" name="displayProvidedOtherFacility" value='true' #if( $program.displayProvidedOtherFacility=='true' ) checked #end ></td>
+		<td><label>$i18n.getString( "hide_provided_other_facility" )</label></td>
+		<td><input type="checkbox" id="displayProvidedOtherFacility" name="displayProvidedOtherFacility" value='false' #if( $program.displayProvidedOtherFacility=='false' ) checked #end ></td>
 		<td></td>
 	</tr>