← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17910: Display categories which associated with the selected category option in the Category Option Deta...

 

------------------------------------------------------------
revno: 17910
committer: Tran Chau<tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2015-01-08 09:24:11 +0700
message:
  Display categories which associated with the selected category option in the Category Option Details.
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonDataElementCategoryOption.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/categoryOption.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/categoryOption.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-resources/src/main/webapp/dhis-web-commons/ajax/jsonDataElementCategoryOption.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonDataElementCategoryOption.vm	2014-11-15 13:26:06 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonDataElementCategoryOption.vm	2015-01-08 02:24:11 +0000
@@ -5,6 +5,20 @@
     "name": "$!encoder.jsonEncode( ${dataElementCategoryOption.name} )",
     "shortName": "$!encoder.jsonEncode( ${dataElementCategoryOption.shortName} )",
     "startDate": "$!format.formatDate( ${dataElementCategoryOption.startDate} )",
-    "endDate": "$!format.formatDate( ${dataElementCategoryOption.endDate} )"
+    "endDate": "$!format.formatDate( ${dataElementCategoryOption.endDate} )",
+    "categories": [
+			#if( $dataElementCategoryOption.categories )
+				#set( $size = $dataElementCategoryOption.categories.size() )
+				#set( $categories = "" )
+				#foreach( $category in $dataElementCategoryOption.categories)
+					{
+						"id": "$category.id",
+						"uid": "$category.uid",
+						"name" : "$!encoder.jsonEncode( ${category.name} )"
+					}#if( $velocityCount < $size ),#end
+				#end
+			#end
+		]
+	
   }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module.properties	2014-12-13 10:38:39 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module.properties	2015-01-08 02:24:11 +0000
@@ -238,4 +238,5 @@
 edit_data_element_category_option_combo = Edit data element category option combo
 average_sum_in_org_unit_hierarchy=Average (sum in org unit hierarchy)
 approve_data=Approve data
-decimals_in_data_output=Decimals in data output
\ No newline at end of file
+decimals_in_data_output=Decimals in data output
+categories = Categories
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/categoryOption.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/categoryOption.js	2014-11-15 13:26:06 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/categoryOption.js	2015-01-08 02:24:11 +0000
@@ -71,6 +71,15 @@
 		setInnerHTML( 'startDateField', json.dataElementCategoryOption.startDate );
 		setInnerHTML( 'endDateField', json.dataElementCategoryOption.endDate );
 		setInnerHTML( 'idField', json.dataElementCategoryOption.uid );
+		
+		var categories = "";
+		for( var i in json.dataElementCategoryOption.categories )
+		{
+			categories += json.dataElementCategoryOption.categories[i].name + "; ";
+		}
+		categories = categories.substr( 0, categories.length - 2 );
+		setInnerHTML( 'categoriesField', categories );
+		
         showDetails();
 	});
 }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/categoryOption.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/categoryOption.vm	2014-11-15 13:26:06 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/categoryOption.vm	2015-01-08 02:24:11 +0000
@@ -68,6 +68,7 @@
           <p><label>$i18n.getString( "name" ):</label><br/><span id="nameField"></span></p>
           <p><label>$i18n.getString( "short_name" ):</label><br/><span id="shortNameField"></span></p>
           <p><label>$i18n.getString( "code" ):</label><br/><span id="codeField"></span></p>
+          <p><label>$i18n.getString( "categories" ):</label><br/><span id="categoriesField"></span></p>
           <p><label>$i18n.getString( "start_date" ):</label><br/><span id="startDateField"></span></p>
           <p><label>$i18n.getString( "end_date" ):</label><br/><span id="endDateField"></span></p>
 		  <p><label>$i18n.getString( "id" ):</label><br/><span id="idField"></span></p>