← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2119: Show Details Bug Fixed in Survey Module

 

------------------------------------------------------------
revno: 2119
committer: Mithilesh Kumar Thakur<mithilesh.hisp@xxxxxxxxx>
branch nick: trunk
timestamp: Wed 2010-09-15 18:53:57 +0530
message:
   Show Details  Bug Fixed in Survey Module 
modified:
  local/in/dhis-web-excelimport/src/main/java/org/hisp/dhis/excelimport/action/ExcelImportResultAction.java
  local/in/dhis-web-excelimport/src/main/java/org/hisp/dhis/excelimport/action/NoAction.java
  local/in/dhis-web-survey/src/main/java/org/hisp/dhis/survey/action/GetSurveyAction.java
  local/in/dhis-web-survey/src/main/resources/org/hisp/dhis/survey/i18n_module.properties
  local/in/dhis-web-survey/src/main/resources/struts.xml
  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/responseSurveyObject.vm
  local/in/dhis-web-survey/src/main/webapp/dhis-web-survey/surveyList.vm
  local/in/pom.xml


--
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-excelimport/src/main/java/org/hisp/dhis/excelimport/action/ExcelImportResultAction.java'
--- local/in/dhis-web-excelimport/src/main/java/org/hisp/dhis/excelimport/action/ExcelImportResultAction.java	2010-08-17 08:35:20 +0000
+++ local/in/dhis-web-excelimport/src/main/java/org/hisp/dhis/excelimport/action/ExcelImportResultAction.java	2010-09-15 13:23:57 +0000
@@ -548,7 +548,8 @@
         String excelImportFolderName = "excelimport";
 
         inputStream = new BufferedInputStream( new FileInputStream( file ) );
-
+        
+       
         String excelTemplatePath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator
             + excelImportFolderName + File.separator + "template" + File.separator + reportFileNameTB;
 
@@ -574,7 +575,7 @@
         }
         
         Workbook excelImportFile = Workbook.getWorkbook( file );
-
+       
         Workbook excelTemplateFile = Workbook.getWorkbook( new File( excelTemplatePath ) );
 
         excelValidator = validateReport( deCodesImportXMLFileName, excelImportFile, excelTemplateFile );

=== modified file 'local/in/dhis-web-excelimport/src/main/java/org/hisp/dhis/excelimport/action/NoAction.java'
--- local/in/dhis-web-excelimport/src/main/java/org/hisp/dhis/excelimport/action/NoAction.java	2010-06-04 11:50:05 +0000
+++ local/in/dhis-web-excelimport/src/main/java/org/hisp/dhis/excelimport/action/NoAction.java	2010-09-15 13:23:57 +0000
@@ -1,9 +1,9 @@
 package org.hisp.dhis.excelimport.action;
 
-import com.opensymphony.xwork2.ActionSupport;
+import com.opensymphony.xwork2.Action;
 
 public class NoAction
-    extends ActionSupport
+    implements Action
 {
     public String execute()
     {

=== modified file 'local/in/dhis-web-survey/src/main/java/org/hisp/dhis/survey/action/GetSurveyAction.java'
--- local/in/dhis-web-survey/src/main/java/org/hisp/dhis/survey/action/GetSurveyAction.java	2010-06-15 11:26:37 +0000
+++ local/in/dhis-web-survey/src/main/java/org/hisp/dhis/survey/action/GetSurveyAction.java	2010-09-15 13:23:57 +0000
@@ -113,9 +113,9 @@
         throws Exception
     {
     	survey = surveyService.getSurvey( surveyId );
-
+    	
     	surveyIndicators = new ArrayList<Indicator>( survey.getIndicators() );
-
+    	
         //Collections.sort( surveyIndicators, dataElementComparator );       
                 	
         //displayPropertyHandler.handle( dataSetDataElements );

=== modified file 'local/in/dhis-web-survey/src/main/resources/org/hisp/dhis/survey/i18n_module.properties'
--- local/in/dhis-web-survey/src/main/resources/org/hisp/dhis/survey/i18n_module.properties	2010-09-01 07:01:26 +0000
+++ local/in/dhis-web-survey/src/main/resources/org/hisp/dhis/survey/i18n_module.properties	2010-09-15 13:23:57 +0000
@@ -44,5 +44,6 @@
 specify_name = specify name 
 define_survey_associations = Define Survey Associations
 value_must_integer  = value must be integer 
+none = NONE
 
 

=== modified file 'local/in/dhis-web-survey/src/main/resources/struts.xml'
--- local/in/dhis-web-survey/src/main/resources/struts.xml	2010-09-10 11:35:58 +0000
+++ local/in/dhis-web-survey/src/main/resources/struts.xml	2010-09-15 13:23:57 +0000
@@ -164,8 +164,7 @@
 		
 		<action name="getSurvey"
 			class="org.hisp.dhis.survey.action.GetSurveyAction">
-			<result name="success" type="velocity-xml">
-				/dhis-web-survey/responseSurveyObject.vm</result>
+			<result name="success" type="velocity-xml">/dhis-web-survey/responseSurveyObject.vm</result>
 			<param name="onExceptionReturn">plainTextError</param>
 		</action>
 		

=== 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	2010-09-10 11:35:58 +0000
+++ local/in/dhis-web-survey/src/main/webapp/dhis-web-survey/javascript/survey.js	2010-09-15 13:23:57 +0000
@@ -13,8 +13,6 @@
 
   if ( result )
   {
-    //window.location.href = 'delSurvey.action?surveyId=' + surveyId;
-    
 	$.post("delSurvey.action",
 		{
 			surveyId : surveyId
@@ -34,11 +32,8 @@
   
     if ( type == 'error' )
    {
-		//document.getElementById( 'message' ).innerHTML = message;
-		//document.getElementById( 'message' ).style.display = 'block';
-		var message = messageElement.firstChild.nodeValue;
-		setFieldValue( 'warningField', message );
-			
+    	var message = messageElement.firstChild.nodeValue;
+		setFieldValue( 'warningField', message );			
 		showWarning();
    }
    else
@@ -268,7 +263,7 @@
 
 function showSurveyDetails( surveyId )
 {
-   $.get("getSurvey.action",
+	$.get("getSurvey.action",
 		{
 			surveyId : surveyId
 		},
@@ -280,26 +275,17 @@
 
 function surveyRecieved( surveyElement )
 {
-  byId('idField').innerHTML = surveyElement.getElementsByTagName( 'id' )[0].firstChild.nodeValue;
-  byId('nameField').innerHTML = surveyElement.getElementsByTagName( 'name' )[0].firstChild.nodeValue;
-  byId('indicatorCountField').innerHTML = surveyElement.getElementsByTagName( 'indicatorCount' )[0].firstChild.nodeValue;
-  byId('descriptionField').innerHTML = surveyElement.getElementsByTagName( 'description' )[0].firstChild.nodeValue;
-  var urlOrg = surveyElement.getElementsByTagName( 'url' )[0].firstChild.nodeValue;
  
-  if( urlOrg == null || urlOrg.length <=0 )
-  {
-     urlOrg = 'NONE';
-     byId('urlField').innerHTML = urlOrg;
-  }
-  else
-  {  
-    var occur = urlOrg.match("http://";);
-    if( occur == null || occur.length <=0 )
-      byId('urlField').innerHTML = "<a href='http://"+urlOrg+";' target='_blank'>"+urlOrg+"</a>";
-    else
-      byId('urlField').innerHTML = "<a href='"+urlOrg+"' target='_blank'>"+urlOrg+"</a>";
-  }   
-      
-    showDetails();
+  setInnerHTML( 'idField', getElementValue( surveyElement, 'id' ) );
+  setInnerHTML( 'nameField', getElementValue( surveyElement, 'name' ) );
+  setInnerHTML( 'indicatorCountField', getElementValue( surveyElement, 'indicatorCount' ) );
+  
+  var desCription = getElementValue( surveyElement, 'description' );
+  setInnerHTML( 'descriptionField', desCription ? desCription : '[' + i18n_none + ']' );
+  
+  var url = getElementValue( surveyElement, 'url' );
+  setInnerHTML( 'urlField', url ? '<a href="' + url + '">' + url + '</a>' : '[' + i18n_none + ']' );
+  
+   showDetails();
 }
 

=== modified file 'local/in/dhis-web-survey/src/main/webapp/dhis-web-survey/responseSurveyObject.vm'
--- local/in/dhis-web-survey/src/main/webapp/dhis-web-survey/responseSurveyObject.vm	2010-06-04 11:50:05 +0000
+++ local/in/dhis-web-survey/src/main/webapp/dhis-web-survey/responseSurveyObject.vm	2010-09-15 13:23:57 +0000
@@ -3,6 +3,6 @@
   <id>$survey.id</id>
   <name>$encoder.xmlEncode( $survey.name )</name> 
   <indicatorCount>$surveyIndicators.size()</indicatorCount>
-  <url>$survey.url</url>
+  <url>$encoder.xmlEncode( $survey.url )</url>
   <description>$encoder.xmlEncode( $survey.description )</description>   
 </survey>
\ No newline at end of file

=== modified file 'local/in/dhis-web-survey/src/main/webapp/dhis-web-survey/surveyList.vm'
--- local/in/dhis-web-survey/src/main/webapp/dhis-web-survey/surveyList.vm	2010-06-04 11:50:05 +0000
+++ local/in/dhis-web-survey/src/main/webapp/dhis-web-survey/surveyList.vm	2010-09-15 13:23:57 +0000
@@ -81,4 +81,5 @@
 	window.location.href="section.action?surveyId=" + surveyId;
 }
 var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete" ) , "'" )';
+var i18n_none = '$encoder.jsEscape( $i18n.getString( "none" ) , "'" )';
 </script>

=== modified file 'local/in/pom.xml'
--- local/in/pom.xml	2010-08-20 09:13:09 +0000
+++ local/in/pom.xml	2010-09-15 13:23:57 +0000
@@ -22,7 +22,7 @@
 <!--  <module>dhis-web-mobile</module>
 	<module>dhis-web-reports-in</module>-->
     <module>dhis-web-reports-national</module>
-<!--	<module>dhis-web-survey</module> -->
+	<module>dhis-web-survey</module> 
 	<module>dhis-web-validationrule-in</module>
   </modules>