← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7597: validation fix for comment fields, also updated cacheManifest

 

------------------------------------------------------------
revno: 7597
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-07-12 17:33:08 +0300
message:
  validation fix for comment fields, also updated cacheManifest
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/cacheManifest.vm
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.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-commons-resources/src/main/webapp/cacheManifest.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/cacheManifest.vm	2012-03-04 15:03:03 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/cacheManifest.vm	2012-07-12 14:33:08 +0000
@@ -1,5 +1,5 @@
 CACHE MANIFEST
-# 2.8-SNAPSHOT Version 2
+# 2.9-SNAPSHOT Version 1
 NETWORK:
 *
 CACHE:

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js	2012-03-26 18:11:26 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js	2012-07-12 14:33:08 +0000
@@ -7,6 +7,14 @@
     var commentValue = $( '#commentTextArea' ).val();
     var periodId = $( '#selectedPeriodId' ).val();
 
+    if( commentValue.length > 359 )
+    {
+        markComment( COLOR_YELLOW );
+        window.alert(i18n_value_too_long + " for comment field");
+
+        return;
+    }
+
     var commentSaver = new CommentSaver( currentDataElementId, currentOptionComboId, currentOrganisationUnitId,
             periodId, commentValue );
 
@@ -61,11 +69,11 @@
         markComment( COLOR_RED );
         window.alert( i18n_saving_comment_failed_error_code + '\n\n' + textStatus );
     }
+}
 
-    function markComment( color )
-    {
-        $( '#commentTextArea' ).css( 'background-color', color );
-    }
+function markComment( color )
+{
+    $( '#commentTextArea' ).css( 'background-color', color );
 }
 
 function removeMinMaxLimit()