← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5655: Add Show-Events button into Event registration form.

 

------------------------------------------------------------
revno: 5655
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-01-04 11:55:19 +0700
message:
  Add Show-Events button into Event registration form.
added:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetEventsByProgramAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/historyAnonymousEvents.vm
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceStore.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java
  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/HibernateProgramStore.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ProgramStageCustomDataEntryAction.java
  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/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/anonymousRegistration.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js


--
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-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceService.java	2011-04-28 07:10:33 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceService.java	2012-01-04 04:55:19 +0000
@@ -55,6 +55,8 @@
     Collection<ProgramStageInstance> getProgramStageInstances( ProgramStage programStage );
 
     Collection<ProgramStageInstance> getProgramStageInstances( Collection<ProgramInstance> programInstances );
+    
+    List<ProgramStageInstance> getProgramStageInstances( ProgramInstance programInstance, int min, int max );
 
     Collection<ProgramStageInstance> getProgramStageInstances( Date dueDate );
 

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceStore.java	2011-04-28 07:10:33 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceStore.java	2012-01-04 04:55:19 +0000
@@ -67,4 +67,6 @@
     public List<ProgramStageInstance> get(OrganisationUnit unit, Date after, Date before, Boolean completed);
 
     List<ProgramStageInstance> getProgramStageInstances( Patient patient, Boolean completed);
+    
+    List<ProgramStageInstance> getProgramStageInstances( ProgramInstance programInstance, int min, int max );
 }

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java	2011-04-28 07:10:33 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java	2012-01-04 04:55:19 +0000
@@ -169,4 +169,9 @@
     {
         return programStageInstanceStore.getProgramStageInstances( patient, completed );
     }
+    
+    public List<ProgramStageInstance> getProgramStageInstances( ProgramInstance programInstance, int min, int max )
+    {
+        return programStageInstanceStore.getProgramStageInstances( programInstance, min, max );
+    }
 }

=== 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	2011-10-27 05:51:06 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java	2012-01-04 04:55:19 +0000
@@ -32,6 +32,7 @@
 import java.util.List;
 
 import org.hibernate.Query;
+import org.hibernate.criterion.Order;
 import org.hibernate.criterion.Restrictions;
 import org.hisp.dhis.hibernate.HibernateGenericStore;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
@@ -143,4 +144,12 @@
 
         return getQuery( hql ).setEntity( "patient", patient ).setBoolean( "completed", completed ).list();
     }
+    
+    @SuppressWarnings( "unchecked" )
+    public List<ProgramStageInstance> getProgramStageInstances( ProgramInstance programInstance, int min, int max )
+    {
+        return getCriteria( Restrictions.eq( "programInstance.id", programInstance.getId() ) )
+            .addOrder(Order.desc("id")).setFirstResult( min )
+            .setMaxResults( max ).list();
+    }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStore.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStore.java	2012-01-04 04:55:19 +0000
@@ -33,9 +33,6 @@
 import org.hisp.dhis.hibernate.HibernateGenericStore;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.program.Program;
-import org.hisp.dhis.program.ProgramAttribute;
-import org.hisp.dhis.program.ProgramAttributeOption;
-import org.hisp.dhis.program.ProgramAttributeOptionStore;
 import org.hisp.dhis.program.ProgramStore;
 
 /**

=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetEventsByProgramAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetEventsByProgramAction.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetEventsByProgramAction.java	2012-01-04 04:55:19 +0000
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2004-2012, 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.caseentry;
+
+import java.util.Collection;
+
+import org.hisp.dhis.paging.ActionPagingSupport;
+import org.hisp.dhis.program.ProgramInstance;
+import org.hisp.dhis.program.ProgramInstanceService;
+import org.hisp.dhis.program.ProgramStageInstance;
+import org.hisp.dhis.program.ProgramStageInstanceService;
+
+/**
+ * @author Chau Thu Tran
+ * 
+ * @version $Id: GetEventsByProgramAction.java Jan 03, 2012 13:58:34 AM $
+ */
+
+public class GetEventsByProgramAction
+    extends ActionPagingSupport<ProgramStageInstance>
+{
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+
+    private ProgramInstanceService programInstanceService;
+
+    public void setProgramInstanceService( ProgramInstanceService programInstanceService )
+    {
+        this.programInstanceService = programInstanceService;
+    }
+
+    private ProgramStageInstanceService programStageInstanceService;
+
+    public void setProgramStageInstanceService( ProgramStageInstanceService programStageInstanceService )
+    {
+        this.programStageInstanceService = programStageInstanceService;
+    }
+
+    // -------------------------------------------------------------------------
+    // Input/Output
+    // -------------------------------------------------------------------------
+
+    private Integer programInstanceId;
+
+    public void setProgramInstanceId( Integer programInstanceId )
+    {
+        this.programInstanceId = programInstanceId;
+    }
+
+    private Collection<ProgramStageInstance> programStageInstances;
+
+    public Collection<ProgramStageInstance> getProgramStageInstances()
+    {
+        return programStageInstances;
+    }
+
+    private Integer total;
+
+    public Integer getTotal()
+    {
+        return total;
+    }
+
+    // -------------------------------------------------------------------------
+    // Implementation Action
+    // -------------------------------------------------------------------------
+
+    public String execute()
+        throws Exception
+    {
+        ProgramInstance programInstance = programInstanceService.getProgramInstance( programInstanceId );
+
+        total = programInstance.getProgramStageInstances().size();
+
+        this.paging = createPaging( total );
+
+        programStageInstances = programStageInstanceService.getProgramStageInstances( programInstance, paging
+            .getStartPos(), paging.getPageSize() );
+
+        return SUCCESS;
+    }
+}

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ProgramStageCustomDataEntryAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ProgramStageCustomDataEntryAction.java	2011-12-29 09:03:09 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ProgramStageCustomDataEntryAction.java	2012-01-04 04:55:19 +0000
@@ -248,14 +248,17 @@
         programStage = programStageInstance.getProgramStage();
 
         programStageDataElements = new ArrayList<ProgramStageDataElement>( programStage.getProgramStageDataElements() );
-        
+
         Collections.sort( programStageDataElements, new ProgramStageDataElementSortOrderComparator() );
 
         program = programStage.getProgram();
 
         patient = programStageInstance.getProgramInstance().getPatient();
 
-        patientIdentifier = patientIdentifierService.getPatientIdentifier( patient );
+        if ( patient != null )
+        {
+            patientIdentifier = patientIdentifierService.getPatientIdentifier( patient );
+        }
 
         selectedStateManager.setSelectedProgramStageInstance( programStageInstance );
 

=== 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-12-27 07:35:54 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2012-01-04 04:55:19 +0000
@@ -398,6 +398,14 @@
 			ref="org.hisp.dhis.program.ProgramStageInstanceService" />
 	</bean>
 
+	<bean id="org.hisp.dhis.caseentry.action.caseentry.GetEventsByProgramAction"
+    	class="org.hisp.dhis.caseentry.action.caseentry.GetEventsByProgramAction" scope="prototype">
+    	<property name="programInstanceService"
+        	ref="org.hisp.dhis.program.ProgramInstanceService" />
+        <property name="programStageInstanceService"
+ 	       	ref="org.hisp.dhis.program.ProgramStageInstanceService" />
+	</bean>
+ 
 	<!--  Patient chart -->
 
 	<bean

=== 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	2011-12-27 06:23:35 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2012-01-04 04:55:19 +0000
@@ -453,4 +453,7 @@
 delete_current_event_success=Delete current event successfully
 please_enter_report_date = Please enter report date
 comfirm_delete_current_event = Are you sure you want to delete the current event ?
-registered_by_orgunit = Registered by facility
\ No newline at end of file
+registered_by_orgunit = Registered by facility
+show_events = Show events
+event_information = Event information
+history_events = History events 
\ 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	2011-12-29 04:50:47 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2012-01-04 04:55:19 +0000
@@ -456,6 +456,22 @@
 				/dhis-web-commons/ajax/jsonResponseError.vm</result>
 		</action>
 		
+		 <action name="getEventsByProgram"
+			class="org.hisp.dhis.caseentry.action.caseentry.GetEventsByProgramAction">
+			<result name="success" type="velocity">/content.vm</result>
+			<param name="page">/dhis-web-caseentry/historyAnonymousEvents.vm</param>
+			<param name="javascripts">javascript/anonymousRegistration.js</param>
+			<param name="stylesheets">
+                 ../dhis-web-caseentry/style/patient.css,
+                 ../dhis-web-commons/paging/paging.css</param>
+		</action>
+        
+        <action name="viewAnonymousEvents"
+                class="org.hisp.dhis.caseentry.action.caseentry.ProgramStageCustomDataEntryAction">
+                <result name="success" type="velocity">/content.vm</result>
+                <param name="page">/dhis-web-caseentry/dataEntryForm.vm</param>
+        </action>
+ 
 		<!-- Patient-Program Enrollment -->
 
 		<action name="showProgramEnrollmentForm"

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm	2011-12-21 03:46:55 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm	2012-01-04 04:55:19 +0000
@@ -5,6 +5,7 @@
 	<input type="button" id="createEventBtn" value="$i18n.getString('create_new_event')" onClick="javascript: createNewEvent();" style="width:12em " disabled="disabled">
 	<input type="button" id="completeBtn" value="$i18n.getString('complete')" onClick="doComplete();" style="width:12em" disabled="disabled" >
 	<input type="button" id="deleteCurrentEventBtn" value="$i18n.getString('delete_current_event')" onClick="javascript: deleteCurrentEvent();" style="width:12em " disabled="disabled" >
+	<input type="button" id="showEventBtn" value="$i18n.getString('show_events')" onClick="javascript: showHistoryEvents();" style="width:12em " disabled="disabled" >
 </div>	
 			
 <div id="dataRecordingSelectDiv" class="inputCriteria" style="width:420px;height:80px;">
@@ -36,6 +37,7 @@
 #parse( "dhis-web-commons/loader/loader.vm" )
 
 <div id="dataEntryFormDiv"> </div>
+<div id='viewEventDiv'></div>
 
 <script>
 	var i18n_please_select = '[ ' + '$encoder.jsEscape( $i18n.getString( "please_select" ) , "'" )' + ' ]';
@@ -60,4 +62,6 @@
 	var i18n_delete_current_event_success = '$encoder.jsEscape( $i18n.getString( "delete_current_event_success" ) , "'")';
 	var i18n_please_enter_report_date = '$encoder.jsEscape( $i18n.getString( "please_enter_report_date" ) , "'")';
 	var i18n_comfirm_delete_current_event = '$encoder.jsEscape( $i18n.getString( "comfirm_delete_current_event" ) , "'")';
+	var i18n_history_events = '$encoder.jsEscape( $i18n.getString( "history_events" ) , "'")';
+	var i18n_event_information = '$encoder.jsEscape( $i18n.getString( "event_information" ) , "'")';
 </script>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm	2011-12-28 06:21:57 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm	2012-01-04 04:55:19 +0000
@@ -120,13 +120,13 @@
 						#if ( $patientDataValue.value )        
 							#if( !$patientDataValue.providedByAnotherFacility )
 								$patientDataValue.organisationUnit.name
-								<input  name="providedByAnotherFacility" id="$id" type="hidden" onclick="updateProvidingFacility( $programStageDataElement.dataElement.id, this )">
+								<input  name="providedByAnotherFacility" id="$id" type="hidden" onclick="updateProvidingFacility( $programStageDataElement.dataElement.id, this )" #if($programStageInstance.completed) disabled="disabled" #end >
 							#else
 								$i18n.getString("other_facility")
-								<input  name="providedByAnotherFacility" id="$id" type="hidden" onclick="updateProvidingFacility( $programStageDataElement.dataElement.id, this )">
+								<input  name="providedByAnotherFacility" id="$id" type="hidden" onclick="updateProvidingFacility( $programStageDataElement.dataElement.id, this )" #if($programStageInstance.completed) disabled="disabled" #end >
 							#end
 						 #else
-							<input name="providedByAnotherFacility" id="$id" type="checkbox" onclick="updateProvidingFacility( $programStageDataElement.dataElement.id, this )">
+							<input name="providedByAnotherFacility" id="$id" type="checkbox" onclick="updateProvidingFacility( $programStageDataElement.dataElement.id, this )" #if($programStageInstance.completed) disabled="disabled" #end >
 						 #end                         
 					</td>    
 				</tr>

=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/historyAnonymousEvents.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/historyAnonymousEvents.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/historyAnonymousEvents.vm	2012-01-04 04:55:19 +0000
@@ -0,0 +1,18 @@
+<h2>$i18n.getString('history_events')</h2>
+<table>
+	#foreach( $programStageInstance in $programStageInstances)
+	<tr>	
+		<td>
+			<a href="javascript:viewRecords( $programStageInstance.id )">
+				$format.formatDate( $programStageInstance.executionDate )
+			</a>
+		</td>
+	</tr>
+	#end
+	
+	<tr>
+		<div class="paging-container">
+			#parse( "/dhis-web-commons/paging/paging.vm" )
+		</div>
+	</tr>
+</table>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js	2011-12-21 09:42:40 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js	2012-01-04 04:55:19 +0000
@@ -8,6 +8,7 @@
 	
 	disable('createEventBtn');
 	disable('deleteCurrentEventBtn');
+	disable('showEventBtn');
 	
 	$.postJSON( 'loadAnonymousPrograms.action',{}
 		, function( json ) 
@@ -55,6 +56,7 @@
 	var programId = getFieldValue('programId');
 	if( programId == '' )
 	{
+		disable('showEventBtn');
 		return;
 	}
 	
@@ -66,6 +68,7 @@
 		}, 
 		function( json ) 
 		{    
+			enable('showEventBtn');
 			setFieldValue( 'programStageId', json.programStages[0].id );
 			setFieldValue( 'selectedProgramId', programId );
 			
@@ -75,13 +78,10 @@
 			}
 			else
 			{
-				
 				enable( 'executionDate' );
 				enable('createEventBtn');
 				disable('deleteCurrentEventBtn');
 				disable('completeBtn');
-				disable('validationBtn');
-				
 				hideById('loaderDiv');
 			}
 			
@@ -104,7 +104,6 @@
 				enable('createEventBtn');
 				disable('deleteCurrentEventBtn');
 				disable('completeBtn');
-				disable('validationBtn');
 				enable( 'executionDate' );
 				$('#executionDate').bind('change');
 			}
@@ -116,14 +115,12 @@
 					enable('createEventBtn');
 					enable('deleteCurrentEventBtn');
 					disable('completeBtn');
-					disable('validationBtn');
 				} 
 				else
 				{
 					disable('createEventBtn');
 					enable('deleteCurrentEventBtn');
 					enable('completeBtn');
-					enable('validationBtn');
 					enable( 'executionDate' );
 					jQuery('#executionDate').bind('change');
 				}
@@ -197,4 +194,32 @@
 				}
 			});
 	}
+}
+
+isAjax = true;
+function showHistoryEvents()
+{
+	contentDiv = 'dataEntryFormDiv';
+	$( '#dataEntryFormDiv' ).load( "getEventsByProgram.action", 
+		{ 
+			programInstanceId: jQuery('select[id=programId] option:selected').attr('programInstanceId')
+		},function( )
+		{
+		});
+}
+
+
+function viewRecords( programStageInstanceId ) 
+{
+	$('#viewEventDiv' )
+		.load( 'viewAnonymousEvents.action?programStageInstanceId=' + programStageInstanceId )
+		.dialog({
+			title: i18n_event_information,
+			maximize: true, 
+			closable: true,
+			modal:true,
+			overlay:{background:'#000000', opacity:0.1},
+			width: 800,
+			height: 400
+		});
 }
\ No newline at end of file