← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4727: Don't show patient details in Summary report; remove unused file.

 

------------------------------------------------------------
revno: 4727
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2011-09-28 11:02:30 +0700
message:
  Don't show patient details in Summary report; remove unused file.
removed:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GetPatientDetailsAction.java
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml
  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/commons.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/dataEntry.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/javascript/report.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/report.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
=== removed file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GetPatientDetailsAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GetPatientDetailsAction.java	2011-05-25 06:27:29 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GetPatientDetailsAction.java	1970-01-01 00:00:00 +0000
@@ -1,276 +0,0 @@
-/*
- * Copyright (c) 2004-2009, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package org.hisp.dhis.caseentry.action.report;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.hisp.dhis.patient.Patient;
-import org.hisp.dhis.patient.PatientAttribute;
-import org.hisp.dhis.patient.PatientAttributeGroup;
-import org.hisp.dhis.patient.PatientAttributeGroupService;
-import org.hisp.dhis.patient.PatientAttributeService;
-import org.hisp.dhis.patient.PatientIdentifier;
-import org.hisp.dhis.patient.PatientIdentifierService;
-import org.hisp.dhis.patient.PatientIdentifierType;
-import org.hisp.dhis.patient.PatientIdentifierTypeService;
-import org.hisp.dhis.patient.PatientService;
-import org.hisp.dhis.patientattributevalue.PatientAttributeValue;
-import org.hisp.dhis.patientattributevalue.PatientAttributeValueService;
-import org.hisp.dhis.program.Program;
-import org.hisp.dhis.program.ProgramService;
-
-import com.opensymphony.xwork2.Action;
-
-public class GetPatientDetailsAction
-    implements Action
-{
-    // -------------------------------------------------------------------------
-    // Dependencies
-    // -------------------------------------------------------------------------
-
-    private PatientService patientService;
-
-    private PatientIdentifierService patientIdentifierService;
-
-    private ProgramService programService;
-
-    private PatientAttributeValueService patientAttributeValueService;
-
-    private PatientAttributeService patientAttributeService;
-
-    private PatientAttributeGroupService patientAttributeGroupService;
-
-    private PatientIdentifierTypeService patientIdentifierTypeService;
-
-    // -------------------------------------------------------------------------
-    // Input/Output
-    // -------------------------------------------------------------------------
-
-    private int id;
-
-    private Patient patient;
-
-    private PatientIdentifier patientIdentifier;
-
-    private Collection<Program> programs;
-
-    private Map<Integer, String> patientAttributeValueMap = new HashMap<Integer, String>();
-
-    private Collection<PatientAttribute> noGroupAttributes;
-
-    private Collection<PatientAttributeGroup> attributeGroups;
-
-    private Collection<PatientIdentifierType> identifierTypes;
-
-    private Map<Integer, String> identiferMap;
-
-    private String childContactName;
-
-    private String childContactType;
-
-    private String systemIdentifier;
-
-    // -------------------------------------------------------------------------
-    // Action implementation
-    // -------------------------------------------------------------------------
-
-    public String execute()
-        throws Exception
-    {
-        patient = patientService.getPatient( id );
-
-        patientIdentifier = patientIdentifierService.getPatientIdentifier( patient );
-
-        identifierTypes = patientIdentifierTypeService.getAllPatientIdentifierTypes();
-
-        identiferMap = new HashMap<Integer, String>();
-
-        PatientIdentifierType idType = null;
-        Patient representative = patient.getRepresentative();
-
-        if ( patient.isUnderAge() && representative != null )
-        {
-            for ( PatientIdentifier representativeIdentifier : representative.getIdentifiers() )
-            {
-                if ( representativeIdentifier.getIdentifierType() != null
-                    && representativeIdentifier.getIdentifierType().isRelated() )
-                {
-                    identiferMap.put( representativeIdentifier.getIdentifierType().getId(), representativeIdentifier
-                        .getIdentifier() );
-                }
-            }
-        }
-
-        for ( PatientIdentifier identifier : patient.getIdentifiers() )
-        {
-            idType = identifier.getIdentifierType();
-            if ( idType != null )
-            {
-                identiferMap.put( identifier.getIdentifierType().getId(), identifier.getIdentifier() );
-            }
-            else
-            {
-                systemIdentifier = identifier.getIdentifier();
-            }
-        }
-
-        for ( PatientAttribute patientAttribute : patient.getAttributes() )
-        {
-            patientAttributeValueMap.put( patientAttribute.getId(), PatientAttributeValue.UNKNOWN );
-        }
-
-        Collection<PatientAttributeValue> patientAttributeValues = patientAttributeValueService
-            .getPatientAttributeValues( patient );
-
-        for ( PatientAttributeValue patientAttributeValue : patientAttributeValues )
-        {
-            if ( PatientAttribute.TYPE_COMBO.equalsIgnoreCase( patientAttributeValue.getPatientAttribute()
-                .getValueType() ) )
-            {
-                patientAttributeValueMap.put( patientAttributeValue.getPatientAttribute().getId(),
-                    patientAttributeValue.getPatientAttributeOption().getName() );
-            }
-            else
-            {
-                patientAttributeValueMap.put( patientAttributeValue.getPatientAttribute().getId(),
-                    patientAttributeValue.getValue() );
-            }
-        }
-
-        programs = programService.getAllPrograms();
-
-        noGroupAttributes = patientAttributeService.getPatientAttributesNotGroup();
-
-        attributeGroups = patientAttributeGroupService.getAllPatientAttributeGroups();
-
-        return SUCCESS;
-
-    }
-
-    // -----------------------------------------------------------------------------
-    // Getter / Setter
-    // -----------------------------------------------------------------------------
-
-    public void setPatientService( PatientService patientService )
-    {
-        this.patientService = patientService;
-    }
-
-    public void setPatientIdentifierService( PatientIdentifierService patientIdentifierService )
-    {
-        this.patientIdentifierService = patientIdentifierService;
-    }
-
-    public void setProgramService( ProgramService programService )
-    {
-        this.programService = programService;
-    }
-
-    public void setPatientAttributeValueService( PatientAttributeValueService patientAttributeValueService )
-    {
-        this.patientAttributeValueService = patientAttributeValueService;
-    }
-
-    public void setPatientAttributeService( PatientAttributeService patientAttributeService )
-    {
-        this.patientAttributeService = patientAttributeService;
-    }
-
-    public void setPatientAttributeGroupService( PatientAttributeGroupService patientAttributeGroupService )
-    {
-        this.patientAttributeGroupService = patientAttributeGroupService;
-    }
-
-    public void setPatientIdentifierTypeService( PatientIdentifierTypeService patientIdentifierTypeService )
-    {
-        this.patientIdentifierTypeService = patientIdentifierTypeService;
-    }
-
-    public void setId( int id )
-    {
-        this.id = id;
-    }
-
-    public Patient getPatient()
-    {
-        return patient;
-    }
-
-    public PatientIdentifier getPatientIdentifier()
-    {
-        return patientIdentifier;
-    }
-
-    public Collection<Program> getPrograms()
-    {
-        return programs;
-    }
-
-    public Map<Integer, String> getPatientAttributeValueMap()
-    {
-        return patientAttributeValueMap;
-    }
-
-    public Collection<PatientAttribute> getNoGroupAttributes()
-    {
-        return noGroupAttributes;
-    }
-
-    public Collection<PatientAttributeGroup> getAttributeGroups()
-    {
-        return attributeGroups;
-    }
-
-    public Collection<PatientIdentifierType> getIdentifierTypes()
-    {
-        return identifierTypes;
-    }
-
-    public Map<Integer, String> getIdentiferMap()
-    {
-        return identiferMap;
-    }
-
-    public String getChildContactName()
-    {
-        return childContactName;
-    }
-
-    public String getChildContactType()
-    {
-        return childContactType;
-    }
-
-    public String getSystemIdentifier()
-    {
-        return systemIdentifier;
-    }
-
-}

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2011-09-28 03:31:19 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2011-09-28 04:02:30 +0000
@@ -277,25 +277,6 @@
 			ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
 	</bean>
 
-	<bean id="org.hisp.dhis.caseentry.action.report.GetPatientDetailsAction"
-		class="org.hisp.dhis.caseentry.action.report.GetPatientDetailsAction"
-		scope="prototype">
-		<property name="patientService" ref="org.hisp.dhis.patient.PatientService" />
-		<property name="patientIdentifierService"
-			ref="org.hisp.dhis.patient.PatientIdentifierService" />
-		<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
-		<property name="patientAttributeValueService"
-			ref="org.hisp.dhis.patientattributevalue.PatientAttributeValueService" />
-		<property name="patientAttributeService">
-			<ref bean="org.hisp.dhis.patient.PatientAttributeService" />
-		</property>
-		<property name="patientAttributeGroupService"
-			ref="org.hisp.dhis.patient.PatientAttributeGroupService" />
-		<property name="patientIdentifierTypeService">
-			<ref bean="org.hisp.dhis.patient.PatientIdentifierTypeService" />
-		</property>
-	</bean>
-
 	<!-- Case Aggregation -->
 
 	<bean

=== 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	2011-09-28 02:14:43 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2011-09-28 04:02:30 +0000
@@ -24,8 +24,11 @@
 			<result name="success" type="velocity">/main.vm</result>
 			<param name="page">/dhis-web-caseentry/select.vm</param>
 			<param name="menu">/dhis-web-caseentry/dataEntryMenu.vm</param>
-			<param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,javascript/dataEntry.js,
-				../dhis-web-commons/javascripts/date.js</param>
+			<param name="javascripts">../dhis-web-commons/ouwt/ouwt.js
+				,javascript/commons.js
+				,javascript/dataEntry.js,
+				../dhis-web-commons/javascripts/date.js
+			</param>
 		</action>
 
 		<action name="validateSearch"
@@ -192,15 +195,6 @@
 			<param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,javascript/report.js</param>
 		</action>
 
-		<action name="reportSelect"
-			class="org.hisp.dhis.caseentry.action.report.ReportSelectAction">
-			<interceptor-ref name="organisationUnitTreeStack" />
-			<result name="success" type="velocity">/main.vm</result>
-			<param name="page">/dhis-web-caseentry/reportSelect.vm</param>
-			<param name="menu">/dhis-web-caseentry/reportsMenu.vm</param>
-			<param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,javascript/report.js</param>
-		</action>
-
 		<action name="validateReportParameters"
 			class="org.hisp.dhis.caseentry.action.report.ValidateReportParametersAction">
 			<result name="success" type="velocity-xml">
@@ -216,22 +210,16 @@
 			class="org.hisp.dhis.caseentry.action.report.GenerateReportAction">
 			<result name="success" type="velocity">/content.vm</result>
 			<param name="page">/dhis-web-caseentry/report.vm</param>
-			<param name="javascripts">javascript/report.js</param>
+			<param name="javascripts">javascript/commons.js,javascript/report.js</param>
 			<param name="stylesheets">../dhis-web-commons/paging/paging.css</param>
 		</action>
 
 		<action name="viewRecords"
 			class="org.hisp.dhis.caseentry.action.report.ViewRecordsAction">
-			<result name="success" type="velocity">/popup.vm</result>
+			<result name="success" type="velocity">/content.vm</result>
 			<param name="page">/dhis-web-caseentry/records.vm</param>
 		</action>
 
-		<action name="getPatientDetails"
-			class="org.hisp.dhis.caseentry.action.report.GetPatientDetailsAction">
-			<result name="success" type="velocity">/content.vm</result>
-			<param name="page">/dhis-web-caseentry/detailsPatient.vm</param>
-		</action>
-
 		<!-- Case Aggregation -->
 
 		<action name="caseAggregationForm"
@@ -586,5 +574,11 @@
 			<param name="requiredAuthorities">F_PATIENT_ADD</param>
 		</action>
 		
+		<action name="getPatientDetails"
+			class="org.hisp.dhis.caseentry.action.patient.GetPatientAction">
+			<result name="success" type="velocity">/content.vm</result>
+			<param name="page">/dhis-web-caseentry/detailsPatient.vm</param>
+		</action>
+		
 	</package>
 </struts>

=== 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	2011-09-28 03:05:50 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataentryRecords.vm	2011-09-28 04:02:30 +0000
@@ -62,17 +62,13 @@
 				<td colspan="$size">
 					<p></p>
 					<div class="paging-container">
-							#parse( "/dhis-web-commons/paging/paging.vm" )
+						#parse( "/dhis-web-commons/paging/paging.vm" )
 					</div>
 				</td>
 				<td></td>
 			</tr>
         </table>
         </td>
-		<!-- <td style="vertical-align:top">
-			<div id="detailsArea" style="display:none;overflow:auto;height:250px;width:250px">
-			</div>
-		</td> -->
     </tr>
 </table>
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2011-09-14 06:36:13 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2011-09-28 04:02:30 +0000
@@ -94,3 +94,74 @@
 	return params;
 }
 
+// -----------------------------------------------------------------------------
+// View patient details
+// -----------------------------------------------------------------------------
+
+function showPatientDetails( patientId )
+{
+    $('#detailsArea').load("getPatientDetails.action", 
+		{
+			id:patientId
+		}
+		, function( html ){
+			setInnerHTML( 'detailsArea', html );
+			showDetails();
+		});
+}
+
+// -----------------------------------------------------------------------------
+// Show Details
+// -----------------------------------------------------------------------------
+
+function showDetails()
+{
+	var detailArea = $("#detailsArea");
+	var top = (f_clientHeight() / 2) - 200;	
+	if ( top < 0 ) top = 0; 
+    var left = screen.width - detailArea.width() - 100;
+    detailArea.css({"left":left+"px","top":top+"px"});
+    detailArea.show('fast');
+    
+}
+
+/**
+ *  Get document width, hieght, scroll positions
+ *  Work with all browsers
+ * @return
+ */
+
+function f_clientWidth() {
+	return f_filterResults (
+		window.innerWidth ? window.innerWidth : 0,
+		document.documentElement ? document.documentElement.clientWidth : 0,
+		document.body ? document.body.clientWidth : 0
+	);
+}
+function f_clientHeight() {
+	return f_filterResults (
+		window.innerHeight ? window.innerHeight : 0,
+		document.documentElement ? document.documentElement.clientHeight : 0,
+		document.body ? document.body.clientHeight : 0
+	);
+}
+function f_scrollLeft() {
+	return f_filterResults (
+		window.pageXOffset ? window.pageXOffset : 0,
+		document.documentElement ? document.documentElement.scrollLeft : 0,
+		document.body ? document.body.scrollLeft : 0
+	);
+}
+function f_scrollTop() {
+	return f_filterResults (
+		window.pageYOffset ? window.pageYOffset : 0,
+		document.documentElement ? document.documentElement.scrollTop : 0,
+		document.body ? document.body.scrollTop : 0
+	);
+}
+function f_filterResults(n_win, n_docel, n_body) {
+	var n_result = n_win ? n_win : 0;
+	if (n_docel && (!n_result || (n_result > n_docel)))
+		n_result = n_docel;
+	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
+}

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/dataEntry.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/dataEntry.js	2011-09-14 06:36:13 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/dataEntry.js	2011-09-28 04:02:30 +0000
@@ -224,26 +224,6 @@
     }
 }
 
-//-----------------------------------------------------------------------------
-// View details
-//-----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// View details
-// -----------------------------------------------------------------------------
-
-function showPatientDetails( patientId )
-{
-    $('#detailsArea').load("getPatientDetails.action", 
-		{
-			id:patientId
-		}
-		, function( html ){
-			setInnerHTML( 'detailsArea', html );
-			showDetails();
-		});
-}
-
 //------------------------------------------------------------------------------
 //Save value
 //------------------------------------------------------------------------------

=== 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	2011-09-27 08:12:23 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js	2011-09-28 04:02:30 +0000
@@ -61,22 +61,6 @@
 }
 
 // -----------------------------------------------------------------------------
-// View details
-// -----------------------------------------------------------------------------
-
-function showPatientDetails( patientId )
-{
-    $('#detailsArea').load("getPatientDetails.action", 
-		{
-			id:patientId
-		}
-		, function( html ){
-			setInnerHTML( 'detailsArea', html );
-			showDetails();
-		});
-}
-
-// -----------------------------------------------------------------------------
 // Remove patient
 // -----------------------------------------------------------------------------
 
@@ -816,63 +800,6 @@
 	});
 }
 
-
-// -----------------------------------------------------------------------------
-// Show Details
-// -----------------------------------------------------------------------------
-
-function showDetails()
-{
-	var detailArea = $("#detailsArea");
-	var top = (f_clientHeight() / 2) - 200;	
-	if ( top < 0 ) top = 0; 
-    var left = screen.width - detailArea.width() - 100;
-    detailArea.css({"left":left+"px","top":top+"px"});
-    detailArea.show('fast');
-    
-}
-
-/**
- *  Get document width, hieght, scroll positions
- *  Work with all browsers
- * @return
- */
-
-function f_clientWidth() {
-	return f_filterResults (
-		window.innerWidth ? window.innerWidth : 0,
-		document.documentElement ? document.documentElement.clientWidth : 0,
-		document.body ? document.body.clientWidth : 0
-	);
-}
-function f_clientHeight() {
-	return f_filterResults (
-		window.innerHeight ? window.innerHeight : 0,
-		document.documentElement ? document.documentElement.clientHeight : 0,
-		document.body ? document.body.clientHeight : 0
-	);
-}
-function f_scrollLeft() {
-	return f_filterResults (
-		window.pageXOffset ? window.pageXOffset : 0,
-		document.documentElement ? document.documentElement.scrollLeft : 0,
-		document.body ? document.body.scrollLeft : 0
-	);
-}
-function f_scrollTop() {
-	return f_filterResults (
-		window.pageYOffset ? window.pageYOffset : 0,
-		document.documentElement ? document.documentElement.scrollTop : 0,
-		document.body ? document.body.scrollTop : 0
-	);
-}
-function f_filterResults(n_win, n_docel, n_body) {
-	var n_result = n_win ? n_win : 0;
-	if (n_docel && (!n_result || (n_result > n_docel)))
-		n_result = n_docel;
-	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
-}
-
 // -----------------------------------------------------------------------------
 // Advanced search
 // -----------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/report.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/report.js	2011-08-19 21:33:57 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/report.js	2011-09-28 04:02:30 +0000
@@ -99,121 +99,3 @@
     
     window.open( url, '_blank_', windowFeatures);
 }
-
-//-----------------------------------------------------------------------------
-//View details
-//-----------------------------------------------------------------------------
-
-function showPatientDetails( patientId )
-{
- var request = new Request();
- request.setResponseTypeXML( 'patient' );
- request.setCallbackSuccess( patientReceived );
- request.send( 'getPatientDetails.action?id=' + patientId );
-}
-
-function patientReceived( patientElement )
-{   
- var identifiers = patientElement.getElementsByTagName( "identifier" );   
- 
- var identifierText = '';
-	
-	for ( var i = 0; i < identifiers.length; i++ )
-	{		
-		identifierText = identifierText + identifiers[ i ].getElementsByTagName( "identifierText" )[0].firstChild.nodeValue + '<br>';		
-	}
-	
-	setInnerHTML( 'identifierField', identifierText );
-	
-	var attributes = patientElement.getElementsByTagName( "attribute" );   
- 
- var attributeValues = '';
-	
-	for ( var i = 0; i < attributes.length; i++ )
-	{	
-		attributeValues = attributeValues + '<strong>' + attributes[ i ].getElementsByTagName( "name" )[0].firstChild.nodeValue  + ':  </strong>' + attributes[ i ].getElementsByTagName( "value" )[0].firstChild.nodeValue + '<br>';		
-	}
-	
-	setInnerHTML( 'attributeField', attributeValues );
- 
- var programs = patientElement.getElementsByTagName( "program" );   
- 
- var programName = '';
-	
-	for ( var i = 0; i < programs.length; i++ )
-	{		
-		programName = programName + programs[ i ].getElementsByTagName( "name" )[0].firstChild.nodeValue + '<br>';		
-	}
-	
-	setInnerHTML( 'programField', programName );
-
- showDetails();
-}
-
-/**
- * Overwrite showDetails() of common.js
- * This method will show details div on a pop up instead of show the div in the main table's column.
- * So we will have more place for the main column of the table.
- * @return
- */
-
-function showDetails()
-{
-	var detailArea = $("#detailsArea");
-	var top = (f_clientHeight() / 2) - 200;	
-	//if ( top < 0 ) top = 100; 
-    top = 100;
-	var left = screen.width - detailArea.width() - 100;
-    detailArea.css({"left":left+"px","top":top+"px"});
-    detailArea.show('fast');
-    
-}
-
-
-function hideDetails()
-{
-	var detailArea = $("#detailsArea");
-	detailArea.hide();
-}
-
-/**
- *  Get document width, hieght, scroll positions
- *  Work with all browsers
- * @return
- */
-
-function f_clientWidth() {
-	return f_filterResults (
-		window.innerWidth ? window.innerWidth : 0,
-		document.documentElement ? document.documentElement.clientWidth : 0,
-		document.body ? document.body.clientWidth : 0
-	);
-}
-function f_clientHeight() {
-	return f_filterResults (
-		window.innerHeight ? window.innerHeight : 0,
-		document.documentElement ? document.documentElement.clientHeight : 0,
-		document.body ? document.body.clientHeight : 0
-	);
-}
-function f_scrollLeft() {
-	return f_filterResults (
-		window.pageXOffset ? window.pageXOffset : 0,
-		document.documentElement ? document.documentElement.scrollLeft : 0,
-		document.body ? document.body.scrollLeft : 0
-	);
-}
-function f_scrollTop() {
-	return f_filterResults (
-		window.pageYOffset ? window.pageYOffset : 0,
-		document.documentElement ? document.documentElement.scrollTop : 0,
-		document.body ? document.body.scrollTop : 0
-	);
-}
-function f_filterResults(n_win, n_docel, n_body) {
-	var n_result = n_win ? n_win : 0;
-	if (n_docel && (!n_result || (n_result > n_docel)))
-		n_result = n_docel;
-	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
-}
-

=== 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	2011-07-15 08:07:54 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/report.vm	2011-09-28 04:02:30 +0000
@@ -10,6 +10,7 @@
 		<col/>
         #end       
         <tr>
+			<th>#</th>
             <th style="text-align:center">$i18n.getString( "full_name" )</th>
             #foreach( $programStage in $program.programStages )
                 <th style="text-align:center">$encoder.htmlEncode( $programStage.name )</th>
@@ -20,7 +21,11 @@
             #set( $mark = false )                 
             #foreach( $programInstance in $programInstances )
                 <tr #alternate( $mark )>                
-                    <td><a href="javascript:showPatientDetails( $programInstance.patient.id )" title='$i18n.getString( "show_details" )'>$programInstance.patient.getFullName()</a></td>                    
+                    <td>
+						#set( $nr = ( ( $paging.getCurrentPage() - 1  ) * $paging.pageSize ) + $velocityCount )
+						$nr
+					</td>
+					<td><a href="javascript:showPatientDetails( $programInstance.patient.id )" title='$i18n.getString( "show_details" )'>$programInstance.patient.getFullName()</a></td>                    
                     #foreach( $programStageInstance in $programInstance.programStageInstances )
                         #if( $programStageInstance.executionDate )
                             <td style="text-align:center" bgcolor="$colorMap.get( $programStageInstance.id )">
@@ -39,7 +44,15 @@
                 #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>
+		</tr>
     </table>
     </td>
 </tr>
@@ -47,15 +60,5 @@
 #end
 <p></p>
 
-<div class="paging-container">
-	#parse( "/dhis-web-commons/paging/paging.vm" )
-</div>
-
 <div id="detailsArea" style="display:none;overflow:auto;height:250px;width:250px" ondblclick="javascript:hideDetails()">
-    <div style="float:right;" onclick="javascript:hideDetails()">
-        <a href="javascript:hideDetails()" title="$i18n.getString( 'hide_details' )"><img src="../images/close.png" alt="$i18n.getString( 'hide_details' )"/></a>
-    </div>              
-    <p><label>$i18n.getString( "identifier" ):</label><br><span id="identifierField"></span></p>
-    <p><label>$i18n.getString( "attributes" ):</label><br><span id="attributeField"></span></p>
-    <p><label>$i18n.getString( "enrolled_in_program" ):</label><br><span id="programField"></span></p>
 </div>