← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1558: Fix bugs and change some css attributes.

 

------------------------------------------------------------
revno: 1558
committer: Viet <Viet@Viet-Laptop>
branch nick: trunk
timestamp: Fri 2010-03-05 11:54:12 +0530
message:
  Fix bugs and change some css attributes.
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/SearchPersonAction.java
  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/javascript/patient.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/underage.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/underAgeForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttibuteForm.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-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/SearchPersonAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/SearchPersonAction.java	2010-03-03 11:02:53 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/SearchPersonAction.java	2010-03-05 06:24:12 +0000
@@ -63,7 +63,7 @@
     
     private Integer attributeId;
     
-    private String value;
+    private String searchValue;
     
     // -------------------------------------------------------------------------
     // Output
@@ -80,24 +80,28 @@
     public String execute()
         throws Exception
     {
-        patients =  patientService.searchPatient( identifierTypeId, attributeId, value );
-        
-        for ( Patient p : patients )
+        patients =  patientService.searchPatient( identifierTypeId, attributeId, searchValue );
+        
+        
+        
+        
+        if( patients != null && patients.size() > 0 )
         {
-            Collection<PatientAttributeValue> patientAttributeValues = patientAttributeValueService
-                .getPatientAttributeValues( p );
-            
-            for ( PatientAttributeValue patientAttributeValue : patientAttributeValues )
+            for ( Patient p : patients )
             {
-                patientAttributeValueMap
-                    .put( p.getId() + "_" + patientAttributeValue.getPatientAttribute().getId(),
-                        patientAttributeValue.getValue() );
+                Collection<PatientAttributeValue> patientAttributeValues = patientAttributeValueService
+                    .getPatientAttributeValues( p );
+                
+                for ( PatientAttributeValue patientAttributeValue : patientAttributeValues )
+                {
+                    patientAttributeValueMap
+                        .put( p.getId() + "_" + patientAttributeValue.getPatientAttribute().getId(),
+                            patientAttributeValue.getValue() );
+                }
             }
-        }
-        
+        }        
         return SUCCESS;
     }
-    
 
     // -------------------------------------------------------------------------
     // Getter/Setter
@@ -113,11 +117,6 @@
         this.attributeId = attributeId;
     }
 
-    public void setValue( String value )
-    {
-        this.value = value;
-    }
-
     public void setPatientService( PatientService patientService )
     {
         this.patientService = patientService;
@@ -128,17 +127,21 @@
         return patients;
     }
 
-
     public Map<String, String> getPatientAttributeValueMap()
     {
         return patientAttributeValueMap;
     }
 
-
     public void setPatientAttributeValueService( PatientAttributeValueService patientAttributeValueService )
     {
         this.patientAttributeValueService = patientAttributeValueService;
     }
 
 
+    public void setSearchValue( String searchValue )
+    {
+        this.searchValue = searchValue;
+    }
+
+
 }

=== 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	2009-10-24 09:32:01 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/AddProgramAction.java	2010-03-05 06:24:12 +0000
@@ -66,7 +66,29 @@
     public void setDescription( String description )
     {
         this.description = description;
-    }    
+    }   
+    
+    /**
+     * Description of Date of Enrollment
+     * This description is differ from each program
+     */
+    private String dateOfEnrollmentDescription;
+ 
+    public void setDateOfEnrollmentDescription( String dateOfEnrollmentDescription )
+    {
+        this.dateOfEnrollmentDescription = dateOfEnrollmentDescription;
+    }
+    
+    /**
+     * Description of Date of Incident
+     * This description is differ from each program
+     */
+    private String dateOfIncidentDescription;
+    
+    public void setDateOfIncidentDescription( String dateOfIncidentDescription )
+    {
+        this.dateOfIncidentDescription = dateOfIncidentDescription;
+    }
 
     // -------------------------------------------------------------------------
     // Action implementation
@@ -80,6 +102,8 @@
                 
         program.setName( nameField );
         program.setDescription( description );
+        program.setDateOfEnrollmentDescription( dateOfEnrollmentDescription );
+        program.setDateOfIncidentDescription( dateOfIncidentDescription );
         
 
         programService.saveProgram( 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	2009-10-24 09:32:01 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/UpdateProgramAction.java	2010-03-05 06:24:12 +0000
@@ -75,6 +75,27 @@
         this.description = description;
     }    
 
+    /**
+     * Description of Date of Enrollment
+     * This description is differ from each program
+     */
+    private String dateOfEnrollmentDescription;
+ 
+    public void setDateOfEnrollmentDescription( String dateOfEnrollmentDescription )
+    {
+        this.dateOfEnrollmentDescription = dateOfEnrollmentDescription;
+    }
+    
+    /**
+     * Description of Date of Incident
+     * This description is differ from each program
+     */
+    private String dateOfIncidentDescription;
+    
+    public void setDateOfIncidentDescription( String dateOfIncidentDescription )
+    {
+        this.dateOfIncidentDescription = dateOfIncidentDescription;
+    }
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -86,6 +107,8 @@
             
         program.setName( nameField );
         program.setDescription( description );
+        program.setDateOfEnrollmentDescription( dateOfEnrollmentDescription );
+        program.setDateOfIncidentDescription( dateOfIncidentDescription );
 
         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	2010-03-03 11:02:53 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties	2010-03-05 06:24:12 +0000
@@ -373,4 +373,7 @@
 add_person_successfully = Add Person successfully
 please_select_relationshipType = Please select Relationship type
 please_choose_representative_for_this_under_age_patient = Please chose representative for this under age patient
-please_choose_relationshipType_for_this_under_age_patient = Please choose relationship type for this under age patient
\ No newline at end of file
+please_choose_relationshipType_for_this_under_age_patient = Please choose relationship type for this under age patient
+dateOfEnrollmentDescription = Date of Enrollment description
+dateOfIncidentDescription = Date of Incident description
+child_representative = Child'sRepresentative
\ 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/javascript/patient.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patient.js	2010-03-04 11:51:40 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patient.js	2010-03-05 06:24:12 +0000
@@ -515,7 +515,7 @@
 /**
  * Show list patient duplicate  by jQuery thickbox plugin
  * @param rootElement : root element of the response xml
- * @param validate  :  is TRUE if this method is called in validation method  
+ * @param validate  :  is TRUE if this method is called from validation method  
  */
 function showListPatientDuplicate(rootElement, validate)
 {
@@ -564,6 +564,7 @@
 		tb_show( message, "#TB_inline?height=500&width=500&inlineId=hiddenModalContent", null);
 	}
 }
+
 function validatePatient()
 {
 	if( jQuery("#id").val() )
@@ -571,6 +572,12 @@
 	else validateAddPatient();
 }
 
+//  ------------------------------
+//  checked = TRUE  : show pop up
+//  ------------------------------
+//  checked = FALSE : find all identifier which is disabled, remove its value and enable it
+//  This happen when user chose a representative, but now they dont want this patient to be under age anymore
+//  TODO : if user created a new person, should we delete that person in this case ?
 function toggleUnderAge(this_)
 {
 	if( jQuery(this_).is(":checked"))

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/underage.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/underage.js	2010-03-03 11:02:53 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/underage.js	2010-03-05 06:24:12 +0000
@@ -1,5 +1,7 @@
-jQuery(document).ready(function(){
+jQuery(document).ready(function()
+{
 	jQuery("#tabs").tabs();
+	
 	jQuery("#searchForm").validate({
 		 meta:"validate"
 		,errorElement:"td"
@@ -13,6 +15,7 @@
 			,searchValue		:"required"
 		}
 	});
+	
 	jQuery("#addRepresentativeForm").validate({
 		 meta:"validate"
 		,errorElement:"td"
@@ -20,9 +23,26 @@
 						{
 							validateAddRepresentative();
 						}
+		,rules : {
+			birthDate :{required:true,dateISO:true,datelessthanequaltoday:true}
+		}
 	});
+	
 	jQuery.validator.loadLocaled( jQuery("#curLocaleCode").val() );
-	jQuery("#birthDate").rules("add",{required:true,dateISO:true,datelessthanequaltoday:true});
+	
+	// Esc key for jQuery thickbox
+	// jQuery thickbox already has this event
+	// but somehow it's over written by jQuery tabs plugin
+	document.onkeydown = function(e){ 	
+		if (e == null) { // ie
+			keycode = event.keyCode;
+		} else { // mozilla
+			keycode = e.which;
+		}
+		if(keycode == 27){ // close
+			window.parent.tb_remove();
+		}
+	}
 });
 
 
@@ -39,7 +59,6 @@
 		alert(i18n_please_select_relationshipType);
 	}
 	
-	
 	var params = 
 				'&firstName=' + getFieldValue( 'firstName' ) 
 				+'&middleName=' + getFieldValue( 'middleName' ) 
@@ -181,6 +200,7 @@
 	}
 }
 
+// Will be call after save new person successfully
 function autoChoosePerson(xmlElement)
 {
 	jQuery("#tab-2").html("<center><strong>"+i18n_add_person_successfully+"</strong></center>");
@@ -199,6 +219,7 @@
 	
 }
 
+// Set Representative information to parent page.
 function choosePerson(this_)
 {
 	

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/underAgeForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/underAgeForm.vm	2010-03-03 11:02:53 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/underAgeForm.vm	2010-03-05 06:24:12 +0000
@@ -3,6 +3,9 @@
 div#listPatients {font-size: 0.8em}
 div#listPatients label { font-weight: bold;}  
 div#listPatients td {padding: 2px 5px}
+div#popupHeader {text-align: center}
+span#popupHeaderText{position: relative;}
+span#popupHeaderText {left:0}
 </style>
 <!-- TAB Header -->
 <div id="tabs">
@@ -41,6 +44,7 @@
 		<td>$i18n.getString("identifier_type")</td>
 		<td>
 			<select name="identifierTypeId" id="identifierTypeId" >
+				<option value="">[$i18n.getString( "please_select" )]</option>       
 				#foreach($identifierType in $identifierTypes)
 					<option value="$identifierType.id">$identifierType.name</option>
 				#end
@@ -52,6 +56,7 @@
 		<td>$i18n.getString("attribute")</td>
 		<td>
 			<select name="attributeId" id="attributeId" >
+				<option value="">[$i18n.getString( "please_select" )]</option>       
 				#foreach($attribute in $attributes)
 					<option value="$attribute.id">$attribute.name</option>
 				#end

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttibuteForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttibuteForm.vm	2010-02-28 10:44:15 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttibuteForm.vm	2010-03-05 06:24:12 +0000
@@ -43,11 +43,11 @@
     <tbody>
       <tr>
         <td>$i18n.getString( "name" ) <em title="$i18n.getString( "required" )" class="required">*</em></td>
-        <td><input type="text" id="nameField" name="nameField" value="$encoder.htmlEncode( $patientAttribute.name )" style="width:30em" class="{validate:{required:true,rangelength:[4,35],alphanumeric:true}}"></td>
+        <td><input type="text" id="nameField" name="nameField" value="$encoder.htmlEncode( $patientAttribute.name )" style="width:30em" class="{validate:{required:true,rangelength:[2,35]}}"></td>
       </tr>   
       <tr>
         <td>$i18n.getString( "description" ) <em title="$i18n.getString( "required" )" class="required">*</em></td>
-        <td><input type="text" id="description" name="description" value="$encoder.htmlEncode( $patientAttribute.description )" style="width:30em" class="{validate:{required:true,minlength:4,alphanumeric:true}}"></td>
+        <td><input type="text" id="description" name="description" value="$encoder.htmlEncode( $patientAttribute.description )" style="width:30em" class="{validate:{required:true,minlength:2}}"></td>
       </tr>
       
       <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	2010-02-22 09:19:15 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm	2010-03-05 06:24:12 +0000
@@ -35,22 +35,22 @@
     <tbody>
       <tr>
 		<td><label>$i18n.getString( "name" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
-		<td><input type="text" id="nameField" name="nameField" value="$encoder.htmlEncode( $program.name )" style="width:30em" class="{validate:{required:true,rangelength:[4,35],alphanumeric:true}}"></td>
+		<td><input type="text" id="nameField" name="nameField" value="$encoder.htmlEncode( $program.name )" style="width:30em" class="{validate:{required:true,rangelength:[2,35]}}"></td>
 		<td></td>
 	  </tr>	  
       <tr>
 		<td><label>$i18n.getString( "description" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
-		<td><input type="text" id="description" name="description" value="$encoder.htmlEncode( $program.description )" style="width:30em" class="{validate:{required:true,minlength:4}}"></td>
+		<td><input type="text" id="description" name="description" value="$encoder.htmlEncode( $program.description )" style="width:30em" class="{validate:{required:true,minlength:2}}"></td>
 		<td></td>
 	  </tr>	
   	  <tr>
 		<td><label>$i18n.getString( "dateOfEnrollmentDescription" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
-		<td><input type="text" id="dateOfEnrollmentDescription" name="dateOfEnrollmentDescription"  value="$encoder.htmlEncode( $program.dateOfEnrollmentDescription )" style="width:30em" class="{validate:{required:true,minlength:4}}"></td>
+		<td><input type="text" id="dateOfEnrollmentDescription" name="dateOfEnrollmentDescription"  value="$encoder.htmlEncode( $program.dateOfEnrollmentDescription )" style="width:30em" class="{validate:{required:true,minlength:2}}"></td>
 		<td></td>
 	  </tr>	
 	  <tr>
 		<td><label>$i18n.getString( "dateOfIncidentDescription" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
-		<td><input type="text" id="dateOfIncidentDescription" name="dateOfIncidentDescription" value="$encoder.htmlEncode( $program.dateOfIncidentDescription )" style="width:30em" class="{validate:{required:true,minlength:4}}"></td>
+		<td><input type="text" id="dateOfIncidentDescription" name="dateOfIncidentDescription" value="$encoder.htmlEncode( $program.dateOfIncidentDescription )" style="width:30em" class="{validate:{required:true,minlength:2}}"></td>
 		<td></td>
 	  </tr>	    
       <tr>