← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7371: Fixed error when select an orgunit in Multi entry form.

 

------------------------------------------------------------
revno: 7371
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-06-25 11:17:52 +0700
message:
  Fixed error when select an orgunit in Multi entry form.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataentryRecords.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/multiDataEntry.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/multiDataEntrySelect.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/resources/org/hisp/dhis/caseentry/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2012-06-23 15:48:45 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2012-06-25 04:17:52 +0000
@@ -365,4 +365,5 @@
 search_events_by_dataelements = Search events by data elements
 list_all_events = List all events
 specify_data_element = Please specify a data element
-advanced_search = Advanced search
\ No newline at end of file
+advanced_search = Advanced search
+no_patient_enrolled_the_program = No person enrolled the program
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2012-06-23 11:05:13 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2012-06-25 04:17:52 +0000
@@ -200,8 +200,8 @@
 
 		<action name="getPrograms"
 			class="org.hisp.dhis.caseentry.action.caseentry.GetProgramsByOrgunitAction">
-			<result name="success" type="velocity-json">
-				/dhis-web-caseentry/responsePrograms.vm</result>
+			<result name="success" type="velocity">/content.vm</result>
+			<param name="page">/dhis-web-caseentry/multiDataEntryIndex.vm</param>
 		</action>
 
 		<action name="getDataRecords"

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataentryRecords.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataentryRecords.vm	2012-06-07 04:23:40 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataentryRecords.vm	2012-06-25 04:17:52 +0000
@@ -1,54 +1,57 @@
-
-<table class="mainPageTable">
-    <tr>
-        <td>    
-        <table class="listTable" id="patientList">
-            <tbody id="list">
-                #set( $mark = false )                 
-                #foreach( $patient in $patientListByOrgUnit )
-					#set( $programInstance = $programInstanceMap.get( $patient ) )
-						<tr #alternate( $mark )>
-							<td>
-								<input type='button' class='patient-object' value='$patient.getFullName()' onclick='javascript:showPatientHistory( "$patient.id" );' title='$i18n.getString( "patient_details_and_history" )'>
-							</td>
-							#foreach( $programStageInstance in $programInstance.programStageInstances )
+#if( $patientListByOrgUnit && $patientListByOrgUnit.size()>0 )
+	<table class="mainPageTable">
+		<tr>
+			<td>    
+			<table class="listTable" id="patientList">
+				<tbody id="list">
+					#set( $mark = false )                 
+					#foreach( $patient in $patientListByOrgUnit )
+						#set( $programInstance = $programInstanceMap.get( $patient ) )
+							<tr #alternate( $mark )>
 								<td>
-									<img src='images/rightarrow.png'>
-								</td>
-								
-								<td width='100px;'>
-									<input type='button' id='ps_$programStageInstance.id' name='programStageBtn' class='stage-object' value='$programStageInstance.programStage.name $format.formatDate( $programStageInstance.dueDate )' onclick='javascript:viewPrgramStageRecords( $programStageInstance.id );'>
-									<script>	
-										var status = $statusMap.get( $programStageInstance.id );
-										setEventColorStatus( 'ps_' + $programStageInstance.id ,status);
-									</script>
-								</td>
-							#end
-						</tr>
-                    #if( $mark )
-                        #set( $mark = false )
-                    #else
-                        #set( $mark = true )
-                    #end 
-                #end    
-            </tbody>
-			<tr>
-				#set( $size=$program.programStages.size() + 2 )
-				<td colspan="$size">
-					<p></p>
-					<div class="paging-container">
-						#parse( "/dhis-web-commons/paging/paging.vm" )
-					</div>
-				</td>
-				<td></td>
-			</tr>
-        </table>
-        </td>
-    </tr>
-</table>
+									<input type='button' class='patient-object' value='$patient.getFullName()' onclick='javascript:showPatientHistory( "$patient.id" );' title='$i18n.getString( "patient_details_and_history" )'>
+								</td>
+								#foreach( $programStageInstance in $programInstance.programStageInstances )
+									<td>
+										<img src='images/rightarrow.png'>
+									</td>
+									
+									<td width='100px;'>
+										<input type='button' id='ps_$programStageInstance.id' name='programStageBtn' class='stage-object' value='$programStageInstance.programStage.name $format.formatDate( $programStageInstance.dueDate )' onclick='javascript:viewPrgramStageRecords( $programStageInstance.id );'>
+										<script>	
+											var status = $statusMap.get( $programStageInstance.id );
+											setEventColorStatus( 'ps_' + $programStageInstance.id ,status);
+										</script>
+									</td>
+								#end
+							</tr>
+						#if( $mark )
+							#set( $mark = false )
+						#else
+							#set( $mark = true )
+						#end 
+					#end    
+				</tbody>
+				<tr>
+					#set( $size=$program.programStages.size() + 2 )
+					<td colspan="$size">
+						<p></p>
+						<div class="paging-container">
+							#parse( "/dhis-web-commons/paging/paging.vm" )
+						</div>
+					</td>
+					<td></td>
+				</tr>
+			</table>
+			</td>
+		</tr>
+	</table>
 
-<div id="detailsInfo">
-</div>
+	<div id="detailsInfo">
+	</div>
+#else
+	<h5>$i18n.getString('No person enrolled the program')</h5>
+#end
 
 <script>
 	jQuery(document).ready(function(){	

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/multiDataEntry.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/multiDataEntry.js	2012-06-20 06:32:51 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/multiDataEntry.js	2012-06-25 04:17:52 +0000
@@ -2,28 +2,13 @@
 function multiDataEntryOrgunitSelected( orgUnits, orgUnitNames )
 {
 	hideById("listPatient");
-	jQuery.getJSON( "getPrograms.action",{}, 
-		function( json ) 
-		{    
-			enable('programId');
-			enable('patientAttributeId');
-			
-			clearListById('programId');
-			if(json.programs.length == 0)
-			{
-				disable('programId');
-				disable('patientAttributeId');
-			}
-			else
-			{
-				addOptionById( 'programId', "0", i18n_select );
-				
-				for ( var i in json.programs ) 
-				{
-					addOptionById( 'programId', json.programs[i].id, json.programs[i].name );
-				} 
-			}	
+	jQuery('#programDiv').load("getPrograms.action",{}, 
+		function()
+		{
+			showById('programDiv');
+			hideById('btnBack');
 			setFieldValue( 'orgunitName', orgUnitNames[0] );
+			hideLoader();
 		});
 }
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/multiDataEntrySelect.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/multiDataEntrySelect.vm	2012-06-20 06:32:51 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/multiDataEntrySelect.vm	2012-06-25 04:17:52 +0000
@@ -1,24 +1,14 @@
 <h3>$i18n.getString( "multiple_name_based" ) #openHelp('multi_name_based_data_entry')</h3>
 
-<h4 id='programName' name='programName'></h4>	
-
+<h4 id='programName' name='programName'></h4>
 <input type="button" id='btnBack' name='btnBack' style='width: 150px;display:none;' value="$i18n.getString( 'back' )" onclick="backButtonOnClick();"/>
-<p></p>
-<form id="dataEntryForm" name="dataEntryForm" method="post" action="multipledataEntrySelect.action">
-	<div id='programDiv'>
-		<input type='hidden' id='programId' name='programId' />
-		#foreach( $program in $programs )
-			<ul class="introList">
-				<li class="introItem" onclick="javascript:selectProgram('$program.id', '$program.name')">
-				  <span class="introItemHeader"><img src="../icons/program.png" style="float:left; margin-right:15px">$program.name</span><br>
-				  <span>$program.description</span>
-				</li>
-			</ul>	
-		#end
-	</div>
-</form>
+
+<div id='programDiv'>
+	#parse( "dhis-web-caseentry/multiDataEntryIndex.vm" )
+</div>
 
 #parse( "dhis-web-commons/loader/loader.vm" )
+
 <input type='hidden' id='orgunitId' value='$organisationUnit.id'>
 <div id='listPatient'></div>