← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3284: DataBrowser - Changed the displaying way of the error message when organisation unit is unselected.

 

------------------------------------------------------------
revno: 3284
committer: Hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-04-05 13:02:03 +0700
message:
  DataBrowser - Changed the displaying way of the error message when organisation unit is unselected.
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module_vi_VN.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/dataBrowserForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/dataBrowser.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/dataBrowserForm.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-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties	2011-03-17 19:31:16 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties	2011-04-05 06:02:03 +0000
@@ -187,6 +187,7 @@
 drilldown_data_element_group                                        = Data Element Group
 drilldown_orgunit                                         			= Organisation Unit
 drilldown_orgunit_group                                             = Organisation Unit Group
+drilldown_select_org_unit                                           = Please select an organization unit
 browse_data_at_this_level                                           = Browse data at this level only
 browse_data_at_descendant_levels                                    = Browse data at all descendant levels
 view_data_at_descendant_levels                                      = Summary drill down
@@ -286,8 +287,7 @@
 lock_all_in_group                                                   = Lock all in group
 unlock_all_in_group                                                 = Unlock all in group
 process_started                                                     = Checking...
-sqlview_process_canceled_interrupted                                = WARNING:  This query could retrieve a large amount of data from database.\n\nDo you want to save it...? =======
-organisation_not_selected                                           = WARNING:  There is no organisation unit selected
+sqlview_process_canceled_interrupted                                = WARNING:  This query could retrieve a large amount of data from database.\n\nDo you want to save it...?
 selected_periods                                                    = Selected Periods
 selected_datasets                                                   = Selected Datasets
 child_tree                                                          = Child Tree

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module_vi_VN.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module_vi_VN.properties	2011-03-14 05:00:01 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module_vi_VN.properties	2011-04-05 06:02:03 +0000
@@ -110,7 +110,6 @@
 organisation_unit_groups                                            = Nh\u00f3m c\u00e1c \u0111\u01a1n v\u1ecb
 organisation_unit_group_set_structure								= C\u1ea5u tr\u00fac nh\u00f3m t\u1eadp h\u1ee3p c\u1ee7a \u0111\u01a1n v\u1ecb
 organisation_unit													= \u0110\u01a1n v\u1ecb
-organisation_not_selected                                           = C\u1ea2NH B\u00c1O:  Kh\u00f4ng c\u00f3 \u0111\u01a1n v\u1ecb n\u00e0o \u0111\u01b0\u1ee3c ch\u1ecdn
 org_unit															= \u0110\u01a1n v\u1ecb
 number_of_queries_executed											= S\u1ed1 l\u01b0\u1ee3ng c\u00e1c truy v\u1ea5n th\u1ef1c thi
 number_of_objects													= S\u1ed1 \u0111\u1ed1i t\u01b0\u1ee3ng
@@ -211,6 +210,7 @@
 drilldown_select_browse_mode                                        = H\u00e3y ch\u1ecdn ch\u1ebf \u0111\u1ed9 duy\u1ec7t d\u1eef li\u1ec7u
 drilldown_orgunit_group                                             = Nh\u00f3m \u0111\u01a1n v\u1ecb
 drilldown_organisation_unit                                         = \u0110\u01a1n v\u1ecb
+drilldown_select_org_unit                                           = Vui l\u00f2ng ch\u1ecdn 1 \u0111\u01a1n v\u1ecb
 drilldown_fromdate_is_later_than_todate                             = Ng\u00e0y b\u1eaft \u0111\u1ea7u ph\u1ea3i tr\u01b0\u1edbc ng\u00e0y k\u1ebft th\u00fac
 drilldown_formdate_invalid                                          = Ng\u00e0y b\u1eaft \u0111\u1ea7u kh\u00f4ng h\u1ee3p l\u1ec7
 drilldown_export                                                    = K\u1ebft qu\u1ea3

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/dataBrowserForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/dataBrowserForm.vm	2011-03-29 07:05:29 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/dataBrowserForm.vm	2011-04-05 06:02:03 +0000
@@ -6,6 +6,7 @@
 	var i18n_drilldown_enddate_invalid = '$encoder.jsEscape( $i18n.getString("drilldown_enddate_invalid"), "'" )';
 	var i18n_drilldown_fromdate_is_later_tdan_todate = '$encoder.jsEscape( $i18n.getString("drilldown_fromdate_is_later_tdan_todate"), "'" )';
 	var i18n_drilldown_select_browse_mode = '$encoder.jsEscape( $i18n.getString("drilldown_select_browse_mode"), "'" )';	
+	var i18n_please_select_org_unit = '$encoder.jsEscape( $i18n.getString("drilldown_select_org_unit"), "'" )';	
 </script>
 
 <h3>$i18n.getString( "data_browser" ) #openHelp( "dataBrowser" )</h3> 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/dataBrowser.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/dataBrowser.js	2011-03-14 05:00:01 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/dataBrowser.js	2011-04-05 06:02:03 +0000
@@ -7,6 +7,13 @@
 currentUrlLink = "";
 currentParentId = "";
 
+var isOrgUnitSelected = false;
+
+function organisationUnitModeSelected( units )
+{
+	isOrgUnitSelected = (units && units.length > 0);
+}
+
 function modeHandler()
 {
     var modeList = byId( "mode" );
@@ -28,6 +35,17 @@
     }
 }
 
+function validateBeforeSubmit( form )
+{
+	var mode = getFieldValue( "mode" );
+
+	if ( (mode == "OU") && !isOrgUnitSelected )
+	{
+		setHeaderDelayMessage( i18n_please_select_org_unit );
+	}
+	else form.submit();
+}
+
 // -----------------------------------------------------------------------------
 // Supportive methods
 // -----------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/dataBrowserForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/dataBrowserForm.js	2011-03-29 07:05:29 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/dataBrowserForm.js	2011-04-05 06:02:03 +0000
@@ -1,4 +1,6 @@
 jQuery(document).ready(function() {
+
+	selection.setListenerFunction( organisationUnitModeSelected );
 	datePickerInRange( 'fromDate' , 'toDate' );
 
 	var r = getValidationRules();
@@ -12,11 +14,9 @@
 		}
 	};
 
-	validation2( 'databrowser', function( form ){ 			
-		form.submit();
-	}, {
-		'rules': rules
-	});		
+	validation2( 'databrowser', function( form ){
+		validateBeforeSubmit();
+	}, { 'rules': rules });
 });
 
 var flag;