← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19280: Minor

 

------------------------------------------------------------
revno: 19280
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2015-06-03 18:14:07 +0200
message:
  Minor
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programindicator/GetProgramIndicatorAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/programIndicator.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/programIndicator.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/programIndicatorForm.vm
  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-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programindicator/GetProgramIndicatorAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programindicator/GetProgramIndicatorAction.java	2015-06-03 14:47:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programindicator/GetProgramIndicatorAction.java	2015-06-03 16:14:07 +0000
@@ -140,20 +140,22 @@
         if ( id != null )
         {
             programIndicator = programIndicatorService.getProgramIndicator( id );
+            program = programIndicator.getProgram();
             description = programIndicatorService.getExpressionDescription( programIndicator.getExpression() );        
             filter = programIndicatorService.getExpressionDescription( programIndicator.getFilter() );
+            attributes = new ArrayList<>( program.getTrackedEntityAttributes() );
         }
-        
-        if ( programId != null )
+        else if ( programId != null )
         {            
             program = programService.getProgram( programId );
             attributes = new ArrayList<>( program.getTrackedEntityAttributes() );
-            constants = new ArrayList<>( constantService.getAllConstants() );
+        }
+        
+        constants = new ArrayList<>( constantService.getAllConstants() );
 
-            FilterUtils.filter( attributes, AggregatableTrackedEntityAttributeValueFilter.INSTANCE );
-            Collections.sort( attributes, IdentifiableObjectNameComparator.INSTANCE );
-            Collections.sort( constants, IdentifiableObjectNameComparator.INSTANCE );
-        }
+        FilterUtils.filter( attributes, AggregatableTrackedEntityAttributeValueFilter.INSTANCE );
+        Collections.sort( attributes, IdentifiableObjectNameComparator.INSTANCE );
+        Collections.sort( constants, IdentifiableObjectNameComparator.INSTANCE );
         
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/programIndicator.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/programIndicator.js	2015-06-03 14:47:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/programIndicator.js	2015-06-03 16:14:07 +0000
@@ -10,7 +10,7 @@
 // -----------------------------------------------------------------------------
 
 function showUpdateProgramIndicator( context ) {
-  location.href = 'showUpdateProgramIndicator.action?id=' + context.id + '&programId=' + context.program;
+  location.href = 'showUpdateProgramIndicator.action?id=' + context.id;
 }
 
 function removeIndicator( context ) {
@@ -133,11 +133,9 @@
 			expression: expression
 		}, function( json ) {
 			if( json.valid ){
-				setFieldValue(type + '-check', json.message);
 				setInnerHTML(type + '-description', json.description);
 			}
 			else {
-				setFieldValue(type + '-check','');
 				setInnerHTML(type + '-description', json.message);
 			}
 		});

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/programIndicator.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/programIndicator.vm	2015-06-03 14:47:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/programIndicator.vm	2015-06-03 16:14:07 +0000
@@ -35,8 +35,7 @@
 				<tbody id="list">
 					#set( $mark = false )
 					#foreach( $programIndicator in $programIndicators )
-						<tr id="tr${programIndicator.id}" data-id="$!programIndicator.id" data-uid="$!programIndicator.uid" 
-							data-type="ProgramIndicator" data-name="$encoder.htmlEncode( $!programIndicator.displayName )" data-program="$program.id"
+						<tr id="tr${programIndicator.id}" data-id="$!programIndicator.id" data-uid="$!programIndicator.uid" data-type="ProgramIndicator" data-name="$encoder.htmlEncode( $!programIndicator.displayName )"
 						    data-can-manage="$security.canManage( $programIndicator )"
 						    data-can-update="$security.canUpdate( $programIndicator )"
 						    data-can-delete="$security.canDelete( $programIndicator )">

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/programIndicatorForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/programIndicatorForm.vm	2015-06-03 14:47:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/programIndicatorForm.vm	2015-06-03 16:14:07 +0000
@@ -115,12 +115,12 @@
 	</tr>
 	<tr>
         <th style="padding-top:15px">$i18n.getString( "expression" ) <span class="tipText">Tip: use abs(x) sin(x) cos(x) tan(x) ln(x) log(x) sqrt(x) mod(x,y) oizp(x) zing(x)</span></th>
-    </tr>	
+    </tr>
 	<tr>
 		<td>
 			<textarea style="width:665px" id="expression" name="expression" onkeyup="getExpressionDescription('expression')">$!encoder.htmlEncode($!programIndicator.expression)</textarea>
 		</td>
-	</tr>	
+	</tr>
 	<tr>
 		<td style="padding-top:4px">
 			<a class="greyButtonLink" href="javascript:insertOperator( 'expression', '(' )" title="$i18n.getString( 'left_brackets' )">&#40;</a>
@@ -130,14 +130,13 @@
 			<a class="greyButtonLink" href="javascript:insertOperator( 'expression', '+' )" title="$i18n.getString( 'plus' )">&#43;</a>
 			<a class="greyButtonLink" href="javascript:insertOperator( 'expression', '-' )" title="$i18n.getString( 'minus' )">&#45;</a><br><br>
 		</td>
-	</tr>	
+	</tr>
 	<tr>
         <th style="padding-top:4px">$i18n.getString( "expression_description" )</th>
     </tr>	
 	<tr>
 		<td>
-			<div id='expression-description' style="padding: 5px 0 20px 0">$!encoder.htmlEncode($!description)</div>			
-			<input type="hidden" id="expression-check" name="expression-check" title="$i18n.getString('expression_is_not_well_formed')" class="{validate:{required:true}}"  />
+			<div id='expression-description' style="padding: 5px 0 20px 0" class="{validate:{required:true}}">$!encoder.htmlEncode($!description)</div>
 		</td>
 	</tr>
 </table>
@@ -267,8 +266,7 @@
     </tr>	
 	<tr>
 		<td>
-			<div id='filter-description' style="padding: 5px 0 20px 0">$!encoder.htmlEncode($!description)</div>			
-			<input type="hidden" id="filter-check" name="filter-check" title="$i18n.getString('expression_is_not_well_formed')" class="{validate:{required:true}}"  />
+			<div id='filter-description' style="padding: 5px 0 20px 0">$!encoder.htmlEncode($!description)</div>
 		</td>
 	</tr>
 </table>

=== 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-06-03 14:47:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramIndicator.vm	2015-06-03 16:14:07 +0000
@@ -15,8 +15,6 @@
 	checkValueIsExist( "name", "validateProgramIndicator.action",{id:getFieldValue('id')} );	
 	checkValueIsExist( "shortName", "validateProgramIndicator.action",{id:getFieldValue('id')} );	
 	checkValueIsExist( "code", "validateProgramIndicator.action",{id:getFieldValue('id')} );
-		
-	setFieldValue('checkExpression',$('#aggregationDescription').html() );
 });
 </script>