dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #30246
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15344: Fixed bug - Error when displaying values of TYes-Only attributes in registration form.
------------------------------------------------------------
revno: 15344
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-05-22 10:24:43 +0800
message:
Fixed bug - Error when displaying values of TYes-Only attributes in registration form.
modified:
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/attributeFormDiv.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentForm.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackedEntityInstanceForm.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-caseentry/src/main/webapp/dhis-web-caseentry/attributeFormDiv.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/attributeFormDiv.vm 2014-05-22 02:12:37 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/attributeFormDiv.vm 2014-05-22 02:24:43 +0000
@@ -11,6 +11,8 @@
<option value="true" #if($value=='true') selected #end >$i18n.getString( "yes" )</option>
<option value="false" #if($value=='false') selected #end >$i18n.getString( "no" )</option>
</select>
+ #elseif( $attribute.valueType == "trueOnly" )
+ <input type='checkbox' value="true" id="attr$attribute.id" name="attr$attribute.id" #if($value=='true') checked #end>
#elseif( $attribute.valueType == "date" )
<input type="text" id="attr$attribute.id" name="attr$attribute.id" value='$!format.formatDate($value)' objectId='$attribute.id' objectType='attr' class=' #validate( "default" $attribute.mandatory )' >
<script type="text/javascript">
@@ -23,7 +25,25 @@
<option value="$option" #if($value==$option) selected #end >$option</option>
#end
</select>
- #else
+ #elseif( $attribute.valueType == "users" )
+ <select inherit="$!attribute.inherit" class=' #validate( "default" $mandatory )' >
+ <option value="">[$i18n.getString("please_select")]</option>
+ #foreach( $user in $healthWorkers)
+ <option value="$user.id" #if($attributeValue == $user.id) selected="selected" #end >$user.name</option>
+ #end
+ </select>
+ #elseif( $attribute.valueType == "phoneNumber" )
+ #if($attributeValue=='')
+ #set($attributeValue=$!phoneNumberAreaCode)
+ #end
+ <input type='text' value='$attributeValue' id="attr$attribute.id" name="attr$attribute.id" inherit="$!attribute.inherit" class="{validate:{phone:true}}"/>
+ #elseif( $attribute.valueType == "trackerAssociate" )
+ <input type="checkbox" value='true' id="attr$attribute.id" name="attr$attribute.id"
+ inherit="$!attribute.inherit" #if($value=='true') checked #end
+ onclick="toggleUnderAge(this);" class='underAge' />
+ #elseif( $attribute.valueType == "age" || $attribute.valueType == "number" )
+ <input type='text' id="attr$attribute.id" value="$!attributeValue" name="attr$attribute.id" inherit="$!attribute.inherit" class="{validate:{required:$mandatory ,number:true}}"/>
+ #else
<input type="text" id="attr$attribute.id" name="attr$attribute.id" value='$value' class="{validate:{required:$attribute.mandatory #if($!attribute.noChars),maxlength:$attribute.noChars #end #if($attribute.valueType=='NUMBER'),number:true #end }}" >
#end
</td>
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentForm.vm 2014-05-14 14:25:05 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentForm.vm 2014-05-22 02:24:43 +0000
@@ -6,7 +6,7 @@
<input type='hidden' id='entityInstanceId' name='entityInstanceId' value='$programInstance.entityInstance.id' />
<input type='hidden' id='entityInstanceUid' name='entityInstanceUid' value='$programInstance.entityInstance.uid' />
<input type='hidden' id='hasDataEntry' name='hasDataEntry' value='$hasDataEntry' />
-<input type='hidden' name='editDataEntryForm' id='editDataEntryForm' value='$auth.hasAccess( "dhis-web-caseentry", "editDataEntryForm" )'>
+<input type='hidden' id='editDataEntryForm' name='editDataEntryForm' value='$auth.hasAccess( "dhis-web-caseentry", "editDataEntryForm" )'>
<div id="tabs">
<ul>
@@ -73,19 +73,39 @@
<option value="true" #if( $attributeValue=='true') selected="selected" #end>$i18n.getString( "yes" )</option>
<option value="false" #if( $attributeValue=='false') selected="selected" #end>$i18n.getString( "no" )</option>
</select>
+ #elseif( $attribute.valueType == "trueOnly" )
+ <input type='checkbox' value="true" id="attr$attribute.id" name="attr$attribute.id" #if($attributeValue=='true') checked #end>
#elseif( $attribute.valueType == "date" )
<input type="text" id="attr$attribute.id" name="attr$attribute.id" value="$!attributeValue" objectId='$attribute.id' objectType='attr' class="{validate:{required:$mandatory}}" >
<script type="text/javascript">
datePickerValid( 'attr$attribute.id', false, false );
</script>
- #elseif( $attribute.valueType == "combo" )
+ #elseif( $attribute.valueType == "optionSet" )
<select id="attr$attribute.id" name="attr$attribute.id" class="{validate:{required:$mandatory}}" >
<option value="">[$i18n.getString( "please_select" )]</option>
#foreach ($option in $attribute.optionSet.options )
<option value="$option" #if($attributeValue == $option) selected="selected" #end>$option</option>
#end
</select>
- #else
+ #elseif( $attribute.valueType == "users" )
+ <select inherit="$!attribute.inherit" class=' #validate( "default" $mandatory )' >
+ <option value="">[$i18n.getString("please_select")]</option>
+ #foreach( $user in $healthWorkers)
+ <option value="$user.id" #if($attributeValue == $user.id) selected="selected" #end >$user.name</option>
+ #end
+ </select>
+ #elseif( $attribute.valueType == "phoneNumber" )
+ #if($attributeValue=='')
+ #set($attributeValue=$!phoneNumberAreaCode)
+ #end
+ <input type='text' value='$attributeValue' id="attr$attribute.id" name="attr$attribute.id" inherit="$!attribute.inherit" class="{validate:{phone:true}}"/>
+ #elseif( $attribute.valueType == "trackerAssociate" )
+ <input type="checkbox" value='true' id="attr$attribute.id" name="attr$attribute.id"
+ inherit="$!attribute.inherit" #if($attributeValue=='true') checked #end
+ onclick="toggleUnderAge(this);" class='underAge' />
+ #elseif( $attribute.valueType == "age" || $attribute.valueType == "number" )
+ <input type='text' id="attr$attribute.id" value="$!attributeValue" name="attr$attribute.id" inherit="$!attribute.inherit" class="{validate:{required:$mandatory ,number:true}}"/>
+ #else
<input type="text" id="attr$attribute.id" name="attr$attribute.id" value="$!attributeValue" class="{validate:{required:$mandatory #if($!attribute.noChars),maxlength:$attribute.noChars #end #if($attribute.valueType=='NUMBER'),number:true #end }}" >
#end
</td>
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackedEntityInstanceForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackedEntityInstanceForm.vm 2014-05-22 02:09:49 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackedEntityInstanceForm.vm 2014-05-22 02:24:43 +0000
@@ -51,9 +51,9 @@
<td class="input-column">
#if( $attribute.valueType == "bool" )
<select id="attr$attribute.id" name="attr$attribute.id" inherit="$!attribute.inherit" class="{validate:{required:$mandatory }}" >
- <option value="" selected="selected">[$i18n.getString( "please_select" )]</option>
- <option value="true" #if($value=='true') selected #end>$i18n.getString( "yes" )</option>
- <option value="false" #if($value=='false') selected #end>$i18n.getString( "no" )</option>
+ <option value="" selected="selected">[$i18n.getString( "please_select" )]</option>
+ <option value="true" #if($value=='true') selected #end>$i18n.getString( "yes" )</option>
+ <option value="false" #if($value=='false') selected #end>$i18n.getString( "no" )</option>
</select>
#elseif( $attribute.valueType == "trueOnly" )
<input type='checkbox' value="true" id="attr$attribute.id" name="attr$attribute.id" inherit="$!attribute.inherit" #if($value=='true') checked #end class="{validate:{required:$mandatory }}" >
@@ -73,7 +73,7 @@
<select inherit="$!attribute.inherit" class=' #validate( "default" $mandatory )' >
<option value="">[$i18n.getString("please_select")]</option>
#foreach( $user in $healthWorkers)
- <option value="$user.id" #if($attributeValue == $user.id) selected="selected" #end >$user.name</option>
+ <option value="$user.id" #if($value == $user.id) selected="selected" #end >$user.name</option>
#end
</select>
#elseif( $attribute.valueType == "phoneNumber" )
@@ -117,7 +117,7 @@
<option value="false" #if( !$attributeValue ) selected="selected" #end>$i18n.getString( "no" )</option>
</select>
#elseif( $attribute.valueType == "trueOnly" )
- <input type='checkbox' value="true" id="attr$attribute.id" name="attr$attribute.id" inherit="$!attribute.inherit" #if($value=='true') checked #end>
+ <input type='checkbox' value="true" id="attr$attribute.id" name="attr$attribute.id" inherit="$!attribute.inherit" #if($attributeValue=='true') checked #end>
#elseif( $attribute.valueType == "date" )
<input type="text" id="attr$attribute.id" name="attr$attribute.id" inherit="$!attribute.inherit" value="$!attributeValue" class=' #validate( "default" $mandatory )'>
<script type="text/javascript">
@@ -144,7 +144,7 @@
<input type='text' value='$attributeValue' id="attr$attribute.id" name="attr$attribute.id" inherit="$!attribute.inherit" class="{validate:{phone:true}}"/>
#elseif( $attribute.valueType == "trackerAssociate" )
<input type="checkbox" value='true' id="attr$attribute.id" name="attr$attribute.id"
- inherit="$!attribute.inherit" #if($value=='true') checked #end
+ inherit="$!attribute.inherit" #if($attributeValue=='true') checked #end
onclick="toggleUnderAge(this);" class='underAge' />
#elseif( $attribute.valueType == "age" || $attribute.valueType == "number" )
<input type='text' id="attr$attribute.id" value="$!attributeValue" name="attr$attribute.id" inherit="$!attribute.inherit" class="{validate:{required:$mandatory ,number:true}}"/>