← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3734: Removed the Program.minDaysAllowedInputData property.

 

------------------------------------------------------------
revno: 3734
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2011-05-25 12:27:00 +0700
message:
  Removed the Program.minDaysAllowedInputData property.
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/caseentry/SaveDateValueAction.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/dataEntry.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/select.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/GetPatientsByNameAction.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/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/responseProgram.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	2011-05-05 21:14:56 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java	2011-05-25 05:27:00 +0000
@@ -75,8 +75,6 @@
 
     private Set<ValidationCriteria> patientValidationCriteria = new HashSet<ValidationCriteria>();
 
-    private Integer minDaysAllowedInputData;
-
     private Integer maxDaysAllowedInputData;
     
     // -------------------------------------------------------------------------
@@ -211,16 +209,6 @@
         this.dateOfEnrollmentDescription = dateOfEnrollmentDescription;
     }
 
-    public Integer getMinDaysAllowedInputData()
-    {
-        return minDaysAllowedInputData;
-    }
-
-    public void setMinDaysAllowedInputData( Integer minDaysAllowedInputData )
-    {
-        this.minDaysAllowedInputData = minDaysAllowedInputData;
-    }
-
     public Integer getMaxDaysAllowedInputData()
     {
         return maxDaysAllowedInputData;

=== 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	2011-05-23 06:10:58 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java	2011-05-25 05:27:00 +0000
@@ -92,7 +92,7 @@
         executeSql( "UPDATE patientidentifiertype SET type='" + PatientIdentifierType.VALUE_TYPE_TEXT
             + "' WHERE type IS NULL" );
 
-        executeSql( "UPDATE program SET minDaysAllowedInputData=0 WHERE minDaysAllowedInputData IS NULL" );
+        executeSql( "ALTER TABLE program DROP COLUMN minDaysAllowedInputData" );
 
         executeSql( "UPDATE program SET maxDaysAllowedInputData=0 WHERE maxDaysAllowedInputData 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	2011-05-06 04:41:35 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml	2011-05-25 05:27:00 +0000
@@ -34,9 +34,7 @@
       <key column="programid" foreign-key="fk_program_criteria_programid" />
       <many-to-many column="validationcriteriaid" class="org.hisp.dhis.validation.ValidationCriteria" foreign-key="fk_program_criteria_validationcriteriaid" />
     </set>
-
-    <property name="minDaysAllowedInputData" />
-
+    
     <property name="maxDaysAllowedInputData" />
 
   </class>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveDateValueAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveDateValueAction.java	2011-03-31 01:49:21 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveDateValueAction.java	2011-05-25 05:27:00 +0000
@@ -208,55 +208,25 @@
             }
 
             // -----------------------------------------------------------------
-            // Check inputed value :
-            // value >= DueDate - program.minDaysAllowedInputData
+            // Check inputed value:
             // value <= DueDate + program.maxDaysAllowedInputData
             // -----------------------------------------------------------------
 
             Date dueDate = programStageInstance.getDueDate();
 
-            if ( dateValue.before( dueDate ) )
-            {
-
-                long diffMillis = dueDate.getTime() - dateValue.getTime();
-
-                long diffMinDays = diffMillis / 86400000;
-
-                if ( diffMinDays > program.getMinDaysAllowedInputData() )
-                {
-                    statusCode = 2;
-
-                    message = "- " + i18n.getString( "date_is_greater_then_or_equals_due_date_minus_no_min_days" )
-                        + " " + " ( " + i18n.getString( "min_days" ) + " : ( " + program.getMinDaysAllowedInputData()
-                        + i18n.getString( "days" ) + " )" + "\n" + "- "
-                        + i18n.getString( "date_is_less_then_or_equals_plus_no_max_days" ) + " " + " ( "
-                        + i18n.getString( "max_days" ) + " : " + program.getMaxDaysAllowedInputData()
-                        + i18n.getString( "days" ) + " )";
-
-                    return SUCCESS;
-                }
-
-            }
-            else
-            {
-
-                long diffMillis = dateValue.getTime() - dueDate.getTime();
-
-                long diffMaxDays = diffMillis / 86400000;
-
-                if ( diffMaxDays > program.getMaxDaysAllowedInputData() )
-                {
-                    statusCode = 2;
-
-                    message = "- " + i18n.getString( "date_is_greater_then_or_equals_due_date_minus_no_min_days" )
-                        + " " + " ( " + i18n.getString( "min_days" ) + " : ( " + program.getMinDaysAllowedInputData()
-                        + i18n.getString( "days" ) + " )" + "\n" + "- "
-                        + i18n.getString( "date_is_less_then_or_equals_plus_no_max_days" ) + " " + " ( "
-                        + i18n.getString( "max_days" ) + " : " + program.getMaxDaysAllowedInputData()
-                        + i18n.getString( "days" ) + " )";
-
-                    return SUCCESS;
-                }
+            long diffMillis = dateValue.getTime() - dueDate.getTime();
+
+            long diffMaxDays = diffMillis / 86400000;
+
+            if ( diffMaxDays > program.getMaxDaysAllowedInputData() )
+            {
+                statusCode = 2;
+
+                message = i18n.getString( "date_is_less_then_or_equals_plus_no_max_days" ) + " " + " ( "
+                    + i18n.getString( "max_days" ) + " : " + program.getMaxDaysAllowedInputData()
+                    + i18n.getString( "days" ) + " )";
+
+                return SUCCESS;
             }
 
         }

=== 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	2011-05-12 07:02:28 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2011-05-25 05:27:00 +0000
@@ -265,7 +265,7 @@
 to 																= To
 ga_orgunit                                                      = OrganisationUnit
 ga_facilityby                                                   = OrganisationUnit By
-date_is_greater_then_or_equals_due_date_minus_no_min_days		= Date inputed is greater then or equals [ Due Date - Number of min days allowed to input data ]
+date_is_greater_then_or_equals_due_date							= Date inputed is greater then or equals due date
 date_is_less_then_or_equals_plus_no_max_days					= Date inputed is less then or equals [ Due Date + Number of max days allowed to input data ]
 min_days														= Min days
 max_days														= Max days

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/dataEntry.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/dataEntry.js	2011-05-20 09:30:54 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/dataEntry.js	2011-05-25 05:27:00 +0000
@@ -383,7 +383,7 @@
         }
         else
         {
-            if(executionDate != "")
+            if( executionDate != "")
             {
                 markValue( ERROR );
                 window.alert( i18n_invalid_date );
@@ -1212,14 +1212,15 @@
         }
     }
 	
-	var incidentDate = new Date( jQuery('#incidentDate').val() );
+	var dueDate = new Date( jQuery('#dueDate').val() );
+	
 	var inputtedDate = new Date(jQuery(this_).val());
-	if( inputtedDate < incidentDate )
+	if( inputtedDate < dueDate )
 	{
 		jQuery(this_).css({
                 "background-color":"#ffcc00"
             });
-            window.alert( i18n_date_less_incident_date );
+            window.alert( i18n_date_is_greater_then_or_equals_due_date );
 		  
             jQuery(this_).focus();
 
@@ -1440,6 +1441,7 @@
 					});
 					
 					hideLoader();
+					hideById('contentDiv');
 				},'xml');
 		}
     }

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/select.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/select.vm	2011-05-11 02:13:32 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/select.vm	2011-05-25 05:27:00 +0000
@@ -73,7 +73,9 @@
     var i18n_complete_confirm_message = '$encoder.jsEscape( $i18n.getString( "complete_confirm_message" ) , "'")';
     var i18n_error_required_field = '$encoder.jsEscape( $i18n.getString( "error_required_field" ) , "'")';
 	var i18n_violate_validation = '$encoder.jsEscape( $i18n.getString( "violate_validation" ) , "'")';
-	var i18n_date_less_incident_date = '$encoder.jsEscape( $i18n.getString( "date_less_incident_date" ) , "'")';
+	//var i18n_date_less_incident_date = '$encoder.jsEscape( $i18n.getString( "date_less_incident_date" ) , "'")';
+	var i18n_date_is_greater_then_or_equals_due_date = '$encoder.jsEscape( $i18n.getString( "date_is_greater_then_or_equals_due_date" ) , "'")';
+	
 	
 	setFieldValue('orgunitId', '$!organisationUnit.id');
 </script>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/GetPatientsByNameAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/GetPatientsByNameAction.java	2011-05-13 09:11:13 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/GetPatientsByNameAction.java	2011-05-25 05:27:00 +0000
@@ -110,7 +110,7 @@
             }
         }
 
-        String fullName = firstName + " " + middleName + " " + lastName;
+        String fullName = (firstName + " " + middleName + " " + lastName).trim();
         total = patientService.countGetPatientsByName( fullName );
         this.paging = createPaging( total );
 

=== 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	2011-03-31 01:42:05 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/AddProgramAction.java	2011-05-25 05:27:00 +0000
@@ -81,14 +81,7 @@
     {
         this.dateOfIncidentDescription = dateOfIncidentDescription;
     }
-
-    private Integer minDaysAllowedInputData;
-
-    public void setMinDaysAllowedInputData( Integer minDaysAllowedInputData )
-    {
-        this.minDaysAllowedInputData = minDaysAllowedInputData;
-    }
-
+    
     private Integer maxDaysAllowedInputData;
 
     public void setMaxDaysAllowedInputData( Integer maxDaysAllowedInputData )
@@ -107,10 +100,9 @@
 
         program.setName( name );
         program.setDescription( description );
-        program.setVersion( new Integer( 1 ) );
+        program.setVersion( 1 );
         program.setDateOfEnrollmentDescription( dateOfEnrollmentDescription );
         program.setDateOfIncidentDescription( dateOfIncidentDescription );
-        program.setMinDaysAllowedInputData( minDaysAllowedInputData );
         program.setMaxDaysAllowedInputData( maxDaysAllowedInputData );
         
         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	2011-03-31 01:42:05 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/UpdateProgramAction.java	2011-05-25 05:27:00 +0000
@@ -101,13 +101,6 @@
         this.dateOfIncidentDescription = dateOfIncidentDescription;
     }
 
-    private Integer minDaysAllowedInputData;
-
-    public void setMinDaysAllowedInputData( Integer minDaysAllowedInputData )
-    {
-        this.minDaysAllowedInputData = minDaysAllowedInputData;
-    }
-
     private Integer maxDaysAllowedInputData;
 
     public void setMaxDaysAllowedInputData( Integer maxDaysAllowedInputData )
@@ -128,7 +121,6 @@
         program.setVersion( version );
         program.setDateOfEnrollmentDescription( dateOfEnrollmentDescription );
         program.setDateOfIncidentDescription( dateOfIncidentDescription );
-        program.setMinDaysAllowedInputData( minDaysAllowedInputData );
         program.setMaxDaysAllowedInputData( maxDaysAllowedInputData );
 
         programService.updateProgram( program );

=== 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	2011-03-30 04:56:17 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm	2011-05-25 05:27:00 +0000
@@ -36,12 +36,6 @@
 		<td><input type="text" id="dateOfIncidentDescription" name="dateOfIncidentDescription" style="width:30em" class="{validate:{required:true,minlength:4}}"></td>
 		<td></td>
 	</tr>	
-  	  
-	<tr>
-		<td><label>$i18n.getString( "no_min_days_allowed_input_data" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
-		<td><input type="text" id="minDaysAllowedInputData" name="minDaysAllowedInputData" style="width:30em" class="{validate:{required:true,number:true}}"></td>
-		<td></td>
-	</tr>	
 	
 	<tr>
 		<td><label>$i18n.getString( "no_max_days_allowed_input_data" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/responseProgram.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/responseProgram.vm	2011-03-30 04:59:34 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/responseProgram.vm	2011-05-25 05:27:00 +0000
@@ -3,6 +3,5 @@
 	"name":"$!encoder.jsEncode( ${program.name} )",
 	"description": "$!encoder.jsEncode( ${program.description} )",
 	"programStageCount": "$program.programStages.size()",
-	"minDay": "$program.minDaysAllowedInputData",
 	"maxDay": "$program.maxDaysAllowedInputData"
 }
\ 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/updateProgramForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm	2011-02-18 04:29:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm	2011-05-25 05:27:00 +0000
@@ -50,12 +50,6 @@
 		<td><input type="text" id="dateOfIncidentDescription" name="dateOfIncidentDescription" value="$!program.dateOfIncidentDescription" style="width:30em" class="{validate:{required:true,minlength:4}}"></td>
 		<td></td>
 	  </tr>
-  
-	  <tr>
-		<td><label>$i18n.getString( "no_min_days_allowed_input_data" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
-		<td><input type="text" id="minDaysAllowedInputData" name="minDaysAllowedInputData" value="$!program.minDaysAllowedInputData" style="width:30em" class="{validate:{required:true,number:true}}"></td>
-		<td></td>
-	  </tr>	
 	
 	  <tr>
 		<td><label>$i18n.getString( "no_max_days_allowed_input_data" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>