← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12411: filter dataelements in add/update dataset to only show domain=aggregate

 

------------------------------------------------------------
revno: 12411
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-10-03 10:36:23 +0200
message:
  filter dataelements in add/update dataset to only show domain=aggregate
modified:
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementsAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/addDataSet.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editDataSet.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-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementsAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementsAction.java	2013-10-02 11:02:41 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementsAction.java	2013-10-03 08:36:23 +0000
@@ -195,8 +195,16 @@
         }
         else if ( domain != null )
         {
-            dataElements = new ArrayList<DataElement>(
-                dataElementService.getDataElementsByDomainType( DataElement.DOMAIN_TYPE_PATIENT ) );
+            if ( domain.equals( DataElement.DOMAIN_TYPE_AGGREGATE ) )
+            {
+                dataElements = new ArrayList<DataElement>(
+                    dataElementService.getDataElementsByDomainType( DataElement.DOMAIN_TYPE_AGGREGATE ) );
+            }
+            else
+            {
+                dataElements = new ArrayList<DataElement>(
+                    dataElementService.getDataElementsByDomainType( DataElement.DOMAIN_TYPE_PATIENT ) );
+            }
         }
         else
         {

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/addDataSet.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/addDataSet.vm	2013-09-30 11:24:38 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/addDataSet.vm	2013-10-03 08:36:23 +0000
@@ -2,7 +2,7 @@
 <script type="text/javascript">
 	jQuery(function() {
 		jQuery("#availableDataElementsList").dhisAjaxSelect({
-			source: "../dhis-web-commons-ajax-json/getDataElements.action",
+			source: "../dhis-web-commons-ajax-json/getDataElements.action?domain=aggregate",
 			iterator: "dataElements",
 			connectedTo: 'dataElementsSelectedList',
 			handler: function(item) {

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editDataSet.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editDataSet.vm	2013-09-30 10:39:35 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editDataSet.vm	2013-10-03 08:36:23 +0000
@@ -2,7 +2,7 @@
 <script type="text/javascript">
 	jQuery(function() {
 		jQuery("#availableDataElementsList").dhisAjaxSelect({
-			source: "../dhis-web-commons-ajax-json/getDataElements.action",
+			source: "../dhis-web-commons-ajax-json/getDataElements.action?domain=aggregate",
 			iterator: "dataElements",
 			connectedTo: 'dataElementsSelectedList',
 			handler: function(item) {