← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6389: (patient) Add a option to show/hide incident-date field.

 

------------------------------------------------------------
revno: 6389
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-03-27 14:20:28 +0700
message:
  (patient) Add a option to show/hide incident-date field.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java
  dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ProgramEnrollmentAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SaveProgramEnrollmentAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml
  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/dataEntryForm.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentForm.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentSelectForm.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonProgram.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/javascript/addProgramForm.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/updateProgramForm.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programList.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-api/src/main/java/org/hisp/dhis/program/Program.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java	2012-02-27 01:07:19 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java	2012-03-27 07:20:28 +0000
@@ -79,6 +79,8 @@
 
     private Boolean displayProvidedOtherFacility;
 
+    private Boolean hideDateOfIncident;
+
     // -------------------------------------------------------------------------
     // Constructors
     // -------------------------------------------------------------------------
@@ -139,7 +141,7 @@
     {
         this.displayProvidedOtherFacility = displayProvidedOtherFacility;
     }
-    
+
     public String getDescription()
     {
         return description;
@@ -230,6 +232,16 @@
         this.dateOfIncidentDescription = dateOfIncidentDescription;
     }
 
+    public Boolean getHideDateOfIncident()
+    {
+        return hideDateOfIncident;
+    }
+
+    public void setHideDateOfIncident( Boolean hideDateOfIncident )
+    {
+        this.hideDateOfIncident = hideDateOfIncident;
+    }
+
     public Set<ValidationCriteria> getPatientValidationCriteria()
     {
         return patientValidationCriteria;

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java	2012-03-23 05:58:50 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java	2012-03-27 07:20:28 +0000
@@ -82,6 +82,9 @@
         executeSql( "ALTER TABLE patientdatavaluearchive DROP COLUMN storedby" );  
         executeSql( "DROP TABLE patientchart" ); 
         executeSql( "DROP TABLE patientchart" ); 
+        
+        executeSql( "UPDATE program set hideDateOfIncident=false WHERE hideDateOfIncident is null" );
+
     }
 
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml	2012-02-27 01:07:19 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml	2012-03-27 07:20:28 +0000
@@ -45,5 +45,7 @@
     
     <property name="displayProvidedOtherFacility" />
     
+    <property name="hideDateOfIncident" />
+    
   </class>
 </hibernate-mapping>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ProgramEnrollmentAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ProgramEnrollmentAction.java	2012-03-27 01:29:30 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ProgramEnrollmentAction.java	2012-03-27 07:20:28 +0000
@@ -259,7 +259,7 @@
             noGroupAttributes = patientAttributeService.getPatientAttributes( program, null );
 
             Collection<PatientAttributeValue> patientAttributeValues = patientAttributeValueService
-                .getPatientAttributeValues( patient, program );
+                .getPatientAttributeValues( patient );
 
             for ( PatientAttributeValue patientAttributeValue : patientAttributeValues )
             {

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SaveProgramEnrollmentAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SaveProgramEnrollmentAction.java	2012-03-27 01:29:30 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SaveProgramEnrollmentAction.java	2012-03-27 07:20:28 +0000
@@ -251,6 +251,11 @@
 
         program = programService.getProgram( programId );
 
+        if( dateOfIncident == null )
+        {
+            dateOfIncident = enrollmentDate;
+        }
+        
         Collection<ProgramInstance> programInstances = programInstanceService.getProgramInstances( patient, program,
             false );
 
@@ -311,19 +316,22 @@
             }
         }
 
-        // ---------------------------------------------------------------------
+     // ---------------------------------------------------------------------
         // Load identifier types of the selected program
         // ---------------------------------------------------------------------
 
         identifierTypes = identifierTypeService.getPatientIdentifierTypes( program );
         identiferMap = new HashMap<Integer, String>();
 
-        Collection<PatientIdentifier> patientIdentifiers = patientIdentifierService.getPatientIdentifiers(
-            identifierTypes, patient );
-
-        for ( PatientIdentifier identifier : patientIdentifiers )
+        if ( identifierTypes != null && identifierTypes.size() > 0 )
         {
-            identiferMap.put( identifier.getIdentifierType().getId(), identifier.getIdentifier() );
+            Collection<PatientIdentifier> patientIdentifiers = patientIdentifierService.getPatientIdentifiers(
+                identifierTypes, patient );
+
+            for ( PatientIdentifier identifier : patientIdentifiers )
+            {
+                identiferMap.put( identifier.getIdentifierType().getId(), identifier.getIdentifier() );
+            }
         }
 
         // ---------------------------------------------------------------------
@@ -337,7 +345,7 @@
         noGroupAttributes = patientAttributeService.getPatientAttributes( program, null );
 
         Collection<PatientAttributeValue> patientAttributeValues = patientAttributeValueService
-            .getPatientAttributeValues( patient, program );
+            .getPatientAttributeValues( patient );
 
         for ( PatientAttributeValue patientAttributeValue : patientAttributeValues )
         {
@@ -353,6 +361,7 @@
                     patientAttributeValue.getValue() );
             }
         }
+        
         return SUCCESS;
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2012-03-27 01:29:30 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2012-03-27 07:20:28 +0000
@@ -622,13 +622,12 @@
 		<property name="patientService" ref="org.hisp.dhis.patient.PatientService" />
 		<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
 		<property name="programInstanceService" ref="org.hisp.dhis.program.ProgramInstanceService" />
-		<property name="programStageInstanceService"
-			ref="org.hisp.dhis.program.ProgramStageInstanceService" />
+		<property name="programStageInstanceService" ref="org.hisp.dhis.program.ProgramStageInstanceService" />
 		<property name="identifierTypeService" ref="org.hisp.dhis.patient.PatientIdentifierTypeService" />
 		<property name="patientIdentifierService" ref="org.hisp.dhis.patient.PatientIdentifierService" />
-		<property name="patientAttributeValueService" ref=" org.hisp.dhis.patientattributevalue.PatientAttributeValueService" />
 		<property name="patientAttributeService" ref="org.hisp.dhis.patient.PatientAttributeService" />
-		<property name="patientAttributeOptionService" ref="org.hisp.dhis.patient.PatientAttributeOptionService" />
+		<property name="patientAttributeGroupService" ref="org.hisp.dhis.patient.PatientAttributeGroupService" />
+		<property name="patientAttributeValueService" ref="org.hisp.dhis.patientattributevalue.PatientAttributeValueService" />
 	</bean>
 
 	<bean id="org.hisp.dhis.caseentry.action.patient.SaveDueDateAction"

=== 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	2012-03-27 04:22:51 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2012-03-27 07:20:28 +0000
@@ -288,4 +288,5 @@
 orgunit_hiererachy_included_on = Organisation unit hiererachy included on
 level = Level
 patient_identifier_and_attributes = Beneficiary identifier and attributes
-please_fill_out_only_one_of_these_fields = Please fill out at only one of these fields.
\ No newline at end of file
+please_fill_out_only_one_of_these_fields = Please fill out at only one of these fields.
+age_year = Age year
\ No newline at end of file

=== 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-03-26 06:36:24 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm	2012-03-27 07:20:28 +0000
@@ -27,10 +27,7 @@
 			enable('executionDate');
 		}
 		
-		//initCustomCheckboxes();
-			
 		entryFormContainerOnReady();
-			
 	});
 </script>
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js	2012-03-27 01:29:30 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js	2012-03-27 07:20:28 +0000
@@ -477,6 +477,7 @@
 		}, function()
 		{
 			showById('enrollmentDiv');
+			
 			jQuery('#loaderDiv').hide();
 		});
 }
@@ -530,6 +531,17 @@
 				showById('dateOfIncidentTD');
 			}
 			
+			var hideDateOfIncident = jQuery('#programEnrollmentSelectDiv [name=programId] option:selected').attr('hidedateofincident');
+				
+			if( hideDateOfIncident=='true')
+			{
+				hideById( 'dateOfIncidentTR');
+			}
+			else
+			{
+				showById( 'dateOfIncidentTR');
+			}
+			
 			jQuery('#loaderDiv').hide();
 		});
 }

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm	2012-03-27 04:22:51 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm	2012-03-27 07:20:28 +0000
@@ -45,7 +45,7 @@
 	<td class="input-column">		
 		<input type="text" id="birthDate" name="birthDate" style='width:168px' />
 		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$i18n.getString( "verified" ) <input type='checkbox' id='verified' name='verified' onchange='verifiedOnchange();' value='true' checked >
-		$i18n.getString( "age" ) <input type="text" id="age" name="age" class="{validate:{number:true}}"  style="width:50px" disabled />
+		$i18n.getString( "age_year" ) <input type="text" id="age" name="age" class="{validate:{number:true}}"  style="width:50px" disabled />
 	</td>
    <td></td>
 </tr>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentForm.vm	2012-03-27 01:29:30 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentForm.vm	2012-03-27 07:20:28 +0000
@@ -20,7 +20,7 @@
 			<tr #alternate( $mark )>
 				<td class='text-column'><label>$identifierType.name #if($identifierType.mandatory == true )<em title="$i18n.getString( 'required' )" class="required">*</em> #end</label></td>       
 					<td class="input-column">
-					<input type="text" id="iden$identifierType.id" name="iden$identifierType.id" value='$identifier' class="{validate:{required:$identifierType.mandatory, #if($!identifierType.noChars) maxlength:$identifierType.noChars, #end #if($identifierType.type=='number') number:true #elseif($!identifierType.type=='letter') lettersonly:true #end }}" onchange='savePatientIdentifier( $identifierType.id, this);' onkeypress="return keyPress(event, this)" tabindex="$tabIndex" /></td>
+					<input type="text" id="iden$identifierType.id" name="iden$identifierType.id" value='$!identifier' class="{validate:{required:$identifierType.mandatory, #if($!identifierType.noChars) maxlength:$identifierType.noChars, #end #if($identifierType.type=='number') number:true #elseif($!identifierType.type=='letter') lettersonly:true #end }}" onchange='savePatientIdentifier( $identifierType.id, this);' onkeypress="return keyPress(event, this)" tabindex="$tabIndex" /></td>
 			</tr>
 			#set( $tabIndex = $tabIndex + 1 )
 			#set( $mark = !$mark  )

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentSelectForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentSelectForm.vm	2012-03-27 01:29:30 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentSelectForm.vm	2012-03-27 07:20:28 +0000
@@ -49,7 +49,7 @@
 						<select id="programId" name="programId" onchange="showProgramEnrollmentForm('$patient.id', this.value);" >
 							<option value="0">[$i18n.getString( "select" )]</option>
 							#foreach( $program in $programs )
-								<option value="$program.id" singleevent='$program.singleEvent'>$encoder.htmlEncode( $program.name )</option>
+								<option value="$program.id" singleevent='$program.singleEvent' hideDateOfIncident='$program.hideDateOfIncident'>$encoder.htmlEncode( $program.name )</option>
 							#end
 						</select>
 					</td>
@@ -60,10 +60,12 @@
 					<td class='text-column'><label for="enrollmentDate"><span id='enrollmentDateDescription'></span><em title="$i18n.getString( "required" )" class="required"> * </em></label></td>
                     <td colspan='2' class='input-column'><input type="text" id="enrollmentDate" name="enrollmentDate" disabled="disabled" class="{validate:{required:true}}"></td>
 				</tr>
-				<tr id='dateOfIncidentTR' class='hidden'>
+				
+				<tr id='dateOfIncidentTR' style='display:none'>
 					<td class='text-column'><label for="dateOfIncident"><span id='dateOfIncidentDescription'></span><em title="$i18n.getString( "required" )" class="required"> * </em></label></td>
 					<td colspan='2' class='input-column'><input type="text" id="dateOfIncident" name="dateOfIncident" disabled="disabled" class="{validate:{required:true}}"></td>
 				</tr>
+			
 				<tr>
 					<td></td>
 					<td></td>   

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm	2012-03-27 04:22:51 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm	2012-03-27 07:20:28 +0000
@@ -99,7 +99,7 @@
 		<td class="input-column" >
 			<input type="text" id="birthDate" name="birthDate" value="$format.formatDate( $!patient.birthDate )" style='width:168px' >
 			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$i18n.getString( "verified" ) <input type='checkbox' id='verified' name='verified' onchange='verifiedOnchange();' #if($patient.dobType=='V') checked #end >
-			$i18n.getString( "age" )<input type="text" id="age" name="age" class="{validate:{number:true, alphanumeric: true}}" style="width:50px" #if($patient.dobType!='V') disable #end >
+			$i18n.getString( "age_year" )<input type="text" id="age" name="age" class="{validate:{number:true, alphanumeric: true}}" style="width:50px" #if($patient.dobType!='V') disable #end >
 		</td>
 	</tr>
 	

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonProgram.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonProgram.vm	2012-02-13 02:41:24 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonProgram.vm	2012-03-27 07:20:28 +0000
@@ -9,6 +9,7 @@
 	"dateOfEnrollmentDescription": "$!encoder.jsEncode( ${program.dateOfEnrollmentDescription} )",
 	"dateOfIncidentDescription": "$!encoder.jsEncode( ${program.dateOfIncidentDescription} )",
 	"programStageCount": "${program.programStages.size()}",
-	"maxDay": "${program.maxDaysAllowedInputData}"
+	"maxDay": "${program.maxDaysAllowedInputData}",
+	"hideDateOfIncident": "${program.hideDateOfIncident}"
   }
 }
\ No newline at end of file

=== 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-03-01 07:44:57 +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-27 07:20:28 +0000
@@ -132,6 +132,13 @@
         this.displayProvidedOtherFacility = displayProvidedOtherFacility;
     }
 
+    private Boolean hideDateOfIncident;
+
+    public void setHideDateOfIncident( Boolean hideDateOfIncident )
+    {
+        this.hideDateOfIncident = hideDateOfIncident;
+    }
+
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -142,7 +149,8 @@
         singleEvent = (singleEvent == null) ? false : singleEvent;
         anonymous = (anonymous == null) ? false : anonymous;
         displayProvidedOtherFacility = (displayProvidedOtherFacility == null) ? true : displayProvidedOtherFacility;
-        
+        hideDateOfIncident = (hideDateOfIncident == null) ? false : displayProvidedOtherFacility;
+
         Program program = new Program();
 
         program.setName( name );
@@ -154,7 +162,8 @@
         program.setSingleEvent( singleEvent );
         program.setAnonymous( anonymous );
         program.setDisplayProvidedOtherFacility( displayProvidedOtherFacility );
-
+        program.setHideDateOfIncident( hideDateOfIncident );
+        
         programService.saveProgram( program );
 
         if ( singleEvent )

=== 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-03-01 07:44:57 +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-27 07:20:28 +0000
@@ -129,6 +129,13 @@
         this.displayProvidedOtherFacility = displayProvidedOtherFacility;
     }
 
+    private Boolean hideDateOfIncident;
+
+    public void setHideDateOfIncident( Boolean hideDateOfIncident )
+    {
+        this.hideDateOfIncident = hideDateOfIncident;
+    }
+
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -139,6 +146,7 @@
         singleEvent = (singleEvent == null) ? false : singleEvent;
         anonymous = (anonymous == null) ? false : anonymous;
         displayProvidedOtherFacility = (displayProvidedOtherFacility == null) ? true : displayProvidedOtherFacility;
+        hideDateOfIncident = (hideDateOfIncident == null) ? false : hideDateOfIncident;
 
         Program program = programService.getProgram( id );
         program.setName( name );
@@ -150,6 +158,7 @@
         program.setSingleEvent( singleEvent );
         program.setAnonymous( anonymous );
         program.setDisplayProvidedOtherFacility( displayProvidedOtherFacility );
+        program.setHideDateOfIncident( hideDateOfIncident );
 
         programService.updateProgram( program );
 

=== 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-03-21 05:07:15 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties	2012-03-27 07:20:28 +0000
@@ -253,4 +253,5 @@
 patient_org_unit_registration=Beneficiary Org Unit Registration
 dataset= Dataset
 filter_by_data_set = Filter by dataset
-show_all_item = Show All Items
\ No newline at end of file
+show_all_item = Show All Items
+hide_date_of_incident = Hide date of incident
\ 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-03-19 09:35:42 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm	2012-03-27 07:20:28 +0000
@@ -43,6 +43,12 @@
 		</tr>
 		
 		<tr>
+			<td><label>$i18n.getString( "hide_date_of_incident" )</label></td>
+			<td><input type="checkbox" id="hideDateOfIncident" name="hideDateOfIncident" value='true' onchange='hideIncidentDateOnchange();'></td>
+			<td></td>
+		</tr>
+		
+		<tr>
 			<td><label>$i18n.getString( "date_of_enrollment_description" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
 			<td><input type="text" id="dateOfEnrollmentDescription" name="dateOfEnrollmentDescription" class="{validate:{required:true,minlength:4}}"></td>
 			<td></td>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/addProgramForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/addProgramForm.js	2012-03-19 09:35:42 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/addProgramForm.js	2012-03-27 07:20:28 +0000
@@ -1,6 +1,7 @@
 jQuery(document).ready(	function(){
 	validation( 'addProgramForm', function( form ){		
 		enable('dateOfEnrollmentDescription');
+		enable('dateOfIncidentDescription');
 		form.submit();
 	});				
 	

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js	2012-03-13 09:47:39 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js	2012-03-27 07:20:28 +0000
@@ -23,7 +23,10 @@
 		setInnerHTML( 'dateOfIncidentDescriptionField', json.program.dateOfIncidentDescription );   		
 		setInnerHTML( 'programStageCountField',  json.program.programStageCount );
 		setInnerHTML( 'maxDaysFromStartField',  json.program.maxDay );
-   
+		
+		var hideIncidentDateField = ( json.program.hideDateOfIncident == 'true') ? i18n_yes : i18n_no;
+		setInnerHTML( 'hideIncidentDateField',  hideIncidentDateField );
+		
 		showDetails();
 	});   
 }
@@ -54,3 +57,17 @@
 	}
 }
 
+function hideIncidentDateOnchange()
+{
+	var checked = byId( 'hideDateOfIncident' ).checked;
+	
+	if( checked)
+	{
+		disable( 'dateOfIncidentDescription' );
+	}
+	else
+	{
+		enable( 'dateOfIncidentDescription' );
+	}
+}
+

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/updateProgramForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/updateProgramForm.js	2012-03-19 09:35:42 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/updateProgramForm.js	2012-03-27 07:20:28 +0000
@@ -1,7 +1,7 @@
 jQuery(document).ready(	function(){
-
 	validation( 'updateProgramForm', function( form ){ 
 		enable('dateOfEnrollmentDescription');
+		enable('dateOfIncidentDescription');
 		form.submit();			
 	});	
 	

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programList.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programList.vm	2012-03-23 05:58:50 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programList.vm	2012-03-27 07:20:28 +0000
@@ -54,6 +54,7 @@
 				<p><label class="bold">$i18n.getString( "date_of_incident_description" ):</label><br><span id="dateOfIncidentDescriptionField"></span></p>				
 				<p><label class="bold">$i18n.getString( "stage_in_program" ):</label><br><span id="programStageCountField"></span></p>
 				<p><label class="bold">$i18n.getString( "max_days_from_start" ):</label><br><span id="maxDaysFromStartField"></span></p>
+				<p><label class="bold">$i18n.getString( "hide_date_of_incident" ):</label><br><span id="hideIncidentDateField"></span></p>
 			</div>
 
 		</td>

=== 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-03-19 09:35:42 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm	2012-03-27 07:20:28 +0000
@@ -2,7 +2,7 @@
 
 <h3>$i18n.getString( "edit_program" )</h3>
 
-<form id="updateProgramForm" name="updateProgramForm" action="updateProgram.action" method="post" >
+<form id="updateProgramForm" name="updateProgramForm" action="updateProgram.action" method="get" >
   <input type="hidden" id="id" name="id" value="$program.id">
   
   <table id="detailsList">
@@ -42,6 +42,12 @@
 	</tr>
 		
 	<tr>
+		<td><label>$i18n.getString( "hide_date_of_incident" )</label></td>
+		<td><input type="checkbox" id="hideDateOfIncident" name="hideDateOfIncident" value='true' onchange='hideIncidentDateOnchange();' #if( $program.hideDateOfIncident=='true' ) checked #end ></td>
+		<td></td>
+	</tr>
+	
+	<tr>
 		<td><label>$i18n.getString( "version" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
 		<td><input type="text" id="version" name="version" value="$program.version" class="{validate:{required:true,number:true}}"></td>
 		<td></td>
@@ -53,7 +59,7 @@
 	</tr>	
 	<tr>
 		<td><label>$i18n.getString( "date_of_incident_description" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
-		<td><input type="text" id="dateOfIncidentDescription" name="dateOfIncidentDescription" value="$!program.dateOfIncidentDescription" class="{validate:{required:true,minlength:4}}"></td>
+		<td><input type="text" id="dateOfIncidentDescription" name="dateOfIncidentDescription" value="$!program.dateOfIncidentDescription" class="{validate:{required:true,minlength:4}}" #if( $program.hideDateOfIncident=='true' ) disabled #end ></td>
 		<td></td>
 	</tr>