← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4314: Disabling validation and view history functions in offline mode.

 

------------------------------------------------------------
revno: 4314
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-08-16 15:16:34 +0200
message:
  Disabling validation and view history functions in offline mode.
modified:
  dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/org/hisp/dhis/de/i18n_module.properties
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/style/dhis-web-dataentry.css


--
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-dataentry/src/main/resources/org/hisp/dhis/de/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/org/hisp/dhis/de/i18n_module.properties	2011-07-28 07:34:34 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/org/hisp/dhis/de/i18n_module.properties	2011-08-16 13:16:34 +0000
@@ -126,4 +126,5 @@
 on									= On
 value								= Value
 no_response_from_server				= No response from server. Please check connectivity and try again.
-save_comment						= Save comment
\ No newline at end of file
+save_comment						= Save comment
+operation_not_available_offline		= This operation is not available in off-line mode
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js	2011-08-16 12:16:33 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js	2011-08-16 13:16:34 +0000
@@ -109,23 +109,23 @@
         {
             if ( value.length > 255 )
             {
-                return alertField( fieldId, i18n_value_too_long + '\n\n' + dataElementName );
+                return alertField( fieldId, i18n_value_too_long + ': ' + dataElementName );
             }
             if ( type == 'int' && !isInt( value ) )
             {
-                return alertField( fieldId, i18n_value_must_integer + '\n\n' + dataElementName );
+                return alertField( fieldId, i18n_value_must_integer + ': ' + dataElementName );
             }
             if ( type == 'number' && !isRealNumber( value ) )
             {
-                return alertField( fieldId, i18n_value_must_number + '\n\n' + dataElementName );
+                return alertField( fieldId, i18n_value_must_number + ': ' + dataElementName );
             }
             if ( type == 'positiveNumber' && !isPositiveInt( value ) )
             {
-                return alertField( fieldId, i18n_value_must_positive_integer + '\n\n' + dataElementName );
+                return alertField( fieldId, i18n_value_must_positive_integer + ': ' + dataElementName );
             }
             if ( type == 'negativeNumber' && !isNegativeInt( value ) )
             {
-                return alertField( fieldId, i18n_value_must_negative_integer + '\n\n' + dataElementName );
+                return alertField( fieldId, i18n_value_must_negative_integer + ': ' + dataElementName );
             }
             if ( isValidZeroNumber( value ) )
             {
@@ -198,8 +198,8 @@
 {
     $( fieldId ).css( fieldId, COLOR_YELLOW );
     $( fieldId ).select();
-    $( fieldId ).focus();
-    alert( alertMessage );
+    $( fieldId ).focus();    
+    window.alert( alertMessage );
 
     return false;
 }

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2011-08-16 08:07:09 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2011-08-16 13:16:34 +0000
@@ -557,7 +557,7 @@
             $( '#completeButton' ).removeAttr( 'disabled' );
             $( '#undoButton' ).attr( 'disabled', 'disabled' );
 
-            alert( i18n_no_response_from_server );
+            window.alert( i18n_no_response_from_server );
         } );
     }
 }
@@ -580,7 +580,7 @@
             $( '#completeButton' ).removeAttr( 'disabled' );
             $( '#undoButton' ).attr( 'disabled', 'disabled' );
 
-            alert( i18n_no_response_from_server );
+            window.alert( i18n_no_response_from_server );
         } );
     }
     else
@@ -612,7 +612,7 @@
             $( '#completeButton' ).attr( 'disabled', 'disabled' );
             $( '#undoButton' ).removeAttr( 'disabled' );
 
-            alert( i18n_no_response_from_server );
+            window.alert( i18n_no_response_from_server );
         } );
     }
 }
@@ -640,7 +640,18 @@
         periodId : periodId,
         dataSetId : dataSetId,
         organisationUnitId: currentOrganisationUnitId
-    }, displayValidationDialog );
+    },
+    function( response, status, xhr ) 
+    {
+    	if ( status == 'error' )
+    	{
+    		window.alert( i18n_operation_not_available_offline );
+    	}
+    	else
+    	{
+    		displayValidationDialog();
+    	}
+    } );
 }
 
 // -----------------------------------------------------------------------------
@@ -670,9 +681,17 @@
         optionComboId: optionComboId,
         periodId: periodId,
         organisationUnitId: currentOrganisationUnitId 
-    }, function()
+    },
+    function( response, status, xhr ) 
     {
-        displayHistoryDialog( operandName );
+    	if ( status == 'error' )
+    	{
+    		window.alert( i18n_operation_not_available_offline );
+    	}
+    	else
+    	{
+        	displayHistoryDialog( operandName );
+    	}
     } );
 }
 

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm	2011-08-16 07:51:39 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm	2011-08-16 13:16:34 +0000
@@ -18,6 +18,7 @@
 var i18n_confirm_complete = '$encoder.jsEscape( $i18n.getString( "confirm_complete" ) , "'")';
 var i18n_confirm_undo = '$encoder.jsEscape( $i18n.getString( "confirm_undo" ) , "'")';
 var i18n_no_response_from_server = '$encoder.jsEscape( $i18n.getString( "no_response_from_server" ) , "'")';
+var i18n_operation_not_available_offline = '$encoder.jsEscape( $i18n.getString( "operation_not_available_offline" ) , "'")';
 
 var i18n_enter_digits = '$encoder.jsEscape( $i18n.getString( "enter_digits" ) , "'")';
 var i18n_max_must_be_greater_than_min = '$encoder.jsEscape( $i18n.getString( "max_must_be_greater_than_min" ) , "'")';
@@ -79,7 +80,7 @@
 	<span id="currentDataElement">$i18n.getString( "no_dataelement_selected" )</span>
 </div>
 
-<div id="actions" style="">	
+<div id="actions">	
     <input type="button" value="$i18n.getString( 'run_validation' )" onclick="validate()" id="validationButton" style="width:150px;" disabled="disabled"/>
 </div>
 

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/style/dhis-web-dataentry.css'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/style/dhis-web-dataentry.css	2011-08-16 08:07:09 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/style/dhis-web-dataentry.css	2011-08-16 13:16:34 +0000
@@ -8,7 +8,7 @@
   font-size: 14px;
   text-align: right;
   position: fixed;
-  top: 58px;
+  top: 55px;
   right: 10px;
   filter: alpha(opacity=85);
   opacity: 0.85;