← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10675: Minor fix for custom registration form.

 

------------------------------------------------------------
revno: 10675
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-04-24 14:53:20 +0700
message:
  Minor fix for custom registration form.
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/dataentryform/DelRegistrationFormAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientRegistrationForm.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/dataentryform/DelRegistrationFormAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/dataentryform/DelRegistrationFormAction.java	2013-04-24 04:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/dataentryform/DelRegistrationFormAction.java	2013-04-24 07:53:20 +0000
@@ -78,9 +78,17 @@
     public String execute()
         throws Exception
     {
-        Program program = programService.getProgram( id );
+        PatientRegistrationForm registrationForm = null;
+        if ( id != null )
+        {
+            Program program = programService.getProgram( id );
 
-        PatientRegistrationForm registrationForm = patientRegistrationFormService.getPatientRegistrationForm( program );
+            registrationForm = patientRegistrationFormService.getPatientRegistrationForm( program );
+        }
+        else
+        {
+            registrationForm = patientRegistrationFormService.getCommonPatientRegistrationForm();
+        }
 
         patientRegistrationFormService.deletePatientRegistrationForm( registrationForm );
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientRegistrationForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientRegistrationForm.vm	2013-04-24 04:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientRegistrationForm.vm	2013-04-24 07:53:20 +0000
@@ -37,7 +37,7 @@
 					</td>   					
 					<td style="text-align:center">
 					  <a href="javascript:updateNewForm($registrationForm.id, '$!registrationForm.program.id')" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
-					  <a href="javascript:removeRegistrationForm( '$registrationForm.program.id', '$encoder.jsEncode( $registrationForm.program.name )')" title="$i18n.getString( "remove" )"><img id='active_$registrationForm.program.id' src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
+					  <a href="javascript:removeRegistrationForm( '$!registrationForm.program.id', '$!encoder.jsEncode( $registrationForm.program.name )')" title="$i18n.getString( "remove" )"><img id='active_$registrationForm.program.id' src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
 					  <img id='define_$registrationForm.program.id' style='display:none;' src='../images/delete-denied.png' title='$i18n.getString("remove")'>
 					</td>