dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #08469
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2033: Cleaning up a bit in data entry, not using old default form in section form for non-multidimensio...
------------------------------------------------------------
revno: 2033
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2010-11-11 16:56:41 +0100
message:
Cleaning up a bit in data entry, not using old default form in section form for non-multidimensional dataelements
removed:
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/section/dataElement.vm
modified:
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/section/form.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
=== removed file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/section/dataElement.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/section/dataElement.vm 2010-10-28 09:17:13 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/section/dataElement.vm 1970-01-01 00:00:00 +0000
@@ -1,165 +0,0 @@
-<table class="mainPageTable" cellpadding="0">
- <col id="noCol"/>
- <col id="deCol"/>
- <col id="typeCol"/>
- <col id="minCol"/>
- <col id="entryCol"/>
- <col id="maxCol"/>
- <col id="commentCol"/>
- <!--
- <col>
- <col>
- -->
- <tr>
- <th style="text-align:center">$i18n.getString( "nr" )</th>
- <th style="text-align:center">$i18n.getString( "data_element" )</th>
- <th style="text-align:center">$i18n.getString( "value_type" )</th>
- <th style="text-align:center">$i18n.getString( "min" )</th>
- <th style="text-align:center">$i18n.getString( "entry" )</th>
- <th style="text-align:center">$i18n.getString( "max" )</th>
- <th style="text-align:center">$i18n.getString( "comment" )</th>
- <!--<th>$i18n.getString( "timestamp" )</th>-->
- <!--<th>$i18n.getString( "stored_by" )</th>-->
- </tr>
-
-#set( $count = 0 )
-#set( $mark = 0 )
-
-#foreach( $dataElement in $section.dataElements )
- #set( $count = $count + 1 )
- #if( $mark == 1 )
- #set( $mark = 0 )
- #else
- #set( $mark = 1 )
- #end
-
- #set( $optionComboId = $defaultOptionComboId )
- #set( $dataValue = false )
- #set( $dataValue = $dataValueMap.get( "$dataElement.id:$defaultOptionComboId" ) )
- #set( $calculatedValue = false )
- #set( $calculatedValue = $calculatedValueMap.get( $dataElement ) )
- #set( $minMax = false )
- #set( $minMax = $minMaxMap.get( "$dataElement.id:$defaultOptionComboId" ) )
- #set( $calculated = false )
- #set( $calculated = ($calculatedDataElementIds.contains($dataElement.id)) )
- <tr>
- ##count
- <td style="text-align:center">$count</td>
-
- ##data element name
- <td #if( $mark == 0 ) style="background-color:#dddddd" #end>
- <span id="value[$dataElement.id].name" title="$!encoder.htmlEncode( $dataElement.description )">
- #if( $dataElement.type == "int" && $auth.hasAccess( "dhis-web-dataentry", "viewHistory" ) )
- <a href="javascript:viewHistory( $dataElement.id, $optionComboId, true )">
- #end
- #if( $useShortName )
- $encoder.htmlEncode( $dataElement.shortName )
- #else
- $encoder.htmlEncode( $dataElement.name )
- #end
- #if( $dataElement.type == "int" && $auth.hasAccess( "dhis-web-dataentry", "viewHistory" ) )
- </a>
- #end
- </span>
- </td>
-
- ##type
- <td>$dataElementValueTypeMap.get( $dataElement.getDetailedNumberType() )<span id="value[$dataElement.id].type" style="display:none">$dataElement.getDetailedNumberType()</span></td>
-
- ##min value
- <td>
- #if( $dataElement.type == "int" )
- <div id="value[$dataElement.id:$optionComboId].min" style="text-align:center">$!minMax.min</div>
- #end
- </td>
-
- ##entry
- <td>
-
- #set( $greyedField = false )
- #set( $greyedField = $greyedFields.get( "$dataElement.id:$optionComboId" ) )
-
- #set( $dataEntryId = "value[$dataElement.id].value:value[$optionComboId].value" )
- ##Data Entry
- #if( $dataElement.type == "bool" )
- <select name="entryselect" id="$dataEntryId" #if( $auth.hasAccess( "dhis-web-dataentry", "saveValue" )) onchange="saveBoolean( $dataElement.id, $optionComboId, this )" #else disabled="disabled" #end style="width:100% #if( $greyedField ) ;background-color:#000000 #end " tabindex="$tabIndex" #if( $greyedField ) disabled="disabled" #end>
- <option value="">[$i18n.getString( "no_value" )]</option>
- <option value="true" #if( $datavalue && $dataValue.value == "true" ) selected="selected" #end>$i18n.getString( "yes" )</option>
- <option value="false" #if( $datavalue && $dataValue.value == "false" ) selected="selected" #end>$i18n.getString( "no" )</option>
- </select>
-
- #elseif( $dataElement.type == "date" )
- <input name="entryfield" id="value[$dataElement.id].date" type="text" value="$!encoder.htmlEncode( $dataValue.value )" #if( $auth.hasAccess( "dhis-web-dataentry", "saveValue") ) onchange="saveDate( $dataElement.id, '$encoder.jsEncode( $dataElement.name )' )" #else disabled="disabled" #end #if( $greyedField ) disabled="disabled" #end>
- <img src="../images/calendar_icon.gif" width="16" height="16" id="getValueDate" style="cursor: pointer;" title="$i18n.getString( 'date_selector' )" onmouseover="this.style.background='orange';" onmouseout="this.style.background=''" alt="$i18n.getString( 'value_date' )"/>
- <script type="text/javascript">
- Calendar.setup({
- inputField : "value[$dataElement.id].date", // id of the input field
- ifFormat : "$i18n.getString('format.date.label')", // format of the input field
- button : "getValueDate" // trigger for the calendar (button ID)
- });
- </script>
- #else
-
- #if( $dataElement.type == "string" )
- #set( $coun = 0 )
- #foreach($customValue in $customValues)
- #if($dataElement.id == $customValue.dataElement.id && $dataValue.optionCombo.id == $customValue.optionCombo.id)
- #set( $coun = $coun +1 )
- #end
- #end
- #if($coun>0)
- <select name="entryselect" id="$dataEntryId" #if( $auth.hasAccess( "dhis-web-dataentry", "saveValue" )) onchange="saveBoolean( $dataElement.id, $optionComboId, this )" #else disabled="disabled" #end style="width:100% #if( $greyedField ) ;background-color:#000000 #end " tabindex="$tabIndex" #if( $locked ) disabled="disabled" #end #if( $greyedField ) disabled="disabled" #end>
- <option value="">[$i18n.getString( "please_select" )] </option>
- #foreach($customValue in $customValues)
- #if($dataElement.id == $customValue.dataElement.id && $dataValue.optionCombo.id == $customValue.optionCombo.id)
- <option value="$customValue.customValue" #if( $dataValue.value == $customValue.customValue ) selected="selected" #end>$customValue.customValue</option>
- #end
- #end
- </select>
- #else
- #set( $zeroValueSaveMode = true )
- <input name="entryfield" id="$dataEntryId" type="text" value="$!encoder.htmlEncode( $dataValue.value )" #if( $auth.hasAccess( "dhis-web-dataentry", "saveValue") ) onchange="saveValue( $dataElement.id, $optionComboId, '$encoder.jsEncode( $dataElement.name )', $zeroValueSaveMode )" ondblclick="viewHistory( $dataElement.id, $optionComboId, true )" #else disabled="disabled" #end onkeypress="return keyPress(event, this)" style="width:100% #if( $minMaxError ) ;background-color:#ffcccc #end #if( $greyedField ) ;background-color:#000000 #end #if( $dataElement.type == 'int' ) ;text-align:center #end" tabindex="$tabIndex" #if( $locked ) disabled="disabled" #end #if( $greyedField ) disabled="disabled" #end />
- #end
- #end
-
- #set( $minMaxError = false )
- #if( $dataElement.type == "int" && $dataValue && $minMax )
- #if( $integer.parseInt( $dataValue.value ) < $minMax.min || $integer.parseInt( $dataValue.value ) > $minMax.max )
- #set( $minMaxError = true )
- #end
- #end
- #if ( $calculated && $dataElement.type != "string")
- <input name="entryfield" id="$dataEntryId" class="calculated" type="text" value="#if($dataValue) $!encoder.htmlEncode( $dataValue.value ) #elseif( $calculatedValue )$!encoder.htmlEncode( $calculatedValue ) #end" disabled="disabled" onkeypress="return keyPress(event, this)" style="width:100% #if( $minMaxError ) ;background-color:#ffcccc #end #if( $greyedField ) ;background-color:#000000 #end #if( $dataElement.type == 'int' ) ;text-align:center #end" #if( $greyedField ) disabled="disabled" #end />
- #else
- #if ( $dataElement.type != "string")
- <input name="entryfield" id="$dataEntryId" type="text" value="$!encoder.htmlEncode( $dataValue.value )" #if( $auth.hasAccess( "dhis-web-dataentry", "saveValue") ) onchange="saveValue( $dataElement.id, $optionComboId, '$encoder.jsEncode( $dataElement.name )' )" #else disabled="disabled" #end onkeypress="return keyPress(event, this)" style="width:100% #if( $greyedField ) ;background-color:#000000 #end #if( $minMaxError ) ;background-color:#ffcccc #end #if( $dataElement.type == 'int' ) ;text-align:center #end" tabindex="$tabIndex" #if( $greyedField ) disabled="disabled" #end />
- #end
- #end
- #end
- </td>
-
- ##max value
- <td>
- #if( $dataElement.type == "int" )
- <div id="value[$dataElement.id:$optionComboId].max" style="text-align:center">$!minMax.max</div>
- #end
- </td>
-
- ##comment
- <td>
- <select id="value[$dataElement.id:$optionComboId].comments" #if( $auth.hasAccess( "dhis-web-dataentry", "saveComment" )) onchange="commentSelected( $dataElement.id, $optionComboId )" #else disabled="disabled" #end #if( $dataValue.comment && !$standardComments.contains( $dataValue.comment )) style="display:none; width:100%" #end #if( $greyedField == "true" ) disabled="disabled" #end>
- <option value="">[$i18n.getString( "no_comment" )]</option>
- <option value="custom">[$i18n.getString( "custom_comment" )]</option>
- #foreach( $comment in $standardComments )
- <option value="$encoder.htmlEncode( $comment )" #if( $datavalue.comment && $comment == $dataValue.comment ) selected="selected" #end>$encoder.htmlEncode( $comment )</option>
- #end
- </select>
- <input id="value[$dataElement.id:$optionComboId].comment" type="text" value="$!encoder.htmlEncode( $dataValue.comment )" #if( $auth.hasAccess( "dhis-web-dataentry", "saveComment" ))
- onblur="commentLeft( $dataElement.id, $optionComboId )" #else disabled="disabled" #end style="width:100% #if( !$dataValue.comment || $standardComments.contains( $dataValue.comment )) ;display:none #end" #if( $greyedField == "true" ) disabled="disabled" #end/>
- </td>
- <!--<td><span id="value[$dataElement.id].timestamp">#if( $dataValue.timestamp ) $format.formatDateTime( $dataValue.timestamp ) #end</span></td>-->
- <!--<td><span id="value[$dataElement.id].storedBy">$!encoder.htmlEncode( $dataValue.storedBy )</span></td>-->
- </tr>
- #set( $tabIndex = $tabIndex + 1 )
-#end
-</table>
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/section/form.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/section/form.vm 2010-10-28 09:17:13 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/section/form.vm 2010-11-11 15:56:41 +0000
@@ -25,13 +25,7 @@
<td>
<div id="$section.id" style="display:block">
- #set( $isMultiDimensional = $sectionIsMultiDimensional.get( $section.id ) )
-
- #if($isMultiDimensional == true )
- #parse( "/dhis-web-dataentry/section/multiDimensionalDataElement.vm" )
- #else
- #parse( "/dhis-web-dataentry/section/dataElement.vm" )
- #end
+ #parse( "/dhis-web-dataentry/section/multiDimensionalDataElement.vm" )
</div>
</td>