← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5209: Improved scheduling ui

 

------------------------------------------------------------
revno: 5209
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-11-24 09:27:50 +0100
message:
  Improved scheduling ui
added:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/scheduling.js
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/viewScheduledTasks.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/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/struts.xml	2011-11-02 14:39:42 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/struts.xml	2011-11-24 08:27:50 +0000
@@ -556,6 +556,7 @@
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-maintenance-dataadmin/viewScheduledTasks.vm</param>
       <param name="menu">/dhis-web-maintenance-dataadmin/menu.vm</param>
+      <param name="javascripts">javascript/scheduling.js</param>
       <param name="statusOnly">true</param>
       <param name="requiredAuthorities">F_SCHEDULING_ADMIN</param>
     </action>
@@ -564,6 +565,7 @@
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-maintenance-dataadmin/viewScheduledTasks.vm</param>
       <param name="menu">/dhis-web-maintenance-dataadmin/menu.vm</param>
+      <param name="javascripts">javascript/scheduling.js</param>
       <param name="requiredAuthorities">F_SCHEDULING_ADMIN</param>
     </action>
 	

=== added 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	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/scheduling.js	2011-11-24 08:27:50 +0000
@@ -0,0 +1,18 @@
+
+$( document ).ready( function() 
+{
+	if ( $( '#isRunning' ).val() == 'true' )
+	{
+		$( '.scheduling' ).attr( 'disabled', 'disabled' );
+	}
+	else
+	{
+		$( '.scheduling' ).removeAttr( 'disabled' );
+	}
+} );
+
+function submitSchedulingForm()
+{
+	$( '.scheduling' ).removeAttr( 'disabled' );
+	$( '#schedulingForm' ).submit();
+}
\ 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	2011-11-02 14:39:42 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/viewScheduledTasks.vm	2011-11-24 08:27:50 +0000
@@ -1,18 +1,20 @@
 
 <h3>$i18n.getString( "scheduling_management" )</h3>
 
-<form action="scheduleTasks.action" method="post">
+<input id="isRunning" type="hidden" value="${running}">
+
+<form id="schedulingForm" action="scheduleTasks.action" method="post">
 <table>
 <tr>
 	<th>$i18n.getString( "aggregation_period_types" )</th>
 </tr>
 <tr>
 	<td>
-		<label for="monthly">$i18n.getString( "Monthly" )</label><input type="checkbox" id="monthly" name="scheduledPeriodTypes" value="Monthly"#if( $periodTypes.contains( "Monthly" ) ) checked="checked"#end>&nbsp;
-		<label for="biMonthly">$i18n.getString( "BiMonthly" )</label><input type="checkbox" id="biMonthly" name="scheduledPeriodTypes" value="BiMonthly"#if( $periodTypes.contains( "BiMonthly" ) ) checked="checked"#end>&nbsp;
-		<label for="quarterly">$i18n.getString( "Quarterly" )</label><input type="checkbox" id="quarterly" name="scheduledPeriodTypes" value="Quarterly"#if( $periodTypes.contains( "Quarterly" ) ) checked="checked"#end><br><br>
-		<label for="sixMonthly">$i18n.getString( "SixMonthly" )</label><input type="checkbox" id="sixMonthly" name="scheduledPeriodTypes" value="SixMonthly"#if( $periodTypes.contains( "SixMonthly" ) ) checked="checked"#end>&nbsp;
-		<label for="yearly">$i18n.getString( "Yearly" )</label><input type="checkbox" id="yearly" name="scheduledPeriodTypes" value="Yearly"#if( $periodTypes.contains( "Yearly" ) ) checked="checked"#end>			
+		<label for="monthly">$i18n.getString( "Monthly" )</label><input type="checkbox" id="monthly" class="scheduling" name="scheduledPeriodTypes" value="Monthly"#if( $periodTypes.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( $periodTypes.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( $periodTypes.contains( "Quarterly" ) ) checked="checked"#end><br><br>
+		<label for="sixMonthly">$i18n.getString( "SixMonthly" )</label><input type="checkbox" id="sixMonthly" class="scheduling" name="scheduledPeriodTypes" value="SixMonthly"#if( $periodTypes.contains( "SixMonthly" ) ) checked="checked"#end>&nbsp;
+		<label for="yearly">$i18n.getString( "Yearly" )</label><input type="checkbox" id="yearly" class="scheduling" name="scheduledPeriodTypes" class="scheduler" value="Yearly"#if( $periodTypes.contains( "Yearly" ) ) checked="checked"#end>			
 	</td>
 </tr>
 <tr>
@@ -20,7 +22,7 @@
 </tr>
 <tr>
 	<td>
-		<input type="submit" style="width:140px" 
+		<input type="button" style="width:140px" onclick="submitSchedulingForm()"
 		#if ( $running )
 		value="$i18n.getString( 'stop' )"
 		#else