dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #20254
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9172: Made the validation violation dialog in data entry a bit more readable. Displaying the validation...
------------------------------------------------------------
revno: 9172
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-12-04 18:33:33 +0100
message:
Made the validation violation dialog in data entry a bit more readable. Displaying the validation rule description and removed the left/right side descriptions.
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/ValidationRule.java
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/webapp/dhis-web-dataentry/javascript/form.js
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/validationResult.vm
dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/org/hisp/dhis/validationrule/i18n_module.properties
dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/addValidationRuleForm.vm
dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/updateValidationRuleForm.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-api/src/main/java/org/hisp/dhis/validation/ValidationRule.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/ValidationRule.java 2012-10-10 12:49:27 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/ValidationRule.java 2012-12-04 17:33:33 +0000
@@ -131,6 +131,10 @@
return "[" + name + "]";
}
+ // -------------------------------------------------------------------------
+ // Logic
+ // -------------------------------------------------------------------------
+
public void clearExpressions()
{
this.leftSide = null;
@@ -148,6 +152,11 @@
groups.remove( validationRuleGroup );
validationRuleGroup.getMembers().remove( this );
}
+
+ public String getDescriptionNameFallback()
+ {
+ return description != null && !description.trim().isEmpty() ? description : name;
+ }
// -------------------------------------------------------------------------
// Set and get methods
=== 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 2012-11-15 13:29:27 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/org/hisp/dhis/de/i18n_module.properties 2012-12-04 17:33:33 +0000
@@ -104,4 +104,6 @@
insert_input_fields_into_the_form=Insert input fields into the form
select_data_element=Select data element
all_values_for_data_element_must_be_filled=This form requires that all fields for a data element must be filled, please correct this before continuing.
-childrens_forms=Childrens forms
\ No newline at end of file
+childrens_forms=Childrens forms
+left_side=Left side
+right_side=Right side
\ No newline at end of file
=== 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 2012-11-15 16:52:10 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js 2012-12-04 17:33:33 +0000
@@ -1387,7 +1387,7 @@
$( '#validationDiv' ).dialog( {
modal: true,
title: 'Validation',
- width: 870,
+ width: 920,
height: height
} );
}
=== 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 2012-10-10 15:51:52 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/validationResult.vm 2012-12-04 17:33:33 +0000
@@ -5,13 +5,11 @@
#if( $results.size() > 0)
<table class="listTable" width="100%">
<tr>
- <th style="width:110px">$i18n.getString( "validation_rule" )</th>
+ <th>$i18n.getString( "validation_rule" )</th>
<th>$i18n.getString( "expression" )</th>
- <th>$i18n.getString( "description" )</th>
- <th>$i18n.getString( "value" )</th>
- <th>$i18n.getString( "operator" )</th>
- <th>$i18n.getString( "value" )</th>
- <th>$i18n.getString( "description" )</th>
+ <th style="width:65px">$i18n.getString( "left_side" )</th>
+ <th style="width:65px">$i18n.getString( "operator" )</th>
+ <th style="width:65px">$i18n.getString( "right_side" )</th>
</tr>
#set( $mark = false )
#foreach( $result in $results )
@@ -19,13 +17,11 @@
#set ( $leftFormula = $leftsideFormulaMap.get( $id ) )
#set ( $rightFormula = $rightsideFormulaMap.get( $id ) )
<tr>
- <td style="height:32px"#alternate( $mark )>$encoder.htmlEncode( $result.validationRule.name )</td>
+ <td style="height:32px"#alternate( $mark )>$encoder.htmlEncode( $result.validationRule.getDescriptionNameFallback() )</td>
<td#alternate( $mark )>$!encoder.htmlEncode( $leftFormula ) $encoder.htmlEncode( $i18n.getString( $result.validationRule.operator.mathematicalOperator ) ) $!encoder.htmlEncode( $rightFormula )</td>
- <td#alternate( $mark )>$!encoder.htmlEncode( $result.validationRule.leftSide.description )</td>
<td#alternate( $mark )>$result.leftsideValue</td>
<td#alternate( $mark )>$encoder.htmlEncode( $i18n.getString( $result.validationRule.operator.mathematicalOperator ) )</td>
<td#alternate( $mark )>$result.rightsideValue</td>
- <td#alternate( $mark )>$!encoder.htmlEncode( $result.validationRule.rightSide.description )</td>
</tr>
#if( $mark )
#set( $mark = false )
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/org/hisp/dhis/validationrule/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/org/hisp/dhis/validationrule/i18n_module.properties 2012-09-22 21:59:39 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/org/hisp/dhis/validationrule/i18n_module.properties 2012-12-04 17:33:33 +0000
@@ -125,4 +125,5 @@
analysing_please_wait=Analysing data, please wait
skip_for_missing_values=Skip for missing values
select_parameters=Select parameters
-compulsory_pair=Compulsory pair
\ No newline at end of file
+compulsory_pair=Compulsory pair
+visible_in_validation_violations=visible in validation violations
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/addValidationRuleForm.vm'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/addValidationRuleForm.vm 2012-10-17 18:53:29 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/addValidationRuleForm.vm 2012-12-04 17:33:33 +0000
@@ -6,11 +6,11 @@
<th colspan="2">$i18n.getString( "details" )</th>
</tr>
<tr>
- <td><label for="name">$encoder.htmlEncode( $i18n.getString( "name" ) ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
+ <td style="width:120px"><label for="name">$encoder.htmlEncode( $i18n.getString( "name" ) ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
<td><input type="text" id="name" name="name"></td>
</tr>
<tr>
- <td><label for="description">$encoder.htmlEncode( $i18n.getString( "description" ) )</label></td>
+ <td><label for="description">$encoder.htmlEncode( $i18n.getString( "description" ) ) ($encoder.htmlEncode( $i18n.getString( "visible_in_validation_violations" ) ))</label></td>
<td><textarea name="description"></textarea></td>
</tr>
<tr>
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/updateValidationRuleForm.vm'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/updateValidationRuleForm.vm 2012-10-17 18:53:29 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/updateValidationRuleForm.vm 2012-12-04 17:33:33 +0000
@@ -16,11 +16,11 @@
<th colspan="2">$i18n.getString( "details" )</th>
</tr>
<tr>
- <td><label for="name">$encoder.htmlEncode( $i18n.getString( "name" ) ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
+ <td style="width:120px"><label for="name">$encoder.htmlEncode( $i18n.getString( "name" ) ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
<td><input type="text" id="name" name="name" value="$!encoder.htmlEncode( $validationRule.name )"></td>
</tr>
<tr>
- <td><label for="description">$encoder.htmlEncode( $i18n.getString( "description" ) )</label></td>
+ <td><label for="description">$encoder.htmlEncode( $i18n.getString( "description" ) ) ($encoder.htmlEncode( $i18n.getString( "visible_in_validation_violations" ) ))</label></td>
<td><textarea name="description">$!encoder.htmlEncode( $validationRule.description )</textarea></td>
</tr>
<tr>