dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #13307
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4226: Made validation popup in data entry a modal dialog
------------------------------------------------------------
revno: 4226
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-07-28 09:34:34 +0200
message:
Made validation popup in data entry a modal dialog
modified:
dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/org/hisp/dhis/de/i18n_module.properties
dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/struts.xml
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/history.vm
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/select.vm
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/validationResult.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/resources/org/hisp/dhis/de/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/org/hisp/dhis/de/i18n_module.properties 2011-06-26 19:19:35 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/org/hisp/dhis/de/i18n_module.properties 2011-07-28 07:34:34 +0000
@@ -69,7 +69,7 @@
expression = Expression
successful_validation = The data entry screen successfully passed validation
unsuccessful_validation = The data entry screen has validation errors, please correct these before proceeding
-the_following_values_violates_rules = The following values violates validation rules
+the_following_values_violate_rules = The following values violate validation rules
the_following_values_are_outliers = The following values are considered as outliers (min-max or std dev)
value = Value
operator = Operator
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/struts.xml 2011-07-28 07:15:09 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/struts.xml 2011-07-28 07:34:34 +0000
@@ -76,9 +76,8 @@
</action>
<action name="validate" class="org.hisp.dhis.de.action.ValidationAction">
- <result name="success" type="velocity">/popup.vm</result>
- <result name="input" type="velocity">/popup.vm</result>
- <param name="page">/dhis-web-dataentry/validationResult.vm</param>
+ <result name="success" type="velocity">/dhis-web-dataentry/validationResult.vm</result>
+ <result name="input" type="velocity">/dhis-web-dataentry/validationResult.vm</result>
</action>
<action name="markValueForFollowup" class="org.hisp.dhis.de.action.MarkForFollowupAction">
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/history.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/history.vm 2011-07-28 07:15:09 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/history.vm 2011-07-28 07:34:34 +0000
@@ -22,7 +22,7 @@
<table>
<tr>
<!-- Comment -->
- <td valign="top">
+ <td valign="top">
<h4>$i18n.getString( "dataelement_comment" )</h4>
<textarea id="commentTextArea" style="height:130px;width:240px">$!encoder.htmlEncode( $dataValue.comment )</textarea><br>
<input type="button" value="$i18n.getString( 'save_comment' )" style="width:130px" onclick="saveComment()">
=== 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:15:09 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js 2011-07-28 07:34:34 +0000
@@ -501,9 +501,7 @@
}
else
{
- var url = 'validate.action?periodId=' + periodId + '&dataSetId=' + dataSetId;
-
- window.open( url, '_blank', 'width=800, height=400, scrollbars=yes, resizable=yes' );
+ validate();
}
}
@@ -535,14 +533,26 @@
// Validation
// -----------------------------------------------------------------------------
+function displayValidationDialog()
+{
+ $( '#validationDiv' ).dialog( {
+ modal: true,
+ title: 'Validation',
+ width: 800,
+ height: 400
+ } );
+}
+
function validate()
{
var periodId = $( '#selectedPeriodId' ).val();
var dataSetId = $( '#selectedDataSetId' ).val();
-
- var url = 'validate.action?periodId=' + periodId + '&dataSetId=' + dataSetId;
- window.open( url, '_blank', 'width=800, height=400, scrollbars=yes, resizable=yes' );
+ $( '#validationDiv' ).load( 'validate.action', {
+ periodId: periodId,
+ dataSetId: dataSetId },
+ displayValidationDialog
+ );
}
// -----------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm 2011-07-28 07:15:09 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm 2011-07-28 07:34:34 +0000
@@ -111,3 +111,5 @@
<div id="contentDiv"></div>
<div id="historyDiv"></div>
+
+<div id="validationDiv"></div>
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/validationResult.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/validationResult.vm 2011-03-17 11:01:05 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/validationResult.vm 2011-07-28 07:34:34 +0000
@@ -1,13 +1,13 @@
<h3>$encoder.htmlEncode( $i18n.getString( "validation_result" ) )</h3>
#if( $results.size() == 0 && $dataValues.size() == 0 )
- <p><b>$encoder.htmlEncode( $i18n.getString( "successful_validation" ) )</b></p>
+ <p class="bold">$encoder.htmlEncode( $i18n.getString( "successful_validation" ) )</p>
#else
- <p><b>$encoder.htmlEncode( $i18n.getString( "unsuccessful_validation" ) )</b></p>
+ <p class="bold">$encoder.htmlEncode( $i18n.getString( "unsuccessful_validation" ) )</p>
#end
#if( $results.size() > 0)
- <p><b>$encoder.htmlEncode( $i18n.getString( "the_following_values_violates_rules" ) )</b></p>
+ <p class="bold">$encoder.htmlEncode( $i18n.getString( "the_following_values_violate_rules" ) )</p>
<table class="listTable" width="100%">
<tr>
<th style="width:110px">$encoder.htmlEncode( $i18n.getString( "validation_rule" ) )</th>
@@ -42,7 +42,7 @@
#end
#if( $dataValues.size() > 0 )
- <p><b>$encoder.htmlEncode( $i18n.getString( "the_following_values_are_outliers" ) )</b></p>
+ <p class="bold">$encoder.htmlEncode( $i18n.getString( "the_following_values_are_outliers" ) )</p>
<table class="listTable" style="width:100%">
<tr>
<th>$i18n.getString( "data_element" )</th>
@@ -66,5 +66,3 @@
#end
</table>
#end
-
-<p><input type="button" value="$encoder.htmlEncode( $i18n.getString( "close" ) )" style="width:10em" onclick="window.close()"></p>