← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7192: Change UI of multi-program data entry form.

 

------------------------------------------------------------
revno: 7192
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-06-05 15:47:35 +0700
message:
  Change UI of multi-program data entry form.
modified:
  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
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/report.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/dataEntry.css
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/patient.css
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/report.css


--
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/struts.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2012-05-31 07:17:15 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2012-06-05 08:47:35 +0000
@@ -177,6 +177,7 @@
 			<result name="success" type="velocity">/main.vm</result>
 			<param name="page">/dhis-web-caseentry/multiDataEntrySelect.vm</param>
 			<param name="menu">/dhis-web-caseentry/dataEntryMenu.vm</param>
+			<param name="stylesheets">style/patient.css</param>
 			<param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,javascript/commons.js,
 				javascript/form.js,javascript/multiDataEntry.js</param>			
 			<param name="requiredAuthorities">F_NAME_BASED_DATA_ENTRY</param>

=== 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-03-09 01:56:35 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataentryRecords.vm	2012-06-05 08:47:35 +0000
@@ -3,50 +3,24 @@
     <tr>
         <td>    
         <table class="listTable" id="patientList">
-			<col>
-            #if( $sortPatientAttribute )
-				<col>
-			#end
-            #foreach( $programStage in $program.programStages )
-                <col>
-            #end 
-			<thead>
-				<tr>
-					<th>#</th>
-					#if( $sortPatientAttribute )
-						<th>$encoder.htmlEncode( $sortPatientAttribute.name )</th>
-					#end
-					<th>$i18n.getString( "full_name" )</th>
-					#foreach( $programStage in $program.programStages )
-						<th class="{sorter: false}">$encoder.htmlEncode( $programStage.name )</th>
-					#end                
-				</tr>
-			</thead>
             <tbody id="list">
                 #set( $mark = false )                 
                 #foreach( $patient in $patientListByOrgUnit )
 					#set( $programInstance = $programInstanceMap.get( $patient ) )
-					<tr #alternate( $mark )>
-						<td>
-							#set( $nr = ( ( $paging.getCurrentPage() - 1  ) * $paging.pageSize ) + $velocityCount )
-							$nr
-						</td>
-						#if( $sortPatientAttribute )
-							<td>$!patientAttributeValueMap.get( $patient.id ).value</td>
-						#end
-                        <td><a href="javascript:showPatientHistory( '$patient.id' )" title="$i18n.getString( 'patient_details_and_history' )">$patient.getFullName()</a></td>                    
-                        #foreach( $programStageInstance in $programStageInstanceMap.get( $programInstance ) )
-                            #if( $programStageInstance.executionDate )
-                                <td class="cent" bgcolor="$colorMap.get( $programStageInstance.id )">
-                                    <a href="javascript:viewPrgramStageRecords( $programStageInstance.id );">$format.formatDate( $programStageInstance.executionDate )</a>
-                                </td>
-                            #else
-                                <td class="cent" bgcolor="$colorMap.get( $programStageInstance.id )">
-									<a href="javascript:viewPrgramStageRecords( $programStageInstance.id );">$format.formatDate( $programStageInstance.dueDate )</a>
-								</td>
-                            #end
-                        #end
-                    </tr>
+						<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 )
+								<td>
+									<img src='images/rightarrow.png'>
+								</td>
+								
+								<td width='100px;'>
+									<input type='button' class='stage-object' style='border-color:$colorMap.get( $programStageInstance.id );' value='$programStageInstance.programStage.name $format.formatDate( $programStageInstance.dueDate )' onclick='javascript:viewPrgramStageRecords( $programStageInstance.id );'>
+								</td>
+							#end
+						</tr>
                     #if( $mark )
                         #set( $mark = false )
                     #else

=== 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-03-05 07:32:05 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/multiDataEntry.js	2012-06-05 08:47:35 +0000
@@ -29,29 +29,37 @@
 
 selection.setListenerFunction( multiDataEntryOrgunitSelected );
 
-function selectProgram()
+function selectProgram( programId, programName )
 {
 	setInnerHTML('listPatient', '');
-	if( getFieldValue('programId') == 0 )
-	{
-		hideById('listPatient');
-		return;
-	}
-	
 	contentDiv = 'listPatient';
 	showLoader();
 	jQuery('#listPatient').load("getDataRecords.action",
 		{
-			programId:getFieldValue('programId'),
-			sortPatientAttributeId: getFieldValue('patientAttributeId')
+			programId:programId,
+			sortPatientAttributeId:0
 		}, 
 		function()
 		{
+			hideById('programDiv');
+			
+			setFieldValue('programId', programId);
+			setInnerHTML('programName', programName);
+			showById('programName');
+			
+			showById('btnBack');
 			showById("listPatient");
 			hideLoader();
 		});
 }
 
+function backButtonOnClick()
+{
+	hideById("listPatient");
+	hideById('btnBack');
+	hideById('programName');
+	showById('programDiv');
+}
 function viewPrgramStageRecords( programStageInstanceId ) 
 {
 	$('#contentDataRecord').dialog('destroy').remove();

=== 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-05-30 07:10:46 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/multiDataEntrySelect.vm	2012-06-05 08:47:35 +0000
@@ -1,37 +1,21 @@
 <h3>$i18n.getString( "multiple_name_based" ) #openHelp('multi_name_based_data_entry')</h3>
 
+<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">
-	<table> 
-		<tr style="margin-bottom:8px">
-			<td><label>$i18n.getString( "orgunit" )</label></td>
-			<td>
-				<input type="text" readonly="readonly" id='orgunitName' name='orgunitName' #if( $organisationUnit ) value="$organisationUnit.name" #else value="[$i18n.getString( "select" )]" #end style="min-width:350px">
-			</td>
-			<td>&nbsp;</td>
-			<td>&nbsp;</td>
-		</tr>
-
-        <tr>
-            <td><label for="programId">$i18n.getString( "program" )</label></td>
-            <td>
-                <select id="programId" name="programId" style="min-width:350px" onchange="javascript:selectProgram()" #if( $programs.size() == 0 ) disabled="disabled" #end>
-                    <option value="0">[$i18n.getString( "select" )]</option>
-                    #foreach( $program in $programs )
-                        <option value="$program.id" #if( $programId && $program.id == $programId ) selected="selected" #end>$encoder.htmlEncode( $program.name )</option>
-                    #end
-                </select>
-            </td>
-			<td align="right"><label>$i18n.getString( "sort_by" )</label></td>
-			<td>
-				<select id="patientAttributeId" name="patientAttributeId" style="min-width:350px" onchange="javascript:selectProgram();" #if( $programs.size() == 0 ) disabled="disabled" #end>
-                    <option value="0">[$i18n.getString( "select" )]</option>
-                    #foreach( $patientAttribute in $patientAttributes )
-                        <option value="$patientAttribute.id" #if( $sortPatientAttributeId && $patientAttribute.id == $sortPatientAttributeId ) selected="selected" #end>$encoder.htmlEncode( $patientAttribute.name )</option>
-                    #end
-                </select>
-			</td>
-        </tr>
-    </table>   
+	<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>
 
 #parse( "dhis-web-commons/loader/loader.vm" )

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/report.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/report.vm	2012-06-04 10:03:56 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/report.vm	2012-06-05 08:47:35 +0000
@@ -10,14 +10,14 @@
             #foreach( $programInstance in $programInstances )
                 <tr #alternate( $mark )>                
 					<td>
-						<input type='button' class='buttonInfo' style='border-color:#bbbbbb;background-color:#cccccc' value='$programInstance.patient.getFullName()' onclick='javascript:showPatientHistory( $programInstance.patient.id )' title='$i18n.getString( "patient_details_and_history" )'>
+						<input type='button' class='patient-object' value='$programInstance.patient.getFullName()' onclick='javascript:showPatientHistory( $programInstance.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' class='buttonInfo' style='border-color:$colorMap.get( $programStageInstance.id );' value='$programStageInstance.programStage.name $format.formatDate( $programStageInstance.dueDate )' onclick='javascript:viewRecords( $programStageInstance.id )'>
+							<input type='button' class='stage-object' style='border-color:$colorMap.get( $programStageInstance.id );' value='$programStageInstance.programStage.name $format.formatDate( $programStageInstance.dueDate )' onclick='javascript:viewRecords( $programStageInstance.id )'>
 						</td>
                     #end
                 </tr>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/dataEntry.css'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/dataEntry.css	2012-05-31 07:17:15 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/dataEntry.css	2012-06-05 08:47:35 +0000
@@ -103,4 +103,4 @@
 	font-size: .7.5em !important;
 }
 
-.ui-autocomplete { height: 100px; overflow-y: scroll; overflow-x: hidden;}
\ No newline at end of file
+.ui-autocomplete { height: 100px; overflow-y: scroll; overflow-x: hidden;}

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/patient.css'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/patient.css	2012-05-24 05:21:12 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/patient.css	2012-06-05 08:47:35 +0000
@@ -74,3 +74,26 @@
 {
 	border: 1px solid #3f5d8e;
 }
+
+
+.stage-object
+{
+	width: 100px;
+	height: 40px;
+    white-space: normal;
+	border:2px solid; 
+	background-color:#ffffff;
+	cursor:pointer;
+}
+
+.patient-object
+{
+	width: 100px;
+	height: 40px;
+    white-space: normal;
+	border:2px solid; 
+	border-color:#bbbbbb;
+	background-color:#cccccc
+	cursor:pointer;
+}
+

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/report.css'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/report.css	2012-05-30 06:36:41 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/report.css	2012-06-05 08:47:35 +0000
@@ -58,7 +58,7 @@
 	display: block;
 }
 
-.buttonInfo
+.stage-object
 {
 	width: 100px;
 	height: 40px;
@@ -66,4 +66,15 @@
 	border:2px solid; 
 	background-color:#ffffff;
 	cursor:pointer;
+}
+
+.patient-object
+{
+	width: 100px;
+	height: 40px;
+    white-space: normal;
+	border:2px solid; 
+	border-color:#bbbbbb;
+	background-color:#cccccc
+	cursor:pointer;
 }
\ No newline at end of file