← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18150: Implemented missing TODO : associating catoptcombos to catopts

 

------------------------------------------------------------
revno: 18150
committer: Bob Jolliffe <bobjolliffe@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2015-02-02 13:06:15 +0000
message:
  Implemented missing TODO : associating catoptcombos to catopts
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryCombo.java


--
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-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryCombo.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryCombo.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryCombo.java	2015-02-02 13:06:15 +0000
@@ -147,7 +147,7 @@
 
         return arrays;
     }
-
+    
     public List<DataElementCategoryOptionCombo> generateOptionCombosList()
     {
         List<DataElementCategoryOptionCombo> list = new ArrayList<>();
@@ -215,10 +215,16 @@
         return name.toString();
     }
 
-    //TODO update category option -> category option combo association
     public void generateOptionCombos()
     {
         this.optionCombos = new HashSet<>( generateOptionCombosList() );
+        for (DataElementCategoryOptionCombo optionCombo : optionCombos)
+        {
+            for (DataElementCategoryOption categoryOption : optionCombo.getCategoryOptions())
+            {
+                categoryOption.addCategoryOptionCombo(optionCombo);
+            }
+        }
     }
 
     public boolean hasOptionCombos()