dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #19769
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8758: Add validation rule for fields in program validation.
------------------------------------------------------------
revno: 8758
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-10-30 10:46:59 +0700
message:
Add validation rule for fields in program validation.
modified:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addDateProgramValidationForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addMultiProgramValidationForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientIdentifierTypeForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addSingleProgramValidationForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateMultiProgramValidationForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientIdentifierType.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateSingleProgramValidationForm.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-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties 2012-10-29 07:10:34 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties 2012-10-30 03:46:59 +0000
@@ -312,6 +312,6 @@
add_single_rule = Add single rule
add_multi_rule = Add multi rule
no_aggregation = No aggregation
-please_select_program_stage = Please select program stage
never = Never
-age_at_visit_days_since_birth = Age at visit (days since birth)
\ No newline at end of file
+age_at_visit_days_since_birth = Age at visit (days since birth)
+formula = Formula
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addDateProgramValidationForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addDateProgramValidationForm.vm 2012-01-13 02:14:28 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addDateProgramValidationForm.vm 2012-10-30 03:46:59 +0000
@@ -1,5 +1,8 @@
+
<h3>$i18n.getString( "validation_for_date_data_elements" )</h3>
+<h4>$program.name</h4>
+
<form id='programValidationForm' name='programValidationForm' method='post' action='addProgramValidation.action'>
<input type='hidden' id='programId' name='programId' value='$program.id'>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addMultiProgramValidationForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addMultiProgramValidationForm.vm 2012-10-26 03:26:57 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addMultiProgramValidationForm.vm 2012-10-30 03:46:59 +0000
@@ -14,10 +14,9 @@
</tr>
</thead>
<tbody>
-
<tr>
<td>
- <label>$i18n.getString('description')</label>
+ <label>$i18n.getString('description') <em title="$i18n.getString( "required" )" class="required">*</em></label>
</td>
</tr>
<tr>
@@ -26,25 +25,17 @@
</td>
</tr>
<tr>
- <td> </td>
- </tr>
- <tr>
- <th colspan='2'>
- <label>$i18n.getString('validation')</label>
- </th>
- </tr>
- <tr>
- <td>
- <label>$i18n.getString('left_side')</label>
- </td>
- <td>
- <label>$i18n.getString('right_side')</label>
- </td>
+ <th><label>$i18n.getString('left_side')</label></th>
+ <th><label>$i18n.getString('right_side')</label></th>
+ </tr>
+ <tr>
+ <td><label>$i18n.getString("program_stage")</label></td>
+ <td><label>$i18n.getString('program_stage')</label></td>
</tr>
<tr>
<td>
<select id='leftStage' name='leftStage' onchange="getLeftPrgramStageDataElements();" style='width:320px'>
- <option value=''>[$i18n.getString( "please_select_program_stage" )]</option>
+ <option value=''>[$i18n.getString( "please_select" )]</option>
#foreach($stage in $program.programStages)
<option value='$stage.id'>$stage.name</option>
#end
@@ -52,7 +43,7 @@
</td>
<td>
<select id='rightStage' name='rightStage' onchange="getRightPrgramStageDataElements();" style='width:320px'>
- <option value=''>[$i18n.getString( "please_select_program_stage" )]</option>
+ <option value=''>[$i18n.getString( "please_select" )]</option>
#foreach($stage in $program.programStages)
<option value='$stage.id'>$stage.name</option>
#end
@@ -60,6 +51,10 @@
</td>
</tr>
<tr>
+ <td><label>$i18n.getString("data_elements")</label></td>
+ <td><label>$i18n.getString('data_elements')</label></td>
+ </tr>
+ <tr>
<td>
<select id='leftSideDE' name='leftSideDE' size='7' ondblclick="insertDataElement(this, 'leftSide', 'leftStageDescription');" style='width:320px'>
</select>
@@ -99,23 +94,29 @@
</tr>
<tr>
<td>
- <textarea rows='5' id='leftSide' name='leftSide' class="{validate:{required:true,minlength:4}}" onkeyup="getValidationDescription('leftStageDescription', 'leftSide')" style='width:320px'></textarea>
+ <fieldset>
+ <legend>$i18n.getString("formula")</legend>
+ <textarea rows='5' id='leftSide' name='leftSide' class="{validate:{required:true,minlength:4}}" onkeyup="getValidationDescription('leftStageDescription', 'leftSide')" style='width:300px'></textarea>
+ </fieldset>
</td>
<td>
- <textarea rows='5' id='rightSide' name='rightSide' class="{validate:{required:true,minlength:4}}" onkeyup="getValidationDescription('rightStageDescription', 'rightSide')" style='width:320px'></textarea>
+ <fieldset>
+ <legend>$i18n.getString("formula")</legend>
+ <textarea rows='5' id='rightSide' name='rightSide' class="{validate:{required:true,minlength:4}}" onkeyup="getValidationDescription('rightStageDescription', 'rightSide')" style='width:300px'></textarea>
+ </fieldset>
</td>
</tr>
<tr>
<td>
<fieldset>
<legend>$i18n.getString( "description" )</legend>
- <div id='leftStageDescription'></div>
+ <div id='leftStageDescription' style='width:300px'></div>
</fieldset>
</td>
<td>
<fieldset>
<legend>$i18n.getString( "description" )</legend>
- <div id='rightStageDescription'></div>
+ <div id='rightStageDescription' style='width:300px'></div>
</fieldset>
</td>
</tr>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientIdentifierTypeForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientIdentifierTypeForm.vm 2012-09-05 14:30:23 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientIdentifierTypeForm.vm 2012-10-30 03:46:59 +0000
@@ -48,7 +48,7 @@
</tr>
<tr>
- <td><label for="type">$i18n.getString( "type" )<em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
+ <td><label for="type">$i18n.getString( "type" )</label></td>
<td>
<select style="width: 336px;" id="type" name="type" class="{validate:{required:true}}">
<option value="text" selected="selected">$i18n.getString( "text" )</option>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm 2012-10-15 04:35:32 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm 2012-10-30 03:46:59 +0000
@@ -25,7 +25,7 @@
</tr>
<tr>
- <td><label>$i18n.getString( "type" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
+ <td><label>$i18n.getString( "type" ) </label></td>
<td>
<select style="width: 336px;" id="type" name="type" onchange='programOnChange();' class="{validate:{required:true}}">
<option value='1'>$i18n.getString('multiple_events_with_registration')</option>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addSingleProgramValidationForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addSingleProgramValidationForm.vm 2012-10-26 03:26:57 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addSingleProgramValidationForm.vm 2012-10-30 03:46:59 +0000
@@ -16,24 +16,23 @@
<tbody>
<tr>
- <td>
- <label>$i18n.getString('description')</label>
- </td>
+ <td><label>$i18n.getString('description') <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
</tr>
<tr>
<td>
- <input type="text" id='description' name='description' class="{validate:{required:true,minlength:4}}" style='width:320px;'>
+ <input type="text" id='description' name='description' class="{validate:{required:true,minlength:4}}" style='width:300px;'>
</td>
</tr>
<tr>
- <th>
- <label>$i18n.getString('validation')</label>
- </th>
+ <th><label>$i18n.getString('validation')</label></th>
+ </tr>
+ <tr>
+ <td>$i18n.getString("program_stage")</td>
</tr>
<tr>
<td>
<select id='leftStage' name='leftStage' onchange="getLeftPrgramStageDataElements();" style='width:320px;'>
- <option value=''>[$i18n.getString( "please_select_program_stage" )]</option>
+ <option value=''>[$i18n.getString( "please_select" )]</option>
#foreach($stage in $program.programStages)
<option value='$stage.id'>$stage.name</option>
#end
@@ -41,6 +40,9 @@
</td>
</tr>
<tr>
+ <td>$i18n.getString("data_elements")</td>
+ </tr>
+ <tr>
<td>
<select id='leftSideDE' name='leftSideDE' size='7' ondblclick="insertDataElement(this, 'leftSide', 'leftStageDescription');" style='width:320px;'>
</select>
@@ -63,15 +65,18 @@
</tr>
<tr>
<td>
- <textarea rows='5' id='leftSide' name='leftSide' class="{validate:{required:true,minlength:4}}" onkeyup="getValidationDescription('leftStageDescription', 'leftSide')" style='width:320px;'></textarea>
- <input type='hidden' id='rightSide' name='rightSide' value='1==1'>
+ <fieldset>
+ <legend>$i18n.getString("formula")</legend>
+ <textarea rows='5' id='leftSide' name='leftSide' class="{validate:{required:true,minlength:4}}" onkeyup="getValidationDescription('leftStageDescription', 'leftSide')" style='width:320px;'></textarea>
+ <input type='hidden' id='rightSide' name='rightSide' value='1==1'>
+ </fieldset>
</td>
</tr>
<tr>
<td>
<fieldset>
<legend>$i18n.getString( "description" )</legend>
- <div id='leftStageDescription' style='width:320px;'></div>
+ <div id='leftStageDescription' style='width:300px;'></div>
</fieldset>
</td>
</tr>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateMultiProgramValidationForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateMultiProgramValidationForm.vm 2012-10-26 03:26:57 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateMultiProgramValidationForm.vm 2012-10-30 03:46:59 +0000
@@ -1,6 +1,6 @@
<h3>$i18n.getString( "edit_program_validation_rule" )</h3>
-<h4>$program.name</h4>
+<h4>$validation.program.name</h4>
<form id='programValidationForm' name='programValidationForm' method='post' action='updateProgramValidation.action'>
@@ -16,29 +16,24 @@
<tr>
<td>
- <label>$i18n.getString('description')</label>
+ <label>$i18n.getString('description') <em title="$i18n.getString( "required" )" class="required">*</em></label>
</td>
</tr>
<tr>
<td colspan='2'>
- <input type="text" id='description' style='width:640px' name='description' value='$validation.description' style='width:640px;'>
+ <input type="text" id='description' style='width:640px' name='description' value='$validation.description' style='width:640px;' class="{validate:{required:true,minlength:4}}">
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
- <th colspan='2'>
- <label>$i18n.getString('validation')</label>
- </th>
+ <th><label>$i18n.getString('left_side')</label></th>
+ <th><label>$i18n.getString('right_side')</label></th>
</tr>
<tr>
- <td>
- <label>$i18n.getString('left_side')</label>
- </td>
- <td>
- <label>$i18n.getString('right_side')</label>
- </td>
+ <td><label>$i18n.getString("program_stage")</label></td>
+ <td><label>$i18n.getString('program_stage')</label></td>
</tr>
<tr>
<td>
@@ -59,6 +54,10 @@
</td>
</tr>
<tr>
+ <td><label>$i18n.getString("data_elements")</label></td>
+ <td><label>$i18n.getString('data_elements')</label></td>
+ </tr>
+ <tr>
<td>
<select id='leftSideDE' name='leftSideDE' size='7' ondblclick="insertDataElement(this, 'leftSide');" style='width:320px;'>
</select>
@@ -98,23 +97,29 @@
</tr>
<tr>
<td>
- <textarea rows='5' id='leftSide' name='leftSide' onkeyup="getValidationDescription('leftStageDescription', 'leftSide')" style='width:320px;'>$validation.leftSide</textarea>
+ <fieldset>
+ <legend>$i18n.getString("formula")</legend>
+ <textarea rows='5' id='leftSide' name='leftSide' onkeyup="getValidationDescription('leftStageDescription', 'leftSide')" style='width:320px;'>$validation.leftSide</textarea>
+ </fieldset>
</td>
<td>
- <textarea rows='5' id='rightSide' name='rightSide' onkeyup="getValidationDescription('rightStageDescription', 'rightSide')" style='width:320px;'>$validation.rightSide</textarea>
+ <fieldset>
+ <legend>$i18n.getString("formula")</legend>
+ <textarea rows='5' id='rightSide' name='rightSide' onkeyup="getValidationDescription('rightStageDescription', 'rightSide')" style='width:300px;'>$validation.rightSide</textarea>
+ </fieldset>
</td>
</tr>
<tr>
<td>
<fieldset>
<legend>$i18n.getString( "description" )</legend>
- <div id='leftStageDescription' style='width:320px;'>$!leftDescription</div>
+ <div id='leftStageDescription' style='width:300px;'>$!leftDescription</div>
</fieldset>
</td>
<td>
<fieldset>
<legend>$i18n.getString( "description" )</legend>
- <div id='rightStageDescription' style='width:320px;'>$!rightDescription</div>
+ <div id='rightStageDescription' style='width:300px;'>$!rightDescription</div>
</fieldset>
</td>
</tr>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientIdentifierType.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientIdentifierType.vm 2012-09-05 14:30:23 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientIdentifierType.vm 2012-10-30 03:46:59 +0000
@@ -49,7 +49,7 @@
</tr>
<tr>
- <td><label for="type">$i18n.getString( "type" )<em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
+ <td><label for="type">$i18n.getString( "type" )</label></td>
<td>
<select style="width: 336px;" id="type" name="type" class="{validate:{required:true}}">
<option value="text" #if( $patientIdentifierType.type=='text' ) selected="selected" #end>$i18n.getString( "text" )</option>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm 2012-10-15 04:35:32 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm 2012-10-30 03:46:59 +0000
@@ -25,7 +25,7 @@
</tr>
<tr>
- <td><label>$i18n.getString( "type" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
+ <td><label>$i18n.getString( "type" ) </label></td>
<td>
<select style="width: 336px;" id="type" name="type" onchange='programOnChange();' class="{validate:{required:true}}">
<option value='1' #if( $program.type=='1' ) selected #end>$i18n.getString('multiple_events_with_registration')</option>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateSingleProgramValidationForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateSingleProgramValidationForm.vm 2012-10-26 03:26:57 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateSingleProgramValidationForm.vm 2012-10-30 03:46:59 +0000
@@ -1,6 +1,6 @@
<h3>$i18n.getString( "edit_program_validation_rule" )</h3>
-<h4>$program.name</h4>
+<h4>$validation.program.name</h4>
<form id='programValidationForm' name='programValidationForm' method='post' action='updateProgramValidation.action'>
@@ -16,23 +16,24 @@
<tr>
<td width="20em" colspan='2'>
- <label>$i18n.getString('description')</label>
+ <label>$i18n.getString('description') <em title="$i18n.getString( "required" )" class="required">*</em></label>
</td>
</tr>
<tr>
<td colspan='2'>
- <input type="text" id='description' name='description' value='$validation.description'>
- </td>
- </tr>
- <tr>
- <td>
- <label>$i18n.getString('left_side')</label>
- </td>
+ <input type="text" id='description' name='description' value='$validation.description' class="{validate:{required:true,minlength:4}}">
+ </td>
+ </tr>
+ <tr>
+ <th><label>$i18n.getString('validation')</label></th>
+ </tr>
+ <tr>
+ <td><label>$i18n.getString("program_stage")</label></td>
</tr>
<tr>
<td>
<select id='leftStage' name='leftStage' onchange="getLeftPrgramStageDataElements();">
- <option value=''>[$i18n.getString( "please_select_program_stage" )]</option>
+ <option value=''>[$i18n.getString( "please_select" )]</option>
#foreach($stage in $validation.program.programStages)
<option value='$stage.id'>$stage.name</option>
#end
@@ -40,6 +41,9 @@
</td>
</tr>
<tr>
+ <td>$i18n.getString("data_elements")</td>
+ </tr>
+ <tr>
<td>
<select id='leftSideDE' name='leftSideDE' size='7' ondblclick="insertDataElement(this, 'leftSide', 'leftStageDescription');">
</select>
@@ -62,15 +66,18 @@
</tr>
<tr>
<td>
- <textarea rows='5' id='leftSide' name='leftSide' onkeyup="getValidationDescription('leftStageDescription', 'leftSide')" style='width:320px;'>$validation.leftSide</textarea>
- <input type='hidden' id='rightSide' name='rightSide' value='1==1'>
+ <fieldset>
+ <legend>$i18n.getString("formula")</legend>
+ <textarea rows='5' id='leftSide' name='leftSide' onkeyup="getValidationDescription('leftStageDescription', 'leftSide')" style='width:300px;'>$validation.leftSide</textarea>
+ <input type='hidden' id='rightSide' name='rightSide' value='1==1'>
+ </fieldset>
</td>
</tr>
<tr>
<td>
<fieldset>
<legend>$i18n.getString( "description" )</legend>
- <div id='leftStageDescription' style='width:320px;'>$!leftDescription</div>
+ <div id='leftStageDescription' style='width:300px;'>$!leftDescription</div>
</fieldset>
</td>
</tr>