← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4228: Made validation result details in validation module a modal dialog

 

------------------------------------------------------------
revno: 4228
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-07-28 10:10:02 +0200
message:
  Made validation result details in validation module a modal dialog
modified:
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js
  dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/general.js
  dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/runValidation.js
  dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/viewValidationResultDetailsForm.vm
  dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/viewValidationResultForm.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-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-07-28 07:34:34 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2011-07-28 08:10:02 +0000
@@ -549,8 +549,7 @@
     var dataSetId = $( '#selectedDataSetId' ).val();
 	
 	$( '#validationDiv' ).load( 'validate.action', {
-		periodId: periodId,
-		dataSetId: dataSetId },
+		periodId: periodId, dataSetId: dataSetId },	
 		displayValidationDialog
 	);
 }
@@ -574,9 +573,7 @@
 	var periodId = $( '#selectedPeriodId' ).val();
 	
     $( '#historyDiv' ).load( 'viewHistory.action', {
-    	dataElementId: dataElementId,
-    	optionComboId: optionComboId,
-    	periodId: periodId },
+    	dataElementId: dataElementId, optionComboId: optionComboId, periodId: periodId },
     	displayHistoryDialog
     );
 }

=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/struts.xml	2011-06-23 14:44:17 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/struts.xml	2011-07-28 08:10:02 +0000
@@ -148,9 +148,7 @@
     </action>
 
     <action name="viewValidationResultDetails" class="org.hisp.dhis.validationrule.action.GetValidationResultDetailsAction">
-      <result name="success" type="velocity">/popup.vm</result>
-      <param name="page">/dhis-web-validationrule/viewValidationResultDetailsForm.vm</param>
-      <param name="javascripts">javascript/runValidation.js</param>
+      <result name="success" type="velocity">/dhis-web-validationrule/viewValidationResultDetailsForm.vm</result>
     </action>
 
     <action name="exportValidationResult" class="org.hisp.dhis.validationrule.action.ExportValidationResultAction">
@@ -158,7 +156,7 @@
       <result name="xls" type="gridXlsResult" />
       <result name="pdf" type="gridPdfResult" />
     </action>
-        
+    
     <!-- Data analysis -->
 
     <action name="viewAnalysisForm" class="org.hisp.dhis.validationrule.action.dataanalysis.ViewAnalysisFormAction">

=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/general.js'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/general.js	2010-09-04 06:30:08 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/general.js	2011-07-28 08:10:02 +0000
@@ -56,20 +56,6 @@
     return null;
 }
 
-function getElementValue( parentElement, childElementName )
-{
-    var textNode = parentElement.getElementsByTagName( childElementName )[0].firstChild;
-
-    if ( textNode )
-    {
-        return textNode.nodeValue;
-    }
-    else
-    {
-        return null;
-    }
-}
-
 function removeValidationRule( ruleId, ruleName )
 {
 	removeItem( ruleId, ruleName, i18n_confirm_delete, 'removeValidationRule.action' );

=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/runValidation.js'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/runValidation.js	2011-06-23 14:44:17 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/runValidation.js	2011-07-28 08:10:02 +0000
@@ -73,18 +73,22 @@
     } );
 }
 
+function displayValidationDetailsDialog()
+{
+	$( '#validationResultDetailsDiv' ).dialog( {
+	    modal: true,
+	   	title: 'Validation details',
+	   	width: 550,
+	   	height: 500
+	} );
+}
+
 function viewValidationResultDetails( validationRuleId, sourceId, periodId )
 {
-    var url = "viewValidationResultDetails.action?validationRuleId=" + validationRuleId + "&sourceId=" + sourceId
-            + "&periodId=" + periodId;
-
-    var dialog = window
-            .open(
-                    url,
-                    "_blank",
-                    "directories=no, \
-    		 height=550, width=500, location=no, menubar=no, status=no, \
-    		 toolbar=no, resizable=yes" );
+	$( '#validationResultDetailsDiv' ).load( 'viewValidationResultDetails.action', {
+		validationRuleId: validationRuleId, sourceId: sourceId, periodId: periodId },
+		displayValidationDetailsDialog 
+	);
 }
 
 function aggregateChanged()

=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/viewValidationResultDetailsForm.vm'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/viewValidationResultDetailsForm.vm	2011-03-28 20:09:32 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/viewValidationResultDetailsForm.vm	2011-07-28 08:10:02 +0000
@@ -51,7 +51,3 @@
 	</tr>
 	#end
 </table>
-
-<br>
-
-<p><input type="button" value="$i18n.getString( 'close' )" onclick="javascript:window.close()" style="width:100px"></p>

=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/viewValidationResultForm.vm'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/viewValidationResultForm.vm	2011-07-05 02:32:39 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/viewValidationResultForm.vm	2011-07-28 08:10:02 +0000
@@ -1,4 +1,8 @@
 <script type="text/javascript">
+	jQuery(document).ready(function(){	
+		tableSorter( 'validationRuleList' );
+	});
+	
 	var i18n_analysing_please_wait = '$encoder.jsEscape( $i18n.getString( "analysing_please_wait" ) , "'")';
 </script>
 
@@ -120,8 +124,4 @@
 
 #end
 
-<script type="text/javascript">
-	jQuery(document).ready(function(){	
-		tableSorter( 'validationRuleList' );
-	});
-</script>
+<div id="validationResultDetailsDiv"></div>