← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10923: Generating program stage completeness report is wrong.

 

------------------------------------------------------------
revno: 10923
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-05-21 17:08:44 +0700
message:
  Generating program stage completeness report is wrong.
modified:
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java
  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/javascript/programStageCompleteness.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageCompleteness.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageCompletenessSelect.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-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java	2013-05-19 08:24:25 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java	2013-05-21 10:08:44 +0000
@@ -762,7 +762,7 @@
             + "                         ON ou.organisationunitid=psi.organisationunitid"
             + "                 INNER JOIN program pg "
             + "                         ON pg.programid = ps.programid "
-            + "         WHERE psi.organisationunitid = "
+            + "         WHERE ou.parentid = "
             + orgunit.getId()
             + "                 AND pg.programid = "
             + program.getId()

=== 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	2013-05-19 09:15:33 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2013-05-21 10:08:44 +0000
@@ -1147,7 +1147,7 @@
 	<!-- Program-stage-completeness -->
 	
 	  <action name="programStageCompletenessSelect"
-      class="org.hisp.dhis.caseentry.action.caseentry.MultiDataEntrySelectAction">
+      class="org.hisp.dhis.caseentry.action.patient.SelectAction">
       <interceptor-ref name="organisationUnitTreeStack" />
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-caseentry/programStageCompletenessSelect.vm</param>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/programStageCompleteness.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/programStageCompleteness.js	2013-05-21 09:08:24 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/programStageCompleteness.js	2013-05-21 10:08:44 +0000
@@ -5,19 +5,6 @@
 	hideById("listPatientDiv");
 	setFieldValue('orgunitName', orgUnitNames[0]);
 	setFieldValue('orgunitId', orgUnits[0]);
-	clearListById('programId');
-	jQuery.get("getPrograms.action",{}, 
-		function(json)
-		{
-			jQuery( '#programId').append( '<option value="">' + i18n_please_select + '</option>' );
-			for ( i in json.programs ) {
-				if(json.programs[i].type==1){
-					jQuery( '#programId').append( '<option value="' + json.programs[i].id +'" type="' + json.programs[i].type + '">' + json.programs[i].name + '</option>' );
-				}
-			}
-			hideById('programLoader');
-			enable('programId');
-		});
 }
 
 selection.setListenerFunction( orgunitSelected );

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageCompleteness.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageCompleteness.vm	2013-04-16 05:41:25 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageCompleteness.vm	2013-05-21 10:08:44 +0000
@@ -1,8 +1,6 @@
 <style type="text/css">
 .gridTable th, .gridTable td
 {
-  text-align: center;
-  width: 150px;
   line-height: 170%;
 }
 </style>
@@ -11,11 +9,16 @@
 <h5>$!encoder.htmlEncode( $grid.subtitle )</h5>
 
 <table class="listTable gridTable">
+	<col width="30" />
+	<col/>
+	<col/>
+	<col/>
+	<col/>
 	<thead>
 		<tr>
 			<th>#</th>
 			#foreach( $header in $grid.getVisibleHeaders() )
-				<th #if( $header.meta )style="text-align:left"#end>$!encoder.htmlEncode( $header.name )</th>
+				<th #if( $velocityCount < $grid.getVisibleHeaders().size() ) style="text-align:left" #else style="text-align:center" #end>$!encoder.htmlEncode( $header.name )</th>
 			#end
 		</tr>
 	</thead>
@@ -25,11 +28,10 @@
 			<tr>
 				<td>$i</td>
 			#foreach( $col in $row )
-				#set( $index = ( $velocityCount - 1 ) )
-				#if( $grid.getVisibleHeaders().get( $index ).meta )
+				#if( $velocityCount < $row.size() )
 					<td style="text-align:left">$!encoder.htmlEncode( $col )</td>
 				#else
-					<td>$col</td>
+					<td style="text-align:center">$col</td>
 				#end
 			#end
 			</tr>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageCompletenessSelect.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageCompletenessSelect.vm	2013-04-16 05:41:25 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageCompletenessSelect.vm	2013-05-21 10:08:44 +0000
@@ -65,5 +65,5 @@
 #parse( "dhis-web-commons/loader/loader.vm" )
 
 <script>
-	var i18n_please_select = '$encoder.jsEscape( $i18n.getString( "please_select" ) , "'")';
+	var i18n_please_select = '[' + '$encoder.jsEscape( $i18n.getString( "please_select" ) , "'")' + ']';
 </script>