← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5832: Hide due-date and program-stages fields when seleting single-event program in data entry form.

 

------------------------------------------------------------
revno: 5832
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-01-31 13:22:35 +0700
message:
  Hide due-date and program-stages fields when seleting single-event program in data entry form.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataRecordingSelect.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js


--
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/dataRecordingSelect.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataRecordingSelect.vm	2012-01-31 05:43:59 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataRecordingSelect.vm	2012-01-31 06:22:35 +0000
@@ -55,8 +55,8 @@
 							</select>
 						</td>
 					</tr>
-					<tr>
-						<td id='programStageIdLabel' class='textColumn'><label for="programStageId">$i18n.getString( "program_stage" )</label></td>
+					<tr id='programStageIdTR' >
+						<td class='textColumn'><label for="programStageId">$i18n.getString( "program_stage" )</label></td>
 						<td>
 							<select id="programStageId" name="programStageId" class="criteria" onchange="javascript:loadDataEntry();" >
 							</select>
@@ -72,8 +72,8 @@
 							</script>
 					</tr>
 					
-					<tr>
-						<td id='dueDateLabel' class='textColumn'><label for="dueDate">$i18n.getString( "due_date" ) </label></td>
+					<tr id='dueDateTR'>
+						<td class='textColumn'><label for="dueDate">$i18n.getString( "due_date" ) </label></td>
 						<td><input type="text" id="dueDate" name="dueDate" class="criteria" value="$!format.formatDate( $programStageInstance.dueDate )" readonly> </td>
 					</tr>
 				</table>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js	2012-01-31 05:43:59 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js	2012-01-31 06:22:35 +0000
@@ -37,6 +37,8 @@
 			if(singleEvent=='true')
 			{
 				byId('programStageId').selectedIndex = 1;
+				jQuery('#programStageIdTR').attr('class','hidden');
+				jQuery('#dueDateTR').attr('class','hidden');
 				enable('completeBtn');
 				enable('validationBtn');
 				
@@ -70,6 +72,10 @@
 				
 				disable('completeBtn');
 				disable('validationBtn');
+				
+				jQuery('#programStageIdTR').removeAttr('class');
+				jQuery('#dueDateTR').removeAttr('class');
+				
 			}
 			
 	});