← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1665: Integrity check only displays one of two identical indicator definitions.

 

------------------------------------------------------------
revno: 1665
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: trunk
timestamp: Thu 2010-03-18 16:31:22 +0700
message:
  Integrity check only displays one of two identical indicator definitions.
modified:
  dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataintegrity/DefaultDataIntegrityService.java
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/xmlOrganisationUnit.vm
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/xmlOrganisationUnits.vm
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/util/validate/jquery.validate.js


--
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-administration/src/main/java/org/hisp/dhis/dataintegrity/DefaultDataIntegrityService.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataintegrity/DefaultDataIntegrityService.java	2010-01-27 11:51:54 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataintegrity/DefaultDataIntegrityService.java	2010-03-18 09:31:22 +0000
@@ -33,7 +33,7 @@
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.List;
+import java.util.Hashtable;
 import java.util.Map;
 import java.util.Set;
 
@@ -61,7 +61,7 @@
 
 /**
  * @author Lars Helge Overland
- * @version $Id$
+ * @version $Id: DefaultDataIntegrityService.java 2010-03-18 11:52:20Z Chau Thu Tran $
  */
 @Transactional
 public class DefaultDataIntegrityService
@@ -194,7 +194,7 @@
 
     public Collection<Indicator> getIndicatorsWithIdenticalFormulas()
     {
-        List<String> formulas = new ArrayList<String>();
+        Hashtable<String, Indicator> formulas = new Hashtable<String, Indicator>();
         
         Set<Indicator> targets = new HashSet<Indicator>();
         
@@ -204,13 +204,14 @@
         {
             final String formula = indicator.getNumerator() + FORMULA_SEPARATOR + indicator.getDenominator();
             
-            if ( formulas.contains( formula ) )
+            if(formulas.containsKey( formula ))
             {
+                targets.add (formulas.get( formula ));
                 targets.add( indicator );
             }
             else
             {
-                formulas.add( formula );
+                formulas.put( formula, indicator );
             }
         }
         

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/xmlOrganisationUnit.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/xmlOrganisationUnit.vm	2010-01-25 09:23:35 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/xmlOrganisationUnit.vm	2010-03-18 09:31:22 +0000
@@ -3,7 +3,7 @@
 	<id>$organisationUnit.id</id>
 	<name>$!encoder.xmlEncode( $organisationUnit.name )</name>
     <shortName>$!encoder.xmlEncode( $organisationUnit.shortName )</shortName>
-    <code>$!encoder.xmlEncode( $organisationUnit.organisationUnitCode )</code>
+    <code>$!encoder.xmlEncode( $organisationUnit.code )</code>
     <openingDate>$!format.formatPeriod( $organisationUnit.openingDate )</openingDate>
     <closedDate>$!format.formatPeriod( $organisationUnit.closedDate )</closedDate>
     <active>$organisationUnit.active</active>

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/xmlOrganisationUnits.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/xmlOrganisationUnits.vm	2010-01-25 09:23:35 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/xmlOrganisationUnits.vm	2010-03-18 09:31:22 +0000
@@ -5,7 +5,7 @@
 	    <id>$unit.id</id>
 	    <name>$!encoder.xmlEncode( $unit.name )</name>
 	    <shortName>$!encoder.xmlEncode( $unit.shortName )</shortName>
-	    <code>$!encoder.xmlEncode( $unit.organisationUnitCode )</code>
+	    <code>$!encoder.xmlEncode( $unit.code )</code>
 	</organisationUnit>
 #end
 </organisationUnits>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/util/validate/jquery.validate.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/util/validate/jquery.validate.js	2010-03-16 03:34:03 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/util/validate/jquery.validate.js	2010-03-18 09:31:22 +0000
@@ -1002,8 +1002,8 @@
 	
 		// http://docs.jquery.com/Plugins/Validation/Methods/dateISO
 		dateISO: function(value, element) {
-			//return this.optional(element) || /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value);
-			return this.optional(element) || isDate(value, 'yyyy-MM-dd');
+			return this.optional(element) || /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value);
+			//return this.optional(element) || isDate(value, 'yyyy-MM-dd');
 		},