← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11075: Don't allow to edit attributes / identifier which don't belong to selected program in person dash...

 

------------------------------------------------------------
revno: 11075
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-05-29 16:41:18 +0700
message:
  Don't allow to edit attributes / identifier which don't belong to selected program in person dashboard.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetPatientAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.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/GetPatientAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetPatientAction.java	2013-04-26 15:24:15 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetPatientAction.java	2013-05-29 09:41:18 +0000
@@ -195,7 +195,6 @@
 
         if ( customRegistrationForm == null )
         {
-
             // -------------------------------------------------------------------------
             // Get identifier-types && attributes
             // -------------------------------------------------------------------------
@@ -209,14 +208,19 @@
             identifierTypes = patientIdentifierTypeService.getAllPatientIdentifierTypes();
             Collection<PatientAttribute> patientAttributesInProgram = new HashSet<PatientAttribute>();
             
+            noGroupAttributes = patientAttributeService.getPatientAttributesWithoutGroup();
+            
             Collection<Program> programs = programService.getAllPrograms();
             programs.remove(program);
+            
             for ( Program _program : programs )
             {
                 identifierTypes.removeAll( _program.getPatientIdentifierTypes() );
                 patientAttributesInProgram.removeAll( _program.getPatientAttributes() );
+                noGroupAttributes.removeAll( _program.getPatientAttributes() );
             }
 
+            
             attributeGroups = new ArrayList<PatientAttributeGroup>(
                 attributeGroupService.getAllPatientAttributeGroups() );
             Collections.sort( attributeGroups, new PatientAttributeGroupSortOrderComparator() );
@@ -231,9 +235,7 @@
                 }
             }
             
-            noGroupAttributes = patientAttributeService.getPatientAttributesWithoutGroup();
-            noGroupAttributes.removeAll( patientAttributesInProgram );
-            
+           
             // -------------------------------------------------------------------------
             // Get data
             // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm	2013-05-29 08:36:29 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm	2013-05-29 09:41:18 +0000
@@ -129,7 +129,7 @@
 						#if( $status!=1 && $status!=5 && $flag=='false')
 							<tr id='tr1_$programInstance.id' type='$programInstance.program.type'
 								programStageInstanceId='$programStageInstanceId' style='cursor:pointer;'
-								onclick='javascript:loadActiveProgramStageRecords("$programInstance.id", "$programStageInstance.id")' >
+								onclick='javascript:setFieldValue("programIdAddPatient",$programInstance.program.id);loadActiveProgramStageRecords("$programInstance.id", "$programStageInstance.id")' >
 								<td id='td_$programInstance.id'>
 									<a><span id='infor_$programInstance.id'>$programInstance.program.displayName ($format.formatDate($programInstance.enrollmentDate))</span></a>
 									<img id='followup_$programInstance.id' src='images/risk_small.png' #if($programInstance.followup=='true') #else class='hidden' #end >
@@ -178,7 +178,7 @@
 							#set($programStageInstanceId = $programStageInstance.id)
 						#end
 					#end
-					<tr onclick='javascript:loadActiveProgramStageRecords($programInstance.id);' >
+					<tr onclick='javascript:setFieldValue("programIdAddPatient",$programInstance.program.id);loadActiveProgramStageRecords($programInstance.id);' >
 						<td>
 							<a><span id='infor_$programInstance.id'>$programInstance.program.displayName ($format.formatDate($programInstance.enrollmentDate))</span></a>
 						</td>

=== 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	2013-04-26 15:24:15 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm	2013-05-29 09:41:18 +0000
@@ -1,3 +1,4 @@
+
 #if($!customRegistrationForm)
 	$customRegistrationForm
 #else