← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 584: Removed unnecessary code.

 

------------------------------------------------------------
revno: 584
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Sat 2009-09-05 09:10:33 +0200
message:
  Removed unnecessary code.
modified:
  dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editCustomValues.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-commons/src/main/resources/i18n_global.properties'
--- dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties	2009-09-05 07:00:46 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties	2009-09-05 07:10:33 +0000
@@ -225,4 +225,4 @@
 help.dhis-web-reporting.datacompleteness.general.content = The data completeness reporting functionality provides information on the degree of completeness of the reported data, based on user registrations of completely filled data sets.
 
 help.dhis-web-maintenance-dataset.datasetcustomvalue = Custom Value Help
-help.dhis-web-maintenance-dataset.datasetcustomvalue.content	= <b>Purpose</b><br>Custom Values are predefied data entry values. Custom Values appear in the form of a drop down box, where you can select a value from the list for the current Data Element.<p><b>How to manage Custom Values</b><br>You will see four selection areas and number of buttons to manage Custom Values. First box <b>"Available Data Elements"</b> lists all Data Elements for selected Data Set. Second box <b>"Available Category Options"</b> will list Available Category Options upon selection of Data Element from first box. If Data Element has only <b>default</b> Category Option, it will be automatically selected and any Custom Value selected for it will be listed in box four - <b>"Selected Custom Values"</b>. Box three - <b>Suggested Custom Values</b> will list possible values from existing Custom Values as user types new Custom Value text. Adding/Deleting are explained in their respective help content next to control. All actions will produce message, messages are shown at the end of form and their background colour will change depending on failure or success of action. System prevents errors by providing useful messages.
+help.dhis-web-maintenance-dataset.datasetcustomvalue.content = <b>Purpose</b><br>Custom Values are predefied data entry values. Custom Values appear in the form of a drop down box, where you can select a value from the list for the current Data Element.<p><b>How to manage Custom Values</b><br>You will see four selection areas and number of buttons to manage Custom Values. First box <b>"Available Data Elements"</b> lists all Data Elements for selected Data Set. Second box <b>"Available Category Options"</b> will list Available Category Options upon selection of Data Element from first box. If Data Element has only <b>default</b> Category Option, it will be automatically selected and any Custom Value selected for it will be listed in box four - <b>"Selected Custom Values"</b>. Box three - <b>Suggested Custom Values</b> will list possible values from existing Custom Values as user types new Custom Value text. Adding/Deleting are explained in their respective help content next to control. All actions will produce message, messages are shown at the end of form and their background colour will change depending on failure or success of action. System prevents errors by providing useful messages.

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editCustomValues.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editCustomValues.vm	2009-09-05 07:00:46 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editCustomValues.vm	2009-09-05 07:10:33 +0000
@@ -1,7 +1,3 @@
-<html> 
-<head> 
-<title>$i18n.getString( "selectdataelement" )</title> 
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 
 <script>
 /**
@@ -316,209 +312,7 @@
 };
 </script>
 
-<script>
-
-// -----------------------------------------------------------------------------
-// Author:   Torgeir Lorange Ostby, torgeilo@xxxxxxxxx
-// Version:  $Id: request.js 2644 2007-01-03 13:24:56Z torgeilo $
-// -----------------------------------------------------------------------------
-
-/*
- * Usage:
- *
- * function processResponse( response ) { ... }             // Text or XML
- * function requestFailed( httpStatusCode ) { ... }
- *
- * var request = new Request();
- * request.setResponseTypeXML( 'rootElement' );             // Optional
- * request.sendAsPost( 'value=1&value=2' );                 // Optional
- * request.setCallbackSuccess( processResponse );           // Optional
- * request.setCallbackError( requestFailed );               // Optional
- * request.send( 'url.action?value=1' );
- */
-
-function Request()
-{
-    var request;
-    var responseType = 'TEXT';
-    var requestMethod = 'GET';
-    var requestParameters = null;
-    var rootElementName;
-    var callbackSuccess;
-    var callbackError;
-
-    this.setResponseTypeXML = function( rootElementName_ )
-    {
-        responseType = 'XML';
-        rootElementName = rootElementName_;
-    };
-    
-    this.sendAsPost = function( requestParameters_ )
-    {
-        requestMethod = 'POST';
-        requestParameters = requestParameters_;
-    };
-
-    this.setCallbackSuccess = function( callbackSuccess_ )
-    {
-        callbackSuccess = callbackSuccess_;
-    };
-    
-    this.setCallbackError = function( callbackError_ )
-    {
-        callbackError = callbackError_;
-    };
-
-    this.send = function( url )
-    {
-        request = newXMLHttpRequest();
-
-        if ( !request )
-        {
-            window.alert( "Your browser doesn't support XMLHttpRequest" );
-            return;
-        }
-
-        request.onreadystatechange = responseReceived;
-        request.open( requestMethod, url, true );
-        request.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded' );         
-        request.send( requestParameters );
-    };
-    
-    function newXMLHttpRequest()
-    {
-        if ( window.XMLHttpRequest )
-        {
-            try
-            {
-                return new XMLHttpRequest();
-            }
-            catch ( e )
-            {
-                return false;
-            }
-        }
-        else if ( window.ActiveXObject )
-        {
-            try
-            {
-                return new ActiveXObject( 'Msxml2.XMLHTTP' );
-            }
-            catch ( e )
-            {
-                try
-                {
-                    return new ActiveXObject( 'Microsoft.XMLHTTP' );
-                }
-                catch ( ee )
-                {
-                    return false;
-                }
-            }
-        }
-        
-        return false;
-    }
-
-    function responseReceived()
-    {
-        if ( request.readyState == 4 )
-        {
-            switch( request.status )
-            {
-            case 200:
-                if ( callbackSuccess )
-                {
-                    if ( responseType == 'TEXT' )
-                    {
-                        callbackSuccess( request.responseText );
-                    }
-                    else
-                    {
-                        var xml = textToXML( request.responseText, rootElementName );
-
-                        callbackSuccess( xml );
-                    }
-                }
-                break;
-            case 204:
-                if ( callbackSuccess )
-                {
-                    callbackSuccess( null );
-                }
-                break;
-            case 500:
-                var message = 'Operation failed - internal server error';
-                
-                var serverMessage = request.responseText;
-
-                if ( serverMessage )
-                {
-                    var maxLength = 512;
-                    
-                    if ( serverMessage.length > maxLength )
-                    {
-                        serverMessage = serverMessage.substring( 0, maxLength - 3 ) + '...';
-                    }
-                    
-                    if ( serverMessage.length > 0 )
-                    {
-                        message += '\n\n' + serverMessage;
-                    }
-                }
-
-                message += '\n\nThe error details are logged';
-
-                window.alert( message );
-
-                break;
-            default:
-                if ( callbackError )
-                {
-                    callbackError( request.status );
-                }
-            }
-        }
-    }
-
-    function textToXML( text, rootElementName )
-    {
-        var docImpl = document.implementation;
-        var parser, dom;
-
-        // For standards compliant browsers
-        if ( docImpl && docImpl.createLSParser )
-        {
-            parser = docImpl.createLSParser( docImpl.MODE_SYNCHRONOUS, null );
-            var input = docImpl.createLSInput();
-            input.stringData = text;
-            return parser.parse( input ).documentElement;
-        }
-
-        // For IE
-        else if ( window.ActiveXObject )
-        {
-            dom = new ActiveXObject( 'Microsoft.XMLDOM' );
-            dom.async = "false";
-            dom.loadXML( text );
-            return dom.getElementsByTagName( rootElementName )[0];
-        }
-
-        // For Mozilla
-        else if ( window.DOMParser )
-        {
-            parser = new DOMParser();
-            dom = parser.parseFromString( text, 'application\/xml' );
-            return dom.documentElement;
-        }
-
-        // No parsing abilities
-        return null;
-    }
-}
-
-</script>
-<script>
+<script type="text/javascript">
 	
 // -----------------------------------------------------------------------------
 // Find Selected DataElement Count in the DataEntryForm
@@ -884,82 +678,77 @@
     margin: 15px 0 5px 0;
     }
 </style>
-</head>
-<body>
 
 <h3>$i18n.getString( "manage_custom_values" )</h3>
 
-    <table>
-    	<col> ## selectdataelement
-    	<col> ## select_optioncombo
-    <thead>
-      <tr>
-        <th>$i18n.getString( "selectdataelement" )</th>
-		<th>$i18n.getString( "select_optioncombo" )</th>
-      </tr>
-    </thead>
-    <tbody>
-        <tr>
-            <td>
-                <select name="dataElementSelector" id="dataElementSelector" onchange="getOptionCombos()" style="min-width:25em" size="10">            
-                    #foreach($dataElement in $dataElements)
-                        <option  value="$dataElement.id">$dataElement.name</option>
-                    #end 
-                </select>
-                    
-            </td>
-            <td>
-                <select name="optionComboSelector" id="optionComboSelector"  onchange="getCustomValues('get')" style="min-width:25em" size="10">
-                </select>
-            </td>
-        </tr>                       
-        <tr>
-            <td><input type="text" name="newCustomValue" id="newCustomValue" onkeydown="findSimilar()" maxlength="160" style="min-width:25em" size="60"/>&nbsp;&nbsp;
-            </td>
-            <td>
-                <button type="button" onclick="addNew()">$i18n.getString( "add_new_custom_value" )</button> &nbsp;
-                #openHelp( "dhis-web-maintenance-dataset.datasetcustomvalue" )
-            </td>
-        </tr>
-     </tbody>
-     </table> 
-     
-    <table>
-    	<col> ## available_customvalue
-    	<col> ## select_customvalue
-    <thead>
-      <tr>
-        <th>$i18n.getString( "available_customvalue" )</th>
-        <th>$i18n.getString( "select_customvalue" )</th>
-      </tr>
-    </thead>
-    <tbody>
-        <tr>  
-            <td>
-                <select name="availableCustomValue" id="availableCustomValue" onchange="setSuggestedCustomValue()" style="min-width:25em" size="10">
-                </select>
-            </td>                  
-            <td>
-                <select name="customValueSelector" id="customValueSelector" style="min-width:25em" size="10">
-                </select>
-            </td>
-        </tr>            
-    </tbody>
-    </table>
-          
-    <table>
-    <tbody>        
-        <tr>
-            <td>
-                <input type="button" onclick="remove()" value="$i18n.getString( "delete_custom_value" )" style="width:10em">
-                <input type="button" onclick="window.location.href='index.action'" value="$i18n.getString( "done_custom_value" )" style="width:10em">                
-            </td>
-        </tr> 
-    </tbody>
-    </table>                                  
-    
-</body>
-</html>
+<table>
+	<col> ## selectdataelement
+	<col> ## select_optioncombo
+<thead>
+  <tr>
+    <th>$i18n.getString( "selectdataelement" )</th>
+	<th>$i18n.getString( "select_optioncombo" )</th>
+  </tr>
+</thead>
+<tbody>
+    <tr>
+        <td>
+            <select name="dataElementSelector" id="dataElementSelector" onchange="getOptionCombos()" style="min-width:25em" size="10">            
+                #foreach($dataElement in $dataElements)
+                    <option  value="$dataElement.id">$dataElement.name</option>
+                #end 
+            </select>
+                
+        </td>
+        <td>
+            <select name="optionComboSelector" id="optionComboSelector"  onchange="getCustomValues('get')" style="min-width:25em" size="10">
+            </select>
+        </td>
+    </tr>                       
+    <tr>
+        <td><input type="text" name="newCustomValue" id="newCustomValue" onkeydown="findSimilar()" maxlength="160" style="min-width:25em" size="60"/>&nbsp;&nbsp;
+        </td>
+        <td>
+            <button type="button" onclick="addNew()">$i18n.getString( "add_new_custom_value" )</button> &nbsp;
+            #openHelp( "dhis-web-maintenance-dataset.datasetcustomvalue" )
+        </td>
+    </tr>
+ </tbody>
+ </table> 
+ 
+<table>
+	<col> ## available_customvalue
+	<col> ## select_customvalue
+<thead>
+  <tr>
+    <th>$i18n.getString( "available_customvalue" )</th>
+    <th>$i18n.getString( "select_customvalue" )</th>
+  </tr>
+</thead>
+<tbody>
+    <tr>  
+        <td>
+            <select name="availableCustomValue" id="availableCustomValue" onchange="setSuggestedCustomValue()" style="min-width:25em" size="10">
+            </select>
+        </td>                  
+        <td>
+            <select name="customValueSelector" id="customValueSelector" style="min-width:25em" size="10">
+            </select>
+        </td>
+    </tr>            
+</tbody>
+</table>
+      
+<table>
+<tbody>        
+    <tr>
+        <td>
+            <input type="button" onclick="remove()" value="$i18n.getString( "delete_custom_value" )" style="width:10em">
+            <input type="button" onclick="window.location.href='index.action'" value="$i18n.getString( "done_custom_value" )" style="width:10em">                
+        </td>
+    </tr> 
+</tbody>
+</table>                                  
 
 <div id="message" name="message">&nbsp;</div>
 <input type="hidden" name="dataSetIdField" id="dataSetIdField" value="$dataSet.id">