dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #13029
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4101: Improve program validation function in Patient module.
------------------------------------------------------------
revno: 4101
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2011-07-08 12:52:59 +0700
message:
Improve program validation function in Patient module.
removed:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramValidationForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramValidationForm.vm
added:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addMultiProgramValidationForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addSingleProgramValidationForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateMultiProgramValidationForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateSingleProgramValidationForm.vm
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientdatavalue/PatientDataValueService.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientdatavalue/PatientDataValueStore.java
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientdatavalue/DefaultPatientDataValueService.java
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientdatavalue/hibernate/HibernatePatientDataValueStore.java
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramValidationService.java
dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/validation/AddProgramValidationAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/validation/UpdateProgramValidationAction.java
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/javascript/programValidation.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programValidationList.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-api/src/main/java/org/hisp/dhis/patientdatavalue/PatientDataValueService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientdatavalue/PatientDataValueService.java 2010-11-29 02:04:22 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientdatavalue/PatientDataValueService.java 2011-07-08 05:52:59 +0000
@@ -54,43 +54,50 @@
int deletePatientDataValue( DataElement dataElement );
- int deletePatientDataValue( DataElementCategoryOptionCombo optionCombo );
+ int deletePatientDataValue( DataElementCategoryOptionCombo optionCombo );
PatientDataValue getPatientDataValue( ProgramStageInstance programStageInstance, DataElement dataElement,
OrganisationUnit organisationUnit );
+ PatientDataValue getPatientDataValue( ProgramStageInstance programStageInstance, DataElement dataElement,
+ DataElementCategoryOptionCombo optionCombo, OrganisationUnit organisationUnit );
+
Collection<PatientDataValue> getPatientDataValues( ProgramStageInstance programStageInstance );
- Collection<PatientDataValue> getPatientDataValues( Collection<ProgramStageInstance> programStageInstances );
+ Collection<PatientDataValue> getPatientDataValues( Collection<ProgramStageInstance> programStageInstances );
Collection<PatientDataValue> getPatientDataValues( DataElement dataElement );
-
- Collection<PatientDataValue> getPatientDataValues( DataElement dataElement, DataElementCategoryOptionCombo optionCombo );
+
+ Collection<PatientDataValue> getPatientDataValues( DataElement dataElement,
+ DataElementCategoryOptionCombo optionCombo );
Collection<PatientDataValue> getPatientDataValues( DataElementCategoryOptionCombo optionCombo );
Collection<PatientDataValue> getPatientDataValues( OrganisationUnit organisationUnit );
-
+
Collection<PatientDataValue> getPatientDataValues( OrganisationUnit organisationUnit,
ProgramStageInstance programStageInstance );
Collection<PatientDataValue> getPatientDataValues( OrganisationUnit organisationUnit,
- Collection<ProgramStageInstance> programStageInstances );
+ Collection<ProgramStageInstance> programStageInstances );
Collection<PatientDataValue> getPatientDataValues( OrganisationUnit organisationUnit, DataElement dataElement );
Collection<PatientDataValue> getPatientDataValues( OrganisationUnit organisationUnit,
DataElementCategoryOptionCombo optionCombo );
-
+
Collection<PatientDataValue> getPatientDataValues( boolean providedByAnotherFacility );
-
- Collection<PatientDataValue> getPatientDataValues( OrganisationUnit organisationUnit, boolean providedByAnotherFacility );
-
- Collection<PatientDataValue> getPatientDataValues( ProgramStageInstance programStageInstance, boolean providedByAnotherFacility );
-
+
+ Collection<PatientDataValue> getPatientDataValues( OrganisationUnit organisationUnit,
+ boolean providedByAnotherFacility );
+
+ Collection<PatientDataValue> getPatientDataValues( ProgramStageInstance programStageInstance,
+ boolean providedByAnotherFacility );
+
Collection<PatientDataValue> getPatientDataValues( DataElement dataElement, boolean providedByAnotherFacility );
-
- Collection<PatientDataValue> getPatientDataValues( Patient patient, Collection<DataElement> dataElements, Date date, java.util.Date date2 );
+
+ Collection<PatientDataValue> getPatientDataValues( Patient patient, Collection<DataElement> dataElements,
+ Date date, java.util.Date date2 );
Collection<PatientDataValue> getAllPatientDataValues();
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientdatavalue/PatientDataValueStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientdatavalue/PatientDataValueStore.java 2010-11-29 02:04:22 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientdatavalue/PatientDataValueStore.java 2011-07-08 05:52:59 +0000
@@ -56,6 +56,9 @@
PatientDataValue get( ProgramStageInstance programStageInstance, DataElement dataElement,
OrganisationUnit organisationUnit );
+
+ PatientDataValue get( ProgramStageInstance programStageInstance, DataElement dataElement,
+ DataElementCategoryOptionCombo optionCombo, OrganisationUnit organisationUnit );
Collection<PatientDataValue> get( ProgramStageInstance programStageInstance );
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientdatavalue/DefaultPatientDataValueService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientdatavalue/DefaultPatientDataValueService.java 2011-07-06 08:04:17 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientdatavalue/DefaultPatientDataValueService.java 2011-07-08 05:52:59 +0000
@@ -110,6 +110,12 @@
{
return patientDataValueStore.get( programStageInstance, dataElement, organisationUnit );
}
+
+ public PatientDataValue getPatientDataValue( ProgramStageInstance programStageInstance, DataElement dataElement,
+ DataElementCategoryOptionCombo optionCombo, OrganisationUnit organisationUnit )
+ {
+ return patientDataValueStore.get( programStageInstance, dataElement, optionCombo, organisationUnit );
+ }
public Collection<PatientDataValue> getPatientDataValues( ProgramStageInstance programStageInstance )
{
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientdatavalue/hibernate/HibernatePatientDataValueStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientdatavalue/hibernate/HibernatePatientDataValueStore.java 2011-05-02 18:40:36 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientdatavalue/hibernate/HibernatePatientDataValueStore.java 2011-07-08 05:52:59 +0000
@@ -83,6 +83,15 @@
.uniqueResult();
}
+ public PatientDataValue get( ProgramStageInstance programStageInstance, DataElement dataElement,
+ DataElementCategoryOptionCombo optionCombo, OrganisationUnit organisationUnit )
+ {
+ return (PatientDataValue) getCriteria( Restrictions.eq( "programStageInstance", programStageInstance ),
+ Restrictions.eq( "dataElement", dataElement ), Restrictions.eq( "optionCombo", optionCombo ),
+ Restrictions.eq( "organisationUnit", organisationUnit ) )
+ .uniqueResult();
+ }
+
@SuppressWarnings( "unchecked" )
public Collection<PatientDataValue> get( ProgramStageInstance programStageInstance )
{
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramValidationService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramValidationService.java 2011-07-06 08:04:17 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramValidationService.java 2011-07-08 05:52:59 +0000
@@ -36,6 +36,8 @@
import java.util.regex.Pattern;
import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
+import org.hisp.dhis.dataelement.DataElementCategoryService;
import org.hisp.dhis.dataelement.DataElementService;
import org.hisp.dhis.patientdatavalue.PatientDataValue;
import org.hisp.dhis.patientdatavalue.PatientDataValueService;
@@ -48,7 +50,7 @@
*/
@Transactional
public class DefaultProgramValidationService
-implements ProgramValidationService
+ implements ProgramValidationService
{
private ProgramValidationStore validationStore;
@@ -60,6 +62,8 @@
private PatientDataValueService valueService;
+ private DataElementCategoryService categoryService;
+
// -------------------------------------------------------------------------
// Setters
// -------------------------------------------------------------------------
@@ -69,6 +73,11 @@
this.validationStore = validationStore;
}
+ public void setCategoryService( DataElementCategoryService categoryService )
+ {
+ this.categoryService = categoryService;
+ }
+
public void setProgramStageService( ProgramStageService programStageService )
{
this.programStageService = programStageService;
@@ -136,7 +145,7 @@
// ---------------------------------------------------------------------
boolean resultRight = runExpression( validation.getRightSide(), programInstance );
-
+
return (resultLeft == resultRight);
}
@@ -149,8 +158,8 @@
private boolean runExpression( String expression, ProgramInstance programInstance )
{
final String regExp = "\\[" + OBJECT_PROGRAM_STAGE_DATAELEMENT + SEPARATOR_OBJECT + "([a-zA-Z0-9\\- ]+["
- + SEPARATOR_ID + "[0-9]*]*)" + "\\]";
-
+ + SEPARATOR_ID + "[0-9]*]*)" + "\\]";
+
StringBuffer description = new StringBuffer();
Pattern pattern = Pattern.compile( regExp );
@@ -170,12 +179,15 @@
int dataElementId = Integer.parseInt( ids[1] );
DataElement dataElement = dataElementService.getDataElement( dataElementId );
-
+
+ int optionComboId = Integer.parseInt( ids[2] );
+ DataElementCategoryOptionCombo optionCombo = categoryService.getDataElementCategoryOptionCombo( optionComboId );
+
ProgramStageInstance stageInstance = stageInstanceService.getProgramStageInstance( programInstance,
programStage );
- PatientDataValue dataValue = valueService.getPatientDataValue( stageInstance, dataElement, programInstance
- .getPatient().getOrganisationUnit() );
+ PatientDataValue dataValue = valueService.getPatientDataValue( stageInstance, dataElement, optionCombo,
+ programInstance.getPatient().getOrganisationUnit() );
if ( dataValue == null )
{
@@ -191,6 +203,6 @@
parser.parseExpression( description.toString() );
- return ( parser.getValue() == 1.0 );
- }
+ return (parser.getValue() == 1.0);
+ }
}
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml 2011-06-24 07:55:22 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml 2011-07-08 05:52:59 +0000
@@ -226,6 +226,8 @@
ref="org.hisp.dhis.program.ProgramStageService" />
<property name="dataElementService"
ref="org.hisp.dhis.dataelement.DataElementService" />
+ <property name="categoryService"
+ ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
<property name="stageInstanceService"
ref="org.hisp.dhis.program.ProgramStageInstanceService" />
<property name="valueService"
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/validation/AddProgramValidationAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/validation/AddProgramValidationAction.java 2011-04-29 07:41:04 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/validation/AddProgramValidationAction.java 2011-07-08 05:52:59 +0000
@@ -110,9 +110,9 @@
{
ProgramValidation validation = new ProgramValidation();
- validation.setDescription( description );
- validation.setLeftSide( leftSide );
- validation.setRightSide( rightSide );
+ validation.setDescription( description.trim() );
+ validation.setLeftSide( leftSide.trim() );
+ validation.setRightSide( rightSide.trim() );
Program program = programService.getProgram( programId );
validation.setProgram( program );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/validation/UpdateProgramValidationAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/validation/UpdateProgramValidationAction.java 2011-04-29 07:41:04 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/validation/UpdateProgramValidationAction.java 2011-07-08 05:52:59 +0000
@@ -105,9 +105,10 @@
programId = validation.getProgram().getId();
- validation.setDescription( description );
- validation.setLeftSide( leftSide );
- validation.setRightSide( rightSide );
+ validation.setDescription( description.trim() );
+ validation.setLeftSide( leftSide.trim() );
+ validation.setRightSide( rightSide.trim() );
+
programValidationService.updateProgramValidation( validation );
return SUCCESS;
=== 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-07-07 08:03:22 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties 2011-07-08 05:52:59 +0000
@@ -457,8 +457,10 @@
patient_registration = Beneficiary Registration
fill_fields_in_programstage_dataelement_validation = Fill all fields in validation form
define_single_dataelement_validation = Define Single Data Element Validation
-add_program_validation = Add Program Validation
-update_program_validation = Update Program Validation
+add_single_program_validation = Add Single Program Validation
+add_multi_program_validation = Add Multi Program Validation
+update_single_program_validation = Update Single Program Validation
+update_multi_program_validation = Update Multi Program Validation
program_validation_details = Program Validation Details
define_program_validation = Define Program Validation
add_new_single_validation = Add New Single Validation
=== 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-07-07 05:00:40 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml 2011-07-08 05:52:59 +0000
@@ -1131,10 +1131,19 @@
<param name="requiredAuthorities">F_PROGRAM_VALIDATION</param>
</action>
- <action name="showAddProgramValidationForm"
- class="org.hisp.dhis.patient.action.program.GetProgramAction">
- <result name="success" type="velocity">/main.vm</result>
- <param name="page">/dhis-web-maintenance-patient/addProgramValidationForm.vm</param>
+ <action name="showAddMultiProgramValidationForm"
+ class="org.hisp.dhis.patient.action.program.GetProgramAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-maintenance-patient/addMultiProgramValidationForm.vm</param>
+ <param name="menu">/dhis-web-maintenance-patient/patientAndProgramMenu.vm</param>
+ <param name="javascripts">javascript/programValidation.js</param>
+ <param name="requiredAuthorities">F_PROGRAM_VALIDATION</param>
+ </action>
+
+ <action name="showAddSingleProgramValidationForm"
+ class="org.hisp.dhis.patient.action.program.GetProgramAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-maintenance-patient/addSingleProgramValidationForm.vm</param>
<param name="menu">/dhis-web-maintenance-patient/patientAndProgramMenu.vm</param>
<param name="javascripts">javascript/programValidation.js</param>
<param name="requiredAuthorities">F_PROGRAM_VALIDATION</param>
@@ -1147,10 +1156,19 @@
<param name="requiredAuthorities">F_PROGRAM_VALIDATION</param>
</action>
- <action name="showUpdateProgramValidationForm"
- class="org.hisp.dhis.patient.action.validation.GetProgramValidationAction">
- <result name="success" type="velocity">/main.vm</result>
- <param name="page">/dhis-web-maintenance-patient/updateProgramValidationForm.vm</param>
+ <action name="showUpdateMultiProgramValidationForm"
+ class="org.hisp.dhis.patient.action.validation.GetProgramValidationAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-maintenance-patient/updateMultiProgramValidationForm.vm</param>
+ <param name="menu">/dhis-web-maintenance-patient/patientAndProgramMenu.vm</param>
+ <param name="javascripts">javascript/programValidation.js</param>
+ <param name="requiredAuthorities">F_PROGRAM_VALIDATION</param>
+ </action>
+
+ <action name="showUpdateSingleProgramValidationForm"
+ class="org.hisp.dhis.patient.action.validation.GetProgramValidationAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-maintenance-patient/updateSingleProgramValidationForm.vm</param>
<param name="menu">/dhis-web-maintenance-patient/patientAndProgramMenu.vm</param>
<param name="javascripts">javascript/programValidation.js</param>
<param name="requiredAuthorities">F_PROGRAM_VALIDATION</param>
=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addMultiProgramValidationForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addMultiProgramValidationForm.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/addMultiProgramValidationForm.vm 2011-07-08 05:52:59 +0000
@@ -0,0 +1,123 @@
+<script type="text/javascript" src="javascript/addProgramValidationForm.js"></script>
+<h3>$i18n.getString( "add_multi_program_validation" )</h3>
+
+<form id='programValidationForm' name='programValidationForm' method='post' action='addProgramValidation.action'>
+
+<input type='hidden' id='programId' name='programId' value='$program.id'>
+<table>
+
+ <thead>
+ <tr>
+ <th colspan="2">$i18n.getString( "program_validation_details" )</th>
+ </tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td width="20em" colspan='2'>
+ <label>$i18n.getString('description')</label>
+ </td>
+ </tr>
+ <tr>
+ <td colspan='2'>
+ <input type="text" id='description' name='description' style="width:100%" class="{validate:{required:true,minlength:4}}">
+ </td>
+ </tr>
+ <tr>
+ <td width="20em">
+ <label>$i18n.getString('left_side')</label>
+ </td>
+ <td>
+ <label>$i18n.getString('right_side')</label>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <select style="width:30.2em" id='leftStage' name='leftStage' onchange="getLeftPrgramStageDataElements();">
+ <option value=''>[$i18n.getString( "please_select" )]</option>
+ #foreach($stage in $program.programStages)
+ <option value='$stage.id'>$stage.name</option>
+ #end
+ </select>
+ </td>
+ <td>
+ <select style="width:30.2em" id='rightStage' name='rightStage' onchange="getRightPrgramStageDataElements();">
+ <option value=''>[$i18n.getString( "please_select" )]</option>
+ #foreach($stage in $program.programStages)
+ <option value='$stage.id'>$stage.name</option>
+ #end
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <select style="width:30.2em" id='leftSideDE' name='leftSideDE' size='7' ondblclick="insertDataElement(this, 'leftSide', 'leftStageDescription');" >
+ </select>
+ </td>
+ <td>
+ <select style="width:30.2em" id='rightSideDE' name='rightSideDE' size='7' ondblclick="insertDataElement(this, 'rightSide', 'rightStageDescription' );">
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <img src="../images/plus.png" alt="$i18n.getString( 'plus' )" onclick='insertOperator( "leftStageDescription", "leftSide", "+" );' style="cursor:pointer;"/>
+
+ <img src="../images/less.png" alt="$i18n.getString( 'less' )" onclick='insertOperator( "leftStageDescription", "leftSide", "<" );' style="cursor:pointer;">
+ <img src="../images/less_or_equal.png" alt="$i18n.getString( 'less_or_equal' )" onclick='insertOperator( "leftStageDescription", "leftSide", "<=" );' style="cursor:pointer;">
+ <img src="../images/greater.png" alt="$i18n.getString( 'greater' )" onclick='insertOperator( "leftStageDescription", "leftSide", ">" );' style="cursor:pointer;">
+ <img src="../images/greater_or_equal.png" alt="$i18n.getString( 'greater_or_equal' )" onclick='insertOperator( "leftStageDescription", "leftSide", ">=" );' style="cursor:pointer;">
+ <img src="../images/equal.png" alt="$i18n.getString( 'equal' )" onclick='insertOperator( "leftStageDescription", "leftSide", "==" );' style="cursor:pointer;"/>
+ <img src="../images/diff.png" alt="$i18n.getString( 'diff' )" onclick='insertOperator( "leftStageDescription", "leftSide", "!=" );' style="cursor:pointer;"/>
+
+ <img src="../images/clear.png" align="right" alt="$i18n.getString( 'clear' )" onclick="clearValidation( 'leftSide', 'leftStageDescription' )" style="cursor:pointer;margin-right:0.5em"/>
+ </td>
+ <td>
+ <img src="../images/plus.png" alt="$i18n.getString( 'plus' )" onclick='insertOperator( "rightStageDescription", "rightSide", "+" );' style="cursor:pointer;"/>
+
+ <img src="../images/less.png" alt="$i18n.getString( 'less' )" onclick='insertOperator( "rightStageDescription", "rightSide", "<" );' style="cursor:pointer;">
+ <img src="../images/less_or_equal.png" alt="$i18n.getString( 'less_or_equal' )" onclick='insertOperator( "rightStageDescription", "rightSide", "<=" );' style="cursor:pointer;">
+ <img src="../images/greater.png" alt="$i18n.getString( 'greater' )" onclick='insertOperator( "rightStageDescription", "rightSide", ">" );' style="cursor:pointer;">
+ <img src="../images/greater_or_equal.png" alt="$i18n.getString( 'greater_or_equal' )" onclick='insertOperator( "rightStageDescription", "rightSide", ">=" );' style="cursor:pointer;">
+ <img src="../images/equal.png" alt="$i18n.getString( 'equal' )" onclick='insertOperator( "rightStageDescription", "rightSide", "==" );' style="cursor:pointer;"/>
+ <img src="../images/diff.png" alt="$i18n.getString( 'diff' )" onclick='insertOperator( "rightStageDescription", "rightSide", "!=" );' style="cursor:pointer;"/>
+
+ <img src="../images/clear.png" align='right' alt="$i18n.getString( 'clear' )" onclick="clearValidation( 'rightSide', 'rightStageDescription' )" style="cursor:pointer;margin-right:0.5em"/>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <textarea rows='5' style="width:30em" id='leftSide' name='leftSide' class="{validate:{required:true,minlength:4}}" onkeyup="getValidationDescription('leftStageDescription', 'leftSide')"></textarea>
+ </td>
+ <td>
+ <textarea rows='5' style="width:30em" id='rightSide' name='rightSide' class="{validate:{required:true,minlength:4}}" onkeyup="getValidationDescription('rightStageDescription', 'rightSide')"></textarea>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <fieldset style="border: 1px solid #3f5d8e; ">
+ <legend>$i18n.getString( "description" )</legend>
+ <div id='leftStageDescription' style="width:29em"></div>
+ </fieldset>
+ </td>
+ <td>
+ <fieldset style="border: 1px solid #3f5d8e; ">
+ <legend>$i18n.getString( "description" )</legend>
+ <div id='rightStageDescription' style="width:29em;"></div>
+ </fieldset>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <input type='submit' value="$i18n.getString( "add" )" style="width:10em">
+ <input type='button' value="$i18n.getString( "cancel" )" style="width:10em" onclick="window.location.href='programValidation.action?programId=$program.id'">
+ </td>
+ <td></td>
+ </tr>
+
+</table>
+
+<script>
+ getLeftPrgramStageDataElements();
+ getRightPrgramStageDataElements();
+</script>
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramValidationForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramValidationForm.vm 2011-07-07 08:03:22 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramValidationForm.vm 1970-01-01 00:00:00 +0000
@@ -1,97 +0,0 @@
-<script type="text/javascript" src="javascript/addProgramValidationForm.js"></script>
-<h3>$i18n.getString( "add_program_validation" )</h3>
-
-<form id='programValidationForm' name='programValidationForm' method='post' action='addProgramValidation.action'>
-
-<input type='hidden' id='programId' name='programId' value='$program.id'>
-<table>
-
- <thead>
- <tr>
- <th colspan="2">$i18n.getString( "program_validation_details" )</th>
- </tr>
- </thead>
- <tbody>
-
- <tr>
- <td width="20em" colspan='2'>
- <label>$i18n.getString('description')</label>
- </td>
- </tr>
- <tr>
- <td colspan='2'>
- <input type="text" id='description' name='description' style="width:100%" class="{validate:{required:true,minlength:4}}">
- </td>
- </tr>
- <tr>
- <td width="20em">
- <label>$i18n.getString('left_side')</label>
- </td>
- <td>
- <label id='rightLabel'>$i18n.getString('right_side')</label>
- </td>
- </tr>
- <tr>
- <td>
- <select style="width:30.2em" id='leftStage' name='leftStage' onchange="getLeftPrgramStageDataElements();">
- <option value=''>[$i18n.getString( "please_select" )]</option>
- #foreach($stage in $program.programStages)
- <option value='$stage.id'>$stage.name</option>
- #end
- </select>
- </td>
- <td>
- <select style="width:30.2em" id='rightStage' name='rightStage' onchange="getRightPrgramStageDataElements();">
- <option value=''>[$i18n.getString( "please_select" )]</option>
- #foreach($stage in $program.programStages)
- <option value='$stage.id'>$stage.name</option>
- #end
- </select>
- </td>
- </tr>
- <tr>
- <td>
- <select style="width:30.2em" id='leftSideDE' name='leftSideDE' size='7' ondblclick="insertDataElement(this, 'leftSide', 'leftStageDescription');" >
- </select>
- </td>
- <td>
- <select style="width:30.2em" id='rightSideDE' name='rightSideDE' size='7' ondblclick="insertDataElement(this, 'rightSide', 'rightStageDescription' );">
- </select>
- </td>
- </tr>
- <tr>
- <td>
- <textarea rows='5' style="width:30em" id='leftSide' name='leftSide' class="{validate:{required:true,minlength:4}}" onkeyup="getValidationDescription('leftStageDescription', 'leftSide')"></textarea>
- </td>
- <td>
- <textarea rows='5' style="width:30em" id='rightSide' name='rightSide' class="{validate:{required:true,minlength:4}}" onkeyup="getValidationDescription('rightStageDescription', 'rightSide')"></textarea>
- </td>
- </tr>
- <tr>
- <td>
- <fieldset style="border: 1px solid #3f5d8e; ">
- <legend>$i18n.getString( "description" )</legend>
- <div id='leftStageDescription' style="width:29em"></div>
- </fieldset>
- </td>
- <td>
- <fieldset style="border: 1px solid #3f5d8e; " id='rightStageDescriptionFieldset'>
- <legend>$i18n.getString( "description" )</legend>
- <div id='rightStageDescription' style="width:29em;"></div>
- </fieldset>
- </td>
- </tr>
- <tr>
- <td>
- <input type='submit' value="$i18n.getString( "add" )" style="width:10em">
- <input type='button' value="$i18n.getString( "cancel" )" style="width:10em" onclick="window.location.href='programValidation.action?programId=$program.id'">
- </td>
- <td></td>
- </tr>
-
-</table>
-
-<script>
- getLeftPrgramStageDataElements();
- getRightPrgramStageDataElements();
-</script>
=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addSingleProgramValidationForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addSingleProgramValidationForm.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/addSingleProgramValidationForm.vm 2011-07-08 05:52:59 +0000
@@ -0,0 +1,85 @@
+<script type="text/javascript" src="javascript/addProgramValidationForm.js"></script>
+<h3>$i18n.getString( "add_single_program_validation" )</h3>
+
+<form id='programValidationForm' name='programValidationForm' method='post' action='addProgramValidation.action'>
+
+<input type='hidden' id='programId' name='programId' value='$program.id'>
+<table>
+
+ <thead>
+ <tr>
+ <th>$i18n.getString( "program_validation_details" )</th>
+ </tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>
+ <label>$i18n.getString('description')</label>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <input type="text" id='description' name='description' style="width:100%" class="{validate:{required:true,minlength:4}}">
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <label>$i18n.getString('validation')</label>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <select style="width:30.2em" id='leftStage' name='leftStage' onchange="getLeftPrgramStageDataElements();">
+ <option value=''>[$i18n.getString( "please_select" )]</option>
+ #foreach($stage in $program.programStages)
+ <option value='$stage.id'>$stage.name</option>
+ #end
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <select style="width:30.2em" id='leftSideDE' name='leftSideDE' size='7' ondblclick="insertDataElement(this, 'leftSide', 'leftStageDescription');" >
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <img src="../images/plus.png" alt="$i18n.getString( 'plus' )" onclick='insertOperator( "leftStageDescription", "leftSide", "+" );' style="cursor:pointer;"/>
+
+ <img src="../images/less.png" alt="$i18n.getString( 'less' )" onclick='insertOperator( "leftStageDescription", "leftSide", "<" );' style="cursor:pointer;">
+ <img src="../images/less_or_equal.png" alt="$i18n.getString( 'less_or_equal' )" onclick='insertOperator( "leftStageDescription", "leftSide", "<=" );' style="cursor:pointer;">
+ <img src="../images/greater.png" alt="$i18n.getString( 'greater' )" onclick='insertOperator( "leftStageDescription", "leftSide", ">" );' style="cursor:pointer;">
+ <img src="../images/greater_or_equal.png" alt="$i18n.getString( 'greater_or_equal' )" onclick='insertOperator( "leftStageDescription", "leftSide", ">=" );' style="cursor:pointer;">
+ <img src="../images/equal.png" alt="$i18n.getString( 'equal' )" onclick='insertOperator( "leftStageDescription", "leftSide", "==" );' style="cursor:pointer;"/>
+ <img src="../images/diff.png" alt="$i18n.getString( 'diff' )" onclick='insertOperator( "leftStageDescription", "leftSide", "!=" );' style="cursor:pointer;"/>
+
+ <img src="../images/clear.png" alt="$i18n.getString( 'clear' )" align='right' onclick="clearValidation( 'leftSide', 'leftStageDescription' )" style="cursor:pointer;margin-right:0.5em"/>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <textarea rows='5' style="width:30em" id='leftSide' name='leftSide' class="{validate:{required:true,minlength:4}}" onkeyup="getValidationDescription('leftStageDescription', 'leftSide')"></textarea>
+ <input type='hidden' id='rightSide' name='rightSide' value='1==1'>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <fieldset style="border: 1px solid #3f5d8e; ">
+ <legend>$i18n.getString( "description" )</legend>
+ <div id='leftStageDescription' style="width:29em"></div>
+ </fieldset>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <input type='submit' value="$i18n.getString( "add" )" style="width:10em">
+ <input type='button' value="$i18n.getString( "cancel" )" style="width:10em" onclick="window.location.href='programValidation.action?programId=$program.id'">
+ </td>
+ </tr>
+</table>
+
+<script>
+ getLeftPrgramStageDataElements();
+</script>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programValidation.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programValidation.js 2011-07-07 08:03:22 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programValidation.js 2011-07-08 05:52:59 +0000
@@ -3,18 +3,6 @@
validation( 'programValidationForm', function( form ){
form.submit();
});
-
- var isSingle = eval(jQuery.getUrlVars('value')['single']);
-
- if( isSingle || getFieldValue('rightSide') == '1==1')
- {
- hideById('rightLabel');
- hideById('rightStage');
- hideById('rightSideDE');
- hideById('rightSide');
- hideById('rightStageDescriptionFieldset');
- setFieldValue('rightSide','1==1');
- }
});
// -----------------------------------------------------------------------------
@@ -55,10 +43,20 @@
function insertDataElement( element, target, decriptionDiv )
{
- byId(target).value += " " + element.options[element.selectedIndex].value + " ";
-
- getValidationDescription( decriptionDiv, target );
-}
+ var value = " " + element.options[element.selectedIndex].value + " ";
+
+ insertTextCommon( target, value );
+
+ getValidationDescription( decriptionDiv, target );
+}
+
+function insertOperator( decriptionDiv, target, value )
+{
+ insertTextCommon( target, ' ' + value + ' ' );
+
+ getValidationDescription( decriptionDiv, target );
+}
+
function getValidationDescription( decriptionDiv, sideDiv )
{
@@ -68,10 +66,16 @@
},
function (data)
{
- byId( decriptionDiv ).innerHTML = data;
+ setInnerHTML( decriptionDiv, data );
},'html');
}
+function clearValidation( target, decriptionDiv )
+{
+ setFieldValue( target,'' );
+ setInnerHTML( decriptionDiv, '' );
+}
+
//------------------------------------------------------------------------------
// Get DataElements of Program-Stage into left-side
//------------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programValidationList.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programValidationList.vm 2011-07-07 08:03:22 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programValidationList.vm 2011-07-08 05:52:59 +0000
@@ -9,8 +9,8 @@
<tr>
<td></td>
<td>
- <input type="button" value="$i18n.getString( "add_new_single_validation" )" onclick="window.location.href='showAddProgramValidationForm.action?id=$programId&single=true'" style="width:200px">
- <input type="button" value="$i18n.getString( "add_new_multi_validation" )" onclick="window.location.href='showAddProgramValidationForm.action?id=$programId&single=false'" style="width:200px">
+ <input type="button" value="$i18n.getString( "add_new_single_validation" )" onclick="window.location.href='showAddSingleProgramValidationForm.action?id=$programId'" style="width:200px">
+ <input type="button" value="$i18n.getString( "add_new_multi_validation" )" onclick="window.location.href='showAddMultiProgramValidationForm.action?id=$programId'" style="width:200px">
<input type="button" value="$i18n.getString( "cancel" )" onclick="window.location.href='program.action'" style="width:200px">
</td>
</tr>
@@ -25,7 +25,11 @@
<td>$validation.description</td>
<td>
- <a href="showUpdateProgramValidationForm.action?validationId=$validation.id&id=$programId" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a>
+ #if($validation.rightSide=="1==1")
+ <a href="showUpdateSingleProgramValidationForm.action?validationId=$validation.id&id=$programId" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a>
+ #else
+ <a href="showUpdateMultiProgramValidationForm.action?validationId=$validation.id&id=$programId" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a>
+ #end
<a href="javascript:removeProgramValidation( '$validation.id', '$encoder.jsEncode( $validation.description )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a>
<a href="javascript:showProgramValidationDetails( $validation.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a>
</td>
=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateMultiProgramValidationForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateMultiProgramValidationForm.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/updateMultiProgramValidationForm.vm 2011-07-08 05:52:59 +0000
@@ -0,0 +1,122 @@
+<h3>$i18n.getString( "update_program_validation" )</h3>
+
+<form id='programValidationForm' name='programValidationForm' method='post' action='updateProgramValidation.action'>
+
+<input type='hidden' id='id' name='id' value='$validation.id'>
+<table>
+
+ <thead>
+ <tr>
+ <th colspan="2">$i18n.getString( "program_validation_details" )</th>
+ </tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td width="20em" colspan='2'>
+ <label>$i18n.getString('description')</label>
+ </td>
+ </tr>
+ <tr>
+ <td colspan='2'>
+ <input type="text" id='description' name='description' style="width:100%" value='$validation.description'>
+ </td>
+ </tr>
+ <tr>
+ <td width="20em">
+ <label>$i18n.getString('left_side')</label>
+ </td>
+ <td>
+ <label>$i18n.getString('right_side')</label>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <select style="width:30.2em" id='leftStage' name='leftStage' onchange="getLeftPrgramStageDataElements();">
+ <option value=''>[$i18n.getString( "please_select" )]</option>
+ #foreach($stage in $validation.program.programStages)
+ <option value='$stage.id'>$stage.name</option>
+ #end
+ </select>
+ </td>
+ <td>
+ <select style="width:30.2em" id='rightStage' name='rightStage' onchange="getRightPrgramStageDataElements();">
+ <option value=''>[$i18n.getString( "please_select" )]</option>
+ #foreach($stage in $validation.program.programStages)
+ <option value='$stage.id'>$stage.name</option>
+ #end
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <select style="width:30.2em" id='leftSideDE' name='leftSideDE' size='7' ondblclick="insertDataElement(this, 'leftSide');">
+ </select>
+ </td>
+ <td>
+ <select style="width:30.2em" id='rightSideDE' name='rightSideDE' size='7' ondblclick="insertDataElement(this, 'rightSide');">
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <img src="../images/plus.png" alt="$i18n.getString( 'plus' )" onclick='insertOperator( "leftStageDescription", "leftSide", "+" );' style="cursor:pointer;"/>
+
+ <img src="../images/less.png" alt="$i18n.getString( 'less' )" onclick='insertOperator( "leftStageDescription", "leftSide", "<" );' style="cursor:pointer;">
+ <img src="../images/less_or_equal.png" alt="$i18n.getString( 'less_or_equal' )" onclick='insertOperator( "leftStageDescription", "leftSide", "<=" );' style="cursor:pointer;">
+ <img src="../images/greater.png" alt="$i18n.getString( 'greater' )" onclick='insertOperator( "leftStageDescription", "leftSide", ">" );' style="cursor:pointer;">
+ <img src="../images/greater_or_equal.png" alt="$i18n.getString( 'greater_or_equal' )" onclick='insertOperator( "leftStageDescription", "leftSide", ">=" );' style="cursor:pointer;">
+ <img src="../images/equal.png" alt="$i18n.getString( 'equal' )" onclick='insertOperator( "leftStageDescription", "leftSide", "==" );' style="cursor:pointer;"/>
+ <img src="../images/diff.png" alt="$i18n.getString( 'diff' )" onclick='insertOperator( "leftStageDescription", "leftSide", "!=" );' style="cursor:pointer;"/>
+
+ <img src="../images/clear.png" align="right" alt="$i18n.getString( 'clear' )" onclick="clearValidation( 'leftSide', 'leftStageDescription' )" style="cursor:pointer;margin-right:0.5em""/>
+ </td>
+ <td>
+ <img src="../images/plus.png" alt="$i18n.getString( 'plus' )" onclick='insertOperator( "rightStageDescription", "rightSide", "+" );' style="cursor:pointer;"/>
+
+ <img src="../images/less.png" alt="$i18n.getString( 'less' )" onclick='insertOperator( "rightStageDescription", "rightSide", "<" );' style="cursor:pointer;">
+ <img src="../images/less_or_equal.png" alt="$i18n.getString( 'less_or_equal' )" onclick='insertOperator( "rightStageDescription", "rightSide", "<=" );' style="cursor:pointer;">
+ <img src="../images/greater.png" alt="$i18n.getString( 'greater' )" onclick='insertOperator( "rightStageDescription", "rightSide", ">" );' style="cursor:pointer;">
+ <img src="../images/greater_or_equal.png" alt="$i18n.getString( 'greater_or_equal' )" onclick='insertOperator( "rightStageDescription", "rightSide", ">=" );' style="cursor:pointer;">
+ <img src="../images/equal.png" alt="$i18n.getString( 'equal' )" onclick='insertOperator( "rightStageDescription", "rightSide", "==" );' style="cursor:pointer;"/>
+ <img src="../images/diff.png" alt="$i18n.getString( 'diff' )" onclick='insertOperator( "rightStageDescription", "rightSide", "!=" );' style="cursor:pointer;"/>
+
+ <img src="../images/clear.png" align='right' alt="$i18n.getString( 'clear' )" onclick="clearValidation( 'rightSide', 'rightStageDescription' )" style="cursor:pointer;margin-right:0.5em"/>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <textarea rows='5' style="width:30em" id='leftSide' name='leftSide' onkeyup="getValidationDescription('leftStageDescription', 'leftSide')">$validation.leftSide</textarea>
+ </td>
+ <td>
+ <textarea rows='5' style="width:30em" id='rightSide' name='rightSide' onkeyup="getValidationDescription('rightStageDescription', 'rightSide')">$validation.rightSide</textarea>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <fieldset style="border: 1px solid #3f5d8e; ">
+ <legend>$i18n.getString( "description" )</legend>
+ <div id='leftStageDescription' style="width:29em">$!leftDescription</div>
+ </fieldset>
+ </td>
+ <td>
+ <fieldset style="border: 1px solid #3f5d8e; ">
+ <legend>$i18n.getString( "description" )</legend>
+ <div id='rightStageDescription' style="width:29em;">$!rightDescription</div>
+ </fieldset>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <input type='submit' value="$i18n.getString( "update" )" style="width:10em">
+ <input type='button' value="$i18n.getString( "cancel" )" style="width:10em" onclick="window.location.href='programValidation.action?programId=$validation.program.id'">
+ </td>
+ <td></td>
+ </tr>
+
+</table>
+
+<script>
+ getLeftPrgramStageDataElements();
+ getRightPrgramStageDataElements();
+</script>
\ No newline at end of file
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramValidationForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramValidationForm.vm 2011-07-07 08:03:22 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramValidationForm.vm 1970-01-01 00:00:00 +0000
@@ -1,96 +0,0 @@
-<h3>$i18n.getString( "update_program_validation" )</h3>
-
-<form id='programValidationForm' name='programValidationForm' method='post' action='updateProgramValidation.action'>
-
-<input type='hidden' id='id' name='id' value='$validation.id'>
-<table>
-
- <thead>
- <tr>
- <th colspan="2">$i18n.getString( "program_validation_details" )</th>
- </tr>
- </thead>
- <tbody>
-
- <tr>
- <td width="20em" colspan='2'>
- <label>$i18n.getString('description')</label>
- </td>
- </tr>
- <tr>
- <td colspan='2'>
- <input type="text" id='description' name='description' style="width:100%" value='$validation.description'>
- </td>
- </tr>
- <tr>
- <td width="20em">
- <label>$i18n.getString('left_side')</label>
- </td>
- <td>
- <label id='rightLabel'>$i18n.getString('right_side')</label>
- </td>
- </tr>
- <tr>
- <td>
- <select style="width:30.2em" id='leftStage' name='leftStage' onchange="getLeftPrgramStageDataElements();">
- <option value=''>[$i18n.getString( "please_select" )]</option>
- #foreach($stage in $validation.program.programStages)
- <option value='$stage.id'>$stage.name</option>
- #end
- </select>
- </td>
- <td>
- <select style="width:30.2em" id='rightStage' name='rightStage' onchange="getRightPrgramStageDataElements();">
- <option value=''>[$i18n.getString( "please_select" )]</option>
- #foreach($stage in $validation.program.programStages)
- <option value='$stage.id'>$stage.name</option>
- #end
- </select>
- </td>
- </tr>
- <tr>
- <td>
- <select style="width:30.2em" id='leftSideDE' name='leftSideDE' size='7' ondblclick="insertDataElement(this, 'leftSide');">
- </select>
- </td>
- <td>
- <select style="width:30.2em" id='rightSideDE' name='rightSideDE' size='7' ondblclick="insertDataElement(this, 'rightSide');">
- </select>
- </td>
- </tr>
- <tr>
- <td>
- <textarea rows='5' style="width:30em" id='leftSide' name='leftSide' onkeyup="getValidationDescription('leftStageDescription', 'leftSide')">$validation.leftSide</textarea>
- </td>
- <td>
- <textarea rows='5' style="width:30em" id='rightSide' name='rightSide' onkeyup="getValidationDescription('rightStageDescription', 'rightSide')">$validation.rightSide</textarea>
- </td>
- </tr>
- <tr>
- <td>
- <fieldset style="border: 1px solid #3f5d8e; ">
- <legend>$i18n.getString( "description" )</legend>
- <div id='leftStageDescription' style="width:29em">$!leftDescription</div>
- </fieldset>
- </td>
- <td>
- <fieldset style="border: 1px solid #3f5d8e; " id='rightStageDescriptionFieldset'>
- <legend>$i18n.getString( "description" )</legend>
- <div id='rightStageDescription' style="width:29em;">$!rightDescription</div>
- </fieldset>
- </td>
- </tr>
- <tr>
- <td>
- <input type='submit' value="$i18n.getString( "update" )" style="width:10em">
- <input type='button' value="$i18n.getString( "cancel" )" style="width:10em" onclick="window.location.href='programValidation.action?programId=$validation.program.id'">
- </td>
- <td></td>
- </tr>
-
-</table>
-
-<script>
- getLeftPrgramStageDataElements();
- getRightPrgramStageDataElements();
-</script>
\ No newline at end of file
=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateSingleProgramValidationForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateSingleProgramValidationForm.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/updateSingleProgramValidationForm.vm 2011-07-08 05:52:59 +0000
@@ -0,0 +1,86 @@
+<h3>$i18n.getString( "update_program_validation" )</h3>
+
+<form id='programValidationForm' name='programValidationForm' method='post' action='updateProgramValidation.action'>
+
+<input type='hidden' id='id' name='id' value='$validation.id'>
+<table>
+
+ <thead>
+ <tr>
+ <th colspan="2">$i18n.getString( "program_validation_details" )</th>
+ </tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td width="20em" colspan='2'>
+ <label>$i18n.getString('description')</label>
+ </td>
+ </tr>
+ <tr>
+ <td colspan='2'>
+ <input type="text" id='description' name='description' style="width:100%" value='$validation.description'>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <label>$i18n.getString('left_side')</label>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <select style="width:30.2em" id='leftStage' name='leftStage' onchange="getLeftPrgramStageDataElements();">
+ <option value=''>[$i18n.getString( "please_select" )]</option>
+ #foreach($stage in $validation.program.programStages)
+ <option value='$stage.id'>$stage.name</option>
+ #end
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <select style="width:30.2em" id='leftSideDE' name='leftSideDE' size='7' ondblclick="insertDataElement(this, 'leftSide');">
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <img src="../images/plus.png" alt="$i18n.getString( 'plus' )" onclick='insertOperator( "leftStageDescription", "leftSide", "+" );' style="cursor:pointer;"/>
+
+ <img src="../images/less.png" alt="$i18n.getString( 'less' )" onclick='insertOperator( "leftStageDescription", "leftSide", "<" );' style="cursor:pointer;">
+ <img src="../images/less_or_equal.png" alt="$i18n.getString( 'less_or_equal' )" onclick='insertOperator( "leftStageDescription", "leftSide", "<=" );' style="cursor:pointer;">
+ <img src="../images/greater.png" alt="$i18n.getString( 'greater' )" onclick='insertOperator( "leftStageDescription", "leftSide", ">" );' style="cursor:pointer;">
+ <img src="../images/greater_or_equal.png" alt="$i18n.getString( 'greater_or_equal' )" onclick='insertOperator( "leftStageDescription", "leftSide", ">=" );' style="cursor:pointer;">
+ <img src="../images/equal.png" alt="$i18n.getString( 'equal' )" onclick='insertOperator( "leftStageDescription", "leftSide", "==" );' style="cursor:pointer;"/>
+ <img src="../images/diff.png" alt="$i18n.getString( 'diff' )" onclick='insertOperator( "leftStageDescription", "leftSide", "!=" );' style="cursor:pointer;"/>
+
+ <img src="../images/clear.png" alt="$i18n.getString( 'clear' )" align='right' onclick="clearValidation( 'leftSide', 'leftStageDescription' )" style="cursor:pointer;margin-right:0.5em"/>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <textarea rows='5' style="width:30em" id='leftSide' name='leftSide' onkeyup="getValidationDescription('leftStageDescription', 'leftSide')">$validation.leftSide</textarea>
+ <input type='hidden' id='rightSide' name='rightSide' value='1==1'>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <fieldset style="border: 1px solid #3f5d8e; ">
+ <legend>$i18n.getString( "description" )</legend>
+ <div id='leftStageDescription' style="width:29em">$!leftDescription</div>
+ </fieldset>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <input type='submit' value="$i18n.getString( "update" )" style="width:10em">
+ <input type='button' value="$i18n.getString( "cancel" )" style="width:10em" onclick="window.location.href='programValidation.action?programId=$validation.program.id'">
+ </td>
+ <td></td>
+ </tr>
+
+</table>
+
+<script>
+ getLeftPrgramStageDataElements();
+</script>
\ No newline at end of file