← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8548: Load schedule visits when to click on Reschedule and set status tab.

 

------------------------------------------------------------
revno: 8548
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-10-17 11:17:37 +0700
message:
  Load schedule visits when to click on Reschedule and set status tab.
modified:
  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/visitSchedule.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/programEnrollmentForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentForm.vm	2012-10-09 04:15:10 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentForm.vm	2012-10-17 04:17:37 +0000
@@ -1,110 +1,126 @@
 #set($noIden = $identifierTypes.size() )
 #set($noGroup = $attributeGroups.size() )
-#if( $programInstance || $hasDataEntry=='true')
+#if( $programInstance || $hasDataEntry=='true' )
 <input type='hidden' id='programInstanceId' name='programInstanceId' value='$programInstance.id' />
 <input type='hidden' id='patientId' name='patientId' value='$programInstance.patient.id' />
 <input type='hidden' id='hasDataEntry' name='hasDataEntry' value='$hasDataEntry' />
 <div id="tabs">
 	<ul>
-		<li><a href="#tab-1">$i18n.getString("data_entry_screen")</a></li>
-		<li><a href="#tab-2">$i18n.getString("identifier_and_attribute")</a></li>
-		<li><a href="#tab-3">$i18n.getString("reschedule_and_set_status")</a></li>
-		<li><a href="#tab-4">$i18n.getString("comments_and_sms_message")</a></li>
+		#if( $hasDataEntry == 'true' )
+			<li><a href="#tab-1">$i18n.getString("data_entry_screen")</a></li>
+		#end
+		
+		#if( ($identifierTypes && $identifierTypes.size() > 0)
+			|| ($patientAttributes && $patientAttributes.size() > 0) )
+			<li><a href="#tab-2">$i18n.getString("identifier_and_attribute")</a></li>
+		#end
+		
+		#if( $programInstance.program.type=='1' )
+			<li><a href="#tab-3">$i18n.getString("reschedule_and_set_status")</a></li>
+			<li><a href="#tab-4">$i18n.getString("comments_and_sms_message")</a></li>
+		#end
 		<li><a href="#tab-5">$i18n.getString("program_reports")</a></li>
 	</ul>
 	
-	<div id="tab-1">
-		<div id='dataRecordingSelectDiv'>
-			<form id='dataRecordingSelectForm' name='dataRecordingSelectForm' method='post'>
-				#parse( "/dhis-web-caseentry/colorHelp.vm" )
-				<div id='programInstanceDiv'>
-					#parse( "/dhis-web-caseentry/programStageInstanceFlow.vm" )
-					<br>		
-					<table id='executionDateTB' name="executionDateTB" class='hidden'>
-						<tr>
-							<th class='text-column'><span id="reportDateDescriptionField">$i18n.getString( "report_date" ) </span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
-							<th><input type="text" id="executionDate" name="executionDate" class='criteria' value="$!format.formatDate( $programStageInstance.executionDate )" >
-								<script type="text/javascript">
-								   datePickerValid( 'executionDate', false );
-								</script>
-							</th>
-							<th class='text-column'><label for="dueDate">$i18n.getString( "due_date" ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label></th>
-							<th><input type="text" id="dueDate" name="dueDate" class='criteria' value="$!format.formatDate( $programStageInstance.dueDate )" readonly > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
+	#if( $hasDataEntry == 'true')
+		<div id="tab-1">
+			<div id='dataRecordingSelectDiv'>
+				<form id='dataRecordingSelectForm' name='dataRecordingSelectForm' method='post'>
+					#parse( "/dhis-web-caseentry/colorHelp.vm" )
+					<div id='programInstanceDiv'>
+						#parse( "/dhis-web-caseentry/programStageInstanceFlow.vm" )
+						<br>		
+						<table id='executionDateTB' name="executionDateTB" class='hidden'>
+							<tr>
+								<th class='text-column'><span id="reportDateDescriptionField">$i18n.getString( "report_date" ) </span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
+								<th><input type="text" id="executionDate" name="executionDate" class='criteria' value="$!format.formatDate( $programStageInstance.executionDate )" >
+									<script type="text/javascript">
+									   datePickerValid( 'executionDate', false );
+									</script>
+								</th>
+								<th class='text-column'><label for="dueDate">$i18n.getString( "due_date" ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label></th>
+								<th><input type="text" id="dueDate" name="dueDate" class='criteria' value="$!format.formatDate( $programStageInstance.dueDate )" readonly > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
+							</tr>
+						</table>
+					</div>
+				</form>
+			</div>
+			<div id='dataEntryFormDiv' class='hidden'></div>
+		</div>
+	#end
+	
+	#if( ($identifierTypes && $identifierTypes.size() > 0)
+		|| ($patientAttributes && $patientAttributes.size() > 0) )
+		<!-- Identifiers and Attributes TAB -->
+		<div id="tab-2">
+			<form id='patientPropertyForm' name='patientPropertyForm' method="POST">
+				<!-- IDENTIFIERS -->
+				<table>
+					#set( $mark = false )
+					#foreach ($identifierType in $identifierTypes) 
+						#set( $identifier = '')
+						#set( $identifier = $identiferMap.get( $identifierType.id ) )
+						<tr #alternate( $mark )>
+							<td class='text-column'><label>$identifierType.name #if($identifierType.mandatory == true )<em title="$i18n.getString( 'required' )" class="required">*</em> #end</label></td>       
+							<td class="input-column">
+								<input type="text" id="iden$identifierType.id" name="iden$identifierType.id" value='$!identifier' class="{validate:{required:$identifierType.mandatory, #if($!identifierType.noChars) maxlength:$identifierType.noChars, #end #if($identifierType.type=='number') number:true #elseif($!identifierType.type=='letter') lettersonly:true #end }}" />
+							</td>
 						</tr>
-					</table>
-				</div>
-			</form>
-		</div>
-		<div id='dataEntryFormDiv' class='hidden'></div>
-	</div>
-	
-	<!-- Enroll program TAB -->
-	<div id="tab-2">
-		<form id='programEnrollmentInforForm' name='programEnrollmentInforForm' action='#' method="POST" >
-			<!-- IDENTIFIERS -->
-			<table id='enrollmentInforDiv' name='enrollmentInforDiv' class='mainPageTable' >
-				#set( $mark = false )
-				#foreach ($identifierType in $identifierTypes) 
-					#set( $identifier = '')
-					#set( $identifier = $identiferMap.get( $identifierType.id ) )
+						#set( $mark = !$mark  )
+					#end
+					
+				<!-- ATTRIBUTES IN GROUPS -->
+				#foreach($attribute in $patientAttributes )
+					#set( $attributeValue = $!patientAttributeValueMap.get( $attribute.id ) )
 					<tr #alternate( $mark )>
-						<td class='text-column'><label>$identifierType.name #if($identifierType.mandatory == true )<em title="$i18n.getString( 'required' )" class="required">*</em> #end</label></td>       
-						<td class="input-column">
-							<input type="text" id="iden$identifierType.id" name="iden$identifierType.id" value='$!identifier' class="{validate:{required:$identifierType.mandatory, #if($!identifierType.noChars) maxlength:$identifierType.noChars, #end #if($identifierType.type=='number') number:true #elseif($!identifierType.type=='letter') lettersonly:true #end }}" />
-						</td>
+						<td class='text-column'><label>$attribute.name #if($attribute.mandatory)<em title="$i18n.getString( "required" )" class="required">*</em> #end</label></td>
+						<td class="input-column" >
+							#if( $attribute.valueType == "YES/NO" )
+								<select id="attr$attribute.id" name="attr$attribute.id" >              
+									<option value="">[$i18n.getString( "please_select" )]</option>
+									<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 == "DATE" )
+								<input type="text" id="attr$attribute.id" name="attr$attribute.id" value="$!attributeValue"  objectId='$attribute.id' objectType='attr' class=' #validate( "default"  $attribute.mandatory )' >
+								<script type="text/javascript">
+									datePickerValid( 'attr$attribute.id' );
+								</script>                 
+							#elseif( $attribute.valueType == "COMBO" )
+								<select  id="attr$attribute.id" name="attr$attribute.id" class=' #validate( "default"  $attribute.mandatory )' >
+									 <option value="">[$i18n.getString( "please_select" )]</option>
+								#foreach ($option in $attribute.attributeOptions )
+									<option value="$option.id" #if($attributeValue == $option.name) selected="selected" #end>$option.name</option>
+								#end
+								</select>
+							#else 
+								<input type="text"  id="attr$attribute.id" name="attr$attribute.id" value="$!attributeValue" class="{validate:{required:$attribute.mandatory #if($!attribute.noChars),maxlength:$attribute.noChars #end #if($attribute.valueType=='NUMBER'),number:true #end }}"  > 
+							#end
+						</td>		
 					</tr>
 					#set( $mark = !$mark  )
+					<tr><td>&nbsp;</td></tr>
+					<tr>
+						<td></td>
+						<td><input type='submit' value='$i18n.getString("save")' class='button' /></td>
+					</tr>
+				</table>
 				#end
-				
-			<!-- ATTRIBUTES IN GROUPS -->
-			#foreach($attribute in $patientAttributes )
-				#set( $attributeValue = $!patientAttributeValueMap.get( $attribute.id ) )
-				<tr #alternate( $mark )>
-					<td class='text-column'><label>$attribute.name #if($attribute.mandatory)<em title="$i18n.getString( "required" )" class="required">*</em> #end</label></td>
-					<td class="input-column" >
-						#if( $attribute.valueType == "YES/NO" )
-							<select id="attr$attribute.id" name="attr$attribute.id" >              
-								<option value="">[$i18n.getString( "please_select" )]</option>
-								<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 == "DATE" )
-							<input type="text" id="attr$attribute.id" name="attr$attribute.id" value="$!attributeValue"  objectId='$attribute.id' objectType='attr' class=' #validate( "default"  $attribute.mandatory )' >
-							<script type="text/javascript">
-								datePickerValid( 'attr$attribute.id' );
-							</script>                 
-						#elseif( $attribute.valueType == "COMBO" )
-							<select  id="attr$attribute.id" name="attr$attribute.id" class=' #validate( "default"  $attribute.mandatory )' >
-								 <option value="">[$i18n.getString( "please_select" )]</option>
-							#foreach ($option in $attribute.attributeOptions )
-								<option value="$option.id" #if($attributeValue == $option.name) selected="selected" #end>$option.name</option>
-							#end
-							</select>
-						#else 
-							<input type="text"  id="attr$attribute.id" name="attr$attribute.id" value="$!attributeValue" class="{validate:{required:$attribute.mandatory #if($!attribute.noChars),maxlength:$attribute.noChars #end #if($attribute.valueType=='NUMBER'),number:true #end }}"  > 
-						#end
-					</td>		
-				</tr>
-				#set( $mark = !$mark  )
-				<tr><td>&nbsp;</td></tr>
-				<tr>
-					<td></td>
-					<td><input type='submit' value='$i18n.getString("save")' class='button' /></td>
-				</tr>
-			</table>
-			#end
-		</form>
-	</div>
-
-	<!-- Program-stage-instance TAB -->
-	<div id="tab-3">
-		#parse("/dhis-web-caseentry/visitSchedule.vm")
-	</div>
-	
-	<!-- Comments and messages -->
-	<div id='tab-4'>
-		<div id='eventMessagesDiv'></div>
-	</div>
+			</form>
+		</div>
+	#end
+	
+	#if( $programInstance.program.type=='1' )
+		<!-- Program-stage-instance TAB -->
+		<div id="tab-3">
+			#parse("/dhis-web-caseentry/visitSchedule.vm")
+		</div>
+	
+		<!-- Comments and messages -->
+		<div id='tab-4'>
+			<div id='eventMessagesDiv'></div>
+		</div>
+	#end
 
 	<div id='tab-5'><div id='programReportDiv'></div></div>
 	
@@ -112,8 +128,8 @@
 #end
 
 <script type="text/javascript">
-	jQuery("#programEnrollmentInforForm").ready( function(){
-		validation( 'programEnrollmentInforForm', function(form){
+	jQuery("#patientPropertyForm").ready( function(){
+		validation( 'patientPropertyForm', function(form){
 			saveIdentifierAndAttribute( $programInstance.patient.id, $programInstance.program.id, 'programEnrollmentInforForm' );
 		});	
 		
@@ -126,36 +142,7 @@
 		#end
 	});
 
-	#if( $programInstance || $hasDataEntry == 'true')
-		$('#tabs').tabs();
-		
-		#if( $programInstance.program.type!='1' )
-			$("#tabs").tabs("remove", 3);
-			$("#tabs").tabs("remove", 2);
-			$("#tabs").tabs("remove", 1);
-			#if( $hasDataEntry == 'true' )
-				$( "#tabs" ).tabs( "option", "selected", 0 );
-			#else
-				$( "#tabs" ).tabs( "option", "disabled", [0] );
-				$( "#tabs" ).tabs("remove", 0);
-			#end
-		#else
-			#if( ($identifierTypes && $identifierTypes.size() > 0)
-				|| ($patientAttributes && $patientAttributes.size() > 0) )
-				$( "#tabs" ).tabs( "option", "selected", 1 );
-			#else
-				$( "#tabs" ).tabs( "option", "selected", 2 );
-				$("#tabs").tabs("remove", 1);
-			#end
-			
-			#if( $hasDataEntry == 'true' )
-				$( "#tabs" ).tabs( "option", "selected", 0 );
-			#else
-				$( "#tabs" ).tabs( "option", "disabled", [0] );
-				$("#tabs").tabs("remove", 0);
-			#end
-		#end
-	#end
+	$('#tabs').tabs();
 	
 	$( "#tabs" ).bind( "tabsselect", function(event, ui) {
 		if( ui.tab.hash == '#tab-3' ){

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/visitSchedule.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/visitSchedule.vm	2012-10-09 10:03:00 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/visitSchedule.vm	2012-10-17 04:17:37 +0000
@@ -18,16 +18,18 @@
 		</tr>
 	</table>
 </fieldset>
-<br>
+
 #set($programStageInstances = $programInstance.programStageInstances)
 #if( $programStageInstances.size() > 0 )
 	<table class='mainPageTable listTable' id='progarmStageListDiv' name='progarmStageListDiv' >
-		<col width="10px">
-		<col width="200px">
-		<col width="200px">
-		<col width="160px">
-		<col/>
-		<col/>  
+		<colgroup>
+			<col width="10px"/>
+			<col width="200px"/>
+			<col width="200px"/>
+			<col width="160px"/>
+			<col/>
+			<col/>  
+		</colgroup>
 		<tr>
 			<th>$i18n.getString( "nr" )</th>
 			<th>$i18n.getString( "program_stage" )</th>