← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10009: Improved user interface for scheduling

 

------------------------------------------------------------
revno: 10009
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-03-06 11:51:15 +0100
message:
  Improved user interface for scheduling
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/scheduling.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/viewScheduledTasks.vm
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataMart.js
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDataMartForm.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-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/scheduling.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/scheduling.js	2012-04-03 22:10:58 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/scheduling.js	2013-03-06 10:51:15 +0000
@@ -9,6 +9,11 @@
 	{
 		$( '.scheduling' ).removeAttr( 'disabled' );
 	}
+	
+	if ( $( '#dataMartStrategy' ).val() == 'never' )
+	{
+		$( '.dataMart' ).attr( 'disabled', 'disabled' );
+	}
 } );
 
 function submitSchedulingForm()
@@ -16,3 +21,15 @@
 	$( '.scheduling' ).removeAttr( 'disabled' );
 	$( '#schedulingForm' ).submit();
 }
+
+function toggleDataMart()
+{
+	if ( $( '#dataMartStrategy' ).val() == 'never' )
+	{
+		$( '.dataMart' ).attr( 'disabled', 'disabled' );
+	}
+	else
+	{
+		$( '.dataMart' ).removeAttr( 'disabled' );
+	}
+}
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/viewScheduledTasks.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/viewScheduledTasks.vm	2013-03-05 19:00:51 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/viewScheduledTasks.vm	2013-03-06 10:51:15 +0000
@@ -36,22 +36,32 @@
 
 <div class="settingHeader">$i18n.getString( "data_mart" )</div>
 
+<div class="settingLabel">$i18n.getString( "data_mart_task_strategy" )</div>
+
+<div class="setting">
+<select id="dataMartStrategy" name="dataMartStrategy" class="scheduling" onchange="toggleDataMart()">
+    <option value="never">$i18n.getString( "never" )</option>
+    <option value="last12Daily"#if( $dataMartStrategy && $dataMartStrategy == "last12Daily" ) selected="selected"#end>$i18n.getString( "last_12_months_daily" )</option>
+    <option value="last6Daily6To12Weekly"#if( $dataMartStrategy && $dataMartStrategy == "last6Daily6To12Weekly" ) selected="selected"#end>$i18n.getString( "last_6_months_daily_6_to_12_months_weekly" )</option>       
+</select>
+</div>
+
 <div class="settingLabel">$i18n.getString( "aggregation_period_types" )</div>
 
 <div class="setting">
-    <label for="weekly">$i18n.getString( "Weekly" )</label><input type="checkbox" id="weekly" class="scheduling" name="scheduledPeriodTypes" value="Weekly"#if( $scheduledPeriodTypes.contains( "Weekly" ) ) checked="checked"#end>&nbsp;
-    <label for="monthly">$i18n.getString( "Monthly" )</label><input type="checkbox" id="monthly" class="scheduling" name="scheduledPeriodTypes" value="Monthly"#if( $scheduledPeriodTypes.contains( "Monthly" ) ) checked="checked"#end>&nbsp;
-    <label for="biMonthly">$i18n.getString( "BiMonthly" )</label><input type="checkbox" id="biMonthly" class="scheduling" name="scheduledPeriodTypes" value="BiMonthly"#if( $scheduledPeriodTypes.contains( "BiMonthly" ) ) checked="checked"#end>&nbsp;
-    <label for="quarterly">$i18n.getString( "Quarterly" )</label><input type="checkbox" id="quarterly" class="scheduling" name="scheduledPeriodTypes" value="Quarterly"#if( $scheduledPeriodTypes.contains( "Quarterly" ) ) checked="checked"#end><br>
-    <label for="sixMonthly">$i18n.getString( "SixMonthly" )</label><input type="checkbox" id="sixMonthly" class="scheduling" name="scheduledPeriodTypes" value="SixMonthly"#if( $scheduledPeriodTypes.contains( "SixMonthly" ) ) checked="checked"#end>&nbsp;
-    <label for="yearly">$i18n.getString( "Yearly" )</label><input type="checkbox" id="yearly" class="scheduling" name="scheduledPeriodTypes" value="Yearly"#if( $scheduledPeriodTypes.contains( "Yearly" ) ) checked="checked"#end>&nbsp;
-    <label for="financialYearly">$i18n.getString( "financial_yearly" )</label><input type="checkbox" id="financialYearly" class="scheduling" name="scheduledPeriodTypes" value="FinancialJuly"#if( $scheduledPeriodTypes.contains( "FinancialJuly" ) ) checked="checked"#end>			
+    <input type="checkbox" id="weekly" class="scheduling dataMart" name="scheduledPeriodTypes" value="Weekly"#if( $scheduledPeriodTypes.contains( "Weekly" ) ) checked="checked"#end> <label for="weekly">$i18n.getString( "Weekly" )</label>&nbsp;
+    <input type="checkbox" id="monthly" class="scheduling dataMart" name="scheduledPeriodTypes" value="Monthly"#if( $scheduledPeriodTypes.contains( "Monthly" ) ) checked="checked"#end> <label for="monthly">$i18n.getString( "Monthly" )</label>&nbsp;
+    <input type="checkbox" id="biMonthly" class="scheduling dataMart" name="scheduledPeriodTypes" value="BiMonthly"#if( $scheduledPeriodTypes.contains( "BiMonthly" ) ) checked="checked"#end> <label for="biMonthly">$i18n.getString( "BiMonthly" )</label>&nbsp;
+    <input type="checkbox" id="quarterly" class="scheduling dataMart" name="scheduledPeriodTypes" value="Quarterly"#if( $scheduledPeriodTypes.contains( "Quarterly" ) ) checked="checked"#end> <label for="quarterly">$i18n.getString( "Quarterly" )</label><br>
+    <input type="checkbox" id="sixMonthly" class="scheduling dataMart" name="scheduledPeriodTypes" value="SixMonthly"#if( $scheduledPeriodTypes.contains( "SixMonthly" ) ) checked="checked"#end> <label for="sixMonthly">$i18n.getString( "SixMonthly" )</label>&nbsp;
+    <input type="checkbox" id="yearly" class="scheduling dataMart" name="scheduledPeriodTypes" value="Yearly"#if( $scheduledPeriodTypes.contains( "Yearly" ) ) checked="checked"#end> <label for="yearly">$i18n.getString( "Yearly" )</label>&nbsp;
+    <input type="checkbox" id="financialYearly" class="scheduling dataMart" name="scheduledPeriodTypes" value="FinancialJuly"#if( $scheduledPeriodTypes.contains( "FinancialJuly" ) ) checked="checked"#end> <label for="financialYearly">$i18n.getString( "financial_yearly" )</label>			
 </div>
 
 <div class="settingLabel">$i18n.getString( "organisation_unit_group_set_aggregation_level" )</div>
 
 <div class="setting">
-<select id="orgUnitGroupSetAggLevel" name="orgUnitGroupSetAggLevel" class="scheduling">
+<select id="orgUnitGroupSetAggLevel" name="orgUnitGroupSetAggLevel" class="scheduling dataMart">
     <option value="0"#if( $orgUnitGroupSetAggLevel && $orgUnitGroupSetAggLevel == 0 ) selected="selected"#end>[$i18n.getString( "no_aggregation" )]</option>
 	#foreach( $level in $levels )
 	<option value="$level.level"#if( $orgUnitGroupSetAggLevel && $orgUnitGroupSetAggLevel == $level.level ) selected="selected"#end>$encoder.htmlEncode( $level.displayName )</option>
@@ -59,16 +69,6 @@
 </select>
 </div>
 
-<div class="settingLabel">$i18n.getString( "data_mart_task_strategy" )</div>
-
-<div class="setting">
-<select id="dataMartStrategy" name="dataMartStrategy" class="scheduling">
-	<option value="never">$i18n.getString( "never" )</option>
-	<option value="last12Daily"#if( $dataMartStrategy && $dataMartStrategy == "last12Daily" ) selected="selected"#end>$i18n.getString( "last_12_months_daily" )</option>
-	<option value="last6Daily6To12Weekly"#if( $dataMartStrategy && $dataMartStrategy == "last6Daily6To12Weekly" ) selected="selected"#end>$i18n.getString( "last_6_months_daily_6_to_12_months_weekly" )</option>		
-</select>
-</div>
-
 <div class="setting">
 	<input type="button" style="width:140px" onclick="submitSchedulingForm()"
 	#if ( $running )

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataMart.js'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataMart.js	2013-03-05 19:00:51 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataMart.js	2013-03-06 10:51:15 +0000
@@ -31,3 +31,15 @@
 	pingNotifications( 'DATAMART', 'notificationTable' );
 	setTimeout( "pingNotificationsTimeout()", 2500 );
 }
+
+function toggleDataMart()
+{
+	if ( $( '#dataMart' ).is( ':checked' ) )
+	{
+		$( '.dataMart' ).attr( 'disabled', 'disabled' );
+	}
+	else
+	{
+		$( '.dataMart' ).removeAttr( 'disabled' );
+	}
+}
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDataMartForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDataMartForm.vm	2013-03-05 19:00:51 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDataMartForm.vm	2013-03-06 10:51:15 +0000
@@ -14,30 +14,30 @@
 
 <div class="settingHeader">$i18n.getString( "data_mart" )</div>
 
+<div class="setting">
+    <input type="checkbox" id="dataMart" checked="checked" />
+    <label for="dataMart" onclick="toggleDataMart()">$i18n.getString( "data_mart_tables_update" )</label>
+</div>
+
 <div class="settingLabel">$i18n.getString( "aggregation_period_types" )</div>
 
 <div class="setting">
-<label for="weekly">$i18n.getString( "Weekly" )</label><input type="checkbox" id="weekly" class="scheduling" name="periodTypes" value="Weekly">&nbsp;
-<label for="monthly">$i18n.getString( "Monthly" )</label><input type="checkbox" id="monthly" class="scheduling" name="periodTypes" value="Monthly" checked="checked">&nbsp;
-<label for="biMonthly">$i18n.getString( "BiMonthly" )</label><input type="checkbox" id="biMonthly" class="scheduling" name="periodTypes" value="BiMonthly">&nbsp;
-<label for="quarterly">$i18n.getString( "Quarterly" )</label><input type="checkbox" id="quarterly" class="scheduling" name="periodTypes" value="Quarterly" checked="checked"><br>
-<label for="sixMonthly">$i18n.getString( "SixMonthly" )</label><input type="checkbox" id="sixMonthly" class="scheduling" name="periodTypes" value="SixMonthly" checked="checked">&nbsp;
-<label for="yearly">$i18n.getString( "Yearly" )</label><input type="checkbox" id="yearly" class="scheduling" name="periodTypes" value="Yearly" checked="checked">&nbsp;
-<label for="financialYearly">$i18n.getString( "financial_yearly" )</label><input type="checkbox" id="financialYearly" class="scheduling" name="periodTypes" value="FinancialJuly">           
+<input type="checkbox" id="weekly" class="dataMart" name="periodTypes" value="Weekly"> <label for="weekly">$i18n.getString( "Weekly" )</label>&nbsp;
+<input type="checkbox" id="monthly" class="dataMart" name="periodTypes" value="Monthly" checked="checked"> <label for="monthly">$i18n.getString( "Monthly" )</label>&nbsp;
+<input type="checkbox" id="biMonthly" class="dataMart" name="periodTypes" value="BiMonthly"> <label for="biMonthly">$i18n.getString( "BiMonthly" )</label>&nbsp;
+<input type="checkbox" id="quarterly" class="dataMart" name="periodTypes" value="Quarterly" checked="checked"> <label for="quarterly">$i18n.getString( "Quarterly" )</label><br>
+<input type="checkbox" id="sixMonthly" class="dataMart" name="periodTypes" value="SixMonthly" checked="checked"> <label for="sixMonthly">$i18n.getString( "SixMonthly" )</label>&nbsp;
+<input type="checkbox" id="yearly" class="dataMart" name="periodTypes" value="Yearly" checked="checked"> <label for="yearly">$i18n.getString( "Yearly" )</label>&nbsp;
+<input type="checkbox" id="financialYearly" class="dataMart" name="periodTypes" value="FinancialJuly"> <label for="financialYearly">$i18n.getString( "financial_yearly" )</label>
 </div>
 
 <div class="settingLabel">$i18n.getString( "start_date" )</div>
 
-<div class="setting"><input type="text" id="startDate" style="width:200px"></div>
+<div class="setting"><input type="text" id="startDate" class="dataMart" style="width:200px"></div>
 
 <div class="settingLabel">$i18n.getString( "end_date" )</div>
 
-<div class="setting"><input type="text" id="endDate" style="width:200px"></div>
-
-<div class="setting">
-    <input type="checkbox" id="dataMart" checked="checked" />
-    <label for="dataMart">$i18n.getString( "data_mart_tables_update" )</label>
-</div>
+<div class="setting"><input type="text" id="endDate" class="dataMart" style="width:200px"></div>
 
 <div class="setting"><input type="button" onclick="startExport()" value="$i18n.getString( 'start_export' )" style="width:120px"></div>