← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7922: Cannot open data entry form to edit data into Single event with registration.

 

------------------------------------------------------------
revno: 7922
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-08-16 23:31:03 +0700
message:
  Cannot open data entry form to edit data into Single event with registration.
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/form.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/listPatient.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleEventSelect.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/dataRecordingSelect.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataRecordingSelect.vm	2012-08-16 02:08:22 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataRecordingSelect.vm	2012-08-16 16:31:03 +0000
@@ -1,11 +1,56 @@
 <form id='dataRecordingSelectForm' name='dataRecordingSelectForm' method='post'>
+<div class="actions" style='margin-top:30px;' #if($program.type!=1) style='display:none;' #end>
+	<input type="button" class='stage-object' id="newEncounterBtn" value="$i18n.getString('create_new_event')" onClick="javascript: registerIrregularEncounter( getFieldValue('executionDate') );" disabled="disabled" >
+</div>
+<table class="mainPageTable" id='patientInfoDiv'> 
+	<tr>
+		<td valign="top">
+	<table>
+		<tr>            
+			<td class="bold">$i18n.getString( "full_name" ):</td>
+			<td>$encoder.htmlEncode( $patient.getFullName() )<td>
+		</tr>
+		<tr>
+			<td class="bold">$i18n.getString( "gender" ):</td>
+			<td>$i18n.getString( $patient.gender )</td>
+		</tr>
+		<tr>
+			<td class="bold">$i18n.getString( "date_of_birth" ):</td>
+			<td>$format.formatDate( $patient.birthDate ) $patient.getAge()<td>
+		</tr>
+		</table>
+	</tr>
+</table>
+
 #parse( "/dhis-web-caseentry/colorHelp.vm" )
 </p>
+		
+<div id='inputCriteria' class="page inputCriteria" style="width:490px;height:29px;">	
+	<input type='hidden' id='programStageId' name='programStageId'>
+	<table>
+	   <tr id='programIdTR'>
+			<td class='text-column'><label for="programId">$i18n.getString( "program" )</label></td>
+			<td>
+				<select id="programId" name="programId" class="criteria" onchange="loadProgramStages();" #if( $programs.size() == 0 ) disabled="disabled" #end>
+					<option value="0">[$i18n.getString( "select" )]</option>
+					#foreach( $program in $programs )
+						<option value="$program.id" type="$program.type" #if( $programId && $program.id == $programId ) selected="selected" #end>$encoder.htmlEncode( $program.name )</option>
+					#end
+				</select>
+			</td>
+		</tr>
+	</table>
+</div>
 
-<div id='programInstanceDiv' class='hidden'>
-	#parse( "/dhis-web-caseentry/programStageInstanceFlow.vm" )
+<div id='programInstanceDiv' class='hidden '>
+	<div id='programInstanceFlowDiv' style="width:78%;height:115px;overflow-x:auto;">
+		<table>
+			<tr id='programStageIdTR'></tr>
+		</table>
+	</div>
+	
 	<br>		
-	<table id='executionDateTB' class='hidden'>
+	<table id='executionDateTB'>
 		<tr>
 			<th class='text-column'><label for="executionDate">$i18n.getString( "report_date" ) </label></th>
 			<th><input type="text" id="executionDate" name="executionDate" class='criteria' value="$!format.formatDate( $programStageInstance.executionDate )" >
@@ -18,17 +63,35 @@
 		</tr>
 	</table>
 </div>
+
 </form>
 
-<p></p> 
+<p></p>
+	
+<div id='createNewEncounterDiv' class='hidden'>
+	<table>
+		<tr>
+			<td>$i18n.getString( 'due_date' )</td>
+			<td><input id='dueDateNewEncounter' name='dueDateNewEncounter' style='width:260px;'></td>
+			<script type="text/javascript">
+			   datePicker( 'dueDateNewEncounter', false );
+			</script>
+		</tr>
+		<tr>
+			<td></td>
+			<td>
+				<input type='button' value='$i18n.getString("create")' onclick='registerIrregularEncounter( getFieldValue("dueDateNewEncounter" ) );' />
+				<input type='button' value='$i18n.getString("cancel")' onclick="closeDueDateDiv();" />
+			</td>
+</div>
 
 <script>
 	jQuery('#dataRecordingSelectForm').ready(function(){ 
-		jQuery("#programInstanceFlowDiv").animate({scrollLeft: 0});
 		var programs = byId('programId');
 		if( programs.options.length == 2 )
 		{
-			byId('programId').selectedIndex = 1;
+			 byId('programId').selectedIndex = 1;
+			 loadProgramStages();
 		}
 	});
 </script>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/form.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/form.js	2012-08-02 05:27:55 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/form.js	2012-08-16 16:31:03 +0000
@@ -14,6 +14,54 @@
 	enable('searchBtn');	
 	enable('listPatientBtn');
 }
+//------------------------------------------------------------------------------
+// Load data entry form
+//------------------------------------------------------------------------------
+
+function loadDataEntry( programStageInstanceId )
+{
+	setInnerHTML('dataEntryFormDiv', '');
+	showById('executionDateTB');
+	showById('dataEntryFormDiv');
+	setFieldValue( 'dueDate', '' );
+	setFieldValue( 'executionDate', '' );
+	disable('validationBtn');
+	disableCompletedButton(true);
+	disable('uncompleteBtn');
+	
+	jQuery(".stage-object-selected").removeClass('stage-object-selected');
+	var selectedProgramStageInstance = jQuery( '#' + prefixId + programStageInstanceId );
+	selectedProgramStageInstance.addClass('stage-object-selected');
+	setFieldValue( 'programStageId', selectedProgramStageInstance.attr('psid') );
+	
+	showLoader();	
+	$( '#dataEntryFormDiv' ).load( "dataentryform.action", 
+		{ 
+			programStageInstanceId: programStageInstanceId
+		},function( )
+		{
+			var executionDate = jQuery('#dataRecordingSelectDiv input[id=executionDate]').val();
+			var completed = jQuery('#entryFormContainer input[id=completed]').val();
+			var irregular = jQuery('#entryFormContainer input[id=irregular]').val();
+			showById('inputCriteriaDiv');
+			enable('validationBtn');
+			if( executionDate == '' )
+			{
+				disable('validationBtn');
+			}
+			else if( executionDate != '' && completed == 'false' )
+			{
+				disableCompletedButton(false);
+			}
+			else if( completed == 'true' )
+			{
+				disableCompletedButton(true);
+			}
+			
+			hideLoader();
+			hideById('contentDiv'); 
+		} );
+}
 
 //--------------------------------------------------------------------------------------------
 // Show search-form
@@ -71,40 +119,6 @@
 	 return (e)? e.which : null;
 }
 
-function searchValidationCompleted( messageElement )
-{
-    messageElement = messageElement.getElementsByTagName( 'message' )[0];
-	var type = messageElement.getAttribute( 'type' );
-    var message = messageElement.firstChild.nodeValue;
-	
-    if ( type == 'success' )
-    {
-		showLoader();
-		hideById('dataEntryFormDiv');
-		hideById('dataRecordingSelectDiv');
-		$('#contentDiv').load( 'searchPatient.action', 
-			{
-				searchObjectId: getFieldValue('searchObjectId'), 
-				searchText: getFieldValue('searchText'),
-				searchBySelectedOrgunit: byId('searchBySelectedOrgunit').checked
-			},
-			function()
-			{
-				showById('searchDiv');
-				setFieldValue('listAll', false);
-				hideLoader();
-			});
-    }
-    else if ( type == 'error' )
-    {
-        showErrorMessage( i18n_searching_patient_failed + ':' + '\n' + message );
-    }
-    else if ( type == 'input' )
-    {
-        showWarningMessage( message );
-    }
-}
-
 //--------------------------------------------------------------------------------------------
 // Show selected data-recording
 //--------------------------------------------------------------------------------------------
@@ -151,7 +165,7 @@
 				statusSearching = 1;
 				setInnerHTML( 'contentDiv', html );
 				showById('contentDiv');
-				setInnerHTML('searchInforTD', i18n_search_patients_by_attributes );
+				setInnerHTML('searchInforTD', i18n_advanced_search_patients );
 				setFieldValue('listAll',false);
 				jQuery( "#loaderDiv" ).hide();
 			}

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js	2012-08-16 02:08:22 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js	2012-08-16 16:31:03 +0000
@@ -787,7 +787,6 @@
 			$('#dataRecordingSelectDiv [id=programId]').val( programId );
 			$('#dataRecordingSelectDiv [id=inputCriteria]').hide();
 			
-			//loadProgramStages();
 			hideLoader();
 			hideById('contentDiv');
 		});

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/listPatient.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/listPatient.vm	2012-08-07 05:43:56 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/listPatient.vm	2012-08-16 16:31:03 +0000
@@ -102,5 +102,5 @@
 <script>
 	var i18n_patient_details_and_history = '$encoder.jsEscape( $i18n.getString( "patient_details_and_history" ) , "'" )';
 	var i18n_list_all_patients = '$encoder.jsEscape( $i18n.getString( "list_all_patients" ) , "'" )';
-	var i18n_search_patients_by_attributes = '$encoder.jsEscape( $i18n.getString( "search_patients_by_attributes" ) , "'" )';
+	var i18n_advanced_search_patients = '$encoder.jsEscape( $i18n.getString( "advanced_search_patients" ) , "'" )';
 </script>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm	2012-08-16 13:46:23 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm	2012-08-16 16:31:03 +0000
@@ -32,26 +32,26 @@
 		<tr id='programStageAddPatientTR' class='hidden'>
 			<td>
 				<select id='programStageAddPatient_' name='programStageAddPatient' disabled>
-					<option value=''>[$i18n.getString("please_select_program_stage")]</option>
+					<option value=''>[$i18n.getString('please_select_program_stage')]</option>
 				</select>
 				#foreach($program in $programs)
 					<select id='programStageAddPatient_$program.id' name='programStageAddPatient' onchange='enableRadioButton($program.id);' class='hidden'>
-						<option value=''>[$i18n.getString("please_select_program_stage")]</option>
+						<option value=''>[$i18n.getString('please_select_program_stage')]</option>
 						#foreach($programStage in $program.programStages)
 						<option value="$programStage.id">$programStage.name</option>
 						#end
 					</select>
 				#end
 			</td>
-			<td>
+			<td colspan='2'>
 				<input type="radio" disabled id="statusEvent" name="statusEvent" value='1' checked> $i18n.getString("completed") 
 				<input type="radio" disabled id="statusEvent" name="statusEvent" value='2'> $i18n.getString("incomplete") 
 				<input type="radio" disabled id="statusEvent" name="statusEvent" value='3'> $i18n.getString("scheduled_in_future") 
 				<input type="radio" disabled id="statusEvent" name="statusEvent" value='4'> $i18n.getString("overdue") 
 			</td>
-			<td colspan=2=></td>
+			<td></td>
 			<td>
-				<input type="button" id='programStageActionBtn' value="$i18n.getString('send_sms_for_result_list')" onclick="showSendSmsForm();">
+				<input type="button" id='programStageActionBtn' value="$i18n.getString('send_sms_to_list')" onclick="showSendSmsForm();">
 			</td>
 		</tr>
 		</thead>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleEventSelect.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleEventSelect.vm	2012-08-02 06:46:14 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleEventSelect.vm	2012-08-16 16:31:03 +0000
@@ -13,8 +13,9 @@
 
 <h3>$i18n.getString( "single_event_with_registration" ) #openHelp('single_event_with_registration')</h3>
 <input type='hidden' id='isRegistration' name= 'isRegistration' value='true'>
-<input type='hidden' id='listAll' name= 'listAll' >
-<input type='hidden' id='patientId' name= 'patientId' >
+<input type='hidden' id='listAll' name='listAll'>
+<select class='hidden' id='repeatableProgramStageId' name='repeatableProgramStageId'></select>
+<input type='hidden' id='patientId' name= 'patientId'>
 
 <div id='searchDiv'>
 	#parse( "dhis-web-caseentry/searchPatientCriteria.vm" )