← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18571: Fixed bug - Edit program indicator doesn't work; removed the brackets from the program expressio...

 

------------------------------------------------------------
revno: 18571
committer: Tran Chau<tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-03-10 22:09:14 +0700
message:
  Fixed bug - Edit program indicator doesn't work; removed  the brackets from the program expression description.
modified:
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramIndicatorService.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramIndicator.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-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramIndicatorService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramIndicatorService.java	2015-03-10 11:19:30 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramIndicatorService.java	2015-03-10 15:09:14 +0000
@@ -263,8 +263,7 @@
 
                     String dataelementName = dataElement.getDisplayName();
 
-                    matcher.appendReplacement( description, ProgramIndicator.KEY_DATAELEMENT + "{" + programStageName
-                        + ProgramIndicator.SEPARATOR_ID + dataelementName + "}" );
+                    matcher.appendReplacement( description, programStageName + ProgramIndicator.SEPARATOR_ID + dataelementName );
                 }
             }
 
@@ -274,8 +273,7 @@
                 
                 if ( attribute != null )
                 {
-                    matcher.appendReplacement( description,
-                        ProgramIndicator.KEY_ATTRIBUTE + "{" + attribute.getDisplayName() + "}" );
+                    matcher.appendReplacement( description, attribute.getDisplayName() );
                 }
             }
             else if ( ProgramIndicator.KEY_CONSTANT.equals( key ) )
@@ -284,8 +282,22 @@
                 
                 if ( constant != null )
                 {
-                    matcher.appendReplacement( description,
-                        ProgramIndicator.KEY_CONSTANT + "{" + constant.getDisplayName() + "}" );
+                    matcher.appendReplacement( description, constant.getDisplayName() );
+                }
+            }
+            else if ( ProgramIndicator.KEY_PROGRAM_VARIABLE.equals( key ) )
+            {
+                if( uid1.equals( ProgramIndicator.CURRENT_DATE ) )
+                {
+                    matcher.appendReplacement( description, "Current date" );
+                }
+                else if( uid1.equals( ProgramIndicator.ENROLLEMENT_DATE ) )
+                {
+                    matcher.appendReplacement( description, "Enrollment date" );
+                }
+                else if( uid1.equals( ProgramIndicator.INCIDENT_DATE ) )
+                {
+                    matcher.appendReplacement( description, "Incident date" );
                 }
             }
         }
@@ -357,7 +369,6 @@
                 matcher.appendReplacement( description, String.valueOf( 0 ) );
             }
         }
-
         matcher.appendTail( description );
 
         // ---------------------------------------------------------------------

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramIndicator.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramIndicator.vm	2015-02-16 11:46:32 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramIndicator.vm	2015-03-10 15:09:14 +0000
@@ -14,7 +14,9 @@
 	
 	checkValueIsExist( "name", "validateProgramIndicator.action",{id:getFieldValue('id')} );	
 	checkValueIsExist( "shortName", "validateProgramIndicator.action",{id:getFieldValue('id')} );	
-	checkValueIsExist( "code", "validateProgramIndicator.action",{id:getFieldValue('id')} );	
+	checkValueIsExist( "code", "validateProgramIndicator.action",{id:getFieldValue('id')} );
+		
+	setFieldValue('checkExpression',$('#aggregationDescription').html() );
 });
 </script>
 
@@ -93,7 +95,7 @@
 #parse( "/dhis-web-maintenance-program/programIndicatorForm.vm" )
 
 <p>
-	<input type="submit" value="$i18n.getString( 'add' )" style="width:10em">
+	<input type="submit" value="$i18n.getString( 'update' )" style="width:10em">
 	<input type="button" value="$i18n.getString( 'cancel' )" style="width:10em" onclick="window.location.href='programIndicator.action?programId=$programIndicator.program.id'" >
 </p>