← Back to team overview

dhis2-devs team mailing list archive

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

 

------------------------------------------------------------
revno: 14643
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-04-03 19:22:46 +0200
message:
  Minor
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonIdentifiableObjects.vm
  dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/dataApprovalForm.vm
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/dataSetReportForm.vm
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataApproval.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-api/src/main/java/org/hisp/dhis/dataset/DataSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java	2014-03-31 13:30:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java	2014-04-03 17:22:46 +0000
@@ -487,6 +487,15 @@
         
         return groupSets;
     }
+    
+    /**
+     * Indicates whether this data set has a category combination which is different
+     * from the default category combination.
+     */
+    public boolean hasCategoryCombo()
+    {
+        return categoryCombo != null && !DataElementCategoryCombo.DEFAULT_CATEGORY_COMBO_NAME.equals( categoryCombo.getName() );
+    }
 
     // -------------------------------------------------------------------------
     // Getters and setters

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonIdentifiableObjects.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonIdentifiableObjects.vm	2014-04-03 13:57:45 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonIdentifiableObjects.vm	2014-04-03 17:22:46 +0000
@@ -2,7 +2,7 @@
 { "objects": [
 #foreach( $object in $objects )
   {
-    "id": $!{object.id},
+    "id": "$!{object.id}",
     "uid": "$!{object.uid}",
     "name": "$!encoder.jsonEncode( ${object.displayName} )",
     "code": "$!encoder.jsonEncode( ${object.code} )",

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties	2014-04-02 12:33:53 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties	2014-04-03 17:22:46 +0000
@@ -260,4 +260,5 @@
 confirm_approval=Are you sure you want to approve this data set?
 confirm_unapproval=Are you sure you want to unapprove this data set?
 confirm_accept=Are you sure you want to accept this data set approval?
-confirm_unaccept=Are you sure you want to unaccept this data set approval?
\ No newline at end of file
+confirm_unaccept=Are you sure you want to unaccept this data set approval?
+approval_entity=Approval entity
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/dataApprovalForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/dataApprovalForm.vm	2014-04-03 16:34:22 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/dataApprovalForm.vm	2014-04-03 17:22:46 +0000
@@ -61,7 +61,7 @@
 <select id="dataSetId" name="dataSetId" style="width:330px" onchange="dhis2.appr.dataSetSelected()">
   <option value="">[ $i18n.getString( "select" ) ]</option>
   #foreach( $dataSet in $dataSets )
-  <option value="$dataSet.uid" data-pt="${dataSet.periodType.name}">
+  <option value="$dataSet.uid" data-pt="${dataSet.periodType.name}" data-cc="${dataSet.hasCategoryCombo()}">
   $encoder.htmlEncode( $dataSet.displayName )
   </option>
   #end
@@ -85,13 +85,17 @@
 <div id="selectionTree" style="width:328px; height:200px; overflow:auto; border:1px solid #ccc; margin-bottom: 8px;"></div>
 </div>
 
-<div class="inputSection">
-<input type="button" value='$i18n.getString( "get_report" )' style="width:120px" onclick="dhis2.dsr.generateDataSetReport()">
-<input type="button" value='$i18n.getString( "cancel" )' style="width:120px" onclick="hideCriteria()">
-</div>
-
-<div class="inputSection">
-</div>
+<div class="inputSection" id="categoryOptionGroupSection" style="display:none">
+<label>$i18n.getString( "approval_entity" )</label><br>
+<select id="categoryOptionGroupId" name="categoryOptionGroupId" style="width:330px">
+</select>
+</div>
+
+<div class="inputSection">
+<input type="button" value='$i18n.getString( "get_data" )' style="width:120px" onclick="dhis2.dsr.generateDataSetReport()">
+<input type="button" value='$i18n.getString( "cancel" )' style="width:120px" onclick="dhis2.dsr.hideCriteria()">
+</div>
+
 </div>
 
 #parse( "dhis-web-commons/loader/loader.vm" )

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/dataSetReportForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/dataSetReportForm.vm	2014-04-02 15:07:20 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/dataSetReportForm.vm	2014-04-03 17:22:46 +0000
@@ -159,7 +159,7 @@
 
 <div class="inputSection">
 <input type="button" value='$i18n.getString( "get_report" )' style="width:120px" onclick="dhis2.dsr.generateDataSetReport()">
-<input type="button" value='$i18n.getString( "cancel" )' style="width:120px" onclick="hideCriteria()">
+<input type="button" value='$i18n.getString( "cancel" )' style="width:120px" onclick="dhis2.dsr.hideCriteria()">
 </div>
 
 </div>

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataApproval.js'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataApproval.js	2014-04-03 16:34:22 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataApproval.js	2014-04-03 17:22:46 +0000
@@ -47,11 +47,21 @@
 
 dhis2.appr.displayCategoryOptionGroups = function( ou )
 {
+	if ( !ou ) {
+		return;
+	}
+	
 	var url = "getCategoryOptionGroups.action";
 	
 	$.getJSON( url, {ou:ou}, function( json ) {
+		var html = "";
+		$.each( json.objects, function( index, group ) {
+			html += "<option value=\"" + group.uid + "\">" + group.name + "</option>";
+		} );
 		
-	} ):
+		$( "#categoryOptionGroupSection" ).show();
+		$( "#categoryOptionGroupId" ).html( html );
+	} );
 }
 
 //------------------------------------------------------------------------------