← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2692: Minor changed.

 

------------------------------------------------------------
revno: 2692
committer: Hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2011-01-21 11:35:42 +0700
message:
  Minor changed.
modified:
  dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/javascript/export.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-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/javascript/export.js'
--- dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/javascript/export.js	2010-12-29 21:48:41 +0000
+++ dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/javascript/export.js	2011-01-21 04:35:42 +0000
@@ -142,30 +142,11 @@
 
 function toggle( knob )
 {
-    var toggle = false;
-	
-    if ( knob == "all" )
-    {
-        toggle = true;
-    }
-	
-    document.getElementById( "dataElements" ).checked = toggle;
-    document.getElementById( "dataElementGroups" ).checked = toggle;
-    document.getElementById( "dataElementGroupSets" ).checked = toggle;
-    document.getElementById( "dataSets" ).checked = toggle;
-    document.getElementById( "indicators" ).checked = toggle;
-    document.getElementById( "indicatorGroups" ).checked = toggle;
-    document.getElementById( "indicatorGroupSets" ).checked = toggle;
-    document.getElementById( "dataDictionaries" ).checked = toggle;
-    document.getElementById( "organisationUnits" ).checked = toggle;
-    document.getElementById( "organisationUnitGroups" ).checked = toggle;
-    document.getElementById( "organisationUnitGroupSets" ).checked = toggle;
-    document.getElementById( "organisationUnitLevels" ).checked = toggle;
-    document.getElementById( "validationRules" ).checked = toggle;	
-    document.getElementById( "reports" ).checked = toggle;	
-    document.getElementById( "reportTables" ).checked = toggle;
-    document.getElementById( "charts" ).checked = toggle;	
-    document.getElementById( "olapUrls" ).checked = toggle;      
+    var toggle = (knob == "all" ? true : false);
+	
+	jQuery.each( jQuery("input[type=checkbox]"), function(i, item){
+		item.checked = toggle;
+	});
 }
 
 // -----------------------------------------------------------------------------
@@ -174,30 +155,14 @@
 
 function validateMetaDataExportForm()
 {
-    if ( !isChecked( "dataElements" ) &&
-         !isChecked( "dataElementGroups" ) &&
-         !isChecked( "dataElementGroupSets" ) &&
-         !isChecked( "dataSets" ) &&
-         !isChecked( "indicators" ) &&
-         !isChecked( "indicatorGroups" ) &&
-         !isChecked( "indicatorGroupSets" ) &&
-         !isChecked( "dataDictionaries" ) &&
-         !isChecked( "organisationUnits" ) &&
-         !isChecked( "organisationUnitGroups" ) &&
-         !isChecked( "organisationUnitGroupSets" ) &&
-         !isChecked( "organisationUnitLevels" ) &&
-         !isChecked( "validationRules" ) &&
-         !isChecked( "reports" ) &&
-         !isChecked( "reportTables" ) &&
-         !isChecked( "charts" ) &&
-         !isChecked( "olapUrls" ) )
-     {
-         setMessage( i18n_select_one_or_more_object_types );
-         return false;
-     }
-     
-     hideMessage();
-     return true;
+	if ( jQuery("input:checked").length == 0 )
+	{
+		setMessage( i18n_select_one_or_more_object_types );
+		return false;
+	}
+	
+	hideMessage();
+	return true;
 }
 
 function validateDataValueExportForm()