← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9122: Put a symbol in the list for every incomplete event.

 

------------------------------------------------------------
revno: 9122
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-11-26 10:11:12 +0700
message:
  Put a symbol in the list for every incomplete event.
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/webapp/dhis-web-caseentry/programStageInstancesList.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.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-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	2012-11-14 07:23:08 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java	2012-11-26 03:11:12 +0000
@@ -222,7 +222,9 @@
                     deKeys.add( deKey );
                 }
             }
-        }
+        } 
+        
+        grid.addHeader( new GridHeader( "Complete", true, true ) );
 
         // ---------------------------------------------------------------------
         // Get SQL and build grid
@@ -250,8 +252,8 @@
     public void removeEmptyEvents( ProgramStage programStage, OrganisationUnit organisationUnit )
     {
         String sql = "delete from programstageinstance where programstageid=" + programStage.getId()
-            + " and organisationunitid=" + organisationUnit.getId()
-            + " and programstageinstanceid not in " + "(select pdv.programstageinstanceid from patientdatavalue pdv )";
+            + " and organisationunitid=" + organisationUnit.getId() + " and programstageinstanceid not in "
+            + "(select pdv.programstageinstanceid from patientdatavalue pdv )";
         jdbcTemplate.execute( sql );
     }
 
@@ -381,7 +383,7 @@
                     sql += "(select identifier from patientidentifier where patientid=p.patientid and patientidentifiertypeid="
                         + column.getIdentifier() + ") as identifier_" + column.getIdentifier() + ",";
                 }
-                
+
                 if ( column.hasQuery() )
                 {
                     where += operator + "lower(identifier_" + column.getIdentifier() + ") " + column.getQuery() + " ";
@@ -439,8 +441,7 @@
             }
         }
 
-        sql = sql.substring( 0, sql.length() - 1 ) + " "; // Removing last comma
-
+        sql += " psi.completed "; 
         sql += "from programstageinstance psi ";
         sql += "left join programinstance pi on (psi.programinstanceid=pi.programinstanceid) ";
         sql += "left join patient p on (pi.patientid=p.patientid) ";
@@ -462,11 +463,11 @@
         {
             sql += "and ou.organisationunitid in (" + TextUtils.getCommaDelimitedString( orgUnits ) + ") ";
         }
-        if( completed!= null )
+        if ( completed != null )
         {
-            sql += "and psi.completed="+ completed + " ";
+            sql += "and psi.completed=" + completed + " ";
         }
-        
+
         sql += "order by ";
 
         for ( int i = level; i <= maxLevel; i++ )

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstancesList.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstancesList.vm	2012-11-15 02:37:17 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstancesList.vm	2012-11-26 03:11:12 +0000
@@ -28,12 +28,14 @@
 						#set($metaData = $noCols - $valueTypes.size() - 1)
 						#set($index = 0)
 						#foreach( $col in $grid.getHeaders() )
-							#if( $index==1 || $index > $metaData )
-								<th>$col.name</th>
+							#if($index < $noCols - 1 )
+								#if( $index==1 || $index > $metaData )
+									<th>$col.name</th>
+								#end
 							#end
 							#set($index = $index + 1)
 						#end
-						<th style="width:70px">$i18n.getString( "operations" )</th>
+						<th style="width:100px">$i18n.getString( "operations" )</th>
 					</tr>
 				</thead>
 		
@@ -45,17 +47,20 @@
 								#set( $nr = ( ( $paging.getCurrentPage() - 1  ) * $paging.pageSize ) + $velocityCount )
 								$nr
 							</td>
-							
+							#set($completed = "")
 							#foreach( $col in $row )
 								#if( $index == 0 )
 									#set($psid = $col)
+								#elseif($index == $noCols - 1)
+									#set($completed = $col)
 								#elseif( $index==1 || $index > $metaData )
 									<td>$!col</td>
 								#end
 								#set($index = $index + 1)
 							#end
 							
-							<td>
+							<td align='right'>
+								#if($completed=='false')<span class="incomplete-record" title="$i18n.getString('incomplete')">&nbsp;!&nbsp;</span>#end
 								<a href="javascript:showUpdateEvent( $psid )" title='$i18n.getString( "data_entry" )'><img src="images/data_entry.png" alt='$i18n.getString( "data_entry" )'></a>
 								<a href="javascript:removeEvent( $psid )" title='$i18n.getString( "remove" )'><img src="../images/delete.png" alt='$i18n.getString( "remove" )'></a>
 							</td>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.css'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.css	2012-11-15 04:44:29 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.css	2012-11-26 03:11:12 +0000
@@ -56,6 +56,13 @@
 	width:100%;
 }
 
+.incomplete-record
+{
+	color:red;
+	font-weight: bold;
+	font-size:25px;
+}
+
 /*----------------------------------------------------------------------------*/
 /* Table
 /*----------------------------------------------------------------------------*/