← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14798: Fixed bug - Shortcut-link-to-add-a-relative which is defined in Add/update program doesn't work p...

 

------------------------------------------------------------
revno: 14798
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-04-11 18:36:47 +0800
message:
  Fixed bug - Shortcut-link-to-add-a-relative which is defined in Add/update program doesn't work properly in TEI (DONE).
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addTrackedEntityInstanceForm.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackedEntityInstanceDashboard.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/addTrackedEntityInstanceForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addTrackedEntityInstanceForm.vm	2014-04-06 15:48:31 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addTrackedEntityInstanceForm.vm	2014-04-11 10:36:47 +0000
@@ -49,7 +49,7 @@
 		<input type='hidden' name="relationshipTypeId" id="relationshipTypeId" value="$relatedProgram.relationshipType.id">
 		<input type='hidden' name="relationshipFromA" id="relationshipFromA" value="$relatedProgram.relationshipFromA" >
 		<input type='hidden' name="relationshipId" id="relationshipId" value="$entityInstanceId">
-		<input type='hidden' name="relatedProgramId" id="relatedProgramId" value="$program.id" >
+		<input type='hidden' name="relatedProgramId" id="relatedProgramId" value="$program.uid" >
 	#elseif( $!relationshipTypes)
 	<tr>
 		<td class='text-column'><label for="relationship_type">$i18n.getString("relationship_type")<em title="$i18n.getString( "required" )" class="required">*</em></label></td>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2014-04-11 00:54:51 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2014-04-11 10:36:47 +0000
@@ -941,10 +941,14 @@
 	hideById('migrationEntityInstanceDiv');
 	setInnerHTML('entityInstanceDashboard', '');
 	$('#loaderDiv').show();
+	var params = "";
+	if( getFieldValue('program')!='' ){
+		params += "?programId=" + getFieldValue('program');
+	}
+	
 	$('#editEntityInstanceDiv').load(
-			'showUpdateTrackedEntityInstanceForm.action', {
-				id : entityInstanceId,
-				programId : getFieldValue('program')
+			'showUpdateTrackedEntityInstanceForm.action' + params, {
+				id : entityInstanceId
 			}, function() {
 				$('#loaderDiv').hide();
 				showById('editEntityInstanceDiv');
@@ -1459,20 +1463,20 @@
 						var type = $('#tb_' + programInstanceId).attr(
 								'programType');
 						var program = $('#tr1_' + programInstanceId);
+						var selectedProgram = program.attr('programId');
 						var relationshipText = program.attr('relationshipText');
 						var relatedProgramId = program.attr('relatedProgram');
 						var entityInstanceId = getFieldValue('entityInstanceId');
-						var selectedProgram = program.attr('programId');
 						if (relationshipText != "") {
 							setInnerHTML(
 									'entityInstanceRelatedStageSpan',
 									"&#8226; <a href='javascript:showAddTrackedEntityInstanceForm( "
 											+ entityInstanceId
-											+ ","
+											+ ",\""
 											+ relatedProgramId
-											+ ","
+											+ "\",\""
 											+ selectedProgram
-											+ " , false );' id='relatedEntityInstance_$!programStageInstance.id' >"
+											+ "\" , false );' id='relatedEntityInstance_$!programStageInstance.id' >"
 											+ relationshipText
 											+ "</a><br>&nbsp;");
 						} else {

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackedEntityInstanceDashboard.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackedEntityInstanceDashboard.vm	2014-04-04 17:58:28 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackedEntityInstanceDashboard.vm	2014-04-11 10:36:47 +0000
@@ -92,8 +92,8 @@
 						relationshipText='$!programInstance.program.relationshipText'
 						relationshipType='$!programInstance.program.relationshipType.id'
 						relationshipSide='$!programInstance.program.relationshipSide'
-						relatedProgram='$!programInstance.program.relatedProgram.id'
-						programId='$programInstance.program.id'
+						relatedProgram='$!programInstance.program.relatedProgram.uid'
+						programId='$programInstance.program.uid'
 						style='cursor:pointer;'
 						onclick='javascript:setFieldValue("programIdAddTrackedEntityInstance",$programInstance.program.id);loadActiveProgramStageRecords("$programInstance.id", "$programStageInstance.id")' >
 							<td id='td_$programInstance.id'>
@@ -112,11 +112,12 @@
 						#end
 					#else
 					<tr id='tr1_$programInstance.id' type='$programInstance.program.type'
-						programStageInstanceId='$programStageInstance.id' style='cursor:pointer;'
+						programStageInstanceId='$programStageInstance.id' 
 						relationshipText='$!programInstance.program.relationshipText'
 						relationshipType='$!programInstance.program.relationshipType.id'
 						relationshipSide='$!programInstance.program.relationshipSide'
-						relatedProgram='$!programInstance.program.relatedProgram.id'
+						relatedProgram='$!programInstance.program.relatedProgram.uid'
+						programId='$programInstance.program.uid'
 						onclick='javascript:loadActiveProgramStageRecords("$programInstance.id", false)' >
 						<td id='td_$programInstance.id'>
 							<a><span id='infor_$programInstance.id'>$programInstance.program.displayName ($format.formatDate($programInstance.enrollmentDate))</span></a>

=== 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-03-28 07:35:39 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackedEntityInstanceForm.vm	2014-04-11 10:36:47 +0000
@@ -69,8 +69,11 @@
 																	 <option value="$option" #if("$value"=="$option") selected #end>$option</option>
 															 #end
 													 </select>
-											 #elseif( $attribute.valueType == "phoneNumber" ) 
-													 <input type='text' value='$value' id="attr$attribute.id" name="attr$attribute.id" inherit="$!attribute.inherit" class="{validate:{phone:true,required:$mandatory }}"/>
+											 #elseif( $attribute.valueType == "phoneNumber" )
+													#if($value=='')
+														#set($value=$!phoneNumberAreaCode)
+													#end
+													 <input type='text' value='$!value' id="attr$attribute.id" name="attr$attribute.id" inherit="$!attribute.inherit" class="{validate:{phone:true,required:$mandatory }}"/>
 											 #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
@@ -128,7 +131,10 @@
 							#end
 						</select>
 					#elseif( $attribute.valueType == "phoneNumber" ) 
-						<input type='text' value='$value' id="attr$attribute.id" name="attr$attribute.id" inherit="$!attribute.inherit" class="{validate:{phone:true}}"/>
+						#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