← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6007: Remove request object from local/in/survey module

 

------------------------------------------------------------
revno: 6007
committer: Mithilesh Kumar Thakur<mithilesh.hisp@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-02-17 12:27:38 +0530
message:
  Remove request object from local/in/survey module
modified:
  local/in/dhis-web-survey/src/main/java/org/hisp/dhis/survey/action/IndicatorListFilteredByGroup.java
  local/in/dhis-web-survey/src/main/webapp/dhis-web-survey/addSurvey.vm
  local/in/dhis-web-survey/src/main/webapp/dhis-web-survey/editSurvey.vm
  local/in/dhis-web-survey/src/main/webapp/dhis-web-survey/javascript/deTarget.js
  local/in/dhis-web-survey/src/main/webapp/dhis-web-survey/javascript/survey.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 'local/in/dhis-web-survey/src/main/java/org/hisp/dhis/survey/action/IndicatorListFilteredByGroup.java'
--- local/in/dhis-web-survey/src/main/java/org/hisp/dhis/survey/action/IndicatorListFilteredByGroup.java	2011-06-17 10:54:43 +0000
+++ local/in/dhis-web-survey/src/main/java/org/hisp/dhis/survey/action/IndicatorListFilteredByGroup.java	2012-02-17 06:57:38 +0000
@@ -145,7 +145,7 @@
         if ( surveyId != null )
         {
         	Survey survey = surveyService.getSurvey( surveyId );
-
+        	
                 indicators.removeAll( survey.getIndicators() );
         }
 

=== modified file 'local/in/dhis-web-survey/src/main/webapp/dhis-web-survey/addSurvey.vm'
--- local/in/dhis-web-survey/src/main/webapp/dhis-web-survey/addSurvey.vm	2010-06-04 11:50:05 +0000
+++ local/in/dhis-web-survey/src/main/webapp/dhis-web-survey/addSurvey.vm	2012-02-17 06:57:38 +0000
@@ -67,17 +67,21 @@
       <tr>
         <td>
           <!-- List of all available Indicators -->
-          <select size="15" id="availableList" name="availableList" multiple="multiple" style="min-width:25em;height:20em" ondblclick="addSurveyMembers()">            
+         <!-- <select size="15" id="availableList" name="availableList" multiple="multiple" style="min-width:25em;height:20em" ondblclick="addSurveyMembers()">-->
+          <select size="15" id="availableList" name="availableList" multiple="multiple" style="min-width:25em;height:20em" ondblclick="moveSelectedById( 'availableList', 'selectedList' )">	           
           </select>
         </td>
         <td>
-        	<input type="button" value="&gt;" title=$i18n.getString( 'move_selected' ) onclick="addSurveyMembers()">
+        	<!--<input type="button" value="&gt;" title=$i18n.getString( 'move_selected' ) onclick="addSurveyMembers()">-->
+        	<input type="button" value="&gt;" title=$i18n.getString( 'move_selected' ) onClick="moveSelectedById( 'availableList', 'selectedList' )">
         	<br>
-            <input type="button" value="&lt;" title=$i18n.getString( 'remove_selected' ) onclick="removeSurveyMembers()">          
+            <!--<input type="button" value="&lt;" title=$i18n.getString( 'remove_selected' ) onclick="removeSurveyMembers()">-->
+            <input type="button" value="&lt;" title=$i18n.getString( 'remove_selected' ) onClick="moveSelectedById( 'selectedList', 'availableList' )">       
         </td>
         <td>
           <!-- List of all selected Indicators -->
-          <select id="selectedList" name="selectedList" multiple="multiple" style="min-width:25em;height:20em" ondblclick="removeSurveyMembers()">
+          <!--<select id="selectedList" name="selectedList" multiple="multiple" style="min-width:25em;height:20em" ondblclick="removeSurveyMembers()">-->
+          <select id="selectedList" name="selectedList" multiple="multiple" style="min-width:25em;height:20em" ondblclick="moveSelectedById( 'selectedList', 'availableList' )">
           </select>
         </td>
       </tr>

=== modified file 'local/in/dhis-web-survey/src/main/webapp/dhis-web-survey/editSurvey.vm'
--- local/in/dhis-web-survey/src/main/webapp/dhis-web-survey/editSurvey.vm	2010-06-04 11:50:05 +0000
+++ local/in/dhis-web-survey/src/main/webapp/dhis-web-survey/editSurvey.vm	2012-02-17 06:57:38 +0000
@@ -71,17 +71,21 @@
       <tr>
         <td>
           <!-- List of all available Indicators -->
-          <select size="15" id="availableList" name="availableList" multiple="multiple" style="min-width:20em;height:20em" ondblclick="addSurveyMembers()">            
+          <!--<select size="15" id="availableList" name="availableList" multiple="multiple" style="min-width:20em;height:20em" ondblclick="addSurveyMembers()">-->
+          <select size="15" id="availableList" name="availableList" multiple="multiple" style="min-width:20em;height:20em" ondblclick="moveSelectedById( 'availableList', 'selectedList' )">            
           </select>
         </td>
         <td>
-          <input type="button" value="&gt;" title="$i18n.getString('move_selected')" onclick="addSurveyMembers()">
+          <!--<input type="button" value="&gt;" title="$i18n.getString('move_selected')" onclick="addSurveyMembers()">-->
+          <input type="button" value="&gt;" title=$i18n.getString( 'move_selected' ) onClick="moveSelectedById( 'availableList', 'selectedList' )">
           <br>
-          <input type="button" value="&lt;" title="$i18n.getString('remove_selected')" onclick="removeSurveyMembers()">
+          <!--<input type="button" value="&lt;" title="$i18n.getString('remove_selected')" onclick="removeSurveyMembers()">-->
+          <input type="button" value="&lt;" title=$i18n.getString( 'remove_selected' ) onClick="moveSelectedById( 'selectedList', 'availableList' )">
         </td>
         <td>
           <!-- List of all selected Indicators -->
-          <select id="selectedList" name="selectedList" multiple="multiple" style="min-width:20em;height:20em" ondblclick="removeSurveyMembers()">
+          <!--<select id="selectedList" name="selectedList" multiple="multiple" style="min-width:20em;height:20em" ondblclick="removeSurveyMembers()">-->
+          <select id="selectedList" name="selectedList" multiple="multiple" style="min-width:20em;height:20em" ondblclick="moveSelectedById( 'selectedList', 'availableList' )">	
           </select>
         </td>
       </tr>

=== modified file 'local/in/dhis-web-survey/src/main/webapp/dhis-web-survey/javascript/deTarget.js'
--- local/in/dhis-web-survey/src/main/webapp/dhis-web-survey/javascript/deTarget.js	2011-01-19 13:29:17 +0000
+++ local/in/dhis-web-survey/src/main/webapp/dhis-web-survey/javascript/deTarget.js	2012-02-17 06:57:38 +0000
@@ -44,7 +44,6 @@
 		window.location.href = 'deTargetManagement.action';
    }
 }
-
 //validation for adding New DeTarget
 function validateAddDeTarget()
 {
@@ -260,6 +259,8 @@
  // alert(list);
   //alert(list.length);
   
+  /*
+  
   var request = new Request();
   request.setResponseTypeXML( 'indicatorgroup' );
   request.setCallbackSuccess( filterByDataElementGroupCompleted );
@@ -270,7 +271,17 @@
   request.sendAsPost( params );
   request.send( requestString ); 
   } 
- /* 
+ */
+	$.post("filterAvailableDataElementsByDataElementGroup.action",
+			{
+				dataElementGroupId : selectedDataElementGroup
+			},
+			function (data)
+			{
+				filterByDataElementGroupCompleted(data);
+			},'xml');
+	
+  /* 
   
    $.post("filterAvailableIndicatorsByIndicatorGroup.action",
 		{
@@ -282,12 +293,13 @@
 			filterByIndicatorGroupCompleted(data);
 		},'xml');
 		*/
+  }
+  
 }
-
 function filterByDataElementGroupCompleted( xmlObject )
 {
-  //var indicators = indicatorGroup.getElementsByTagName( 'indicators' )[0];
- // var indicatorList = indicators.getElementsByTagName( 'indicator' );
+	//var indicators = indicatorGroup.getElementsByTagName( 'indicators' )[0];
+	// var indicatorList = indicators.getElementsByTagName( 'indicator' );
 
   var availableList = document.getElementById( 'availableList' );
   var selectedList = document.getElementById( 'selectedList' );

=== modified file 'local/in/dhis-web-survey/src/main/webapp/dhis-web-survey/javascript/survey.js'
--- local/in/dhis-web-survey/src/main/webapp/dhis-web-survey/javascript/survey.js	2011-01-19 13:29:17 +0000
+++ local/in/dhis-web-survey/src/main/webapp/dhis-web-survey/javascript/survey.js	2012-02-17 06:57:38 +0000
@@ -228,21 +228,23 @@
  // var list = new Array();
   
   var params = 'indicatorGroupId=' + selectedIndicatorGroup;
-  
+  /*
   for ( var i = 0; i < selectedList.options.length; ++i)
   {
   	//params += '&selectedIndicators=' + selectedList.options[i].value;
   	params += '&selectedIndicators=' + selectedList.options[i].value;
 	//list[i] = selectedList.options[i].value;
   }
+  
   // Clear the list
   var availableList = document.getElementById( 'availableList' );
 
   availableList.options.length = 0;
-  
+  */
  // alert(list);
   //alert(list.length);
   
+  /*
   var request = new Request();
   request.setResponseTypeXML( 'indicatorgroup' );
   request.setCallbackSuccess( filterByIndicatorGroupCompleted );
@@ -252,7 +254,7 @@
  // var params = "indicatorGroupId=" + selectedIndicatorGroup + "&selectedIndicators=" + list;
   request.sendAsPost( params );
   request.send( requestString ); 
-  
+  */
  /* 
   
    $.post("filterAvailableIndicatorsByIndicatorGroup.action",
@@ -265,6 +267,28 @@
 			filterByIndicatorGroupCompleted(data);
 		},'xml');
 		*/
+  
+  var listValue = "";
+
+  // Clear the list
+  var availableList = document.getElementById( 'availableList' );
+
+  availableList.options.length = 0;
+
+  for ( var i = 0; i < selectedList.options.length; ++i)
+  {
+	  listValue+='&selectedIndicators=' + selectedList.options[i].value;
+  }
+	//alert( listValue);
+	$.post("filterAvailableIndicatorsByIndicatorGroup.action?"+listValue,
+	  {
+		indicatorGroupId : selectedIndicatorGroup
+	  },
+	  function (data)
+	  {
+		  filterByIndicatorGroupCompleted(data);
+	  },'xml');
+  
 }
 
 function filterByIndicatorGroupCompleted( indicatorGroup )