dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #09460
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2513: Remove the Unrollment from Enrollment function and add the Unenrollment function into patientList...
------------------------------------------------------------
revno: 2513
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-01-11 14:06:28 +0700
message:
Remove the Unrollment from Enrollment function and add the Unenrollment function into patientList funtion.
added:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/RemoveEnrollmentSelectAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programUnenrollmentForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programUnenrollmentSelectForm.vm
modified:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/ProgramEnrollmentSelectAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/RemoveEnrollmentAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/SaveProgramEnrollmentAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addRelationshipPatientForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/listPatient.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programEnrollmentForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/underAgeForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientForm.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-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/ProgramEnrollmentSelectAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/ProgramEnrollmentSelectAction.java 2010-11-09 02:09:53 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/ProgramEnrollmentSelectAction.java 2011-01-11 07:06:28 +0000
@@ -33,8 +33,6 @@
import org.hisp.dhis.patient.PatientService;
import org.hisp.dhis.patient.state.SelectedStateManager;
import org.hisp.dhis.program.Program;
-import org.hisp.dhis.program.ProgramAttribute;
-import org.hisp.dhis.program.ProgramAttributeService;
import org.hisp.dhis.program.ProgramInstance;
import org.hisp.dhis.program.ProgramService;
@@ -74,13 +72,6 @@
this.programService = programService;
}
- private ProgramAttributeService programAttributeService;
-
- public void setProgramAttributeService( ProgramAttributeService programAttributeService )
- {
- this.programAttributeService = programAttributeService;
- }
-
// -------------------------------------------------------------------------
// Input/Output
// -------------------------------------------------------------------------
@@ -140,13 +131,6 @@
this.programInstance = programInstance;
}
- private Collection<ProgramAttribute> attributes;
-
- public Collection<ProgramAttribute> getAttributes()
- {
- return attributes;
- }
-
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@@ -154,7 +138,6 @@
public String execute()
throws Exception
{
-
// ---------------------------------------------------------------------
// Validate selected Patient
// ---------------------------------------------------------------------
@@ -207,7 +190,6 @@
programId = selectedProgram.getId();
selectedStateManager.setSelectedProgram( selectedProgram );
}
-
else
{
programId = null;
@@ -217,12 +199,6 @@
return SUCCESS;
}
- // ---------------------------------------------------------------------
- // Load Program Attribute
- // ---------------------------------------------------------------------
-
- attributes = programAttributeService.getAllProgramAttributes();
-
return PROGRAM_ENROLLMENT_FORM;
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/RemoveEnrollmentAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/RemoveEnrollmentAction.java 2010-11-09 06:45:07 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/RemoveEnrollmentAction.java 2011-01-11 07:06:28 +0000
@@ -324,7 +324,7 @@
}
}
}
-
+System.out.println("\n\n ++++++++ \n programAttributes : " + programAttributes );
programInstance.setAttributes( programAttributes );
programInstanceService.updateProgramInstance( programInstance );
=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/RemoveEnrollmentSelectAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/RemoveEnrollmentSelectAction.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/RemoveEnrollmentSelectAction.java 2011-01-11 07:06:28 +0000
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2004-2010, 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.patient.action.patient;
+
+import java.util.Collection;
+
+import org.hisp.dhis.program.ProgramAttribute;
+import org.hisp.dhis.program.ProgramAttributeService;
+import org.hisp.dhis.program.ProgramInstance;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Chau Thu Tran
+ * @version $ID : RemoveEnrollmentSelectAction.java Jan 11, 2011 10:00:55 AM $
+ */
+public class RemoveEnrollmentSelectAction
+ implements Action
+{
+ // -------------------------------------------------------------------------
+ // Dependency
+ // -------------------------------------------------------------------------
+
+ private ProgramAttributeService programAttributeService;
+
+ // -------------------------------------------------------------------------
+ // Input/Output
+ // -------------------------------------------------------------------------
+
+ private Integer id;
+
+ private Integer programId;
+
+ private ProgramInstance programInstance;
+
+ private Collection<ProgramAttribute> programAttributes;
+
+
+ // -------------------------------------------------------------------------
+ // Getter
+ // -------------------------------------------------------------------------
+
+ public void setProgramAttributeService( ProgramAttributeService programAttributeService )
+ {
+ this.programAttributeService = programAttributeService;
+ }
+
+ public void setId( Integer id )
+ {
+ this.id = id;
+ }
+
+ public Integer getId()
+ {
+ return id;
+ }
+
+ public void setProgramId( Integer programId )
+ {
+ this.programId = programId;
+ }
+
+ public ProgramInstance getProgramInstance()
+ {
+ return programInstance;
+ }
+
+ public void setProgramInstance( ProgramInstance programInstance )
+ {
+ this.programInstance = programInstance;
+ }
+
+ public Integer getProgramId()
+ {
+ return programId;
+ }
+
+ public Collection<ProgramAttribute> getProgramAttributes()
+ {
+ return programAttributes;
+ }
+
+ // -------------------------------------------------------------------------
+ // Implementation Action
+ // -------------------------------------------------------------------------
+
+ @Override
+ public String execute()
+ throws Exception
+ {
+ programAttributes = programAttributeService.getAllProgramAttributes();
+
+ return SUCCESS;
+ }
+
+}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/SaveProgramEnrollmentAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/SaveProgramEnrollmentAction.java 2010-11-09 02:09:53 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/SaveProgramEnrollmentAction.java 2011-01-11 07:06:28 +0000
@@ -35,8 +35,6 @@
import org.hisp.dhis.patient.PatientService;
import org.hisp.dhis.patient.state.SelectedStateManager;
import org.hisp.dhis.program.Program;
-import org.hisp.dhis.program.ProgramAttribute;
-import org.hisp.dhis.program.ProgramAttributeService;
import org.hisp.dhis.program.ProgramInstance;
import org.hisp.dhis.program.ProgramInstanceService;
import org.hisp.dhis.program.ProgramService;
@@ -93,13 +91,6 @@
this.selectedStateManager = selectedStateManager;
}
- private ProgramAttributeService programAttributeService;
-
- public void setProgramAttributeService( ProgramAttributeService programAttributeService )
- {
- this.programAttributeService = programAttributeService;
- }
-
private I18nFormat format;
public void setFormat( I18nFormat format )
@@ -196,13 +187,6 @@
return message;
}
- private Collection<ProgramAttribute> attributes;
-
- public Collection<ProgramAttribute> getAttributes()
- {
- return attributes;
- }
-
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@@ -279,8 +263,6 @@
}
}
- attributes = programAttributeService.getAllProgramAttributes();
-
return SUCCESS;
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml 2010-12-27 07:59:27 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml 2011-01-11 07:06:28 +0000
@@ -526,8 +526,6 @@
<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
<property name="selectedStateManager"
ref="org.hisp.dhis.patient.state.SelectedStateManager" />
- <property name="programAttributeService"
- ref="org.hisp.dhis.program.ProgramAttributeService" />
</bean>
<bean id="org.hisp.dhis.patient.action.patient.ProgramEnrollmentAction"
@@ -550,9 +548,6 @@
ref="org.hisp.dhis.program.ProgramStageInstanceService" />
<property name="selectedStateManager"
ref="org.hisp.dhis.patient.state.SelectedStateManager" />
- <property name="programAttributeService">
- <ref bean="org.hisp.dhis.program.ProgramAttributeService" />
- </property>
</bean>
<bean id="org.hisp.dhis.patient.action.patient.SaveDueDateAction"
@@ -561,6 +556,13 @@
ref="org.hisp.dhis.program.ProgramStageInstanceService" />
</bean>
+ <bean id="org.hisp.dhis.patient.action.patient.RemoveEnrollmentSelectAction"
+ class="org.hisp.dhis.patient.action.patient.RemoveEnrollmentSelectAction"
+ scope="prototype">
+ <property name="programAttributeService"
+ ref="org.hisp.dhis.program.ProgramAttributeService" />
+ </bean>
+
<bean id="org.hisp.dhis.patient.action.patient.RemoveEnrollmentAction"
class="org.hisp.dhis.patient.action.patient.RemoveEnrollmentAction"
scope="prototype">
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties 2011-01-11 01:56:03 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties 2011-01-11 07:06:28 +0000
@@ -459,4 +459,6 @@
no_patients_found = No Patients Found
similar_patients = Similar patients
orgunit = Organisation Unit
-please_enter_a_valid_full_name = Please enter a valid full name.
\ No newline at end of file
+please_enter_a_valid_full_name = Please enter a valid full name.
+program_unenrollment = Program UnEnrollment
+
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml 2011-01-11 01:56:03 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml 2011-01-11 07:06:28 +0000
@@ -537,10 +537,36 @@
../dhis-web-commons/javascripts/date.js,
javascript/patient.js</param>
</action>
-
+
+ <action name="showProgramUnEnrollmentForm"
+ class="org.hisp.dhis.patient.action.patient.ProgramEnrollmentSelectAction">
+ <result name="enrollmentform" type="chain">enrollChain</result>
+ <result name="success" type="chain">unEnrollmentFormChain</result>
+ <param name="requiredAuthorities">F_PATIENT_UPDATE</param>
+ </action>
+
+ <action name="enrollChain"
+ class="org.hisp.dhis.patient.action.patient.ProgramEnrollmentAction">
+ <result name="success" type="chain">unEnrollmentFormChain</result>
+ </action>
+
+ <action name="unEnrollmentFormChain"
+ class="org.hisp.dhis.patient.action.patient.RemoveEnrollmentSelectAction">
+ <interceptor-ref name="organisationUnitTreeStack" />
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="menu">/dhis-web-maintenance-patient/patientAndProgramMenuWithTree.vm</param>
+ <param name="menuTreeHeight">321</param>
+ <param name="page">/dhis-web-maintenance-patient/programUnenrollmentForm.vm</param>
+ <param name="javascripts">
+ ../dhis-web-commons/ouwt/ouwt.js,
+ ../dhis-web-commons/javascripts/date.js,
+ javascript/patient.js</param>
+ <param name="requiredAuthorities">F_PATIENT_UPDATE</param>
+ </action>
+
<action name="removeEnrollment"
class="org.hisp.dhis.patient.action.patient.RemoveEnrollmentAction">
- <result name="success" type="redirect">showProgramEnrollmentForm.action
+ <result name="success" type="redirect">showProgramUnEnrollmentForm.action?id=${id}
</result>
<param name="requiredAuthorities">F_PATIENT_DELETE</param>
</action>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientForm.vm 2011-01-11 01:56:03 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientForm.vm 2011-01-11 07:06:28 +0000
@@ -60,7 +60,7 @@
<tr>
<td><label for="fullName">$i18n.getString( "full_name" )</label></td>
<td class="input-column" >
- <input type="text" id="fullName" name="fullName" style="width:28em" class="{validate:{required:true, unicodechars:true, rangelength:[2,30]}}" onkeyup="startSearch(event)">
+ <input type="text" id="fullName" name="fullName" style="width:28em" class="{validate:{required:true, unicodechars:true, rangelength:[2,30]}}" onchange="startSearch(event)">
<span id='searchIcon' style="display:none"><img src="../images/loader.gif"></span>
</td>
</tr>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addRelationshipPatientForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addRelationshipPatientForm.vm 2011-01-11 01:56:03 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addRelationshipPatientForm.vm 2011-01-11 07:06:28 +0000
@@ -57,7 +57,7 @@
<tr>
<td><label for="fullName">$i18n.getString( "full_name" )</label></td>
<td class="input-column" >
- <input type="text" id="fullName" name="fullName" style="width:28em" class="{validate:{required:true, unicodechars:true, rangelength:[2,30]}}" onkeyup="startSearch(event)">
+ <input type="text" id="fullName" name="fullName" style="width:28em" class="{validate:{required:true, unicodechars:true, rangelength:[2,30]}}" onchange="startSearch(event)">
<span id='searchIcon' style="display:none"><img src="../images/loader.gif"></span>
</td>
</tr>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/listPatient.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/listPatient.vm 2011-01-11 02:05:50 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/listPatient.vm 2011-01-11 07:06:28 +0000
@@ -21,7 +21,7 @@
<td>$i18n.getString( "total_result" )</td>
<td> </td>
<td> </td>
- <td>$total</td>
+ <td>$!total</td>
</tr>
</table>
@@ -113,6 +113,7 @@
<td style="text-align:center">
<a href="showProgramEnrollmentForm.action?id=$patient.id" title='$i18n.getString( "manage_program_enrollment" )'><img src="../images/enroll.png" alt='$i18n.getString( "manage_program_enrollment" )'></a>
+ <a href="showProgramUnEnrollmentForm.action?id=$patient.id" title='$i18n.getString( "manage_program_unenrollment" )'><img src="../images/unenroll.png" alt='$i18n.getString( "show_details" )'></a>
<a href="showUpdatePatientForm.action?id=$patient.id" title='$i18n.getString( "edit_profile" )'><img src="../images/edit.png" alt='$i18n.getString( "edit_profile" )'></a>
<a href="showRelationshipList.action?id=$patient.id" title='$i18n.getString( "manage_relationship" )'><img src="../images/relationship.png" alt='$i18n.getString( "manage_relationship" )'></a>
<a href="showAddRelationshipPatient.action?id=$patient.id" title='$i18n.getString( "add_dependent" )'><img src="../images/add.png" alt='$i18n.getString( "add_dependent" )'></a>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programEnrollmentForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programEnrollmentForm.vm 2010-11-09 02:09:53 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programEnrollmentForm.vm 2011-01-11 07:06:28 +0000
@@ -36,40 +36,6 @@
<td style="width:180px"><label for="dateOfIncident" #if($selectedProgram) title="$!selectedProgram.dateOfIncidentDescription" #end>$i18n.getString( "date_of_incident" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
<td><input type="text" id="dateOfIncident" name="dateOfIncident" #if( $programInstance ) value="$!format.formatDate( $programInstance.dateOfIncident )" #end><i>( $!selectedProgram.dateOfIncidentDescription )</i></td>
</tr>
-#if($!programInstance.enrollmentDate)
- <tr>
- <td colspan='3'><h2>$i18n.getString('patient_info')<br><hr/></h2></td>
- <tr>
- #foreach($attribute in $attributes)
- <tr>
- <td>$attribute.name</td>
- <td class="input-column">
- #if( $attribute.valueType == "YES/NO" )
- <select id="attr$attribute.id" name="attr$attribute.id" style="width:100">
- <option value="">[$i18n.getString( "please_select" )]</option>
- <option value="true">$i18n.getString( "yes" )</option>
- <option value="false" selected="selected">$i18n.getString( "no" )</option>
- </select>
- #elseif( $attribute.valueType == "DATE" )
- <input type="text" id="attr$attribute.id" name="attr$attribute.id">
- <script type="text/javascript">
- datePickerValid( 'attr$attribute.id' );
- </script>
- #elseif( $attribute.valueType == "COMBO" )
- <select id="attr$attribute.id" name="attr$attribute.id">
- <option value="">[$i18n.getString( "please_select" )]</option>
- #foreach ($option in $attribute.attributeOptions )
- <option value="$option.id" >$option.name</option>
- #end
- </select>
- #else
- <input type="text" id="attr$attribute.id" name="attr$attribute.id">
- #end
-
- #if($!programAttribute.description) <i>($!programAttribute.description)</i> #end
- </td>
- </tr>
- #end
<tr>
<td></td>
<td></td>
@@ -77,14 +43,11 @@
</tr>
</table>
-<hr/>
-#end
<table>
<tr>
<td style="width:180px">
<input type="submit" #if( $programInstance ) value="$i18n.getString( "update" )#else value="$i18n.getString( "enroll" ) #end">
- <input type="button" value="$i18n.getString( "unenroll" )" onclick="javascript: removeEnrollment();" #if( !$programInstance ) disabled="disabled" #end>
</td>
</tr>
</table>
=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programUnenrollmentForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programUnenrollmentForm.vm 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programUnenrollmentForm.vm 2011-01-11 07:06:28 +0000
@@ -0,0 +1,104 @@
+
+<script>
+ //-----------------------------------------------------------------------
+ //init jQuery validation for programEnrollmentForm
+ //-----------------------------------------------------------------------
+ jQuery(document).ready(
+ function()
+ {
+ jQuery("#programUnenrollmentForm").validate({
+ meta:"validate"
+ ,errorElement:"td"
+ ,submitHandler: function(form)
+ {
+ validateProgramEnrollment();
+ }
+ });
+
+ datePickerValid( 'enrollmentDate' );
+ datePickerValid( 'dateOfIncident' );
+ }
+ );
+
+</script>
+
+<form id="programEnrollmentForm" name="programEnrollmentForm" method="post" action='showProgramUnEnrollmentForm.action'>
+
+#parse( "/dhis-web-maintenance-patient/programUnenrollmentSelectForm.vm" )
+
+<table width="100%">
+ <tr>
+ <td style="width:180px"><label for="enrollmentDate" #if($selectedProgram) title="$!selectedProgram.dateOfEnrollmentDescription" #end>$i18n.getString( "date_of_enrollment" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
+ <td><input type="text" id="enrollmentDate" name="enrollmentDate" #if( $programInstance ) value="$!format.formatDate( $programInstance.enrollmentDate )" #end> <i>( $!selectedProgram.dateOfEnrollmentDescription )</i></td>
+ </tr>
+
+ <tr>
+ <td style="width:180px"><label for="dateOfIncident" #if($selectedProgram) title="$!selectedProgram.dateOfIncidentDescription" #end>$i18n.getString( "date_of_incident" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
+ <td><input type="text" id="dateOfIncident" name="dateOfIncident" #if( $programInstance ) value="$!format.formatDate( $programInstance.dateOfIncident )" #end><i>( $!selectedProgram.dateOfIncidentDescription )</i></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ </tr>
+
+#if($!programInstance.enrollmentDate)
+ <tr>
+ <td colspan='2'><hr/></td>
+ <tr>
+ #foreach($attribute in $programAttributes)
+ <tr>
+ <td>$attribute.name</td>
+ <td class="input-column">
+ #if( $attribute.valueType == "YES/NO" )
+ <select id="attr$attribute.id" name="attr$attribute.id" style="width:100">
+ <option value="">[$i18n.getString( "please_select" )]</option>
+ <option value="true">$i18n.getString( "yes" )</option>
+ <option value="false" selected="selected">$i18n.getString( "no" )</option>
+ </select>
+ #elseif( $attribute.valueType == "DATE" )
+ <input type="text" id="attr$attribute.id" name="attr$attribute.id">
+ <script type="text/javascript">
+ datePickerValid( 'attr$attribute.id' );
+ </script>
+ #elseif( $attribute.valueType == "COMBO" )
+ <select id="attr$attribute.id" name="attr$attribute.id">
+ <option value="">[$i18n.getString( "please_select" )]</option>
+ #foreach ($option in $attribute.attributeOptions )
+ <option value="$option.id" >$option.name</option>
+ #end
+ </select>
+ #else
+ <input type="text" id="attr$attribute.id" name="attr$attribute.id">
+ #end
+
+ #if($!programAttribute.description) <i>($!programAttribute.description)</i> #end
+ </td>
+ </tr>
+ #end
+ <tr>
+ <td></td>
+ <td></td>
+ </tr>
+
+</table>
+#end
+
+<table>
+ <tr>
+ <td style="width:180px">
+ <input type="button" value='$i18n.getString( "unenroll" )' onclick="javascript: removeEnrollment();" #if( $!programInstance.enrollmentDate ) #else disabled #end>
+ </td>
+ </tr>
+</table>
+
+</form>
+
+<span id="message"></span>
+
+<script type="text/javascript">
+ var i18n_program_enrollment_failed = '$encoder.jsEscape( $i18n.getString( "program_enrollment_failed" ) , "'")';
+ var i18n_saving_value_failed_status_code = '$encoder.jsEscape( $i18n.getString( "saving_value_failed_status_code" ) , "'")';
+ var i18n_saving_value_failed_error_code = '$encoder.jsEscape( $i18n.getString( "saving_value_failed_error_code" ) , "'")';
+ var i18n_searching_patient_failed = '$encoder.jsEscape( $i18n.getString( "searching_patient_failed" ) , "'")';
+ var i18n_due_date_invalid = '$encoder.jsEscape( $i18n.getString( "due_date_invalid" ) , "'")';
+</script>
=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programUnenrollmentSelectForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programUnenrollmentSelectForm.vm 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programUnenrollmentSelectForm.vm 2011-01-11 07:06:28 +0000
@@ -0,0 +1,51 @@
+<div>
+ <input type="button" value="$i18n.getString( "back_to_search" )" onclick="window.location.href='searchPatient.action'" style="width:10em">
+</div>
+
+
+<h3>$i18n.getString( "program_unenrollment" )</h3>
+
+<div>
+ <input type="hidden" id="id" name="id" value="$patient.id">
+</div>
+
+<table>
+ <tr>
+ <td><strong>$i18n.getString( "full_name" ):</strong></td>
+ <td>$encoder.htmlEncode( $patient.getFullName() )</td>
+ </tr>
+ <tr>
+ <td><strong>$i18n.getString( "gender" ):</strong></td>
+ <td>$encoder.htmlEncode( $patient.gender )</td>
+ </tr>
+ <tr>
+ <td><strong>$i18n.getString( "date_of_birth" ):</strong></td>
+ <td>$format.formatDate( $patient.birthDate )</td>
+ </tr>
+ <tr>
+ <td><strong>$i18n.getString( "age" ):</strong></td>
+ <td>$encoder.htmlEncode( $patient.getAge() )</td>
+ </tr>
+ <tr>
+ <td> </td>
+ </tr>
+</table>
+
+<hr style="clear:both">
+
+<table>
+ <tr>
+ <td style="width:180px"><label for="programId">$i18n.getString( "program" )</label></td>
+ <td>
+ <select id="programId" name="programId" onchange="byId( 'programEnrollmentForm' ).submit();" style="min-width:200px" #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 ) #set( $selectedProgram = $program) selected="selected" #end>$encoder.htmlEncode( $program.name )
+ </option>
+
+ #end
+ </select>
+ </td>
+ </tr>
+
+</table>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/underAgeForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/underAgeForm.vm 2011-01-11 01:56:03 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/underAgeForm.vm 2011-01-11 07:06:28 +0000
@@ -166,7 +166,7 @@
<tr>
<td><label for="required">$i18n.getString( "full_name" )</label></td>
<td class="input-column" >
- <input type="text" id="fullName" name="fullName" style="width:15em" class="{validate:{required:true, unicodechars:true, rangelength:[2,30]}}" onkeyup="startSearch(event)">
+ <input type="text" id="fullName" name="fullName" style="width:15em" class="{validate:{required:true, unicodechars:true, rangelength:[2,30]}}" onchange="startSearch(event)">
<span id='searchIcon' style="display:none"><img src="../images/loader.gif"></span>
</td>
</tr>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientForm.vm 2011-01-11 01:56:03 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientForm.vm 2011-01-11 07:06:28 +0000
@@ -200,7 +200,7 @@
#end
</select>
#else
- <input type="text" id="attr$attribute.id" name="attr$attribute.id" value="$!attributeValue" class="{validate:{required:$attribute.mandatory #if($!attribute.noChars),maxlength:$attribute.noChars #end #if($attribute.valueType=='NUMBER'),number:true #end }}" >
+ <input type="text" id="attr$attribute.id" name="attr$attribute.id" value="$!attributeValue" class="{validate:{required:$attribute.mandatory #if($!attribute.noChars),maxlength:$attribute.noChars #end #if($attribute.valueType=='NUMBER'),number:true #end }}" >
#end
</td>
</tr>