← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8000: (Tracker) Person management improvements(WIP)

 

------------------------------------------------------------
revno: 8000
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-09-05 08:41:15 +0700
message:
  (Tracker) Person management improvements(WIP)
added:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/icons/add_patient.png
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ShowAddPatientFormAction.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/resources/struts.xml
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addPatientForm.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/index.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/menu.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientRegistrationList.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/registrationMenu.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/patient/ShowAddPatientFormAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ShowAddPatientFormAction.java	2012-07-30 10:56:25 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ShowAddPatientFormAction.java	2012-09-05 01:41:15 +0000
@@ -87,6 +87,18 @@
     // Input/Output
     // -------------------------------------------------------------------------
 
+    private Boolean addNewForm;
+    
+    public Boolean getAddNewForm()
+    {
+        return addNewForm;
+    }
+
+    public void setAddNewForm( Boolean addNewForm )
+    {
+        this.addNewForm = addNewForm;
+    }
+
     private Collection<PatientAttribute> noGroupAttributes;
 
     private List<PatientAttributeGroup> attributeGroups;

=== 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-09-04 10:10:05 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2012-09-05 01:41:15 +0000
@@ -110,7 +110,8 @@
 view_patient_chart=View patient chart
 generate_patient_chart=Generate patient chart
 patient_chart_management=Patient chart management
-intro_patient=Create, modify and search for persons. Any type of data can be registered for a person through attributes.
+intro_find_and_add_person=Create, modify and search for persons. Any type of data can be registered for a person through attributes.
+intro_add_person=Add new person. Any type of data can be registered for a person through attributes.
 registration=Registration
 select_relationship=Select relationship
 please_select_a_representative=Please select a representative
@@ -426,4 +427,6 @@
 no_message = No message
 program_reports = Program reports
 show_hide_content = Show/Hide content
-completed_date = Completed date
\ No newline at end of file
+completed_date = Completed date
+find_and_add_person = Find/Add Person
+add_person = Add Person
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2012-09-04 10:10:05 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2012-09-05 01:41:15 +0000
@@ -410,6 +410,24 @@
 			<param name="stylesheets">style/style.css</param>
 			<param name="requiredAuthorities">F_PATIENT_MANAGEMENT</param>
 		</action>
+		
+		<action name="showAddPatientFormFormMenu"
+			class="org.hisp.dhis.caseentry.action.patient.ShowAddPatientFormAction">
+			<interceptor-ref name="organisationUnitTreeStack" />
+			<result name="success" type="velocity">/main.vm</result>
+			<param name="page">/dhis-web-caseentry/addPatientForm.vm</param>
+			<param name="menu">/dhis-web-caseentry/registrationMenu.vm</param>
+			<param name="javascripts">
+				../dhis-web-commons/ouwt/ouwt.js
+				,javascript/commons.js
+				,javascript/patient.js
+				,javascript/entry.js
+				,javascript/relationshipPatient.js
+			</param>
+			<param name="stylesheets">style/style.css</param>
+			<param name="requiredAuthorities">F_PATIENT_ADD</param>
+		</action>
+		
 
 		<action name="searchRegistrationPatient"
 			class="org.hisp.dhis.caseentry.action.patient.SearchPatientAction">

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addPatientForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addPatientForm.vm	2012-08-02 02:48:18 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addPatientForm.vm	2012-09-05 01:41:15 +0000
@@ -41,14 +41,18 @@
 <form id="patientForm" name="patientForm" method="post" >
 <input type="hidden" id="representativeId" name="representativeId"/> 
 <input type="hidden" id="relationshipTypeId" name="relationshipTypeId"/>
-
+<input type="hidden" id="addNewForm" name="addNewForm" value="$!addNewForm"/>
 <table>
 	#parse( "/dhis-web-caseentry/patientForm.vm" )
 	<tr>
 		<td></td>
 		<td>
 			<input type="submit" class="button" value="$i18n.getString( 'add' )"/>
-			<input type="button" class="button" value="$i18n.getString( 'back_to_registration' )" onclick="loadPatientList();"/>
+			#if( $addNewForm == "true")
+				<input type="button" class="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='index.action'"/>
+			#else
+				<input type="button" class="button" value="$i18n.getString( 'back_to_registration' )" onclick="loadPatientList();"/>
+			#end
 		</td>
 	</tr>
 </table>
@@ -58,4 +62,5 @@
 <script>
 	var i18n_error_connect_to_server = '$encoder.jsEscape( $i18n.getString( "error_connect_to_server" ) , "'" )';
 	var i18n_add_person_successfully = '$encoder.jsEscape( $i18n.getString( "add_person_successfully" ) , "'" )';
+	var i18n_error_connect_to_server = '$encoder.jsEscape( $i18n.getString( "error_connect_to_server" ) , "'" )';
 </script>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/index.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/index.vm	2012-07-26 06:12:27 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/index.vm	2012-09-05 01:41:15 +0000
@@ -2,7 +2,8 @@
 <h3>$i18n.getString( "dhis-web-caseentry" )</h3>
 
 <ul class="introList">
-	#introListImgItem( "patient.action" "patient" "patient" )
+	#introListImgItem( "patient.action" "find_and_add_person" "patient" )
+	#introListImgItem( "showAddPatientFormFormMenu.action?addNewForm=true" "add_person" "add_patient" )
 	#introListImgItem( "multipledataEntrySelect.action" "multiple_individual_records" "dataentry" )
 	#introListImgItem( "singleEventSelect.action" "single_event_with_registration" "dataentry" )
     #introListImgItem( "anonymousRegistration.action" "anonymous_events" "dataentry" )

=== 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-09-04 10:10:05 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js	2012-09-05 01:41:15 +0000
@@ -48,11 +48,11 @@
 
 function validateAddPatient()
 {	
-	$("#editPatientDiv :input").attr("disabled", true);
+	$("#patientForm :input").attr("disabled", true);
 	$.ajax({
 		type: "POST",
 		url: 'validatePatient.action',
-		data: getParamsForDiv('editPatientDiv'),
+		data: getParamsForDiv('patientForm'),
 		success:addValidationCompleted
     });	
 }
@@ -69,7 +69,6 @@
 	}
 	else
 	{
-		$("#editPatientDiv :input").attr("disabled", true);
 		if ( type == 'error' )
 		{
 			showErrorMessage( i18n_adding_patient_failed + ':' + '\n' + message );
@@ -83,7 +82,7 @@
 			showListPatientDuplicate(data, false);
 		}
 			
-		$("#editPatientDiv :input").attr("disabled", false);
+		$("#patientForm :input").attr("disabled", false);
 	}
 }
 
@@ -281,15 +280,27 @@
 	$.ajax({
       type: "POST",
       url: 'addPatient.action',
-      data: getParamsForDiv('editPatientDiv'),
+      data: getParamsForDiv('patientForm'),
       success: function(json) {
 		var patientId = json.message.split('_')[0];
 		var systemIdentifierId = json.message.split('_')[1];
 		jQuery('#advSearchBox0 [id="searchText"]').val( systemIdentifierId );
 		statusSearching = 1;
-		
-		showPatientDashboardForm( patientId );
-		jQuery('#resultSearchDiv').dialog('close');
+		if( getFieldValue("addNewForm")=="true")
+		{
+			$("#patientForm :input").attr("disabled", false);
+			$("#patientForm :input").each(function(){
+				if( this.type!='button' || this.type!='submit' ){
+					this.value = "";
+				}
+			});
+			showSuccessMessage(i18n_add_person_successfully);
+		}
+		else
+		{
+			showPatientDashboardForm( patientId );
+			jQuery('#resultSearchDiv').dialog('close');
+		}
       }
      });
     return false;

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/menu.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/menu.vm	2012-08-09 08:57:01 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/menu.vm	2012-09-05 01:41:15 +0000
@@ -1,7 +1,8 @@
 
-<h2>$i18n.getString( "registration" )&nbsp;</h2>
+<h2>$i18n.getString( "patient" )&nbsp;</h2>
 <ul>
-	<li><a href="patient.action">$i18n.getString( "patient" )</a></li>	
+	<li><a href="patient.action">$i18n.getString( "find_and_add_person" )</a></li>
+	<li><a href="showAddPatientFormFormMenu.action?addNewForm=true">$i18n.getString( "add_person" )</a></li>
 </ul>
 
 <h2>$i18n.getString( "data_entry" )&nbsp;</h2>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientRegistrationList.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientRegistrationList.vm	2012-08-28 05:48:46 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientRegistrationList.vm	2012-09-05 01:41:15 +0000
@@ -10,8 +10,7 @@
 			$i18n.getString( "advanced_search_patients" )
 		#end
 		</td>
-	</tr>	
-	
+	</tr>
 	<tr>
 		<td class='text-column' >$i18n.getString( "total_result" )</td>
 		<td>&nbsp;</td>
@@ -80,7 +79,7 @@
 					#end
 				#end
 					
-				<td>$!patient.getFullName()</td>
+				<td onclick="javascript:showPatientDashboardForm( '$patient.id' )">$!patient.getFullName()</td>
 				
 				<td>$i18n.getString($!patient.gender)</td>
 				

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/registrationMenu.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/registrationMenu.vm	2012-05-15 07:12:41 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/registrationMenu.vm	2012-09-05 01:41:15 +0000
@@ -1,8 +1,9 @@
 
-<a href="index.action"><h2>$i18n.getString( "registration" )&nbsp;</h2></a>
+<a href="index.action"><h2>$i18n.getString( "patient" )&nbsp;</h2></a>
 
 <ul>
-	<li><a href="patient.action">$i18n.getString( "patient" )</a></li>
+	<li><a href="patient.action">$i18n.getString( "find_and_add_person" )</a></li>
+	<li><a href="showAddPatientFormFormMenu.action?addNewForm=true">$i18n.getString( "add_person" )</a></li>
 </ul>
 
 <br>

=== added file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/icons/add_patient.png'
Binary files dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/icons/add_patient.png	1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/icons/add_patient.png	2012-09-05 01:41:15 +0000 differ