← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10: More control on the filtering of dataentry forms for the mix of dimensions.

 

------------------------------------------------------------
revno: 10
committer: abyot <abyota@xxxxxxxxx>
branch nick: trunk
timestamp: Mon 2009-03-09 12:39:39 +0530
message:
  More control on the filtering of dataentry forms for the mix of dimensions.
modified:
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/multidimensional/form.vm
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/multidimensional/form.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/multidimensional/form.vm	2009-03-08 11:50:57 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/multidimensional/form.vm	2009-03-09 07:09:39 +0000
@@ -7,16 +7,30 @@
 
 #parse( "/dhis-web-dataentry/select.vm" )
 
-#if ( !$cdeFormExists && $disableDefaultForm )
-	
-	<div style="text-align:center">
-	
-    	<h2> $customDataEntryFormCode </h2>
-    	
-	</div>
-
-		
-#elseif ( $customDataEntryFormExists && !$useDefaultForm )
+
+#if ( $disableDefaultForm )
+	
+	#if ( $customDataEntryFormExists )	
+		
+		#foreach( $optionCombo in $orderdCategoryOptionCombos )			
+			<td>
+				<span id="value[option$optionCombo.id].name" style="display:none">$optionComboNames.get( $optionCombo.id )</span>							
+			</td>		
+		#end		
+		
+		$customDataEntryFormCode	
+		
+	#else
+	
+		<div style="text-align:center">	
+    		<h2> $customDataEntryFormCode </h2>    	
+		</div>	
+		
+	#end
+
+#else
+	
+	#if ( $customDataEntryFormExists && !$useDefaultForm )
 	
 		#foreach( $optionCombo in $orderdCategoryOptionCombos )
 			
@@ -28,103 +42,104 @@
 	
 	$customDataEntryFormCode	
 
-#else
-	
-<table>
-		
-	#set( $colCount = $numberOfTotalColumns )
-	
-	#foreach( $category in $orderedCategories )
-		
-		#set( $categoryOptions = $orderedOptionsMap.get( $category.id ) )
-		#set( $colCount = $colCount / $categoryOptions.size() )		
-		<tr colspan="$colCount">
-			<td></td>
-			#set( $cols = $catColRepeat.get( $category.id ) )
-			#foreach( $col in $cols )
-				#foreach( $categoryOption in $categoryOptions )
-					<th colspan="$colCount"> <div align="center"> $categoryOption.name</div> </th>
+	#else
+	
+		<table>
+		
+			#set( $colCount = $numberOfTotalColumns )
+	
+			#foreach( $category in $orderedCategories )
+		
+				#set( $categoryOptions = $orderedOptionsMap.get( $category.id ) )
+				#set( $colCount = $colCount / $categoryOptions.size() )		
+				<tr colspan="$colCount">
+					<td></td>
+					#set( $cols = $catColRepeat.get( $category.id ) )
+					#foreach( $col in $cols )
+						#foreach( $categoryOption in $categoryOptions )
+							<th colspan="$colCount"> <div align="center"> $categoryOption.name</div> </th>
+						#end
+					#end
+						
+				</tr>
+			#end
+	
+			#set( $count = 0 )
+			#set( $mark = 0 )
+			#set( $tabIndex = 1 )
+
+			#foreach( $dataElement in $orderedDataElements )
+				#set( $count = $count + 1 )
+				#if( $mark == 1 )
+					#set( $mark = 0 )
+				#else
+					#set( $mark = 1 )
 				#end
-			#end
-						
-		</tr>
-	#end
-	
-#set( $count = 0 )
-#set( $mark = 0 )
-#set( $tabIndex = 1 )
-
-#foreach( $dataElement in $orderedDataElements )
-	#set( $count = $count + 1 )
-	#if( $mark == 1 )
-		#set( $mark = 0 )
-	#else
-		#set( $mark = 1 )
-	#end
-	
-	#set( $calculatedValue = false )
-	#set( $calculatedValue = $calculatedValueMap.get( $dataElement ) )
-	#set( $minMax = false )
-	#set( $minMax = $minMaxMap.get( $dataElement.id ) )
-	#set( $calculated = false )
-	#set( $calculated = ($calculatedDataElementIds.contains($dataElement.id)) )
-	<tr #if( $mark == 0 ) style="background-color:#dddddd" #end>
-			
-		##data element name
-		<td>
-			<span id="value[$dataElement.id].name" title="$!encoder.htmlEncode( $dataElement.description )">
-				
-			#if( $useShortName )
-				$encoder.htmlEncode( $dataElement.shortName )
-			#else
-				$encoder.htmlEncode( $dataElement.name )
-			#end		
-			
-		    </span>
-		</td>	
-				
-		#foreach( $optionCombo in $orderdCategoryOptionCombos )
-			#set( $dataValue = false )
-			#set( $dataValue = $dataValueMap.get( "$dataElement.id:$optionCombo.id" ) )
-			
-			#set( $dataEntryId = "value[$dataElement.id].value:value[$optionCombo.id].value" )
-			##Data Entry
-			<td>
-				
-				#if( $dataElement.type == "bool" )
-					<span id="value[option$optionCombo.id].name" style="display:none">$optionComboNames.get( $optionCombo.id )</span>
-					<select name="entryselect" id="$dataEntryId" #if( $auth.hasAccess( "dhis-web-dataentry", "saveValue" )) onchange="saveBoolean($dataElement.id,$optionCombo.id, this )"  #else disabled="disabled" #end style="width:100%" tabindex="$tabIndex" #if( $locked ) disabled="disabled"#end>
-						<option value="">[$i18n.getString( "no_value" )]</option>
-						<option value="true" #if( $dataValue.value == "true" ) selected="selected" #end>$i18n.getString( "yes" )</option>
-						<option value="false" #if( $dataValue.value == "false" ) selected="selected" #end>$i18n.getString( "no" )</option>
-					</select>
-				#else					
-					<span id="value[option$optionCombo.id].name" style="display:none">$optionComboNames.get( $optionCombo.id )</span>	
+	
+				#set( $calculatedValue = false )
+				#set( $calculatedValue = $calculatedValueMap.get( $dataElement ) )
+				#set( $minMax = false )
+				#set( $minMax = $minMaxMap.get( $dataElement.id ) )
+				#set( $calculated = false )
+				#set( $calculated = ($calculatedDataElementIds.contains($dataElement.id)) )
+				<tr #if( $mark == 0 ) style="background-color:#dddddd" #end>
+			
+					##data element name
+					<td>
+						<span id="value[$dataElement.id].name" title="$!encoder.htmlEncode( $dataElement.description )">
+				
+							#if( $useShortName )
+								$encoder.htmlEncode( $dataElement.shortName )
+							#else
+								$encoder.htmlEncode( $dataElement.name )
+							#end		
+			
+		    			</span>
+					</td>	
+				
+					#foreach( $optionCombo in $orderdCategoryOptionCombos )
+						#set( $dataValue = false )
+						#set( $dataValue = $dataValueMap.get( "$dataElement.id:$optionCombo.id" ) )
+			
+						#set( $dataEntryId = "value[$dataElement.id].value:value[$optionCombo.id].value" )
+						##Data Entry
+						<td>
+				
+							#if( $dataElement.type == "bool" )
+								<span id="value[option$optionCombo.id].name" style="display:none">$optionComboNames.get( $optionCombo.id )</span>
+								<select name="entryselect" id="$dataEntryId" #if( $auth.hasAccess( "dhis-web-dataentry", "saveValue" )) onchange="saveBoolean($dataElement.id,$optionCombo.id, this )"  #else disabled="disabled" #end style="width:100%" tabindex="$tabIndex" #if( $locked ) disabled="disabled"#end>
+									<option value="">[$i18n.getString( "no_value" )]</option>
+									<option value="true" #if( $dataValue.value == "true" ) selected="selected" #end>$i18n.getString( "yes" )</option>
+									<option value="false" #if( $dataValue.value == "false" ) selected="selected" #end>$i18n.getString( "no" )</option>
+								</select>
+							#else					
+								<span id="value[option$optionCombo.id].name" style="display:none">$optionComboNames.get( $optionCombo.id )</span>	
 					
-					#if( $dataElement.aggregationOperator == "sum" )
-						<input name="entryfield" id="$dataEntryId" type="text" value="$!encoder.htmlEncode( $dataValue.value )" #if( $auth.hasAccess( "dhis-web-dataentry", "saveValue") ) onchange="saveValue( $dataElement.id, $optionCombo.id, '$encoder.jsEncode( $dataElement.name )', $zeroValueSaveMode )" ondblclick="viewHistory( $dataElement.id, $optionCombo.id  )" #else disabled="disabled" #end onkeypress="return keyPress(event, this)" style="width:100% #if( $minMaxError ) ;background-color:#ffcccc #end #if( $dataElement.type == "int" ) ;text-align:center #end" tabindex="$tabIndex" #if( $locked ) disabled="disabled"#end>
-					#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, $optionCombo.id, '$encoder.jsEncode( $dataElement.name )', $zeroValueSaveMode )" ondblclick="viewHistory( $dataElement.id, $optionCombo.id  )" #else disabled="disabled" #end onkeypress="return keyPress(event, this)" style="width:100% #if( $minMaxError ) ;background-color:#ffcccc #end #if( $dataElement.type == "int" ) ;text-align:center #end" tabindex="$tabIndex" #if( $locked ) disabled="disabled"#end>
-					#end				
-				#end			
+								#if( $dataElement.aggregationOperator == "sum" )
+									<input name="entryfield" id="$dataEntryId" type="text" value="$!encoder.htmlEncode( $dataValue.value )" #if( $auth.hasAccess( "dhis-web-dataentry", "saveValue") ) onchange="saveValue( $dataElement.id, $optionCombo.id, '$encoder.jsEncode( $dataElement.name )', $zeroValueSaveMode )" ondblclick="viewHistory( $dataElement.id, $optionCombo.id  )" #else disabled="disabled" #end onkeypress="return keyPress(event, this)" style="width:100% #if( $minMaxError ) ;background-color:#ffcccc #end #if( $dataElement.type == "int" ) ;text-align:center #end" tabindex="$tabIndex" #if( $locked ) disabled="disabled"#end>
+								#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, $optionCombo.id, '$encoder.jsEncode( $dataElement.name )', $zeroValueSaveMode )" ondblclick="viewHistory( $dataElement.id, $optionCombo.id  )" #else disabled="disabled" #end onkeypress="return keyPress(event, this)" style="width:100% #if( $minMaxError ) ;background-color:#ffcccc #end #if( $dataElement.type == "int" ) ;text-align:center #end" tabindex="$tabIndex" #if( $locked ) disabled="disabled"#end>
+								#end				
+							#end			
 							
-			</td>		
+						</td>		
 			
-		#end
+					#end
 				
-	</tr>
-	<tr style="display:none">
-	##type		
-	<td>$dataElementTypeMap.get( $dataElement.type )<span id="value[$dataElement.id].type" style="display:none">$dataElement.type</span></td>		
-	</tr>
-	#set( $tabIndex = $tabIndex + 1 )
-
-#end
-
-</table>
-
-#end
+				</tr>
+				<tr style="display:none">
+					##type		
+					<td>$dataElementTypeMap.get( $dataElement.type )<span id="value[$dataElement.id].type" style="display:none">$dataElement.type</span></td>		
+				</tr>
+				#set( $tabIndex = $tabIndex + 1 )
+
+			#end
+
+		</table>
+
+	#end
+#end	
 
 #parse( "/dhis-web-dataentry/completeRegistration.vm" )
 

=== 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	2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm	2009-03-09 07:09:39 +0000
@@ -17,7 +17,14 @@
     <input type="button" value="$i18n.getString( "run_validation" )" onclick="javascript:validate();" style="width:150px" #if( !$selectedPeriodIndex ) disabled="disabled" #end><br>
     <input type="button" id="calculateCDEs" value="$i18n.getString( "save_calculated" )" name="calculateCDEs" onclick="calculateAndSaveCDEs();" style="width:150px" #if( !$selectedPeriodIndex ) disabled="disabled" #end><br>
 
-	<input type="checkbox" id="useDefaultForm" name="useDefaultForm" #if( $useDefaultForm || !$customDataEntryFormExists ) checked="checked" #end #if( !$customDataEntryFormExists ) disabled="disabled" #end onchange="document.getElementById( 'selectForm' ).submit();">
+	<input type="checkbox" id="useDefaultForm" name="useDefaultForm"
+		#if( $useDefaultForm || !$customDataEntryFormExists ) 
+			checked="checked" 
+		#end 
+		#if( !$customDataEntryFormExists || $disableDefaultForm ) 
+			disabled="disabled" 
+		#end 
+		onchange="document.getElementById( 'selectForm' ).submit();">	
 	<label>$i18n.getString( "use_default_form" )</label><br>
 
 	<input type="checkbox" id="useSectionForm" name="useSectionForm" #if( $useSectionForm ) checked="checked" #end  #if(!$haveSection) disabled="disabled" #end onchange="document.getElementById( 'selectForm' ).submit();">



--

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.