dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #26811
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13269: Revert R 13240
------------------------------------------------------------
revno: 13269
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-12-17 08:29:04 +0700
message:
Revert R 13240
modified:
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/programStageCompleteness.js
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramMetaData.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/J2meClientUpdateAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/UpdateMobileSettingAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientAttributeForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientAttributeGroupForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientIdentifierTypeForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramIndicator.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramStageForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramStageSectionForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addRelationshipTypeForm.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/addValidationCriteria.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/caseAggregation.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/caseAggregationList.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/caseaggregation.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientAttribute.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientAttributeGroup.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientIdentifierType.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programIndicator.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programStage.js
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/relationship.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/validationcriteria.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/viewPatientRegistationForm.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttribute.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttributeGroup.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientIdentifierType.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientRegistrationForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programIndicator.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programList.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programStage.vm
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/relationshipType.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateCaseAggregation.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttibuteForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttibuteGroupForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientIdentifierType.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramIndicator.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramStageForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramStageSectionForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateRelationshipTypeForm.vm
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/updateValidationCriteria.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/validationCriteria.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewDataEntryForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewPatientRegistationForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewScheduledCaseAggTasks.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-caseentry/src/main/webapp/dhis-web-caseentry/javascript/programStageCompleteness.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/programStageCompleteness.js 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/programStageCompleteness.js 2013-12-17 01:29:04 +0000
@@ -1,16 +1,17 @@
isAjax = true;
+$(function() {
+ selectionTreeSelection.setListenerFunction( orgunitSelected );
+});
+
function orgunitSelected( orgUnits, orgUnitNames )
{
showById('selectDiv');
hideById('showDataBtn');
hideById("listPatientDiv");
- setFieldValue('orgunitName', orgUnitNames[0]);
setFieldValue('orgunitId', orgUnits[0]);
}
-selection.setListenerFunction( orgunitSelected );
-
function generateStageCompleteness()
{
hideById('selectDiv');
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramMetaData.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramMetaData.vm 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramMetaData.vm 2013-12-17 01:29:04 +0000
@@ -7,7 +7,7 @@
"$encoder.jsonEncode( $program.uid )":{
"id":"${program.id}",
"uid":"$encoder.jsonEncode( ${program.uid} )",
- "name":"$encoder.jsonEncode( ${program.displayName} )",
+ "name":"$encoder.jsonEncode( ${program.displayName} )",
"description":"$encoder.jsonEncode( ${program.description} )",
"enrollmentDescription":"$encoder.jsonEncode( ${program.dateOfEnrollmentDescription} )",
"incidentDescription":"$encoder.jsonEncode( ${program.dateOfIncidentDescription} )",
@@ -15,17 +15,17 @@
"programStages":[#set( $pssize = $program.programStages.size() )
#foreach( $ps in $program.programStages )
{
- "id": "${ps.id}",
- "uid": "$encoder.jsonEncode( ${ps.uid} )",
- "name": "$encoder.jsonEncode( ${ps.displayName} )",
- "reportDateDescription": "$encoder.jsonEncode( ${ps.reportDateDescription} )",
- "irregular": "$!{ps.irregular}",
- "displayGenerateEventBox": "$!{ps.displayGenerateEventBox}",
- "validCompleteOnly": "$!{ps.validCompleteOnly}",
- "captureCoordinates": "$!{ps.captureCoordinates}",
- "blockEntryForm": "$!ps.blockEntryForm",
- "remindCompleted": "$!ps.remindCompleted",
- "allowGenerateNextVisit": "$!ps.allowGenerateNextVisit"
+ "id": "${ps.id}",
+ "uid": "$encoder.jsonEncode( ${ps.uid} )",
+ "name": "$encoder.jsonEncode( ${ps.displayName} )",
+ "reportDateDescription": "$encoder.jsonEncode( ${ps.reportDateDescription} )",
+ "irregular": "$!{ps.irregular}",
+ "displayGenerateEventBox": "$!{ps.displayGenerateEventBox}",
+ "validCompleteOnly": "$!{ps.validCompleteOnly}",
+ "captureCoordinates": "$!{ps.captureCoordinates}",
+ "blockEntryForm": "$!ps.blockEntryForm",
+ "remindCompleted": "$!ps.remindCompleted",
+ "allowGenerateNextVisit": "$!ps.allowGenerateNextVisit"
}#if( $velocityCount < $pssize ),#end
#end],
"programAssociations": [
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/J2meClientUpdateAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/J2meClientUpdateAction.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/J2meClientUpdateAction.java 2013-12-17 01:29:04 +0000
@@ -88,10 +88,6 @@
if( list.size() == 0 )
{
this.patientMobileSetting = new PatientMobileSetting();
- patientMobileSetting.setGender( false );
- patientMobileSetting.setDobtype( false );
- patientMobileSetting.setBirthdate( false );
- patientMobileSetting.setRegistrationdate( false );
}
else
{
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/UpdateMobileSettingAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/UpdateMobileSettingAction.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/UpdateMobileSettingAction.java 2013-12-17 01:29:04 +0000
@@ -129,10 +129,6 @@
List<PatientAttribute> attributes = new ArrayList<PatientAttribute>();
setting.setPatientAttributes( attributes );
fillValues( attributes );
- setting.setGender( Boolean.parseBoolean( gender ) );
- setting.setDobtype( Boolean.parseBoolean( dobtype ) );
- setting.setBirthdate( Boolean.parseBoolean( birthdate ) );
- setting.setRegistrationdate( Boolean.parseBoolean( registrationdate ) );
patientMobileSettingService.updatePatientMobileSetting( setting );
}
else
@@ -140,10 +136,6 @@
setting = new PatientMobileSetting();
List<PatientAttribute> attributes = new ArrayList<PatientAttribute>();
setting.setPatientAttributes( attributes );
- setting.setGender( Boolean.parseBoolean( gender ) );
- setting.setDobtype( Boolean.parseBoolean( dobtype ) );
- setting.setBirthdate( Boolean.parseBoolean( birthdate ) );
- setting.setRegistrationdate( Boolean.parseBoolean( registrationdate ) );
fillValues( attributes );
patientMobileSettingService.savePatientMobileSetting( setting );
}
@@ -156,10 +148,6 @@
setting = patientMobileSettingService.getCurrentSetting().iterator().next();
List<PatientAttribute> attributes = new ArrayList<PatientAttribute>();
setting.setPatientAttributes( attributes );
- setting.setGender( Boolean.parseBoolean( gender ) );
- setting.setDobtype( Boolean.parseBoolean( dobtype ) );
- setting.setBirthdate( Boolean.parseBoolean( birthdate ) );
- setting.setRegistrationdate( Boolean.parseBoolean( registrationdate ) );
fillValues( attributes );
patientMobileSettingService.updatePatientMobileSetting( setting );
}
@@ -168,10 +156,6 @@
setting = new PatientMobileSetting();
List<PatientAttribute> attributes = new ArrayList<PatientAttribute>();
setting.setPatientAttributes( attributes );
- setting.setGender( Boolean.parseBoolean( gender ) );
- setting.setDobtype( Boolean.parseBoolean( dobtype ) );
- setting.setBirthdate( Boolean.parseBoolean( birthdate ) );
- setting.setRegistrationdate( Boolean.parseBoolean( registrationdate ) );
fillValues( attributes );
patientMobileSettingService.savePatientMobileSetting( setting );
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientAttributeForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientAttributeForm.vm 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientAttributeForm.vm 2013-12-17 01:29:04 +0000
@@ -1,7 +1,7 @@
<script type="text/javascript" src="javascript/addPatientAttributeForm.js"></script>
<h3>$i18n.getString( "create_new_patient_attribute" )</h3>
-<form id="addPatientAttributeForm" action="addPatientAttribute.action" method="post" >
+<form id="addPatientAttributeForm" action="addPatientAttribute.action" method="post" class="inputForm">
<table id="attrTable">
<thead>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientAttributeGroupForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientAttributeGroupForm.vm 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientAttributeGroupForm.vm 2013-12-17 01:29:04 +0000
@@ -2,7 +2,7 @@
<h3>$i18n.getString( "create_new_patient_attribute_group" )</h3>
-<form id="addPatientAttributeGroupForm" name="addPatientAttributeGroupForm" action="addPatientAttributeGroup.action" method="post" >
+<form id="addPatientAttributeGroupForm" name="addPatientAttributeGroupForm" action="addPatientAttributeGroup.action" method="post" class="inputForm">
<table>
<tr>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientIdentifierTypeForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientIdentifierTypeForm.vm 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientIdentifierTypeForm.vm 2013-12-17 01:29:04 +0000
@@ -5,7 +5,7 @@
<h3>$i18n.getString( "create_new_patient_identifier_type" )</h3>
-<form id="addPatientIdentifierTypeForm" name="addPatientIdentifierTypeForm" action="addPatientIdentifierType.action" method="post" >
+<form id="addPatientIdentifierTypeForm" name="addPatientIdentifierTypeForm" action="addPatientIdentifierType.action" method="post" class="inputForm">
<table>
<thead>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm 2013-12-17 01:29:04 +0000
@@ -85,7 +85,7 @@
<h3>$i18n.getString( "create_new_program" )</h3>
-<form id="addProgramForm" name="addProgramForm" action="addProgram.action" method="get" >
+<form id="addProgramForm" name="addProgramForm" action="addProgram.action" method="get" class="inputForm">
<select id='daysAllowedSendMessages' name="daysAllowedSendMessages" multiple="multiple" class="hidden"></select>
<select id='templateMessages' name="templateMessages" multiple="multiple" class="hidden"></select>
<select id='datesToCompare' name="datesToCompare" multiple="multiple" class="hidden"></select>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramIndicator.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramIndicator.vm 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramIndicator.vm 2013-12-17 01:29:04 +0000
@@ -13,7 +13,7 @@
<h3>$i18n.getString( "create_new_program_indicator" )</h3>
-<form id="programIndicatorForm" action="addProgramIndicator.action" method="post" >
+<form id="programIndicatorForm" action="addProgramIndicator.action" method="post" class="inputForm">
<input type='hidden' id='programId' name='programId' value='$program.id'>
<table>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramStageForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramStageForm.vm 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramStageForm.vm 2013-12-17 01:29:04 +0000
@@ -11,7 +11,7 @@
<h4>$program.displayName</h4>
-<form id="addProgramStageForm" name="addProgramStageForm" action="addProgramStage.action" method="get">
+<form id="addProgramStageForm" name="addProgramStageForm" action="addProgramStage.action" method="get" class="inputForm">
<input type="hidden" id="programId" name="programId" value="$program.id"/>
<input type='hidden' id="id" name="id" value="$program.id"/>
<select id='daysAllowedSendMessages' name="daysAllowedSendMessages" multiple="multiple" class="hidden"></select>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramStageSectionForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramStageSectionForm.vm 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramStageSectionForm.vm 2013-12-17 01:29:04 +0000
@@ -18,7 +18,7 @@
<h4>$programStage.displayName</h4>
-<form id="programStageSectionForm" name="programStageSectionForm" action="addProgramStageSection.action" method="post">
+<form id="programStageSectionForm" name="programStageSectionForm" action="addProgramStageSection.action" method="post" class="inputForm">
<input type="hidden" id="programStageId" name="programStageId" value="$programStage.id"/>
<table>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addRelationshipTypeForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addRelationshipTypeForm.vm 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addRelationshipTypeForm.vm 2013-12-17 01:29:04 +0000
@@ -2,7 +2,7 @@
<h3>$i18n.getString( "create_new_relationship_type" )</h3>
-<form id="addRelationshipTypeForm" name="addRelationshipTypeForm" action="addRelationshipType.action" method="post">
+<form id="addRelationshipTypeForm" name="addRelationshipTypeForm" action="addRelationshipType.action" method="post" class="inputForm">
<table>
<thead>
=== modified 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 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addSingleProgramValidationForm.vm 2013-12-17 01:29:04 +0000
@@ -2,7 +2,7 @@
<h4>$program.displayName</h4>
-<form id='programValidationForm' name='programValidationForm' method='post' action='addProgramValidation.action'>
+<form id='programValidationForm' name='programValidationForm' method='post' action='addProgramValidation.action' class="inputForm">
<input type='hidden' id='programId' name='programId' value='$program.id'>
<table>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addValidationCriteria.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addValidationCriteria.vm 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addValidationCriteria.vm 2013-12-17 01:29:04 +0000
@@ -1,7 +1,7 @@
<script type="text/javascript" src="javascript/addValidationCriteria.js"></script>
<h3>$i18n.getString( "create_validation_criteria" )</h3>
-<form id="validationCriteriaForm" action="addValidationCriteria.action" method="post" >
+<form id="validationCriteriaForm" action="addValidationCriteria.action" method="post" class="inputForm">
<table>
<tr><th colspan="3">$i18n.getString('validation_criteria_details')</th></tr>
<tr>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/caseAggregation.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/caseAggregation.vm 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/caseAggregation.vm 2013-12-17 01:29:04 +0000
@@ -1,5 +1,23 @@
+<script>
+$(function() {
+ dhis2.contextmenu.makeContextMenu({
+ menuId: 'contextMenu',
+ menuItemActiveClass: 'contextMenuItemActive'
+ });
+});
+</script>
+
<h3>$i18n.getString( 'patient_aggregation_query_builder_management' ) #openHelp( "patient_aggregation_query_builder" )</h3>
+<div id="contextMenu" class="contextMenu">
+ <ul id="contextMenuItems" class="contextMenuItems">
+ <li><a data-target-fn="showUpdateCaseAggregationForm"><i class="fa fa-edit"></i> $i18n.getString( "edit" )</a></li>
+ <li><a data-target-fn="translateWithContext"><i class="fa fa-globe"></i> $i18n.getString( "translation_translate" )</a></li>
+ <li><a data-target-fn="removeCaseAggregation"><i class="fa fa-trash-o"></i> $i18n.getString( "remove" )</a></li>
+ <li><a data-target-fn="showCaseAggregationDetails"><i class="fa fa-info-circle"></i> $i18n.getString( "show_details" )</a></li>
+ </ul>
+</div>
+
<table class="mainPageTable">
<tr>
<td style="vertical-align:top">
@@ -17,8 +35,8 @@
</td>
</tr>
<tr>
- <td>$i18n.getString( "filter_by_name" )</td>
- <td>
+ <td>$i18n.getString( "filter_by_name" )</td>
+ <td>
<input type="text" onkeyup="filterValues( this.value , 1)" />
</td>
<td colspan="3" style="text-align:right">
@@ -29,33 +47,29 @@
<table class="listTable">
<col>
- <col width="120">
<thead>
<tr>
<th>$i18n.getString( "name" )</th>
- <th>$i18n.getString( "operations" )</th>
</tr>
</thead>
<tbody id="list">
#parse( "/dhis-web-maintenance-patient/caseAggregationList.vm" )
</tbody>
-
- </table>
+ </table>
</td>
+
<td id="detailsData">
-
- <div id="detailsArea">
- <div id="hideDetailsArea">
+ <div id="detailsArea">
+ <div id="hideDetailsArea">
<a href="javascript:hideDetails()" title="$i18n.getString( "hide_details" )"><img src="../images/close.png" alt="$i18n.getString( 'hide_details' )"></a>
</div>
- <p><label class="bold">$i18n.getString( "name" ):</label><br><span id="nameField"></span></p>
- <p><label class="bold">$i18n.getString( "operator" ):</label><br><span id="operatorField"></span></p>
- <p><label class="bold">$i18n.getString( "aggregation_data_element" ):</label><br><span id="aggregationDataElementField"></span></p>
+ <p><label class="bold">$i18n.getString( "name" ):</label><br><span id="nameField"></span></p>
+ <p><label class="bold">$i18n.getString( "operator" ):</label><br><span id="operatorField"></span></p>
+ <p><label class="bold">$i18n.getString( "aggregation_data_element" ):</label><br><span id="aggregationDataElementField"></span></p>
<p><label class="bold">$i18n.getString( "option_combo" ):</label><br><span id="optionComboField"></span></p>
- <p><label class="bold">$i18n.getString( "data_element_for_sum_avg_min_max" ):</label><br><span id="deSumField"></span></p>
- <p><label class="bold">$i18n.getString( "aggregation_expression" ):</label><br><span id="aggregationExpressionField"></span></p>
+ <p><label class="bold">$i18n.getString( "data_element_for_sum_avg_min_max" ):</label><br><span id="deSumField"></span></p>
+ <p><label class="bold">$i18n.getString( "aggregation_expression" ):</label><br><span id="aggregationExpressionField"></span></p>
</div>
-
</td>
</tr>
</table>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/caseAggregationList.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/caseAggregationList.vm 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/caseAggregationList.vm 2013-12-17 01:29:04 +0000
@@ -1,13 +1,10 @@
-#set($mark=false)
+
#foreach( $aggregationCondition in $aggregationConditions )
- <tr id="tr${aggregationCondition.id}" #alternate( $mark )>
- <td onclick="javascript:showCaseAggregationDetails( $aggregationCondition.id )" >$encoder.htmlEncode( $aggregationCondition.displayName )</td>
- <td>
- <a href="showUpdateCaseAggregationForm.action?id=$aggregationCondition.id&dataSetId=$!dataSetId" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
- <a href="javascript:translate( 'CaseAggregationCondition', '$aggregationCondition.id' )" title="$i18n.getString( 'translation_translate' )"><img src="../images/i18n.png" alt="$i18n.getString( 'translation_translate' )"/></a>
- <a href="javascript:removeCaseAggregation( '$aggregationCondition.id', '$encoder.jsEncode( $aggregationCondition.displayName )' )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
- <a href="javascript:showCaseAggregationDetails( $aggregationCondition.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( 'show_details' )"></a>
- </td>
+ <tr id="tr${aggregationCondition.id}" data-id="$!aggregationCondition.id" data-uid="$!aggregationCondition.uid" data-type="CaseAggregationCondition"
+ data-name="$encoder.htmlEncode( $!aggregationCondition.displayName )"
+ data-can-manage="$security.canManage( $aggregationCondition )"
+ data-can-update="$security.canUpdate( $aggregationCondition )"
+ data-can-delete="$security.canDelete( $aggregationCondition )">
+ <td>$encoder.htmlEncode( $!aggregationCondition.displayName )</td>
</tr>
- #set($mark=!$mark)
-#end
\ No newline at end of file
+#end
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/caseaggregation.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/caseaggregation.js 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/caseaggregation.js 2013-12-17 01:29:04 +0000
@@ -1,552 +1,502 @@
-
//------------------------------------------------------------------------------
// Get dataelements by dataset
//------------------------------------------------------------------------------
-function getDataElementsByDataset()
-{
- var dataSets = document.getElementById( 'dataSets' );
- var dataSetId = dataSets.options[ dataSets.selectedIndex ].value;
- setFieldValue('aggregationDataElementId','');
- setFieldValue('aggregationDataElementInput','');
-
- if( dataSetId == "" ){
- disable( 'dataElementsButton' );
- setFieldValue( 'aggregationDataElementInput','');
- return;
- }
- autoCompletedField();
+function getDataElementsByDataset() {
+ var dataSets = document.getElementById('dataSets');
+ var dataSetId = dataSets.options[ dataSets.selectedIndex ].value;
+ setFieldValue('aggregationDataElementId', '');
+ setFieldValue('aggregationDataElementInput', '');
+
+ if( dataSetId == "" ) {
+ disable('dataElementsButton');
+ setFieldValue('aggregationDataElementInput', '');
+ return;
+ }
+ autoCompletedField();
}
-function autoCompletedField()
-{
- $( "#dataElementsButton" ).unbind('click');
- enable( 'dataElementsButton' );
-
- var input = jQuery( "#aggregationDataElementInput" )
- .autocomplete({
- delay: 0,
- minLength: 0,
- source: function( request, response ){
- $.ajax({
- url: "getDataElementsByDataset.action?id=" + getFieldValue('dataSets') + "&query=" + input.val(),
- dataType: "json",
- success: function(data) {
- response($.map(data.dataElements, function(item) {
- return {
- label: item.name,
- id: item.id
- };
- }));
- }
- });
- },
- select: function( event, ui ) {
- input.val(ui.item.value);
- setFieldValue('aggregationDataElementId',ui.item.id);
- input.autocomplete( "close" );
- },
- change: function( event, ui ) {
- if ( !ui.item ) {
- var matcher = new RegExp( "^" + $.ui.autocomplete.escapeRegex( $(this).val() ) + "$", "i" ),
- valid = false;
- select.children( "option" ).each(function() {
- if ( $( this ).text().match( matcher ) ) {
- this.selected = valid = true;
- return false;
- }
- });
- if ( !valid ) {
- // remove invalid value, as it didn't match anything
- $( this ).val( "" );
- select.val( "" );
- input.data( "autocomplete" ).term = "";
- return false;
- }
- }
- }
- }).addClass( "ui-widget" );
-
- input.data( "autocomplete" )._renderItem = function( ul, item ) {
- return $( "<li></li>" )
- .data( "item.autocomplete", item )
- .append( "<a>" + item.label + "</a>" )
- .appendTo( ul );
- };
-
- var wrapper = this.wrapper = $( "<span style='width:200px'>" )
- .addClass( "ui-combobox" )
- .insertAfter( input );
-
- var button = $( "#dataElementsButton" )
- .attr( "tabIndex", -1 )
- .attr( "title", i18n_show_all_items )
- .appendTo( wrapper )
- .button({
- icons: {
- primary: "ui-icon-triangle-1-s"
- },
- text: false
- })
- .click(function() {
- // close if already visible
- if ( input.autocomplete( "widget" ).is( ":visible" ) ) {
- input.autocomplete( "close" );
- return;
- }
- // work around a bug (likely same cause as #5265)
- $( this ).blur();
- // pass empty string as value to search for, displaying all results
- input.autocomplete( "search", "" );
- input.focus();
- });
+function autoCompletedField() {
+ $("#dataElementsButton").unbind('click');
+ enable('dataElementsButton');
+
+ var input = jQuery("#aggregationDataElementInput")
+ .autocomplete({
+ delay: 0,
+ minLength: 0,
+ source: function( request, response ) {
+ $.ajax({
+ url: "getDataElementsByDataset.action?id=" + getFieldValue('dataSets') + "&query=" + input.val(),
+ dataType: "json",
+ success: function( data ) {
+ response($.map(data.dataElements, function( item ) {
+ return {
+ label: item.name,
+ id: item.id
+ };
+ }));
+ }
+ });
+ },
+ select: function( event, ui ) {
+ input.val(ui.item.value);
+ setFieldValue('aggregationDataElementId', ui.item.id);
+ input.autocomplete("close");
+ },
+ change: function( event, ui ) {
+ if( !ui.item ) {
+ var matcher = new RegExp("^" + $.ui.autocomplete.escapeRegex($(this).val()) + "$", "i"),
+ valid = false;
+ select.children("option").each(function() {
+ if( $(this).text().match(matcher) ) {
+ this.selected = valid = true;
+ return false;
+ }
+ });
+ if( !valid ) {
+ // remove invalid value, as it didn't match anything
+ $(this).val("");
+ select.val("");
+ input.data("autocomplete").term = "";
+ return false;
+ }
+ }
+ }
+ }).addClass("ui-widget");
+
+ input.data("autocomplete")._renderItem = function( ul, item ) {
+ return $("<li></li>")
+ .data("item.autocomplete", item)
+ .append("<a>" + item.label + "</a>")
+ .appendTo(ul);
+ };
+
+ var wrapper = this.wrapper = $("<span style='width:200px'>")
+ .addClass("ui-combobox")
+ .insertAfter(input);
+
+ var button = $("#dataElementsButton")
+ .attr("tabIndex", -1)
+ .attr("title", i18n_show_all_items)
+ .appendTo(wrapper)
+ .button({
+ icons: {
+ primary: "ui-icon-triangle-1-s"
+ },
+ text: false
+ })
+ .click(function() {
+ // close if already visible
+ if( input.autocomplete("widget").is(":visible") ) {
+ input.autocomplete("close");
+ return;
+ }
+ // work around a bug (likely same cause as #5265)
+ $(this).blur();
+ // pass empty string as value to search for, displaying all results
+ input.autocomplete("search", "");
+ input.focus();
+ });
}
//------------------------------------------------------------------------------
// Get Program Stages
//------------------------------------------------------------------------------
-function getParams()
-{
- clearListById( 'programStageId' );
- clearListById( 'dataElements' );
- clearListById('caseProperty');
- var programId = getFieldValue( 'programId' );
- if( programId == ''){
- var caseProperty = jQuery( '#caseProperty' );
- caseProperty.append( '<option suggested="" title="' + i18n_total_of_patient_registration + '" value="[PT:count]">'+ i18n_total_of_patient_registration +'</option>' );
- caseProperty.append( '<option suggested="F, M" title="' + i18n_gender + '" value="[CP:gender]">'+ i18n_gender +'</option>' );
- caseProperty.append( '<option suggested="" title="' + i18n_dob_type + '" value="[CP:dobType]">'+ i18n_dob_type +'</option>' );
- caseProperty.append( '<option suggested="" title="' + i18n_age_days + '" value="[CP:age]">'+ i18n_age_days +'</option>' );
-
- disable('programProperty');
- disable('programStageProperty');
- }
-
- if(jQuery('#programId option:selected').attr('programType')==3){
- jQuery("[name=multiProgram]").remove();
- if( jQuery("[value=times]").attr('checked')!=undefined
- && jQuery("[value=times]").attr('checked')!='true' )
- {
- jQuery("[value=times]").attr('checked',true);
- }
- }
-
- jQuery.getJSON( 'getParamsByProgram.action',{ programId:programId }
- ,function( json )
- {
- enable('programProperty');
- var programstage = jQuery('#programStageId');
-
- for ( i in json.programStages )
- {
- var id = json.programStages[i].id;
- var formularId = "[PS:" + id + "]";
- var name = json.programStages[i].name;
-
- programstage.append( "<option value='" + id + "' title='" + name + "'>" + name + "</option>" );
- }
-
- if( json.programStages.length > 1 )
- {
- programstage.prepend( "<option value='' title='" + i18n_all + "'>" + i18n_all + "</option>" );
- }
- byId('programStageId').options[0].selected = true;
- getPatientDataElements();
-
- clearListById( 'caseProperty' );
- var type = jQuery('#programId option:selected').attr('programType');
- if( type!='3')
- {
- var caseProperty = jQuery( '#caseProperty' );
- for ( i in json.fixedAttributes )
- {
- var id = json.fixedAttributes[i].id;
- var name = json.fixedAttributes[i].name;
-
- caseProperty.append( "<option value='" + id + "' title='" + name + "' suggested='" + json.fixedAttributes[i].suggested + "'>" + name + "</option>" );
- }
-
- for ( i in json.patientAttributes )
- {
- var id = json.patientAttributes[i].id;
- var name = json.patientAttributes[i].name;
- var suggested = json.patientAttributes[i].suggested;
-
- caseProperty.append( "<option value='" + id + "' title='" + name + "' suggested='" + suggested + "'>" + name + "</option>" );
- }
- }
- });
+function getParams() {
+ clearListById('programStageId');
+ clearListById('dataElements');
+ clearListById('caseProperty');
+ var programId = getFieldValue('programId');
+ if( programId == '' ) {
+ var caseProperty = jQuery('#caseProperty');
+ caseProperty.append('<option suggested="" title="' + i18n_total_of_patient_registration + '" value="[PT:count]">' + i18n_total_of_patient_registration + '</option>');
+ caseProperty.append('<option suggested="F, M" title="' + i18n_gender + '" value="[CP:gender]">' + i18n_gender + '</option>');
+ caseProperty.append('<option suggested="" title="' + i18n_dob_type + '" value="[CP:dobType]">' + i18n_dob_type + '</option>');
+ caseProperty.append('<option suggested="" title="' + i18n_age_days + '" value="[CP:age]">' + i18n_age_days + '</option>');
+
+ disable('programProperty');
+ disable('programStageProperty');
+ }
+
+ if( jQuery('#programId option:selected').attr('programType') == 3 ) {
+ jQuery("[name=multiProgram]").remove();
+ if( jQuery("[value=times]").attr('checked') != undefined
+ && jQuery("[value=times]").attr('checked') != 'true' ) {
+ jQuery("[value=times]").attr('checked', true);
+ }
+ }
+
+ jQuery.getJSON('getParamsByProgram.action', { programId: programId }
+ , function( json ) {
+ enable('programProperty');
+ var programstage = jQuery('#programStageId');
+
+ for( i in json.programStages ) {
+ var id = json.programStages[i].id;
+ var formularId = "[PS:" + id + "]";
+ var name = json.programStages[i].name;
+
+ programstage.append("<option value='" + id + "' title='" + name + "'>" + name + "</option>");
+ }
+
+ if( json.programStages.length > 1 ) {
+ programstage.prepend("<option value='' title='" + i18n_all + "'>" + i18n_all + "</option>");
+ }
+ byId('programStageId').options[0].selected = true;
+ getPatientDataElements();
+
+ clearListById('caseProperty');
+ var type = jQuery('#programId option:selected').attr('programType');
+ if( type != '3' ) {
+ var caseProperty = jQuery('#caseProperty');
+ for( i in json.fixedAttributes ) {
+ var id = json.fixedAttributes[i].id;
+ var name = json.fixedAttributes[i].name;
+
+ caseProperty.append("<option value='" + id + "' title='" + name + "' suggested='" + json.fixedAttributes[i].suggested + "'>" + name + "</option>");
+ }
+
+ for( i in json.patientAttributes ) {
+ var id = json.patientAttributes[i].id;
+ var name = json.patientAttributes[i].name;
+ var suggested = json.patientAttributes[i].suggested;
+
+ caseProperty.append("<option value='" + id + "' title='" + name + "' suggested='" + suggested + "'>" + name + "</option>");
+ }
+ }
+ });
}
-function getProgramStages()
-{
- var programId = getFieldValue( 'orgunitProgramId' );
- if(programId=='') return;
-
- clearListById( 'orgunitProgramStageId' );
-
- jQuery.getJSON( 'getProgramStages.action',{ id:programId }
- ,function( json )
- {
- enable('programProperty');
- var programstage = jQuery('#orgunitProgramStageId');
-
- for ( i in json.programStages )
- {
- var id = json.programStages[i].id;
- var formularId = "[PSIC:" + id + "]";
- var name = json.programStages[i].name;
-
- programstage.append( "<option value='" + formularId + "' title='" + name + "'>" + name + "</option>" );
- }
- });
+function getProgramStages() {
+ var programId = getFieldValue('orgunitProgramId');
+ if( programId == '' ) return;
+
+ clearListById('orgunitProgramStageId');
+
+ jQuery.getJSON('getProgramStages.action', { id: programId }
+ , function( json ) {
+ enable('programProperty');
+ var programstage = jQuery('#orgunitProgramStageId');
+
+ for( i in json.programStages ) {
+ var id = json.programStages[i].id;
+ var formularId = "[PSIC:" + id + "]";
+ var name = json.programStages[i].name;
+
+ programstage.append("<option value='" + formularId + "' title='" + name + "'>" + name + "</option>");
+ }
+ });
}
//------------------------------------------------------------------------------
// Get DataElements of Program-Stage
//------------------------------------------------------------------------------
-function getPatientDataElements()
-{
- clearListById( 'dataElements' );
- clearListById( 'dataElementBackups' );
- clearListById( 'deSumId' );
- var programStageId = getFieldValue('programStageId');
-
- jQuery.getJSON( 'getPatientDataElements.action',
- {
- programId:getFieldValue( 'programId' ),
- programStageId:programStageId
- }
- ,function( json )
- {
- if( programStageId!='' ){
- enable('programStageProperty');
- }
- else{
- disable('programStageProperty');
- }
-
- var dataElements = jQuery('#dataElements');
- var dataElementBackups = jQuery('#dataElementBackups');
- clearListById( 'dataElements' );
- clearListById( 'dataElementBackups' );
- var deSumId = jQuery('#deSumId');
- deSumId.append( "<option value='' >" + i18n_please_select + "</option>" );
- for ( i in json.dataElements )
- {
- dataElements.append( "<option value='" + json.dataElements[i].id + "' title='" + json.dataElements[i].name + "' dename='" + json.dataElements[i].name + "' decode='" + json.dataElements[i].code + "' suggested='" + json.dataElements[i].optionset + "' valuetype='" + json.dataElements[i].type + "'>" + json.dataElements[i].name + "</option>" );
- dataElementBackups.append( "<option value='" + json.dataElements[i].id + "' title='" + json.dataElements[i].name + "' dename='" + json.dataElements[i].name + "' decode='" + json.dataElements[i].code + "' suggested='" + json.dataElements[i].optionset + "' valuetype='" + json.dataElements[i].type + "'>" + json.dataElements[i].name + "</option>" );
- if( json.dataElements[i].type=='int')
- {
- deSumId.append( "<option value='" + json.dataElements[i].id + "' title='" + json.dataElements[i].name + "' suggested='" + json.dataElements[i].optionset + "' valuetype='" + json.dataElements[i].type + "'>" + json.dataElements[i].name + "</option>" );
- }
- }
-
- });
+function getPatientDataElements() {
+ clearListById('dataElements');
+ clearListById('dataElementBackups');
+ clearListById('deSumId');
+ var programStageId = getFieldValue('programStageId');
+
+ jQuery.getJSON('getPatientDataElements.action',
+ {
+ programId: getFieldValue('programId'),
+ programStageId: programStageId
+ }
+ , function( json ) {
+ if( programStageId != '' ) {
+ enable('programStageProperty');
+ }
+ else {
+ disable('programStageProperty');
+ }
+
+ var dataElements = jQuery('#dataElements');
+ var dataElementBackups = jQuery('#dataElementBackups');
+ clearListById('dataElements');
+ clearListById('dataElementBackups');
+ var deSumId = jQuery('#deSumId');
+ deSumId.append("<option value='' >" + i18n_please_select + "</option>");
+ for( i in json.dataElements ) {
+ dataElements.append("<option value='" + json.dataElements[i].id + "' title='" + json.dataElements[i].name + "' dename='" + json.dataElements[i].name + "' decode='" + json.dataElements[i].code + "' suggested='" + json.dataElements[i].optionset + "' valuetype='" + json.dataElements[i].type + "'>" + json.dataElements[i].name + "</option>");
+ dataElementBackups.append("<option value='" + json.dataElements[i].id + "' title='" + json.dataElements[i].name + "' dename='" + json.dataElements[i].name + "' decode='" + json.dataElements[i].code + "' suggested='" + json.dataElements[i].optionset + "' valuetype='" + json.dataElements[i].type + "'>" + json.dataElements[i].name + "</option>");
+ if( json.dataElements[i].type == 'int' ) {
+ deSumId.append("<option value='" + json.dataElements[i].id + "' title='" + json.dataElements[i].name + "' suggested='" + json.dataElements[i].optionset + "' valuetype='" + json.dataElements[i].type + "'>" + json.dataElements[i].name + "</option>");
+ }
+ }
+
+ });
}
//-----------------------------------------------------------------
// Insert items into Condition
//-----------------------------------------------------------------
-function insertDataElement( element )
-{
- var progamId = getFieldValue('programId');
- var programStageId = getFieldValue('programStageId');
- programStageId = ( programStageId == "" ) ? "*" : programStageId;
- var dataElementId = element.options[element.selectedIndex].value;
-
- insertTextCommon( 'aggregationCondition', "[DE:" + progamId + "." + programStageId + "." + dataElementId + "]" );
- getConditionDescription();
-}
-
-function insertInfo( element, isProgramStageProperty )
-{
- var id = "";
- if( isProgramStageProperty )
- {
- id = getFieldValue('programStageId');
- }
- else
- {
- id = getFieldValue('programId');
- }
-
- value = element.options[element.selectedIndex].value.replace( '*', id );
- insertTextCommon('aggregationCondition', value );
- getConditionDescription();
-}
-
-function insertOperator( value )
-{
- insertTextCommon('aggregationCondition', ' ' + value + ' ' );
- getConditionDescription();
-}
-
-function insertBoolValue( value )
-{
- insertTextCommon("aggregationCondition", " ='" + value + "' " );
- getConditionDescription();
+function insertDataElement( element ) {
+ var progamId = getFieldValue('programId');
+ var programStageId = getFieldValue('programStageId');
+ programStageId = ( programStageId == "" ) ? "*" : programStageId;
+ var dataElementId = element.options[element.selectedIndex].value;
+
+ insertTextCommon('aggregationCondition', "[DE:" + progamId + "." + programStageId + "." + dataElementId + "]");
+ getConditionDescription();
+}
+
+function insertInfo( element, isProgramStageProperty ) {
+ var id = "";
+ if( isProgramStageProperty ) {
+ id = getFieldValue('programStageId');
+ }
+ else {
+ id = getFieldValue('programId');
+ }
+
+ value = element.options[element.selectedIndex].value.replace('*', id);
+ insertTextCommon('aggregationCondition', value);
+ getConditionDescription();
+}
+
+function insertOperator( value ) {
+ insertTextCommon('aggregationCondition', ' ' + value + ' ');
+ getConditionDescription();
+}
+
+function insertBoolValue( value ) {
+ insertTextCommon("aggregationCondition", " ='" + value + "' ");
+ getConditionDescription();
}
// -----------------------------------------------------------------------------
// Remove Case Aggregation Condition
// -----------------------------------------------------------------------------
-function removeCaseAggregation( caseAggregationId, caseAggregationName )
-{
- removeItem( caseAggregationId, caseAggregationName, i18n_confirm_delete, 'removeCaseAggregation.action' );
-}
-
-// -----------------------------------------------------------------------------
-// View details
-// -----------------------------------------------------------------------------
-
-function showCaseAggregationDetails( caseAggregationId )
-{
- jQuery.getJSON( 'getCaseAggregation.action', { id:caseAggregationId }, function ( json )
- {
- setInnerHTML( 'nameField', json.caseAggregation.name );
- setInnerHTML( 'operatorField', json.caseAggregation.operator );
- setInnerHTML( 'aggregationDataElementField', json.caseAggregation.aggregationDataElement );
- setInnerHTML( 'optionComboField', json.caseAggregation.optionCombo );
- setInnerHTML( 'aggregationExpressionField', json.caseAggregation.aggregationExpression );
- setInnerHTML( 'deSumField', json.caseAggregation.deSum );
- showDetails();
- });
-}
-
-// -----------------------------------------------------------------------------
-// View details
-// -----------------------------------------------------------------------------
-
-function getConditionDescription()
-{
- $.postUTF8( 'getCaseAggregationDescription.action',
- {
- condition:getFieldValue('aggregationCondition')
- },function (data)
- {
- byId('aggregationDescription').innerHTML = data;
- },'html');
+function removeCaseAggregation( context ) {
+ removeItem(context.id, context.name, i18n_confirm_delete, 'removeCaseAggregation.action');
+}
+
+// -----------------------------------------------------------------------------
+// View details
+// -----------------------------------------------------------------------------
+
+function showUpdateCaseAggregationForm( context ) {
+ location.href = 'showUpdateCaseAggregationForm.action?id=' + context.id;
+}
+
+function showCaseAggregationDetails( context ) {
+ jQuery.getJSON('getCaseAggregation.action', { id: context.id }, function( json ) {
+ setInnerHTML('nameField', json.caseAggregation.name);
+ setInnerHTML('operatorField', json.caseAggregation.operator);
+ setInnerHTML('aggregationDataElementField', json.caseAggregation.aggregationDataElement);
+ setInnerHTML('optionComboField', json.caseAggregation.optionCombo);
+ setInnerHTML('aggregationExpressionField', json.caseAggregation.aggregationExpression);
+ setInnerHTML('deSumField', json.caseAggregation.deSum);
+ showDetails();
+ });
+}
+
+// -----------------------------------------------------------------------------
+// View details
+// -----------------------------------------------------------------------------
+
+function getConditionDescription() {
+ $.postUTF8('getCaseAggregationDescription.action',
+ {
+ condition: getFieldValue('aggregationCondition')
+ }, function( data ) {
+ byId('aggregationDescription').innerHTML = data;
+ }, 'html');
}
// -----------------------------------------------------------------------------
// Test condition
// -----------------------------------------------------------------------------
-function testCaseAggregationCondition()
-{
- var operator = jQuery('[name=operator]:checked').val();
- $.postUTF8( 'testCaseAggregationCondition.action',
- {
- condition: getFieldValue('aggregationCondition'),
- deSumId: getFieldValue('deSumId'),
- operator: operator
- },function (json)
- {
- var type = json.response;
-
- if ( type == "input" )
- {
- showWarningMessage( i18n_run_fail );
- }
- else
- {
- showSuccessMessage( i18n_run_success );
- }
- });
-}
-
-function getSuggestedValues( sourceId, targetId )
-{
- clearListById( targetId );
-
- var suggestedValues = jQuery('select[id=' + sourceId + '] option:selected').attr('suggested');
- if( suggestedValues )
- {
- var arrValues = new Array();
- arrValues = suggestedValues.replace(/[//[]+/g,'').replace(/]/g, '').split(', ');
-
- var suggestedValueSelector = byId( targetId );
- for( var i=0; i< arrValues.length; i++ )
- {
- var option = document.createElement("option");
- var value = jQuery.trim( arrValues[i] );
- option.value = "'" + value + "'";
- option.text = value;
- option.title = value;
-
- suggestedValueSelector.add(option, null);
- }
- }
-}
-
-function insertSingleValue( elementId )
-{
- var element = byId( elementId );
- insertTextCommon('aggregationCondition', "=" + element.options[element.selectedIndex].value );
- getConditionDescription();
-}
-
-function insertMultiValues( elementId )
-{
- var list = jQuery('select[id=' + elementId + '] option:selected')
- if( list.length == 0 )
- {
- return;
- }
- if( list.length > 1 )
- {
- var selectedValues = "";
- list.each(function(){
- selectedValues += jQuery(this).val() + ", ";
- });
- selectedValues = " IN @ " + selectedValues.substring( 0, selectedValues.length - 2) + " #";
-
- insertTextCommon('aggregationCondition', selectedValues );
- getConditionDescription();
- }
- else
- {
- insertSingleValue( elementId );
- }
-}
-
-function getCaseAggConditionByDataset()
-{
- $.get( 'getCaseAggConditionByDataset.action',
- {
- dataSetId: getFieldValue( 'dataSetId' )
- }
- , function( html )
- {
- setTableStyles();
- setInnerHTML('list', html );
- } );
-}
-
-function showAddCaseAggregationForm()
-{
- window.location.href='showAddCaseAggregationForm.action?dataSetId=' + getFieldValue( 'dataSetId' );
-}
-
-function operatorOnchange(operator)
-{
- if( operator=='sum' || operator=='avg'
- || operator=='min' || operator=='max' ){
- enable('deSumId');
- }
- else{
- disable('deSumId');
- }
-}
-
-function filterDataElement( event, value, fieldName, backupFieldsName )
-{
- // Remove all options in data element fields
- var field = jQuery('#' + fieldName + " option " ).remove();
- var valueType = getFieldValue('deValueType');
-
- jQuery('#' + backupFieldsName + " option ").each( function(){
- var option = jQuery(this);
- if (valueType=='' || valueType == option.attr('valueType') )
- {
- if(value.length == 0 )
- {
- jQuery('#' + fieldName ).append( "<option value='" + option.attr('value') + "' title='" + option.text() + "' suggested='" + option.attr('optionset') + "' valueType='" + option.attr('valueType') + "'>" + option.text() + "</option>" );
- }
- else if (option.text().toLowerCase().indexOf( value.toLowerCase() ) != -1 )
- {
- jQuery('#' + fieldName ).append( "<option value='" + option.attr('value') + "' title='" + option.text() + "' suggested='" + option.attr('optionset') + "' valueType='" + option.attr('valueType') + "'>" + option.text() + "</option>" );
- }
- }
- });
-
-}
-
-function sortByOnChange( sortBy )
-{
- if( sortBy == 1)
- {
- jQuery('#dataElements').each(function() {
-
- // Keep track of the selected option.
- var selectedValue = $(this).val();
-
- // sort it out
- $(this).html($("option", $(this)).sort(function(a, b) {
- return $(a).attr('dename') == $(b).attr('dename') ? 0 : $(a).attr('dename') < $(b).attr('dename') ? -1 : 1
- }));
-
- // Select one option.
- $(this).val(selectedValue);
-
- });
- }
- else
- {
- jQuery('#dataElements').each(function() {
-
- // Keep track of the selected option.
- var selectedValue = $(this).val();
-
- // sort it out
- $(this).html($("option", $(this)).sort(function(a, b) {
- return $(a).attr('decode') == $(b).attr('decode') ? 0 : $(a).attr('decode') < $(b).attr('decode') ? -1 : 1
- }));
-
- // Select one option.
- $(this).val(selectedValue);
-
- });
- }
-}
-
-function displayNameOnChange( displayName )
-{
- // display - name
- if(displayName=='1'){
- jQuery('#dataElements option').each(function(){
- var item = jQuery(this);
- item[0].text = item.attr('dename');
- item[0].title = item[0].text;
- });
- jQuery('#dataElementBackups option').each(function(){
- var item = jQuery(this);
- item[0].text = item.attr('dename');
- });
- }
- // display - code
- else if(displayName=='2'){
- jQuery('#dataElements option').each(function(){
- var item = jQuery(this);
- item[0].text = item.attr('decode');
- item[0].title = item[0].text;
- });
- jQuery('#dataElementBackups option').each(function(){
- var item = jQuery(this);
- item[0].text = item.attr('decode');
- });
- }
- // display - code and name
- else{
- jQuery('#dataElements option').each(function(){
- var item = jQuery(this);
- item[0].text = "(" + item.attr('decode') + ") " + item.attr('dename');
- item[0].title = item[0].text;
- });
- jQuery('#dataElementBackups option').each(function(){
- var item = jQuery(this);
- item[0].text = "(" + item.attr('decode') + ") " + item.attr('dename');
- });
- }
-}
-
-function cancelOnClick()
-{
- var dataSetId = getFieldValue("dataSets");
- window.location.href='caseAggregation.action?dataSetId=' + dataSetId;
+function testCaseAggregationCondition() {
+ var operator = jQuery('[name=operator]:checked').val();
+ $.postUTF8('testCaseAggregationCondition.action',
+ {
+ condition: getFieldValue('aggregationCondition'),
+ deSumId: getFieldValue('deSumId'),
+ operator: operator
+ }, function( json ) {
+ var type = json.response;
+
+ if( type == "input" ) {
+ showWarningMessage(i18n_run_fail);
+ }
+ else {
+ showSuccessMessage(i18n_run_success);
+ }
+ });
+}
+
+function getSuggestedValues( sourceId, targetId ) {
+ clearListById(targetId);
+
+ var suggestedValues = jQuery('select[id=' + sourceId + '] option:selected').attr('suggested');
+ if( suggestedValues ) {
+ var arrValues = new Array();
+ arrValues = suggestedValues.replace(/[//[]+/g, '').replace(/]/g, '').split(', ');
+
+ var suggestedValueSelector = byId(targetId);
+ for( var i = 0; i < arrValues.length; i++ ) {
+ var option = document.createElement("option");
+ var value = jQuery.trim(arrValues[i]);
+ option.value = "'" + value + "'";
+ option.text = value;
+ option.title = value;
+
+ suggestedValueSelector.add(option, null);
+ }
+ }
+}
+
+function insertSingleValue( elementId ) {
+ var element = byId(elementId);
+ insertTextCommon('aggregationCondition', "=" + element.options[element.selectedIndex].value);
+ getConditionDescription();
+}
+
+function insertMultiValues( elementId ) {
+ var list = jQuery('select[id=' + elementId + '] option:selected')
+ if( list.length == 0 ) {
+ return;
+ }
+ if( list.length > 1 ) {
+ var selectedValues = "";
+ list.each(function() {
+ selectedValues += jQuery(this).val() + ", ";
+ });
+ selectedValues = " IN @ " + selectedValues.substring(0, selectedValues.length - 2) + " #";
+
+ insertTextCommon('aggregationCondition', selectedValues);
+ getConditionDescription();
+ }
+ else {
+ insertSingleValue(elementId);
+ }
+}
+
+function getCaseAggConditionByDataset() {
+ $.get('getCaseAggConditionByDataset.action',
+ {
+ dataSetId: getFieldValue('dataSetId')
+ }
+ , function( html ) {
+ setTableStyles();
+ setInnerHTML('list', html);
+ });
+}
+
+function showAddCaseAggregationForm() {
+ window.location.href = 'showAddCaseAggregationForm.action?dataSetId=' + getFieldValue('dataSetId');
+}
+
+function operatorOnchange( operator ) {
+ if( operator == 'sum' || operator == 'avg'
+ || operator == 'min' || operator == 'max' ) {
+ enable('deSumId');
+ }
+ else {
+ disable('deSumId');
+ }
+}
+
+function filterDataElement( event, value, fieldName, backupFieldsName ) {
+ // Remove all options in data element fields
+ var field = jQuery('#' + fieldName + " option ").remove();
+ var valueType = getFieldValue('deValueType');
+
+ jQuery('#' + backupFieldsName + " option ").each(function() {
+ var option = jQuery(this);
+ if( valueType == '' || valueType == option.attr('valueType') ) {
+ if( value.length == 0 ) {
+ jQuery('#' + fieldName).append("<option value='" + option.attr('value') + "' title='" + option.text() + "' suggested='" + option.attr('optionset') + "' valueType='" + option.attr('valueType') + "'>" + option.text() + "</option>");
+ }
+ else if( option.text().toLowerCase().indexOf(value.toLowerCase()) != -1 ) {
+ jQuery('#' + fieldName).append("<option value='" + option.attr('value') + "' title='" + option.text() + "' suggested='" + option.attr('optionset') + "' valueType='" + option.attr('valueType') + "'>" + option.text() + "</option>");
+ }
+ }
+ });
+
+}
+
+function sortByOnChange( sortBy ) {
+ if( sortBy == 1 ) {
+ jQuery('#dataElements').each(function() {
+
+ // Keep track of the selected option.
+ var selectedValue = $(this).val();
+
+ // sort it out
+ $(this).html($("option", $(this)).sort(function( a, b ) {
+ return $(a).attr('dename') == $(b).attr('dename') ? 0 : $(a).attr('dename') < $(b).attr('dename') ? -1 : 1
+ }));
+
+ // Select one option.
+ $(this).val(selectedValue);
+
+ });
+ }
+ else {
+ jQuery('#dataElements').each(function() {
+
+ // Keep track of the selected option.
+ var selectedValue = $(this).val();
+
+ // sort it out
+ $(this).html($("option", $(this)).sort(function( a, b ) {
+ return $(a).attr('decode') == $(b).attr('decode') ? 0 : $(a).attr('decode') < $(b).attr('decode') ? -1 : 1
+ }));
+
+ // Select one option.
+ $(this).val(selectedValue);
+
+ });
+ }
+}
+
+function displayNameOnChange( displayName ) {
+ // display - name
+ if( displayName == '1' ) {
+ jQuery('#dataElements option').each(function() {
+ var item = jQuery(this);
+ item[0].text = item.attr('dename');
+ item[0].title = item[0].text;
+ });
+ jQuery('#dataElementBackups option').each(function() {
+ var item = jQuery(this);
+ item[0].text = item.attr('dename');
+ });
+ }
+ // display - code
+ else if( displayName == '2' ) {
+ jQuery('#dataElements option').each(function() {
+ var item = jQuery(this);
+ item[0].text = item.attr('decode');
+ item[0].title = item[0].text;
+ });
+ jQuery('#dataElementBackups option').each(function() {
+ var item = jQuery(this);
+ item[0].text = item.attr('decode');
+ });
+ }
+ // display - code and name
+ else {
+ jQuery('#dataElements option').each(function() {
+ var item = jQuery(this);
+ item[0].text = "(" + item.attr('decode') + ") " + item.attr('dename');
+ item[0].title = item[0].text;
+ });
+ jQuery('#dataElementBackups option').each(function() {
+ var item = jQuery(this);
+ item[0].text = "(" + item.attr('decode') + ") " + item.attr('dename');
+ });
+ }
+}
+
+function cancelOnClick() {
+ var dataSetId = getFieldValue("dataSets");
+ window.location.href = 'caseAggregation.action?dataSetId=' + dataSetId;
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientAttribute.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientAttribute.js 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientAttribute.js 2013-12-17 01:29:04 +0000
@@ -1,10 +1,21 @@
+
+$(function() {
+ dhis2.contextmenu.makeContextMenu({
+ menuId: 'contextMenu',
+ menuItemActiveClass: 'contextMenuItemActive'
+ });
+});
+
// -----------------------------------------------------------------------------
// View details
// -----------------------------------------------------------------------------
-function showPatientAttributeDetails( patientAttributeId )
-{
- jQuery.getJSON( 'getPatientAttribute.action', { id: patientAttributeId },
+function showUpdatePatientAttributeForm( context ) {
+ location.href = 'showUpdatePatientAttributeForm.action?id=' + context.id;
+}
+
+function showPatientAttributeDetails( context ) {
+ jQuery.getJSON( 'getPatientAttribute.action', { id: context.id },
function ( json ) {
setInnerHTML( 'nameField', json.patientAttribute.name );
setInnerHTML( 'descriptionField', json.patientAttribute.description );
@@ -37,9 +48,9 @@
// Remove Patient Attribute
// -----------------------------------------------------------------------------
-function removePatientAttribute( patientAttributeId, name )
+function removePatientAttribute( context )
{
- removeItem( patientAttributeId, name, i18n_confirm_delete, 'removePatientAttribute.action' );
+ removeItem( context.id, context.name, i18n_confirm_delete, 'removePatientAttribute.action' );
}
ATTRIBUTE_OPTION =
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientAttributeGroup.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientAttributeGroup.js 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientAttributeGroup.js 2013-12-17 01:29:04 +0000
@@ -1,24 +1,33 @@
+$(function() {
+ dhis2.contextmenu.makeContextMenu({
+ menuId: 'contextMenu',
+ menuItemActiveClass: 'contextMenuItemActive'
+ });
+});
+
// -----------------------------------------------------------------------------
// View details
// -----------------------------------------------------------------------------
-function showPatientAttributeGroupDetails( patientAttributeGroupId )
-{
- jQuery.getJSON( 'getPatientAttributeGroup.action', { id: patientAttributeGroupId },
- function ( json ) {
- setInnerHTML( 'nameField', json.patientAttributeGroup.name );
- setInnerHTML( 'descriptionField', json.patientAttributeGroup.description );
- setInnerHTML( 'noAttributeField', json.patientAttributeGroup.noAttribute );
-
- showDetails();
- });
+function showUpdatePatientAttributeGroupForm( context ) {
+ location.href = 'showUpdatePatientAttributeGroupForm.action?id=' + context.id;
+}
+
+function showPatientAttributeGroupDetails( context ) {
+ jQuery.getJSON('getPatientAttributeGroup.action', { id: context.id },
+ function( json ) {
+ setInnerHTML('nameField', json.patientAttributeGroup.name);
+ setInnerHTML('descriptionField', json.patientAttributeGroup.description);
+ setInnerHTML('noAttributeField', json.patientAttributeGroup.noAttribute);
+
+ showDetails();
+ });
}
// -----------------------------------------------------------------------------
// Remove Patient Attribute
// -----------------------------------------------------------------------------
-function removePatientAttributeGroup( patientAttributeGroupId, name )
-{
- removeItem( patientAttributeGroupId, name, i18n_confirm_delete, 'removePatientAttributeGroup.action' );
-}
\ No newline at end of file
+function removePatientAttributeGroup( context ) {
+ removeItem(context.id, context.name, i18n_confirm_delete, 'removePatientAttributeGroup.action');
+}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientIdentifierType.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientIdentifierType.js 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientIdentifierType.js 2013-12-17 01:29:04 +0000
@@ -1,48 +1,54 @@
+$(function() {
+ dhis2.contextmenu.makeContextMenu({
+ menuId: 'contextMenu',
+ menuItemActiveClass: 'contextMenuItemActive'
+ });
+});
+
// -----------------------------------------------------------------------------
// View details
// -----------------------------------------------------------------------------
-function showPatientIdentifierTypeDetails( patientIdentifierTypeId )
-{
- jQuery.getJSON( 'getPatientIdentifierType.action', { id: patientIdentifierTypeId },
- function ( json ) {
- setInnerHTML( 'nameField', json.patientIdentifierType.name );
- setInnerHTML( 'descriptionField', json.patientIdentifierType.description );
-
- var boolValueMap = { 'true':i18n_yes, 'false':i18n_no };
- var boolType = json.patientIdentifierType.mandatory;
- setInnerHTML( 'mandatoryField', boolValueMap[boolType] );
-
- boolType = json.patientIdentifierType.related;
- setInnerHTML( 'relatedField', boolValueMap[boolType] );
- setInnerHTML( 'noCharsField', json.patientIdentifierType.noChars );
-
- var valueTypeMap = { 'string':i18n_string, 'number':i18n_number, 'letter':i18n_letter_only, 'orgunitCount': i18n_orgunit_count };
- var valueType = json.patientIdentifierType.type;
- setInnerHTML( 'typeField', valueTypeMap[valueType] );
-
- showDetails();
- });
+function showUpdatePatientIdentifierTypeForm( context ) {
+ location.href = 'showUpdatePatientIdentifierTypeForm.action?id=' + context.id;
+}
+
+function showPatientIdentifierTypeDetails( context ) {
+ jQuery.getJSON('getPatientIdentifierType.action', { id: context.id },
+ function( json ) {
+ setInnerHTML('nameField', json.patientIdentifierType.name);
+ setInnerHTML('descriptionField', json.patientIdentifierType.description);
+
+ var boolValueMap = { 'true': i18n_yes, 'false': i18n_no };
+ var boolType = json.patientIdentifierType.mandatory;
+ setInnerHTML('mandatoryField', boolValueMap[boolType]);
+
+ boolType = json.patientIdentifierType.related;
+ setInnerHTML('relatedField', boolValueMap[boolType]);
+ setInnerHTML('noCharsField', json.patientIdentifierType.noChars);
+
+ var valueTypeMap = { 'string': i18n_string, 'number': i18n_number, 'letter': i18n_letter_only, 'orgunitCount': i18n_orgunit_count };
+ var valueType = json.patientIdentifierType.type;
+ setInnerHTML('typeField', valueTypeMap[valueType]);
+
+ showDetails();
+ });
}
// -----------------------------------------------------------------------------
// Remove Patient Identifier Type
// -----------------------------------------------------------------------------
-function removePatientIdentifierType( patientIdentifierTypeId, name )
-{
- removeItem( patientIdentifierTypeId, name, i18n_confirm_delete, 'removePatientIdentifierType.action' );
+function removePatientIdentifierType( context ) {
+ removeItem(context.id, context.name, i18n_confirm_delete, 'removePatientIdentifierType.action');
}
-function typeOnChange()
-{
- var type = getFieldValue('type');
- if(type=='localId')
- {
- jQuery('[name=localIdField]').show();
- }
- else
- {
- jQuery('[name=localIdField]').hide();
- }
-}
\ No newline at end of file
+function typeOnChange() {
+ var type = getFieldValue('type');
+ if( type == 'localId' ) {
+ jQuery('[name=localIdField]').show();
+ }
+ else {
+ jQuery('[name=localIdField]').hide();
+ }
+}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js 2013-12-17 01:29:04 +0000
@@ -1,456 +1,454 @@
+$(function() {
+ dhis2.contextmenu.makeContextMenu({
+ menuId: 'contextMenu',
+ menuItemActiveClass: 'contextMenuItemActive'
+ });
+});
+
// -----------------------------------------------------------------------------
// View details
// -----------------------------------------------------------------------------
-function showProgramDetails( programId )
-{
- jQuery.getJSON( "getProgram.action", {
- id:programId
- }, function(json){
- setInnerHTML( 'nameField', json.program.name );
- setInnerHTML( 'descriptionField', json.program.description );
-
- var type = i18n_multiple_events_with_registration;
- if( json.program.type == "2" )
- type = i18n_single_event_with_registration;
- else if( json.program.type == "3" )
- type = i18n_single_event_without_registration;
- setInnerHTML( 'typeField', type );
-
- var displayIncidentDate = ( json.program.displayIncidentDate == 'true') ? i18n_yes : i18n_no;
- setInnerHTML( 'displayIncidentDateField', displayIncidentDate );
-
- var ignoreOverdueEvents = ( json.program.ignoreOverdueEvents == 'true') ? i18n_yes : i18n_no;
- setInnerHTML( 'ignoreOverdueEventsField', ignoreOverdueEvents );
-
- var onlyEnrollOnce = ( json.program.onlyEnrollOnce == 'true') ? i18n_yes : i18n_no;
- setInnerHTML( 'onlyEnrollOnceField', onlyEnrollOnce );
-
- var displayOnAllOrgunit= ( json.program.displayOnAllOrgunit == 'true') ? i18n_yes : i18n_no;
- setInnerHTML( 'displayOnAllOrgunitField', displayOnAllOrgunit );
-
- var useBirthDateAsIncidentDate = ( json.program.useBirthDateAsIncidentDate == 'true') ? i18n_yes : i18n_no;
- setInnerHTML( 'useBirthDateAsIncidentDateField', useBirthDateAsIncidentDate );
-
- var useBirthDateAsEnrollmentDate = ( json.program.useBirthDateAsEnrollmentDate == 'true') ? i18n_yes : i18n_no;
- setInnerHTML( 'useBirthDateAsEnrollmentDateField', useBirthDateAsEnrollmentDate );
-
- var selectEnrollmentDatesInFuture= ( json.program.selectEnrollmentDatesInFuture == 'true') ? i18n_yes : i18n_no;
- setInnerHTML( 'selectEnrollmentDatesInFutureField', selectEnrollmentDatesInFuture );
-
- var selectIncidentDatesInFuture= ( json.program.selectIncidentDatesInFuture == 'true') ? i18n_yes : i18n_no;
- setInnerHTML( 'selectIncidentDatesInFutureField', selectIncidentDatesInFuture );
-
- var dataEntryMethod= ( json.program.dataEntryMethod == 'true') ? i18n_yes : i18n_no;
- setInnerHTML( 'dataEntryMethodField', dataEntryMethod );
-
- setInnerHTML( 'dateOfEnrollmentDescriptionField', json.program.dateOfEnrollmentDescription );
- setInnerHTML( 'dateOfIncidentDescriptionField', json.program.dateOfIncidentDescription );
- setInnerHTML( 'programStageCountField', json.program.programStageCount );
- setInnerHTML( 'noAttributesField', json.program.noAttributes );
- setInnerHTML( 'noIdentifierTypesField', json.program.noIdentifierTypes );
-
- showDetails();
- });
+function programIndicatorManagementForm( context ) {
+ location.href = 'programIndicator.action?programId=' + context.id;
+}
+
+function showProgramUserRoleForm( context ) {
+ location.href = 'showProgramUserroleForm.action?id=' + context.id;
+}
+
+function showUpdateProgramForm( context ) {
+ location.href = 'showUpdateProgramForm.action?id=' + context.id;
+}
+
+function programStageManagement( context ) {
+ location.href = 'programStage.action?id=' + context.id;
+}
+
+function programValidationManagement( context ) {
+ location.href = 'programValidation.action?programId=' + context.id;
+}
+
+function defineProgramAssociationsForm( context ) {
+ location.href = 'defineProgramAssociationsForm.action?id=' + context.id;
+}
+
+function showProgramDetails( context ) {
+ jQuery.getJSON("getProgram.action", {
+ id: context.id
+ }, function( json ) {
+ setInnerHTML('nameField', json.program.name);
+ setInnerHTML('descriptionField', json.program.description);
+
+ var type = i18n_multiple_events_with_registration;
+ if( json.program.type == "2" )
+ type = i18n_single_event_with_registration;
+ else if( json.program.type == "3" )
+ type = i18n_single_event_without_registration;
+ setInnerHTML('typeField', type);
+
+ var displayIncidentDate = ( json.program.displayIncidentDate == 'true') ? i18n_yes : i18n_no;
+ setInnerHTML('displayIncidentDateField', displayIncidentDate);
+
+ var ignoreOverdueEvents = ( json.program.ignoreOverdueEvents == 'true') ? i18n_yes : i18n_no;
+ setInnerHTML('ignoreOverdueEventsField', ignoreOverdueEvents);
+
+ var onlyEnrollOnce = ( json.program.onlyEnrollOnce == 'true') ? i18n_yes : i18n_no;
+ setInnerHTML('onlyEnrollOnceField', onlyEnrollOnce);
+
+ var displayOnAllOrgunit = ( json.program.displayOnAllOrgunit == 'true') ? i18n_yes : i18n_no;
+ setInnerHTML('displayOnAllOrgunitField', displayOnAllOrgunit);
+
+ var useBirthDateAsIncidentDate = ( json.program.useBirthDateAsIncidentDate == 'true') ? i18n_yes : i18n_no;
+ setInnerHTML('useBirthDateAsIncidentDateField', useBirthDateAsIncidentDate);
+
+ var useBirthDateAsEnrollmentDate = ( json.program.useBirthDateAsEnrollmentDate == 'true') ? i18n_yes : i18n_no;
+ setInnerHTML('useBirthDateAsEnrollmentDateField', useBirthDateAsEnrollmentDate);
+
+ var selectEnrollmentDatesInFuture = ( json.program.selectEnrollmentDatesInFuture == 'true') ? i18n_yes : i18n_no;
+ setInnerHTML('selectEnrollmentDatesInFutureField', selectEnrollmentDatesInFuture);
+
+ var selectIncidentDatesInFuture = ( json.program.selectIncidentDatesInFuture == 'true') ? i18n_yes : i18n_no;
+ setInnerHTML('selectIncidentDatesInFutureField', selectIncidentDatesInFuture);
+
+ var dataEntryMethod = ( json.program.dataEntryMethod == 'true') ? i18n_yes : i18n_no;
+ setInnerHTML('dataEntryMethodField', dataEntryMethod);
+
+ setInnerHTML('dateOfEnrollmentDescriptionField', json.program.dateOfEnrollmentDescription);
+ setInnerHTML('dateOfIncidentDescriptionField', json.program.dateOfIncidentDescription);
+ setInnerHTML('programStageCountField', json.program.programStageCount);
+ setInnerHTML('noAttributesField', json.program.noAttributes);
+ setInnerHTML('noIdentifierTypesField', json.program.noIdentifierTypes);
+
+ showDetails();
+ });
}
// -----------------------------------------------------------------------------
// Remove Program
// -----------------------------------------------------------------------------
-function removeProgram( programId, name )
-{
- removeItem( programId, name, i18n_confirm_delete, 'removeProgram.action' );
-}
-
-function relationshipTypeOnchange()
-{
- clearListById( 'relationshipSide' );
- var relationshipType = jQuery('#relationshipTypeId option:selected');
- if( relationshipType.val() != "")
- {
- var aIsToB = relationshipType.attr('aIsToB');
- var bIsToA = relationshipType.attr('bIsToA');
-
- var relationshipSide = jQuery("#relationshipFromA");
- relationshipSide.append( '<option value="false">' + aIsToB + '</option>' );
- relationshipSide.append( '<option value="true">' + bIsToA + '</option>' );
- }
-}
-
-function programOnChange()
-{
- var type = getFieldValue('type');
-
- // anonymous
- if(type == "3")
- {
- disable('onlyEnrollOnce');
- disable('dateOfEnrollmentDescription');
- disable("displayIncidentDate");
- disable("dateOfIncidentDescription");
- disable("generatedByEnrollmentDate");
- disable("availablePropertyIds");
- disable('ignoreOverdueEvents');
- hideById('selectedList');
- hideById('programMessageTB');
-
- jQuery("[name=displayed]").attr("disabled", true);
- jQuery("[name=displayed]").removeAttr("checked");
-
- jQuery("[name=nonAnonymous]").hide();
- }
- else{
- enable('onlyEnrollOnce');
- jQuery("[name=displayed]").prop("disabled", false);
- enable("availablePropertyIds");
- enable("generatedByEnrollmentDate");
- enable('dateOfEnrollmentDescription');
- enable("displayIncidentDate");
- enable('ignoreOverdueEvents');
- showById('programMessageTB');
- showById("selectedList");
-
- jQuery("[name=nonAnonymous]").show();
- if( type == 2 ){
- disable('ignoreOverdueEvents');
- disable('onlyEnrollOnce');
- disable('generatedByEnrollmentDate');
- }
-
- if(byId('displayIncidentDate').checked){
- enable("dateOfIncidentDescription");
- }
- else {
- disable("dateOfIncidentDescription");
- }
- }
+function removeProgram( context ) {
+ removeItem(context.id, context.name, i18n_confirm_delete, 'removeProgram.action');
+}
+
+function relationshipTypeOnchange() {
+ clearListById('relationshipSide');
+ var relationshipType = jQuery('#relationshipTypeId option:selected');
+ if( relationshipType.val() != "" ) {
+ var aIsToB = relationshipType.attr('aIsToB');
+ var bIsToA = relationshipType.attr('bIsToA');
+
+ var relationshipSide = jQuery("#relationshipFromA");
+ relationshipSide.append('<option value="false">' + aIsToB + '</option>');
+ relationshipSide.append('<option value="true">' + bIsToA + '</option>');
+ }
+}
+
+function programOnChange() {
+ var type = getFieldValue('type');
+
+ // anonymous
+ if( type == "3" ) {
+ disable('onlyEnrollOnce');
+ disable('dateOfEnrollmentDescription');
+ disable("displayIncidentDate");
+ disable("dateOfIncidentDescription");
+ disable("generatedByEnrollmentDate");
+ disable("availablePropertyIds");
+ disable('ignoreOverdueEvents');
+ hideById('selectedList');
+ hideById('programMessageTB');
+
+ jQuery("[name=displayed]").attr("disabled", true);
+ jQuery("[name=displayed]").removeAttr("checked");
+
+ jQuery("[name=nonAnonymous]").hide();
+ }
+ else {
+ enable('onlyEnrollOnce');
+ jQuery("[name=displayed]").prop("disabled", false);
+ enable("availablePropertyIds");
+ enable("generatedByEnrollmentDate");
+ enable('dateOfEnrollmentDescription');
+ enable("displayIncidentDate");
+ enable('ignoreOverdueEvents');
+ showById('programMessageTB');
+ showById("selectedList");
+
+ jQuery("[name=nonAnonymous]").show();
+ if( type == 2 ) {
+ disable('ignoreOverdueEvents');
+ disable('onlyEnrollOnce');
+ disable('generatedByEnrollmentDate');
+ }
+
+ if( byId('displayIncidentDate').checked ) {
+ enable("dateOfIncidentDescription");
+ }
+ else {
+ disable("dateOfIncidentDescription");
+ }
+ }
}
// -----------------------------------------------------------------------------
// select identifiers / attributes
// -----------------------------------------------------------------------------
-function selectProperties()
-{
- var selectedList = jQuery("#selectedList");
- jQuery("#availablePropertyIds").children().each(function(i, item){
- if( item.selected ){
- html = "<tr class='selected' id='" + item.value + "' ondblclick='unSelectProperties( this )'><td onmousedown='select(event,this)'>" + item.text + "</td>";
- html += "<td align='center'><input type='checkbox' name='displayed' value='" + item.value + "'";
- if( item.value.match("^attr_")=="attr_" )
- {
- html += " style='display:none' ";
- }
- html += "></td></tr>";
- selectedList.append( html );
- jQuery( item ).remove();
- }
- });
-
- if(getFieldValue('type') == "3")
- {
- jQuery("[name=displayed]").attr("disabled", true);
- }
-}
-
-function selectAllProperties()
-{
- var selectedList = jQuery("#selectedList");
- jQuery("#availablePropertyIds").children().each(function(i, item){
- html = "<tr class='selected' id='" + item.value + "' ondblclick='unSelectDataElement( this )'><td onmousedown='select(this)'>" + item.text + "</td>";
- html += "<td align='center'><input type='checkbox' name='displayed' value='" + item.value + "'";
- if( item.value.match("^attr_")=="attr_" )
- {
- html += " style='display:none' ";
- }
- html += "'></td></tr>";
- selectedList.append( html );
- jQuery( item ).remove();
- });
-}
-
-function unSelectProperties()
-{
- var availableList = jQuery("#availablePropertyIds");
- jQuery("#selectedList").find("tr").each( function( i, item ){
- item = jQuery(item);
- if( item.hasClass("selected") )
- {
- availableList.append( "<option value='" + item.attr( "id" ) + "' selected='true'>" + item.find("td:first").text() + "</option>" );
- item.remove();
- }
- });
-}
-
-function unSelectAllProperties()
-{
- var availableList = jQuery("#availablePropertyIds");
- jQuery("#selectedList").find("tr").each( function( i, item ){
- item = jQuery(item);
- availableList.append( "<option value='" + item.attr( "id" ) + "' selected='true'>" + item.find("td:first").text() + "</option>" );
- item.remove();
- });
-}
-
-function select( event, element )
-{
- if ( !getKeyCode( event ) )// Ctrl
- {
- jQuery("#selectedList .selected").removeClass( 'selected' );
- }
-
- element = jQuery( element ).parent();
- if( element.hasClass( 'selected') ) element.removeClass( 'selected' );
- else element.addClass( 'selected' );
-}
-
-function getKeyCode(e)
-{
- var ctrlPressed=0;
-
- if (parseInt(navigator.appVersion)>3) {
-
- var evt = e ? e:window.event;
-
- if (document.layers && navigator.appName=="Netscape"
- && parseInt(navigator.appVersion)==4) {
- // NETSCAPE 4 CODE
- var mString =(e.modifiers+32).toString(2).substring(3,6);
- ctrlPressed =(mString.charAt(1)=="1");
- }
- else {
- // NEWER BROWSERS [CROSS-PLATFORM]
- ctrlPressed=evt.ctrlKey;
- }
- }
- return ctrlPressed;
+function selectProperties() {
+ var selectedList = jQuery("#selectedList");
+ jQuery("#availablePropertyIds").children().each(function( i, item ) {
+ if( item.selected ) {
+ html = "<tr class='selected' id='" + item.value + "' ondblclick='unSelectProperties( this )'><td onmousedown='select(event,this)'>" + item.text + "</td>";
+ html += "<td align='center'><input type='checkbox' name='displayed' value='" + item.value + "'";
+ if( item.value.match("^attr_") == "attr_" ) {
+ html += " style='display:none' ";
+ }
+ html += "></td></tr>";
+ selectedList.append(html);
+ jQuery(item).remove();
+ }
+ });
+
+ if( getFieldValue('type') == "3" ) {
+ jQuery("[name=displayed]").attr("disabled", true);
+ }
+}
+
+function selectAllProperties() {
+ var selectedList = jQuery("#selectedList");
+ jQuery("#availablePropertyIds").children().each(function( i, item ) {
+ html = "<tr class='selected' id='" + item.value + "' ondblclick='unSelectDataElement( this )'><td onmousedown='select(this)'>" + item.text + "</td>";
+ html += "<td align='center'><input type='checkbox' name='displayed' value='" + item.value + "'";
+ if( item.value.match("^attr_") == "attr_" ) {
+ html += " style='display:none' ";
+ }
+ html += "'></td></tr>";
+ selectedList.append(html);
+ jQuery(item).remove();
+ });
+}
+
+function unSelectProperties() {
+ var availableList = jQuery("#availablePropertyIds");
+ jQuery("#selectedList").find("tr").each(function( i, item ) {
+ item = jQuery(item);
+ if( item.hasClass("selected") ) {
+ availableList.append("<option value='" + item.attr("id") + "' selected='true'>" + item.find("td:first").text() + "</option>");
+ item.remove();
+ }
+ });
+}
+
+function unSelectAllProperties() {
+ var availableList = jQuery("#availablePropertyIds");
+ jQuery("#selectedList").find("tr").each(function( i, item ) {
+ item = jQuery(item);
+ availableList.append("<option value='" + item.attr("id") + "' selected='true'>" + item.find("td:first").text() + "</option>");
+ item.remove();
+ });
+}
+
+function select( event, element ) {
+ if( !getKeyCode(event) )// Ctrl
+ {
+ jQuery("#selectedList .selected").removeClass('selected');
+ }
+
+ element = jQuery(element).parent();
+ if( element.hasClass('selected') ) element.removeClass('selected');
+ else element.addClass('selected');
+}
+
+function getKeyCode( e ) {
+ var ctrlPressed = 0;
+
+ if( parseInt(navigator.appVersion) > 3 ) {
+
+ var evt = e ? e : window.event;
+
+ if( document.layers && navigator.appName == "Netscape"
+ && parseInt(navigator.appVersion) == 4 ) {
+ // NETSCAPE 4 CODE
+ var mString = (e.modifiers + 32).toString(2).substring(3, 6);
+ ctrlPressed = (mString.charAt(1) == "1");
+ }
+ else {
+ // NEWER BROWSERS [CROSS-PLATFORM]
+ ctrlPressed = evt.ctrlKey;
+ }
+ }
+ return ctrlPressed;
}
//-----------------------------------------------------------------------------
//Move Table Row Up and Down
//-----------------------------------------------------------------------------
-function moveUpPropertyList()
-{
- var selectedList = jQuery("#selectedList");
+function moveUpPropertyList() {
+ var selectedList = jQuery("#selectedList");
- jQuery("#selectedList").find("tr").each( function( i, item ){
- item = jQuery(item);
- if( item.hasClass("selected") )
- {
- var prev = item.prev('#selectedList tr');
- if (prev.length == 1)
- {
- prev.before(item);
- }
- }
- });
+ jQuery("#selectedList").find("tr").each(function( i, item ) {
+ item = jQuery(item);
+ if( item.hasClass("selected") ) {
+ var prev = item.prev('#selectedList tr');
+ if( prev.length == 1 ) {
+ prev.before(item);
+ }
+ }
+ });
}
-function moveDownPropertyList()
-{
- var selectedList = jQuery("#selectedList");
- var items = new Array();
- jQuery("#selectedList").find("tr").each( function( i, item ){
- items.push(jQuery(item));
- });
-
- for( var i=items.length-1;i>=0;i--)
- {
- var item = items[i];
- if( item.hasClass("selected") )
- {
- var next = item.next('#selectedList tr');
- if (next.length == 1)
- {
- next.after(item);
- }
- }
- }
+function moveDownPropertyList() {
+ var selectedList = jQuery("#selectedList");
+ var items = new Array();
+ jQuery("#selectedList").find("tr").each(function( i, item ) {
+ items.push(jQuery(item));
+ });
+
+ for( var i = items.length - 1; i >= 0; i-- ) {
+ var item = items[i];
+ if( item.hasClass("selected") ) {
+ var next = item.next('#selectedList tr');
+ if( next.length == 1 ) {
+ next.after(item);
+ }
+ }
+ }
}
// --------------------------------------------------------------------
// Generate template message form
// --------------------------------------------------------------------
-function generateTemplateMessageForm()
-{
- var rowId = jQuery('.daysAllowedSendMessage').length + 1;
- var contend = '<tr name="tr' + rowId + '" class="listAlternateRow" >'
- + '<td colspan="2">' + i18n_reminder + ' ' + rowId + '<a href="javascript:removeTemplateMessageForm('+ rowId +')"> ( '+ i18n_remove_reminder + ' )</a></td>'
- + '</tr>'
- + '<tr name="tr' + rowId + '">'
- + '<td><label>' + i18n_send_when_to + '</label></td>'
- + '<td>'
- + '<select id="whenToSend' + rowId + '" name="whenToSend' + rowId + '" class="whenToSend" onchange="whenToSendOnChange(' + rowId + ')" >'
- + '<option value="">' + i18n_days_scheduled + '</option>'
- + '<option value="3">' + i18n_complete_program + '</option>'
- + '<option value="1">' + i18n_program_enrollment + '</option>'
- + '</select>'
- + '</td>'
- + '</tr>'
- + '<tr name="tr' + rowId + '">'
- + '<td><label>' + i18n_date_to_compare + '</label></td>'
- + '<td>'
- + '<select id="dateToCompare' + rowId + '" class="dateToCompare">'
- + '<option value="dateofincident">' + i18n_incident_date + '</option>'
- + '<option value="enrollmentdate">' + i18n_enrollment_date + '</option>'
- + '</select>'
- + '</td>'
- + '</tr>'
- + '<tr name="tr' + rowId + '">'
- + '<td><label>' + i18n_send_message + '</label></td>'
- + '<td>'
- + '<input type="text" onchange="setRealDays(' + rowId + ')" style="width:100px;" realvalue="" id="daysAllowedSendMessage' + rowId + '" name="daysAllowedSendMessage' + rowId + '" class="daysAllowedSendMessage {validate:{required:true,number:true}}"/> '
- + i18n_days
- + ' <select id="time' + rowId + '" name="time' + rowId + '" style="width:100px;" onchange="setRealDays(' + rowId + ')" >'
- + '<option value="1">' + i18n_before + '</option>'
- + '<option value="-1">' + i18n_after + '</option>'
- + '</select> '
- + i18n_scheduled_date
- + ' </td>'
- + '</tr>'
- + '<tr name="tr' + rowId + '">'
- + '<td><label>' + i18n_recipients + '</label></td>'
- + '<td>'
- + '<select id="sendTo' + rowId + '" name="sendTo' + rowId + '" class="sendTo" onchange="onchangeUserGroup('+ rowId +')">'
- + '<option value="1">' + i18n_patient_sms_only + '</option>'
- + '<option value="3">' + i18n_orgunit_phone_number_sms_only + '</option>'
- + '<option value="2">' + i18n_health_worker_assigned_to_person + '</option>'
- + '<option value="4">' + i18n_all_users_at_orgunit + '</option>'
- + '<option value="5">' + i18n_user_group + '</option>'
- + '</select>'
- + '</td>'
- + '/<tr>'
- + '<tr name="tr' + rowId + '" id="tr' + rowId + '">'
- + '<td><label>' + i18n_user_group + '</label></td>'
- + '<td>'
- + program_SMS_reminder_form
- + '</td>'
- + '/<tr>'
- + '<tr name="tr' + rowId + '">'
- + ' <td><label>' + i18n_message_type + '</label></td>'
- + ' <td>'
- + ' <select type="text" id="messageType' + rowId + '" name="messageType' + rowId + '" class="messageType {validate:{required:true,number:true}}" >'
- + ' <option value="1">' + i18n_direct_sms + '</option>'
- + ' <option value="2">' + i18n_message + '</option>'
- + ' <option value="3">' + i18n_both + '</option>'
- + ' </select>'
- + ' </td>'
- + '</tr>'
- + '<tr name="tr' + rowId + '">'
- + '<td>' + i18n_params + '</td>'
- + '<td>'
- + '<select multiple size="4" id="params' + rowId +'" name="params" ondblclick="insertParams(this.value, ' + rowId + ');">'
- + '<option value="{patient-name}">' + i18n_patient_name + '</option>'
- + '<option value="{program-name}">' + i18n_program_name + '</option>'
- + '<option value="{incident-date}">' + i18n_incident_date + '</option>'
- + '<option value="{days-since-incident-date}">' + i18n_days_since_incident_date + '</option>'
- + '<option value="{enrollement-date}">' + i18n_enrollment_date + '</option>'
- + '<option value="{days-since-enrollement-date}">' + i18n_days_since_enrollment_date + '</option>'
- + '<option value="{orgunit-name}">' + i18n_orgunit_name + '</option>'
- + '</select>'
- + '</td>'
- + '</tr>'
- + '<tr name="tr' + rowId + '">'
- + '<td><label>' + i18n_message + '</label></td>'
- + '<td><textarea onkeyup="getMessageLength( ' + rowId + ');" id="templateMessage' + rowId + '" name="templateMessage' + rowId + '" style="width:320px" class="templateMessage {validate:{required:true}}"></textarea></td>'
- + '</tr>'
- + '<tr>'
- + '<td></td>'
- + '<td id="messageLengthTD' + rowId + '"></td>'
- + '</tr>';
-
- jQuery('#programStageMessage').append( contend );
- showHideUserGroup();
-}
-
-function showHideUserGroup()
-{
- jQuery(".sendTo").each( function( i, item ){
- var numb = i+1;
- if( item.value == 5){
- showById( 'tr'+numb );
- }
- else
- hideById ( 'tr'+numb );
- });
-}
-
-function removeTemplateMessageForm( rowId )
-{
- jQuery("[name=tr" + rowId + "]").remove();
-}
-
-function insertParams( paramValue, rowId )
-{
- var templateMessage = paramValue;
- insertTextCommon('templateMessage' + rowId, templateMessage);
- getMessageLength(rowId );
-}
-
-function whenToSendOnChange(index)
-{
- var whenToSend = getFieldValue('whenToSend' + index );
- if(whenToSend==""){
- enable('dateToCompare' + index );
- enable('daysAllowedSendMessage' + index );
- enable('time' + index );
- }
- else{
- disable('dateToCompare' + index );
- disable('daysAllowedSendMessage' + index );
- disable('time' + index );
- }
-}
-
-function getMessageLength(rowId)
-{
- var message = getFieldValue( 'templateMessage' + rowId );
- var length = 0;
- var idx = message.indexOf('{');
- while( idx >=0 ){
- length += message.substr(0,idx).length;
- var end = message.indexOf('}');
- if(end>=0){
- message = message.substr(end + 1, message.length);
- idx = message.indexOf('{');
- }
- }
- length += message.length;
- setInnerHTML('messageLengthTD' + rowId, length + " " + i18n_characters_without_params);
- if( length>=160 )
- {
- jQuery('#templateMessage' + rowId ).attr('maxlength', 160);
- }
- else
- {
- jQuery('#templateMessage' + rowId ).removeAttr('maxlength');
- }
-}
-
-function setRealDays(rowId)
-{
- var daysAllowedSendMessage = jQuery("#daysAllowedSendMessage" + rowId);
- var time = jQuery("#time" + rowId + " option:selected ").val();
- daysAllowedSendMessage.attr("realvalue", time * eval(daysAllowedSendMessage).val());
- var aasdf= 0;
-}
-
-function onchangeUserGroup( id )
-{
- var value = document.getElementById( 'sendTo' + id ).value;
- hideById( 'tr'+id );
-
- if( value=="1" || value=="3" ){
- setFieldValue('messageType' + id , '1');
- disable('messageType' + id );
- }
- else{
- if ( value == "5") {
- showById( 'tr' + id );
- }
- enable ('messageType' + id );
- }
+function generateTemplateMessageForm() {
+ var rowId = jQuery('.daysAllowedSendMessage').length + 1;
+ var contend = '<tr name="tr' + rowId + '" class="listAlternateRow" >'
+ + '<td colspan="2">' + i18n_reminder + ' ' + rowId + '<a href="javascript:removeTemplateMessageForm(' + rowId + ')"> ( ' + i18n_remove_reminder + ' )</a></td>'
+ + '</tr>'
+ + '<tr name="tr' + rowId + '">'
+ + '<td><label>' + i18n_send_when_to + '</label></td>'
+ + '<td>'
+ + '<select id="whenToSend' + rowId + '" name="whenToSend' + rowId + '" class="whenToSend" onchange="whenToSendOnChange(' + rowId + ')" >'
+ + '<option value="">' + i18n_days_scheduled + '</option>'
+ + '<option value="3">' + i18n_complete_program + '</option>'
+ + '<option value="1">' + i18n_program_enrollment + '</option>'
+ + '</select>'
+ + '</td>'
+ + '</tr>'
+ + '<tr name="tr' + rowId + '">'
+ + '<td><label>' + i18n_date_to_compare + '</label></td>'
+ + '<td>'
+ + '<select id="dateToCompare' + rowId + '" class="dateToCompare">'
+ + '<option value="dateofincident">' + i18n_incident_date + '</option>'
+ + '<option value="enrollmentdate">' + i18n_enrollment_date + '</option>'
+ + '</select>'
+ + '</td>'
+ + '</tr>'
+ + '<tr name="tr' + rowId + '">'
+ + '<td><label>' + i18n_send_message + '</label></td>'
+ + '<td>'
+ + '<input type="text" onchange="setRealDays(' + rowId + ')" style="width:100px;" realvalue="" id="daysAllowedSendMessage' + rowId + '" name="daysAllowedSendMessage' + rowId + '" class="daysAllowedSendMessage {validate:{required:true,number:true}}"/> '
+ + i18n_days
+ + ' <select id="time' + rowId + '" name="time' + rowId + '" style="width:100px;" onchange="setRealDays(' + rowId + ')" >'
+ + '<option value="1">' + i18n_before + '</option>'
+ + '<option value="-1">' + i18n_after + '</option>'
+ + '</select> '
+ + i18n_scheduled_date
+ + ' </td>'
+ + '</tr>'
+ + '<tr name="tr' + rowId + '">'
+ + '<td><label>' + i18n_recipients + '</label></td>'
+ + '<td>'
+ + '<select id="sendTo' + rowId + '" name="sendTo' + rowId + '" class="sendTo" onchange="onchangeUserGroup(' + rowId + ')">'
+ + '<option value="1">' + i18n_patient_sms_only + '</option>'
+ + '<option value="3">' + i18n_orgunit_phone_number_sms_only + '</option>'
+ + '<option value="2">' + i18n_health_worker_assigned_to_person + '</option>'
+ + '<option value="4">' + i18n_all_users_at_orgunit + '</option>'
+ + '<option value="5">' + i18n_user_group + '</option>'
+ + '</select>'
+ + '</td>'
+ + '/<tr>'
+ + '<tr name="tr' + rowId + '" id="tr' + rowId + '">'
+ + '<td><label>' + i18n_user_group + '</label></td>'
+ + '<td>'
+ + program_SMS_reminder_form
+ + '</td>'
+ + '/<tr>'
+ + '<tr name="tr' + rowId + '">'
+ + ' <td><label>' + i18n_message_type + '</label></td>'
+ + ' <td>'
+ + ' <select type="text" id="messageType' + rowId + '" name="messageType' + rowId + '" class="messageType {validate:{required:true,number:true}}" >'
+ + ' <option value="1">' + i18n_direct_sms + '</option>'
+ + ' <option value="2">' + i18n_message + '</option>'
+ + ' <option value="3">' + i18n_both + '</option>'
+ + ' </select>'
+ + ' </td>'
+ + '</tr>'
+ + '<tr name="tr' + rowId + '">'
+ + '<td>' + i18n_params + '</td>'
+ + '<td>'
+ + '<select multiple size="4" id="params' + rowId + '" name="params" ondblclick="insertParams(this.value, ' + rowId + ');">'
+ + '<option value="{patient-name}">' + i18n_patient_name + '</option>'
+ + '<option value="{program-name}">' + i18n_program_name + '</option>'
+ + '<option value="{incident-date}">' + i18n_incident_date + '</option>'
+ + '<option value="{days-since-incident-date}">' + i18n_days_since_incident_date + '</option>'
+ + '<option value="{enrollement-date}">' + i18n_enrollment_date + '</option>'
+ + '<option value="{days-since-enrollement-date}">' + i18n_days_since_enrollment_date + '</option>'
+ + '<option value="{orgunit-name}">' + i18n_orgunit_name + '</option>'
+ + '</select>'
+ + '</td>'
+ + '</tr>'
+ + '<tr name="tr' + rowId + '">'
+ + '<td><label>' + i18n_message + '</label></td>'
+ + '<td><textarea onkeyup="getMessageLength( ' + rowId + ');" id="templateMessage' + rowId + '" name="templateMessage' + rowId + '" style="width:320px" class="templateMessage {validate:{required:true}}"></textarea></td>'
+ + '</tr>'
+ + '<tr>'
+ + '<td></td>'
+ + '<td id="messageLengthTD' + rowId + '"></td>'
+ + '</tr>';
+
+ jQuery('#programStageMessage').append(contend);
+ showHideUserGroup();
+}
+
+function showHideUserGroup() {
+ jQuery(".sendTo").each(function( i, item ) {
+ var numb = i + 1;
+ if( item.value == 5 ) {
+ showById('tr' + numb);
+ }
+ else
+ hideById('tr' + numb);
+ });
+}
+
+function removeTemplateMessageForm( rowId ) {
+ jQuery("[name=tr" + rowId + "]").remove();
+}
+
+function insertParams( paramValue, rowId ) {
+ var templateMessage = paramValue;
+ insertTextCommon('templateMessage' + rowId, templateMessage);
+ getMessageLength(rowId);
+}
+
+function whenToSendOnChange( index ) {
+ var whenToSend = getFieldValue('whenToSend' + index);
+ if( whenToSend == "" ) {
+ enable('dateToCompare' + index);
+ enable('daysAllowedSendMessage' + index);
+ enable('time' + index);
+ }
+ else {
+ disable('dateToCompare' + index);
+ disable('daysAllowedSendMessage' + index);
+ disable('time' + index);
+ }
+}
+
+function getMessageLength( rowId ) {
+ var message = getFieldValue('templateMessage' + rowId);
+ var length = 0;
+ var idx = message.indexOf('{');
+ while( idx >= 0 ) {
+ length += message.substr(0, idx).length;
+ var end = message.indexOf('}');
+ if( end >= 0 ) {
+ message = message.substr(end + 1, message.length);
+ idx = message.indexOf('{');
+ }
+ }
+ length += message.length;
+ setInnerHTML('messageLengthTD' + rowId, length + " " + i18n_characters_without_params);
+ if( length >= 160 ) {
+ jQuery('#templateMessage' + rowId).attr('maxlength', 160);
+ }
+ else {
+ jQuery('#templateMessage' + rowId).removeAttr('maxlength');
+ }
+}
+
+function setRealDays( rowId ) {
+ var daysAllowedSendMessage = jQuery("#daysAllowedSendMessage" + rowId);
+ var time = jQuery("#time" + rowId + " option:selected ").val();
+ daysAllowedSendMessage.attr("realvalue", time * eval(daysAllowedSendMessage).val());
+ var aasdf = 0;
+}
+
+function onchangeUserGroup( id ) {
+ var value = document.getElementById('sendTo' + id).value;
+ hideById('tr' + id);
+
+ if( value == "1" || value == "3" ) {
+ setFieldValue('messageType' + id, '1');
+ disable('messageType' + id);
+ }
+ else {
+ if( value == "5" ) {
+ showById('tr' + id);
+ }
+ enable('messageType' + id);
+ }
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programIndicator.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programIndicator.js 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programIndicator.js 2013-12-17 01:29:04 +0000
@@ -1,119 +1,118 @@
+$(function() {
+ dhis2.contextmenu.makeContextMenu({
+ menuId: 'contextMenu',
+ menuItemActiveClass: 'contextMenuItemActive'
+ });
+});
// -----------------------------------------------------------------------------
// View details
// -----------------------------------------------------------------------------
-function showProgramIndicatorDetails( programIndicatorId )
-{
- jQuery.getJSON( 'getProgramIndicator.action', { id: programIndicatorId }, function ( json ) {
- setInnerHTML( 'nameField', json.programIndicator.name );
- setInnerHTML( 'codeField', json.programIndicator.code );
- setInnerHTML( 'descriptionField', json.programIndicator.description );
- setInnerHTML( 'valueTypeField', json.programIndicator.valueType );
- setInnerHTML( 'rootDateField', json.programIndicator.rootDate );
- setInnerHTML( 'expressionField', json.programIndicator.expression );
-
- showDetails();
- });
+function showUpdateProgramIndicator( context ) {
+ location.href = 'showUpdateProgramIndicator.action?id=' + context.id;
+}
+
+function removeIndicator( context ) {
+ removeItem( context.id, context.name, i18n_confirm_delete , 'removeProgramIndicator.action' );
+}
+
+function showProgramIndicatorDetails( context ) {
+ jQuery.getJSON('getProgramIndicator.action', { id: context.id }, function( json ) {
+ setInnerHTML('nameField', json.programIndicator.name);
+ setInnerHTML('codeField', json.programIndicator.code);
+ setInnerHTML('descriptionField', json.programIndicator.description);
+ setInnerHTML('valueTypeField', json.programIndicator.valueType);
+ setInnerHTML('rootDateField', json.programIndicator.rootDate);
+ setInnerHTML('expressionField', json.programIndicator.expression);
+
+ showDetails();
+ });
}
// -----------------------------------------------------------------------------
// Remove Program Indicator
// -----------------------------------------------------------------------------
-function removeProgramIndicator( programIndicatorId, name )
-{
- removeItem( programIndicatorId, name, i18n_confirm_delete, 'removeProgramIndicator.action' );
-}
-
-function getPatientDataElements()
-{
- clearListById( 'dataElements' );
- clearListById( 'deSumId' );
- var programStageId = getFieldValue('programStageId');
-
- jQuery.getJSON( 'getPatientDataElements.action',
- {
- programId:getFieldValue( 'programId' ),
- programStageId:programStageId
- }
- ,function( json )
- {
- if( programStageId!='' ){
- enable('programStageProperty');
- }
- else{
- disable('programStageProperty');
- }
- var dataElements = jQuery('#dataElements');
- var deSumId = jQuery('#deSumId');
- for ( i in json.dataElements )
- {
- if( json.dataElements[i].type=='int' || json.dataElements[i].type=='date' )
- {
- dataElements.append( "<option value='" + json.dataElements[i].id + "' title='" + json.dataElements[i].name + "' suggested='" + json.dataElements[i].optionset + "'>" + json.dataElements[i].name + "</option>" );
- if( json.dataElements[i].type=='int')
- {
- deSumId.append( "<option value='" + json.dataElements[i].id + "' title='" + json.dataElements[i].name + "' suggested='" + json.dataElements[i].optionset + "'>" + json.dataElements[i].name + "</option>" );
- }
- }
- }
-
- });
-}
-
-function insertDataElement( element )
-{
- var programStageId = getFieldValue('programStageId');
- var dataElementId = element.options[element.selectedIndex].value;
-
- insertTextCommon( 'expression', "[DE:" + programStageId + "." + dataElementId + "]" );
- getConditionDescription();
-}
-
-function insertInfo( element, isProgramStageProperty )
-{
- var id = "";
- if( isProgramStageProperty )
- {
- id = getFieldValue('programStageId');
- }
- else
- {
- id = getFieldValue('programId');
- }
-
- value = element.options[element.selectedIndex].value.replace( '*', id );
- insertTextCommon('expression', value );
- getConditionDescription();
-}
-
-function insertOperator( value )
-{
- insertTextCommon('expression', ' ' + value + ' ' );
- getConditionDescription();
-}
-
-function getConditionDescription ()
-{
- $.postJSON( 'getProgramIndicatorDescripttion.action',
- {
- expression:getFieldValue('expression')
- },function (json)
- {
- byId('aggregationDescription').innerHTML = json.message;
- })
-}
-
-function programIndicatorOnChange()
-{
- var valueType = getFieldValue('valueType');
- if(valueType=='int'){
- hideById('rootDateTR');
- disable('rootDate');
- }
- else{
- showById('rootDateTR');
- enable('rootDate');
- }
+function removeProgramIndicator( context ) {
+ removeItem(context.id, context.name, i18n_confirm_delete, 'removeProgramIndicator.action');
+}
+
+function getPatientDataElements() {
+ clearListById('dataElements');
+ clearListById('deSumId');
+ var programStageId = getFieldValue('programStageId');
+
+ jQuery.getJSON('getPatientDataElements.action',
+ {
+ programId: getFieldValue('programId'),
+ programStageId: programStageId
+ }
+ , function( json ) {
+ if( programStageId != '' ) {
+ enable('programStageProperty');
+ }
+ else {
+ disable('programStageProperty');
+ }
+ var dataElements = jQuery('#dataElements');
+ var deSumId = jQuery('#deSumId');
+ for( i in json.dataElements ) {
+ if( json.dataElements[i].type == 'int' || json.dataElements[i].type == 'date' ) {
+ dataElements.append("<option value='" + json.dataElements[i].id + "' title='" + json.dataElements[i].name + "' suggested='" + json.dataElements[i].optionset + "'>" + json.dataElements[i].name + "</option>");
+ if( json.dataElements[i].type == 'int' ) {
+ deSumId.append("<option value='" + json.dataElements[i].id + "' title='" + json.dataElements[i].name + "' suggested='" + json.dataElements[i].optionset + "'>" + json.dataElements[i].name + "</option>");
+ }
+ }
+ }
+
+ });
+}
+
+function insertDataElement( element ) {
+ var programStageId = getFieldValue('programStageId');
+ var dataElementId = element.options[element.selectedIndex].value;
+
+ insertTextCommon('expression', "[DE:" + programStageId + "." + dataElementId + "]");
+ getConditionDescription();
+}
+
+function insertInfo( element, isProgramStageProperty ) {
+ var id = "";
+ if( isProgramStageProperty ) {
+ id = getFieldValue('programStageId');
+ }
+ else {
+ id = getFieldValue('programId');
+ }
+
+ value = element.options[element.selectedIndex].value.replace('*', id);
+ insertTextCommon('expression', value);
+ getConditionDescription();
+}
+
+function insertOperator( value ) {
+ insertTextCommon('expression', ' ' + value + ' ');
+ getConditionDescription();
+}
+
+function getConditionDescription() {
+ $.postJSON('getProgramIndicatorDescripttion.action',
+ {
+ expression: getFieldValue('expression')
+ }, function( json ) {
+ byId('aggregationDescription').innerHTML = json.message;
+ })
+}
+
+function programIndicatorOnChange() {
+ var valueType = getFieldValue('valueType');
+ if( valueType == 'int' ) {
+ hideById('rootDateTR');
+ disable('rootDate');
+ }
+ else {
+ showById('rootDateTR');
+ enable('rootDate');
+ }
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programStage.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programStage.js 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programStage.js 2013-12-17 01:29:04 +0000
@@ -1,3 +1,25 @@
+$(function() {
+ dhis2.contextmenu.makeContextMenu({
+ menuId: 'contextMenu',
+ menuItemActiveClass: 'contextMenuItemActive'
+ });
+});
+
+function removeProgramStage( context ) {
+ removeItem( context.id, context.name, i18n_confirm_delete , 'removeProgramStage.action' );
+}
+
+function showUpdateProgramStageForm( context ) {
+ location.href = 'showUpdateProgramStageForm.action?id=' + context.id;
+}
+
+function viewDataEntryForm( context ) {
+ location.href = 'viewDataEntryForm.action?programStageId=' + context.id;
+}
+
+function programStageSectionList( context ) {
+ location.href = 'programStageSectionList.action?id=' + context.id;
+}
function getStageByProgram( programId )
{
@@ -49,9 +71,9 @@
// View details
// -----------------------------------------------------------------------------
-function showProgramStageDetails( programStageId )
+function showProgramStageDetails( context )
{
- jQuery.getJSON( 'getProgramStage.action', { id: programStageId }, function ( json ) {
+ jQuery.getJSON( 'getProgramStage.action', { id: context.id }, function ( json ) {
setInnerHTML( 'nameField', json.programStage.name );
setInnerHTML( 'descriptionField', json.programStage.description );
setInnerHTML( 'scheduledDaysFromStartField', json.programStage.minDaysFromStart );
=== 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 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programValidation.js 2013-12-17 01:29:04 +0000
@@ -1,224 +1,209 @@
var COLOR_GREEN = '#b9ffb9';
var COLOR_WHITE = '#ffffff'
-jQuery(document).ready( function(){
- validation( 'programValidationForm', function( form ){
- form.submit();
- });
+jQuery(document).ready(function() {
+ validation('programValidationForm', function( form ) {
+ form.submit();
+ });
+
+ dhis2.contextmenu.makeContextMenu({
+ menuId: 'contextMenu',
+ menuItemActiveClass: 'contextMenuItemActive'
+ });
});
// -----------------------------------------------------------------------------
// View details
// -----------------------------------------------------------------------------
-function showProgramValidationDetails ( programValidationId )
-{
- jQuery.getJSON( 'getProgramValidation.action', { validationId: programValidationId }, function ( json ) {
- setInnerHTML( 'descriptionField', json.validation.description );
-
- var operator = json.validation.operator;
- setInnerHTML( 'operatorField', i18nalizeOperator( operator ) );
-
- setInnerHTML( 'leftSideDescriptionField', json.validation.leftSideDescription );
- setInnerHTML( 'leftSideExpressionField', json.validation.leftSideExpression );
- setInnerHTML( 'rightSideDescriptionField', json.validation.rightSideDescription );
- setInnerHTML( 'rightSideExpressionField', json.validation.rightSideExpression );
-
- showDetails();
- });
-}
-
-function i18nalizeOperator( operator )
-{
- if ( operator == "equal_to" )
- {
- return i18n_equal_to;
- }
- else if ( operator == "not_equal_to" )
- {
- return i18n_not_equal_to;
- }
- else if ( operator == "greater_than" )
- {
- return i18n_greater_than;
- }
- else if ( operator == "greater_than_or_equal_to" )
- {
- return i18n_greater_than_or_equal_to;
- }
- else if ( operator == "less_than" )
- {
- return i18n_less_than;
- }
- else if ( operator == "less_than_or_equal_to" )
- {
- return i18n_less_than_or_equal_to;
- }
-
- return null;
+function showUpdateSingleProgramValidationForm( context ) {
+ location.href = 'showUpdateSingleProgramValidationForm.action?validationId=' + context.id;
+}
+
+function showProgramValidationDetails( context ) {
+ jQuery.getJSON('getProgramValidation.action', { validationId: context.id }, function( json ) {
+ setInnerHTML('descriptionField', json.validation.description);
+
+ var operator = json.validation.operator;
+ setInnerHTML('operatorField', i18nalizeOperator(operator));
+
+ setInnerHTML('leftSideDescriptionField', json.validation.leftSideDescription);
+ setInnerHTML('leftSideExpressionField', json.validation.leftSideExpression);
+ setInnerHTML('rightSideDescriptionField', json.validation.rightSideDescription);
+ setInnerHTML('rightSideExpressionField', json.validation.rightSideExpression);
+
+ showDetails();
+ });
+}
+
+function i18nalizeOperator( operator ) {
+ if( operator == "equal_to" ) {
+ return i18n_equal_to;
+ }
+ else if( operator == "not_equal_to" ) {
+ return i18n_not_equal_to;
+ }
+ else if( operator == "greater_than" ) {
+ return i18n_greater_than;
+ }
+ else if( operator == "greater_than_or_equal_to" ) {
+ return i18n_greater_than_or_equal_to;
+ }
+ else if( operator == "less_than" ) {
+ return i18n_less_than;
+ }
+ else if( operator == "less_than_or_equal_to" ) {
+ return i18n_less_than_or_equal_to;
+ }
+
+ return null;
}
// -----------------------------------------------------------------------------
// Remove ProgramValidation
// -----------------------------------------------------------------------------
-function removeProgramValidation( programValidationId, name )
-{
- removeItem( programValidationId, name, i18n_confirm_delete, 'removeProgramValidation.action' );
+function removeProgramValidation( context ) {
+ removeItem(context.id, context.name, i18n_confirm_delete, 'removeProgramValidation.action');
}
//------------------------------------------------------------------------------
// Load data-elements of each program-stage
//------------------------------------------------------------------------------
-function getLeftPrgramStageDataElements()
-{
- clearListById( 'dataElementId' );
-
- var programStage = document.getElementById( 'leftStage' );
- var programStageId = programStage.options[ programStage.selectedIndex ].value;
- if( programStageId == '') return;
-
- jQuery.getJSON( "getPatientDataElements.action", {
- programStageId:programStageId
- }, function(json){
- jQuery( '#dataElementId').append( '<option value="DUE_DATE">' + i18n_due_date + '</option>' );
- jQuery( '#dataElementId').append( '<option value="REPORT_DATE">' + i18n_report_date + '</option>' );
- for ( i in json.dataElements ) {
- var id = '[DE:' + programStageId + '.' + json.dataElements[i].id + ']';
- jQuery( '#dataElementId').append( '<option value="' + id + '">' + json.dataElements[i].name + '</option>' );
- }
- });
+function getLeftPrgramStageDataElements() {
+ clearListById('dataElementId');
+
+ var programStage = document.getElementById('leftStage');
+ var programStageId = programStage.options[ programStage.selectedIndex ].value;
+ if( programStageId == '' ) return;
+
+ jQuery.getJSON("getPatientDataElements.action", {
+ programStageId: programStageId
+ }, function( json ) {
+ jQuery('#dataElementId').append('<option value="DUE_DATE">' + i18n_due_date + '</option>');
+ jQuery('#dataElementId').append('<option value="REPORT_DATE">' + i18n_report_date + '</option>');
+ for( i in json.dataElements ) {
+ var id = '[DE:' + programStageId + '.' + json.dataElements[i].id + ']';
+ jQuery('#dataElementId').append('<option value="' + id + '">' + json.dataElements[i].name + '</option>');
+ }
+ });
}
-function getRightPrgramStageDataElements()
-{
- clearListById( 'rightSideDE' );
-
- var programStage = document.getElementById( 'rightStage' );
- var programStageId = programStage.options[ programStage.selectedIndex ].value;
- if( programStageId == '') return;
-
- jQuery.getJSON( "getPatientDataElements.action", {
- programStageId:programStageId
- }, function(json){
- jQuery( '#dataElementId').append( '<option value="DUE_DATE">' + i18n_due_date + '</option>' );
- jQuery( '#dataElementId').append( '<option value="REPORT_DATE">' + i18n_report_date + '</option>' );
- for ( i in json.dataElements ) {
- var id = '[DE:' + programStageId + '.' + json.dataElements[i].id + ']';
- jQuery( '#rightSideDE').append( '<option value="' + id + '">' + json.dataElements[i].name + '</option>' );
- }
- });
-
+function getRightPrgramStageDataElements() {
+ clearListById('rightSideDE');
+
+ var programStage = document.getElementById('rightStage');
+ var programStageId = programStage.options[ programStage.selectedIndex ].value;
+ if( programStageId == '' ) return;
+
+ jQuery.getJSON("getPatientDataElements.action", {
+ programStageId: programStageId
+ }, function( json ) {
+ jQuery('#dataElementId').append('<option value="DUE_DATE">' + i18n_due_date + '</option>');
+ jQuery('#dataElementId').append('<option value="REPORT_DATE">' + i18n_report_date + '</option>');
+ for( i in json.dataElements ) {
+ var id = '[DE:' + programStageId + '.' + json.dataElements[i].id + ']';
+ jQuery('#rightSideDE').append('<option value="' + id + '">' + json.dataElements[i].name + '</option>');
+ }
+ });
+
}
//------------------------------------------------------------------------------
// Show Left side form for designing
//------------------------------------------------------------------------------
-function editLeftExpression()
-{
- left = true;
-
- $( '#expression' ).val( $( '#leftSideExpression' ).val() );
- $( '#expression-container [id=description]' ).val( $( '#leftSideDescription' ).val() );
- $( '#formulaText' ).text( $( '#leftSideTextualExpression' ).val() );
- $( '#nullIfBlank' ).attr( 'checked', ( $( '#leftSideNullIfBlank' ).val() == 'true' || $( '#leftSideNullIfBlank' ).val() == '' ) );
- setInnerHTML( "exp-descriptionInfo", "" );
- setInnerHTML( "exp-expressionInfo", "" );
- $("#expression-container [id=description]" ).css( "background-color", "#ffffff" );
- $("#expression-container [id=expression]" ).css( "background-color", "#ffffff" );
-
- dialog.dialog("open");
+function editLeftExpression() {
+ left = true;
+
+ $('#expression').val($('#leftSideExpression').val());
+ $('#expression-container [id=description]').val($('#leftSideDescription').val());
+ $('#formulaText').text($('#leftSideTextualExpression').val());
+ $('#nullIfBlank').attr('checked', ( $('#leftSideNullIfBlank').val() == 'true' || $('#leftSideNullIfBlank').val() == '' ));
+ setInnerHTML("exp-descriptionInfo", "");
+ setInnerHTML("exp-expressionInfo", "");
+ $("#expression-container [id=description]").css("background-color", "#ffffff");
+ $("#expression-container [id=expression]").css("background-color", "#ffffff");
+
+ dialog.dialog("open");
}
-function editRightExpression()
-{
- left = false;
-
- $( '#expression' ).val( $( '#rightSideExpression' ).val() );
- $( '#expression-container [id=description]' ).val( $( '#rightSideDescription' ).val() );
- $( '#formulaText' ).text( $( '#rightSideTextualExpression' ).val() );
- $( '#nullIfBlank' ).attr( 'checked', ( $( '#rightSideNullIfBlank' ).val() == 'true' || $( '#rightSideNullIfBlank' ).val() == '' ) );
-
- dialog.dialog("open");
+function editRightExpression() {
+ left = false;
+
+ $('#expression').val($('#rightSideExpression').val());
+ $('#expression-container [id=description]').val($('#rightSideDescription').val());
+ $('#formulaText').text($('#rightSideTextualExpression').val());
+ $('#nullIfBlank').attr('checked', ( $('#rightSideNullIfBlank').val() == 'true' || $('#rightSideNullIfBlank').val() == '' ));
+
+ dialog.dialog("open");
}
//------------------------------------------------------------------------------
// Insert formulas
//------------------------------------------------------------------------------
-function insertText( inputAreaName, inputText )
-{
- insertTextCommon( inputAreaName, inputText );
-
- getExpressionText();
+function insertText( inputAreaName, inputText ) {
+ insertTextCommon(inputAreaName, inputText);
+
+ getExpressionText();
}
-function getExpressionText()
-{
- $.postUTF8("getProgramExpressionDescription.action",
- {
- programExpression: $( '#expression' ).val()
- },
- function (data)
- {
- setInnerHTML( "formulaText", data );
- },'html');
+function getExpressionText() {
+ $.postUTF8("getProgramExpressionDescription.action",
+ {
+ programExpression: $('#expression').val()
+ },
+ function( data ) {
+ setInnerHTML("formulaText", data);
+ }, 'html');
}
var left = true;
-function insertExpression()
-{
- var expression = $( '#expression' ).val();
- var description = $( '#expression-container [id=description]' ).val();
-
- if ( left )
- {
- $( '#leftSideExpression' ).val( expression );
- $( '#leftSideDescription' ).val( description );
- $( '#leftSideTextualExpression' ).val( $( '#formulaText' ).text() );
- $( '#leftSideNullIfBlank' ).val( $( '#nullIfBlank' ).is( ':checked' ) );
- }
- else
- {
- $( '#rightSideExpression' ).val( expression );
- $( '#rightSideDescription' ).val( description );
- $( '#rightSideTextualExpression' ).val( $( '#formulaText' ).text() );
- $( '#rightSideNullIfBlank' ).val( $( '#nullIfBlank' ).is( ':checked' ) );
- }
-
- dialog.dialog( "close" );
-}
-
-function validateExpression()
-{
- if ( checkNotEmpty( jQuery( "#expression-container [id=description]" ), i18n_description_not_null ) == false )
- return;
- if ( checkNotEmpty( jQuery( "#expression-container [id=expression]" ), i18n_expression_not_null ) == false )
- return;
- insertExpression();
-}
-
-function checkNotEmpty( field, message )
-{
- if ( field.val().length == 0 )
- {
- setInnerHTML( "exp-" + field.attr("name") + "Info", message );
- $('#expression-container [id=' + field.attr("name") + "]" ).css( "background-color", "#ffc5c5" );
- return false;
- } else
- {
- setInnerHTML( "exp-" + field.attr("name") + "Info", '' );
- $('#expression-container [id=' + field.attr("name") + "]" ).css( "background-color", "#ffffff" );
- }
-
- return true;
-}
-
-function clearSearchText()
-{
- setFieldValue('filter', '');
- filterList( '', 'dataElementId' )
+function insertExpression() {
+ var expression = $('#expression').val();
+ var description = $('#expression-container [id=description]').val();
+
+ if( left ) {
+ $('#leftSideExpression').val(expression);
+ $('#leftSideDescription').val(description);
+ $('#leftSideTextualExpression').val($('#formulaText').text());
+ $('#leftSideNullIfBlank').val($('#nullIfBlank').is(':checked'));
+ }
+ else {
+ $('#rightSideExpression').val(expression);
+ $('#rightSideDescription').val(description);
+ $('#rightSideTextualExpression').val($('#formulaText').text());
+ $('#rightSideNullIfBlank').val($('#nullIfBlank').is(':checked'));
+ }
+
+ dialog.dialog("close");
+}
+
+function validateExpression() {
+ if( checkNotEmpty(jQuery("#expression-container [id=description]"), i18n_description_not_null) == false )
+ return;
+ if( checkNotEmpty(jQuery("#expression-container [id=expression]"), i18n_expression_not_null) == false )
+ return;
+ insertExpression();
+}
+
+function checkNotEmpty( field, message ) {
+ if( field.val().length == 0 ) {
+ setInnerHTML("exp-" + field.attr("name") + "Info", message);
+ $('#expression-container [id=' + field.attr("name") + "]").css("background-color", "#ffc5c5");
+ return false;
+ } else {
+ setInnerHTML("exp-" + field.attr("name") + "Info", '');
+ $('#expression-container [id=' + field.attr("name") + "]").css("background-color", "#ffffff");
+ }
+
+ return true;
+}
+
+function clearSearchText() {
+ setFieldValue('filter', '');
+ filterList('', 'dataElementId')
}
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/relationship.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/relationship.js 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/relationship.js 2013-12-17 01:29:04 +0000
@@ -1,84 +1,83 @@
+$(function() {
+ dhis2.contextmenu.makeContextMenu({
+ menuId: 'contextMenu',
+ menuItemActiveClass: 'contextMenuItemActive'
+ });
+});
+
// -----------------------------------------------------------------------------
// View details
// -----------------------------------------------------------------------------
-function showRelationshipTypeDetails( relationshipTypeId )
-{
- jQuery.getJSON( 'getRelationshipType.action', { id: relationshipTypeId }, function ( json ) {
- setInnerHTML( 'aIsToBField', json.relationshipType.aIsToB );
- setInnerHTML( 'bIsToAField', json.relationshipType.bIsToA );
- setInnerHTML( 'descriptionField', json.relationshipType.description );
-
- showDetails();
- });
+function showUpdateRelationshipTypeForm( context ) {
+ location.href = 'showUpdateRelationshipTypeForm.action?id=' + context.id;
+}
+
+function showRelationshipTypeDetails( context ) {
+ jQuery.getJSON('getRelationshipType.action', { id: context.id }, function( json ) {
+ setInnerHTML('aIsToBField', json.relationshipType.aIsToB);
+ setInnerHTML('bIsToAField', json.relationshipType.bIsToA);
+ setInnerHTML('descriptionField', json.relationshipType.description);
+
+ showDetails();
+ });
}
// -----------------------------------------------------------------------------
// Add RelationshipType
// -----------------------------------------------------------------------------
-function validateAddRelationshipType()
-{
- $.postUTF8(
- 'validateRelationshipType.action',
- {
- "aIsToB": getFieldValue( 'aIsToB' ),
- "bIsToA": getFieldValue( 'bIsToA' )
- },
- function( json )
- {
- if ( json.response == "success" )
- {
- var form = document.getElementById( 'addRelationshipTypeForm' );
- form.submit();
- }else if ( json.response == "input" )
- {
- setHeaderMessage( json.message );
- }
- else if ( json.response == "error" )
- {
- setHeaderMessage( json.message );
- }
- }
- );
+function validateAddRelationshipType() {
+ $.postUTF8(
+ 'validateRelationshipType.action',
+ {
+ "aIsToB": getFieldValue('aIsToB'),
+ "bIsToA": getFieldValue('bIsToA')
+ },
+ function( json ) {
+ if( json.response == "success" ) {
+ var form = document.getElementById('addRelationshipTypeForm');
+ form.submit();
+ } else if( json.response == "input" ) {
+ setHeaderMessage(json.message);
+ }
+ else if( json.response == "error" ) {
+ setHeaderMessage(json.message);
+ }
+ }
+ );
}
// -----------------------------------------------------------------------------
// Update RelationshipType
// -----------------------------------------------------------------------------
-function validateUpdateRelationshipType()
-{
- $.postJSON(
- 'validateRelationshipType.action',
- {
- "id": getFieldValue( 'id' ),
- "aIsToB": getFieldValue( 'aIsToB' ),
- "bIsToA": getFieldValue( 'bIsToA' )
- },
- function( json )
- {
- if ( json.response == "success" )
- {
- var form = document.getElementById( 'updateRelationshipTypeForm' );
- form.submit();
- }else if ( json.response == "input" )
- {
- setHeaderMessage( json.message );
- }
- else if ( json.response == "error" )
- {
- setHeaderMessage( json.message );
- }
- }
- );
+function validateUpdateRelationshipType() {
+ $.postJSON(
+ 'validateRelationshipType.action',
+ {
+ "id": getFieldValue('id'),
+ "aIsToB": getFieldValue('aIsToB'),
+ "bIsToA": getFieldValue('bIsToA')
+ },
+ function( json ) {
+ if( json.response == "success" ) {
+ var form = document.getElementById('updateRelationshipTypeForm');
+ form.submit();
+ } else if( json.response == "input" ) {
+ setHeaderMessage(json.message);
+ }
+ else if( json.response == "error" ) {
+ setHeaderMessage(json.message);
+ }
+ }
+ );
}
// -----------------------------------------------------------------------------
// Remove RelationshipType
// -----------------------------------------------------------------------------
-function removeRelationshipType( relationshipTypeId, aIsToB, bIsToA )
-{
- removeItem( relationshipTypeId, aIsToB + "/" + bIsToA, i18n_confirm_delete, 'removeRelationshipType.action' );
+function removeRelationshipType( context ) {
+ removeItem(context.id, context.name, i18n_confirm_delete, 'removeRelationshipType.action');
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/validationcriteria.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/validationcriteria.js 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/validationcriteria.js 2013-12-17 01:29:04 +0000
@@ -1,74 +1,85 @@
+$(function() {
+ dhis2.contextmenu.makeContextMenu({
+ menuId: 'contextMenu',
+ menuItemActiveClass: 'contextMenuItemActive'
+ });
+});
+
+function showProgramsForValidationCriteriaForm( context ) {
+ location.href = 'showProgramsForValidationCriteriaForm.action?criteriaId=' + context.id;
+}
+
+function showUpdateValidationCriteriaForm( context ) {
+ location.href = 'showUpdateValidationCriteriaForm.action?id=' + context.id;
+}
+
// -----------------------------------------------------------------------------
// Remove Criteria
// -----------------------------------------------------------------------------
-function removeCriteria( id, name )
-{
- removeItem( id, name, i18n_confirm_delete, 'removeValidationCriteria.action' );
+function removeCriteria( context ) {
+ removeItem(context.id, context.name, i18n_confirm_delete, 'removeValidationCriteria.action');
}
// -----------------------------------------------------------------------------
// View details
// -----------------------------------------------------------------------------
-function showValidationCriteriaDetails( criteriaId )
-{
- jQuery.getJSON( 'getValidationCriteria.action', { id: criteriaId }, function ( json ) {
- setInnerHTML( 'nameField', json.validationCriteria.name );
- setInnerHTML( 'descriptionField', json.validationCriteria.description );
-
- var property = json.validationCriteria.property;
- var operator = json.validationCriteria.operator;
- var value = json.validationCriteria.value;
-
- // get operator
- if(operator == 0 ){
- operator = '=';
- }else if(operator == -1 ){
- operator = '<';
- }else {
- operator = '>';
- }
-
- setInnerHTML('criteriaField', property + " " + operator + " " + value );
- showDetails();
- });
+function showValidationCriteriaDetails( context ) {
+ jQuery.getJSON('getValidationCriteria.action', { id: context.id }, function( json ) {
+ setInnerHTML('nameField', json.validationCriteria.name);
+ setInnerHTML('descriptionField', json.validationCriteria.description);
+
+ var property = json.validationCriteria.property;
+ var operator = json.validationCriteria.operator;
+ var value = json.validationCriteria.value;
+
+ // get operator
+ if( operator == 0 ) {
+ operator = '=';
+ } else if( operator == -1 ) {
+ operator = '<';
+ } else {
+ operator = '>';
+ }
+
+ setInnerHTML('criteriaField', property + " " + operator + " " + value);
+ showDetails();
+ });
}
// ----------------------------------------------------------------------------------------
// Show div to Add or Update Validation-Criteria
// ----------------------------------------------------------------------------------------
-function showDivValue(){
-
- var propertyName = byId('property').value;
- hideDiv();
- if(propertyName != '')
- {
- hideById('emptyCriteria');
-
- var div = byId(propertyName + 'Div');
- div.style.display = 'block';
- if( propertyName == 'gender' ||
- propertyName == 'dobType' ){
-
- byId('operator').selectedIndex = 1;
- disable('operator');
- }
- else{
- enable('operator');
- }
- }
-}
-
-function hideDiv()
-{
- hideById('genderDiv');
- hideById('integerValueOfAgeDiv');
- hideById('birthDateDiv');
- hideById('dobTypeDiv');
- showById('emptyCriteria');
-}
-
-function fillValue( value ){
- byId('value').value = value;
-}
\ No newline at end of file
+function showDivValue() {
+
+ var propertyName = byId('property').value;
+ hideDiv();
+ if( propertyName != '' ) {
+ hideById('emptyCriteria');
+
+ var div = byId(propertyName + 'Div');
+ div.style.display = 'block';
+ if( propertyName == 'gender' ||
+ propertyName == 'dobType' ) {
+
+ byId('operator').selectedIndex = 1;
+ disable('operator');
+ }
+ else {
+ enable('operator');
+ }
+ }
+}
+
+function hideDiv() {
+ hideById('genderDiv');
+ hideById('integerValueOfAgeDiv');
+ hideById('birthDateDiv');
+ hideById('dobTypeDiv');
+ showById('emptyCriteria');
+}
+
+function fillValue( value ) {
+ byId('value').value = value;
+}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/viewPatientRegistationForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/viewPatientRegistationForm.js 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/viewPatientRegistationForm.js 2013-12-17 01:29:04 +0000
@@ -371,7 +371,17 @@
var htmlCode = "<input " + id + " value=\"[" + value + "]\" title=\"" + value + "\" ";
- var suggestedValue = getFieldValue('suggestedField');
+ var suggestedValue = getFieldValue('genderSelector');
+ if( jQuery('#genderSelector').is(":visible") )
+ {
+ htmlCode += " suggested='" + suggestedValue + "' ";
+ }
+ suggestedValue = getFieldValue('dobTypeSelector');
+ if( jQuery('#dobTypeSelector').is(":visible") )
+ {
+ htmlCode += " suggested='" + suggestedValue + "' ";
+ }
+ suggestedValue = getFieldValue('suggestedField');
if( jQuery('#suggestedField').is(":visible") )
{
htmlCode += " suggested='" + suggestedValue + "' ";
@@ -495,3 +505,19 @@
window.location.href = 'delRegistrationEntryFormAction.action?id=' + getFieldValue('id');
}
}
+
+function suggestionSelectorToggle()
+{
+ hideById('genderSelector');
+ hideById('dobTypeSelector');
+ showById('suggestedField');
+ if( getFieldValue('fixedAttrSelector')=='gender' ){
+ hideById('suggestedField');
+ showById('genderSelector');
+ }
+ else if(getFieldValue('fixedAttrSelector')=='dobType'){
+ hideById('suggestedField');
+ showById('dobTypeSelector');
+ }
+}
+
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttribute.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttribute.vm 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttribute.vm 2013-12-17 01:29:04 +0000
@@ -1,6 +1,15 @@
<h3>$i18n.getString( "patient_attribute_management" ) #openHelp( "patient_attribute" )</h3>
+<div id="contextMenu" class="contextMenu">
+ <ul id="contextMenuItems" class="contextMenuItems">
+ <li><a data-target-fn="showUpdatePatientAttributeForm"><i class="fa fa-edit"></i> $i18n.getString( "edit" )</a></li>
+ <li><a data-target-fn="translateWithContext"><i class="fa fa-globe"></i> $i18n.getString( "translation_translate" )</a></li>
+ <li><a data-target-fn="removePatientAttribute"><i class="fa fa-trash-o"></i> $i18n.getString( "remove" )</a></li>
+ <li><a data-target-fn="showPatientAttributeDetails"><i class="fa fa-info-circle"></i> $i18n.getString( "show_details" )</a></li>
+ </ul>
+</div>
+
<table class="mainPageTable">
<tr>
<td style="vertical-align:top">
@@ -15,43 +24,33 @@
<table class="listTable">
<col>
- <col width="120">
<thead>
<tr>
<th>$i18n.getString( "name" )</th>
- <th colspan="3">$i18n.getString( "operations" )</th>
</tr>
</thead>
<tbody id="list">
- #foreach( $patientAttribute in $patientAttributes )
- <tr id="tr${patientAttribute.id}">
-
- <td onclick="showPatientAttributeDetails( $patientAttribute.id )">$encoder.htmlEncode( $patientAttribute.displayName )</td>
-
- <td style="text-align:center">
- <a href="showUpdatePatientAttributeForm.action?id=$patientAttribute.id" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
- <a href="javascript:translate( 'PatientAttribute', '$patientAttribute.id' )" title="$i18n.getString( 'translation_translate' )"><img src="../images/i18n.png" alt="$i18n.getString( 'translation_translate' )"/></a>
- <a href="javascript:removePatientAttribute( '$patientAttribute.id', '$encoder.jsEncode( $patientAttribute.displayName )' )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
- <a href="javascript:showPatientAttributeDetails( $patientAttribute.id )" title="$i18n.getString( 'show_details' )"><img src="../images/information.png" alt="$i18n.getString( 'show_details' )"></a>
- </td>
-
- </tr>
- #end
-
- </tbody>
-
- </table>
+ #foreach( $patientAttribute in $patientAttributes )
+ <tr id="tr${patientAttribute.id}" data-id="$!patientAttribute.id" data-uid="$!patientAttribute.uid" data-type="PatientAttribute" data-name="$encoder.htmlEncode( $!patientAttribute.displayName )"
+ data-can-manage="$security.canManage( $patientAttribute )"
+ data-can-update="$security.canUpdate( $patientAttribute )"
+ data-can-delete="$security.canDelete( $patientAttribute )">
+ <td>$encoder.htmlEncode( $!patientAttribute.displayName )</td>
+ </tr>
+ #end
+ </tbody>
+ </table>
</td>
+
<td id="detailsData">
-
- <div id="detailsArea">
- <div id="hideDetailsArea">
- <a href="javascript:hideDetails()" title="$i18n.getString( 'hide_details' )"><img src="../images/hide.png" alt="$i18n.getString( 'hide_details' )"></a>
- </div>
- <p><label class="bold">$i18n.getString( "name" ):</label><br><span id="nameField"></span></p>
- <p><label class="bold">$i18n.getString( "description" ):</label><br><span id="descriptionField"></span></p>
- <p><label class="bold">$i18n.getString( "mandatory" ):</label><br><span id="mandatoryField"></span></p>
- <p><label class="bold">$i18n.getString( "inherit" ):</label><br><span id="inheritField"></span></p>
+ <div id="detailsArea">
+ <div id="hideDetailsArea">
+ <a href="javascript:hideDetails()" title="$i18n.getString( 'hide_details' )"><img src="../images/hide.png" alt="$i18n.getString( 'hide_details' )"></a>
+ </div>
+ <p><label class="bold">$i18n.getString( "name" ):</label><br><span id="nameField"></span></p>
+ <p><label class="bold">$i18n.getString( "description" ):</label><br><span id="descriptionField"></span></p>
+ <p><label class="bold">$i18n.getString( "mandatory" ):</label><br><span id="mandatoryField"></span></p>
+ <p><label class="bold">$i18n.getString( "inherit" ):</label><br><span id="inheritField"></span></p>
<p><label class="bold">$i18n.getString( "value_type" ):</label><br><span id="valueTypeField"></span></p>
</div>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttributeGroup.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttributeGroup.vm 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttributeGroup.vm 2013-12-17 01:29:04 +0000
@@ -1,56 +1,59 @@
-
<h3>$i18n.getString( "patient_attribute_group_management" ) #openHelp( "patient_attribute_group" )</h3>
+<div id="contextMenu" class="contextMenu">
+ <ul id="contextMenuItems" class="contextMenuItems">
+ <li><a data-target-fn="showUpdatePatientAttributeGroupForm"><i class="fa fa-edit"></i> $i18n.getString( "edit" )</a></li>
+ <li><a data-target-fn="translateWithContext"><i class="fa fa-globe"></i> $i18n.getString( "translation_translate" )</a></li>
+ <li><a data-target-fn="removePatientAttributeGroup"><i class="fa fa-trash-o"></i> $i18n.getString( "remove" )</a></li>
+ <li><a data-target-fn="showPatientAttributeGroupDetails"><i class="fa fa-info-circle"></i> $i18n.getString( "show_details" )</a></li>
+ </ul>
+</div>
+
<table class="mainPageTable">
<tr>
<td style="vertical-align:top">
-
- <table class="listTable">
- <col>
- <col width="120">
- <tr>
- <td></td>
- <td style="text-align:right">
- <input type="button" value="$i18n.getString( 'add_new' )" onclick="window.location.href='showAddPatientAttributeGroupForm.action'" style="width:75px">
- <input type="button" value="$i18n.getString( 'sort' )" onclick="window.location.href='showSortPatientAttributeGroup.action'" style="width:75px"><br>
- </td>
- </tr>
- <tr>
- <th>$i18n.getString( "name" )</th>
- <th>$i18n.getString( "operations" )</th>
+ <table width="100%">
+ <tr>
+ <td>
+ $i18n.getString( "filter_by_name" ): <input type="text" onkeyup="filterValues( this.value , 1)" style="width:250px"/>
+ </td>
+ <td colspan="3" style="text-align:right">
+ <input type="button" value="$i18n.getString( 'add_new' )" onclick="window.location.href='showAddPatientAttributeGroupForm.action'" style="width:75px">
+ <input type="button" value="$i18n.getString( 'sort' )" onclick="window.location.href='showSortPatientAttributeGroup.action'" style="width:75px"><br>
+ </td>
+ </tr>
+ </table>
+
+ <table class="listTable">
+ <col>
+ <thead>
+ <tr>
+ <th>$i18n.getString( "name" )</th>
+ </tr>
+ </thead>
+ <tbody id="list">
+ #foreach( $patientAttributeGroup in $patientAttributeGroups )
+ <tr id="tr${patientAttributeGroup.id}" data-id="$!patientAttributeGroup.id" data-uid="$!patientAttributeGroup.uid" data-type="PatientAttributeGroup" data-name="$encoder.htmlEncode( $!patientAttributeGroup.displayName )"
+ data-can-manage="$security.canManage( $patientAttributeGroup )"
+ data-can-update="$security.canUpdate( $patientAttributeGroup )"
+ data-can-delete="$security.canDelete( $patientAttributeGroup )">
+ <td>$encoder.htmlEncode( $!patientAttributeGroup.displayName )</td>
</tr>
-
- <tbody id="list">
- #foreach( $patientAttributeGroup in $patientAttributeGroups )
- <tr id="tr${patientAttributeGroup.id}">
-
- <td onclick="showPatientAttributeGroupDetails( $patientAttributeGroup.id )">$encoder.htmlEncode( $patientAttributeGroup.displayName )</td>
-
- <td>
- <a href="showUpdatePatientAttributeGroupForm.action?id=$patientAttributeGroup.id" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
- <a href="javascript:translate( 'PatientAttributeGroup', '$patientAttributeGroup.id' )" title="$i18n.getString( 'translation_translate' )"><img src="../images/i18n.png" alt="$i18n.getString( 'translation_translate' )"/></a>
- <a href="javascript:removePatientAttributeGroup( '$patientAttributeGroup.id', '$encoder.jsEncode( $patientAttributeGroup.name )' )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
- <a href="javascript:showPatientAttributeGroupDetails( $patientAttributeGroup.id )" title="$i18n.getString( 'show_details' )"><img src="../images/information.png" alt="$i18n.getString( 'show_details' )"></a>
- </td>
-
- </tr>
- #end
-
- </tbody>
-
- </table>
+ #end
+ </tbody>
+ </table>
+
</td>
+
<td id="detailsData">
-
- <div id="detailsArea">
- <div id="hideDetailsArea">
- <a href="javascript:hideDetails()" title="$i18n.getString( "hide_details" )"><img src="../images/hide.png" alt="$i18n.getString( 'hide_details' )"></a>
- </div>
- <p><label class="bold">$i18n.getString( "name" )</label><br><span id="nameField"></span></p>
- <p><label class="bold">$i18n.getString( "description" ):</label><br><span id="descriptionField"></span></p>
- <p><label class="bold">$i18n.getString( "number_of_attribute" ):</label><br><span id="noAttributeField"></span></p>
+ <div id="detailsArea">
+ <div id="hideDetailsArea">
+ <a href="javascript:hideDetails()" title="$i18n.getString( "hide_details" )"><img src="../images/hide.png" alt="$i18n.getString( 'hide_details' )"></a>
+ </div>
+ <p><label class="bold">$i18n.getString( "name" )</label><br><span id="nameField"></span></p>
+ <p><label class="bold">$i18n.getString( "description" ):</label><br><span id="descriptionField"></span></p>
+ <p><label class="bold">$i18n.getString( "number_of_attribute" ):</label><br><span id="noAttributeField"></span></p>
</div>
-
</td>
</tr>
</table>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientIdentifierType.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientIdentifierType.vm 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientIdentifierType.vm 2013-12-17 01:29:04 +0000
@@ -1,46 +1,50 @@
<h3>$i18n.getString( "patient_identifier_type_management" ) #openHelp( "patient_identifier_type" )</h3>
+<div id="contextMenu" class="contextMenu">
+ <ul id="contextMenuItems" class="contextMenuItems">
+ <li><a data-target-fn="showUpdatePatientIdentifierTypeForm"><i class="fa fa-edit"></i> $i18n.getString( "edit" )</a></li>
+ <li><a data-target-fn="translateWithContext"><i class="fa fa-globe"></i> $i18n.getString( "translation_translate" )</a></li>
+ <li><a data-target-fn="removePatientIdentifierType"><i class="fa fa-trash-o"></i> $i18n.getString( "remove" )</a></li>
+ <li><a data-target-fn="showPatientIdentifierTypeDetails"><i class="fa fa-info-circle"></i> $i18n.getString( "show_details" )</a></li>
+ </ul>
+</div>
+
<table class="mainPageTable">
<tr>
<td style="vertical-align:top">
-
- <table class="listTable">
- <col>
- <col width="120">
- <tr>
- <td></td>
- <td colspan="4" style="text-align:right"><input type="button" value="$i18n.getString( "add_new" )" onclick="window.location.href='showAddPatientIdentifierTypeForm.action'" style="width:70px"></td>
- </tr>
- <tr>
- <th>$i18n.getString( "name" )</th>
- <th colspan="4">$i18n.getString( "operations" )</th>
- </tr>
-
- <tbody id="list">
- #foreach( $identifierType in $identifierTypes )
- <tr id="tr${identifierType.id}">
-
- <td onclick="showPatientIdentifierTypeDetails( $identifierType.id )">$encoder.htmlEncode( $identifierType.displayName )</td>
-
- <td style="text-align:center"#alternate( $mark )>
- <a href="showUpdatePatientIdentifierTypeForm.action?id=$identifierType.id" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
- <a href="javascript:translate( 'PatientIdentifierType', '$identifierType.id' )" title="$i18n.getString( 'translation_translate' )"><img src="../images/i18n.png" alt="$i18n.getString( 'translation_translate' )"/></a>
- <a href="javascript:removePatientIdentifierType( '$identifierType.id', '$encoder.jsEncode( $identifierType.displayName )' )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
- <a href="javascript:showPatientIdentifierTypeDetails( $identifierType.id )" title="$i18n.getString( 'show_details' )"><img src="../images/information.png" alt="$i18n.getString( 'show_details' )"></a>
- </td>
-
- </tr>
- #end
-
- </tbody>
-
- </table>
+ <table width="100%">
+ <tr>
+ <td>
+ $i18n.getString( "filter_by_name" ): <input type="text" onkeyup="filterValues( this.value , 1)" style="width:250px"/>
+ </td>
+ <td colspan="3" style="text-align:right">
+ <input type="button" value="$i18n.getString( "add_new" )" onclick="window.location.href='showAddPatientIdentifierTypeForm.action'" style="width:70px">
+ </td>
+ </tr>
+ </table>
+
+ <table class="listTable">
+ <tr>
+ <th>$i18n.getString( "name" )</th>
+ </tr>
+
+ <tbody id="list">
+ #foreach( $identifierType in $identifierTypes )
+ <tr id="tr${identifierType.id}" data-id="$!identifierType.id" data-uid="$!identifierType.uid" data-type="PatientIdentifierType" data-name="$encoder.htmlEncode( $!identifierType.displayName )"
+ data-can-manage="$security.canManage( $identifierType )"
+ data-can-update="$security.canUpdate( $identifierType )"
+ data-can-delete="$security.canDelete( $identifierType )">
+ <td>$encoder.htmlEncode( $!identifierType.displayName )</td>
+ </tr>
+ #end
+ </tbody>
+ </table>
</td>
+
<td id="detailsData">
-
- <div id="detailsArea">
- <div id="hideDetailsArea">
+ <div id="detailsArea">
+ <div id="hideDetailsArea">
<a href="javascript:hideDetails()" title="$i18n.getString( 'hide_details' )"><img src="../images/hide.png" alt="$i18n.getString( 'hide_details' )"></a>
</div>
<p><label class="bold">$i18n.getString( "name" ):</label><br><span id="nameField"></span></p>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientRegistrationForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientRegistrationForm.vm 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientRegistrationForm.vm 2013-12-17 01:29:04 +0000
@@ -1,3 +1,9 @@
+<style>
+ .listTable > tbody > tr > td {
+ padding: 8px 0 8px 5px;
+ }
+</style>
+
<h3>$i18n.getString( "patient_registration_form_management" ) #openHelp( "person_registration_form" )</h3>
<table class='mainPageTable'>
@@ -30,7 +36,7 @@
$i18n.getString('no_program')
#set($hasCommonForm = 'true')
#end
- </td>
+ </td>
<td style="text-align:center">
<a href="javascript:updateNewForm($registrationForm.id, '$!registrationForm.program.id')" title="$i18n.getString( 'edit' )"><img src="../images/edit_layout.png" alt="$i18n.getString( 'design_data_entry_form' )"></a>
<a href="javascript:removeRegistrationForm( '$!registrationForm.program.id', '$!encoder.jsEncode( $registrationForm.program.name )')" title="$i18n.getString( "remove" )"><img id='active_$registrationForm.program.id' src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programIndicator.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programIndicator.vm 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programIndicator.vm 2013-12-17 01:29:04 +0000
@@ -1,5 +1,14 @@
<h3>$i18n.getString( "program_indicator_management_form" )</h3>
+<div id="contextMenu" class="contextMenu">
+ <ul id="contextMenuItems" class="contextMenuItems">
+ <li><a data-target-fn="showUpdateProgramIndicator"><i class="fa fa-edit"></i> $i18n.getString( "edit" )</a></li>
+ <li><a data-target-fn="translateWithContext"><i class="fa fa-globe"></i> $i18n.getString( "translation_translate" )</a></li>
+ <li><a data-target-fn="removeIndicator"><i class="fa fa-trash-o"></i> $i18n.getString( "remove" )</a></li>
+ <li><a data-target-fn="showProgramIndicatorDetails"><i class="fa fa-info-circle"></i> $i18n.getString( "show_details" )</a></li>
+ </ul>
+</div>
+
<h4>$program.displayName</h4>
<input type='hidden' id='id' name='id' value='$program.id'>
@@ -16,38 +25,31 @@
<table class="listTable" id="listTable">
<col>
<col>
- <col width="180">
<thead>
<tr>
<th>$i18n.getString( "name" )</th>
<th>$i18n.getString( "description" )</th>
- <th>$i18n.getString( "operations" )</th>
</tr>
</thead>
<tbody id="list">
#set( $mark = false )
#foreach( $programIndicator in $programIndicators )
- <tr id="tr${programIndicator.id}" #alternate( $mark )>
- <td onclick="showProgramIndicatorDetails( $programIndicator.id )">$encoder.htmlEncode( $programIndicator.displayName )</td>
- <td onclick="showProgramIndicatorDetails( $programIndicator.id )">$encoder.htmlEncode( $programIndicator.description )</td>
- <td style="text-align:center"#alternate( $mark )>
- <a href="showUpdateProgramIndicator.action?id=$programIndicator.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
- <a href="javascript:translate( 'ProgramIndicator', '$programIndicator.id' )" title="$i18n.getString( 'translation_translate' )"><img src="../images/i18n.png" alt="$i18n.getString( 'translation_translate' )"/></a>
- <a href="javascript:removeItem( '$programIndicator.id', '$encoder.jsEncode( $programIndicator.displayName )', i18n_confirm_delete , 'removeProgramIndicator.action' )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
- <a href="javascript:showProgramIndicatorDetails( $programIndicator.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( 'show_details' )"></a>
- </td>
+ <tr id="tr${programIndicator.id}" data-id="$!programIndicator.id" data-uid="$!programIndicator.uid" data-type="ProgramIndicator" data-name="$encoder.htmlEncode( $!programIndicator.displayName )"
+ data-can-manage="$security.canManage( $programIndicator )"
+ data-can-update="$security.canUpdate( $programIndicator )"
+ data-can-delete="$security.canDelete( $programIndicator )">
+ <td>$encoder.htmlEncode( $!programIndicator.displayName )</td>
+ <td>$encoder.htmlEncode( $!programIndicator.description )</td>
</tr>
- #set( $mark = !$mark )
#end
</tbody>
</table>
</td>
<td id="detailsData">
-
- <div id="detailsArea">
- <div id="hideDetailsArea">
+ <div id="detailsArea">
+ <div id="hideDetailsArea">
<a href="javascript:hideDetails()" title="$i18n.getString( 'hide_details' )"><img src="../images/hide.png" alt="$i18n.getString( 'hide_details' )"></a>
</div>
<p><label class="bold">$i18n.getString( "name" ):</label><br><span id="nameField"></span></p>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programList.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programList.vm 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programList.vm 2013-12-17 01:29:04 +0000
@@ -2,86 +2,56 @@
<h3>$i18n.getString( "program_management" ) #openHelp( "program" )</h3>
+<div id="contextMenu" class="contextMenu" style="width: 250px;">
+ <ul id="contextMenuItems" class="contextMenuItems">
+ <li data-enabled="canUpdate"><a data-target-fn="defineProgramAssociationsForm"><i class="fa fa-plus"></i> $i18n.getString( "assign_program_to_orgunits" )</a></li>
+ <li data-enabled="canUpdate"><a data-target-fn="showProgramUserRoleForm"><i class="fa fa-plus"></i> $i18n.getString( "assign_program_to_userroles" )</a></li>
+ <li data-enabled="canUpdate"><a data-target-fn="showUpdateProgramForm"><i class="fa fa-edit"></i> $i18n.getString( "edit" )</a></li>
+ <li data-enabled="canUpdate"><a data-target-fn="programStageManagement"><i class="fa fa-edit"></i> $i18n.getString( "view_program_stages" )</a></li>
+ <li data-enabled="canUpdate"><a data-target-fn="programValidationManagement"><i class="fa fa-edit"></i> $i18n.getString( "program_validation_rule_management" )</a></li>
+ <li data-enabled="canManageForm"><a data-target-fn="programIndicatorManagementForm"><i class="fa fa-edit"></i> $i18n.getString( "program_indicator_management_form" )</a></li>
+ <li data-enabled="canManage"><a data-target-fn="showSharingDialogWithContext"><i class="fa fa-share"></i> $i18n.getString( "sharing_settings" )</a></li>
+ <li data-enabled="canUpdate"><a data-target-fn="translateWithContext"><i class="fa fa-globe"></i> $i18n.getString( "translation_translate" )</a></li>
+ <li data-enabled="canDelete"><a data-target-fn="removeProgram"><i class="fa fa-trash-o"></i> $i18n.getString( "remove" )</a></li>
+ <li><a data-target-fn="showProgramDetails"><i class="fa fa-info-circle"></i> $i18n.getString( "show_details" )</a></li>
+ </ul>
+</div>
+
<table class="mainPageTable">
<tr>
- <td align="right"><input type="button" value="$i18n.getString( "add_new" )" onclick="window.location.href='showAddProgramForm.action'" style="width:70px"></td>
+ <td align="right">
+ <input type="button" value="$i18n.getString( "add_new" )" onclick="window.location.href='showAddProgramForm.action'" style="width:70px">
+ </td>
</tr>
+
<tr>
<td style="vertical-align:top">
<table class="listTable" id="listTable">
- <col>
- <col width="300">
- <thead>
+ <col>
+ <thead>
<tr>
<th>$i18n.getString( "name" )</th>
- <th class="{sorter: false}">$i18n.getString( "operations" )</th>
</tr>
</thead>
- <tbody id="list">
- #foreach( $program in $programs )
- <tr id="tr${program.id}">
-
- <td onclick="showProgramDetails( $program.id )">$encoder.htmlEncode( $program.displayName )</td>
-
- <td style="text-align:center">
- <!-- assign orgunit -->
- #if( $security.canUpdate( $program ) )
- <a href="defineProgramAssociationsForm.action?id=$program.id" title="$i18n.getString( 'assign_program_to_orgunits' )"><img src="../images/assign.png" alt="$i18n.getString( 'assign_program_to_orgunits' )"></a>
- #else
- <img src="../images/assign-denied.png">
- #end
-
- #if( $security.canUpdate( $program ) )
- <!-- assign userrole -->
- <a href="showProgramUserroleForm.action?id=$program.id" title="$i18n.getString( 'assign_program_to_userroles' )"><img src="images/userrole.png" alt="$i18n.getString( 'assign_program_to_userroles' )"></a>
- <a href="showUpdateProgramForm.action?id=$program.id" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
- <a href="programStage.action?id=$program.id" title="$i18n.getString( 'view_program_stages' )"><img src="../images/add_section.png" alt="$i18n.getString( 'view_stage_management' )"></a>
- <a href="programValidation.action?programId=$program.id" title="$i18n.getString( 'program_validation_rule_management' )"><img src="../images/assign_b.png" alt="$i18n.getString( 'program_validation_rule_management' )"></a>
- #else
- <img src="images/userrole-defined.png">
- <img src="../images/edit-denied.png">
- <img src="images/programstage-denied.png">
- <img src="../images/assign_b-denied.png">
- #end
-
- #if( $auth.hasAccess( "dhis-web-maintenance-patient", "programIndicator" ) && $program.type !='3' )
- <a href="programIndicator.action?programId=$program.id" title="$i18n.getString( 'program_indicator_management_form' )"><img src="images/indicator.png" ></a>
- #else
- <img src="images/indicator_denied.png">
- #end
-
- #if ( $security.canManage( $program ) )
- <a href="javascript:showSharingDialog('program', '$program.uid');" title="$i18n.getString( 'sharing_settings' )"><img src="../images/relationship.png" alt="$i18n.getString( 'sharing_settings' )"></a>
- #else
- <img src="../images/relationship-denied.png">
- #end
-
- #if( $security.canUpdate( $program ) )
- <a href="javascript:translate( 'Program', '$program.id' )" title="$i18n.getString( 'translation_translate' )"><img src="../images/i18n.png" alt="$i18n.getString( 'translation_translate' )"/></a>
- #else
- <img src="../images/i18n-denied.png">
- #end
-
- #if( $security.canDelete( $program ) )
- <a href="javascript:removeProgram( '$program.id', '$encoder.jsEncode( $program.displayName )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
- #else
- <img src="../images/delete-denied.png">
- #end
-
- <a href="javascript:showProgramDetails( $program.id )" title="$i18n.getString( 'show_details' )"><img src="../images/information.png" alt="$i18n.getString( 'show_details' )"></a>
- </td>
-
- </tr>
- #end
+ <tbody id="list">
+ #foreach( $program in $programs )
+ <tr id="tr${program.id}" data-id="$!program.id" data-uid="$!program.uid" data-type="Program" data-name="$encoder.htmlEncode( $!program.displayName )"
+ data-can-manage="$security.canManage( $program )"
+ data-can-update="$security.canUpdate( $program )"
+ data-can-delete="$security.canDelete( $program )"
+ data-can-manage-form="#if( $auth.hasAccess( "dhis-web-maintenance-patient", "programIndicator" ) && $program.type !='3' )true#{else}false#end">
+ <td>$encoder.htmlEncode( $!program.displayName )</td>
+ </tr>
+ #end
- </tbody>
- </table>
+ </tbody>
+ </table>
</td>
+
<td id="detailsData">
-
- <div id="detailsArea">
- <div id="hideDetailsArea">
+ <div id="detailsArea">
+ <div id="hideDetailsArea">
<a href="javascript:hideDetails()" title="$i18n.getString( "hide_details" )"><img src="../images/hide.png" alt="$i18n.getString( 'hide_details' )"></a>
</div>
<p><label class="bold">$i18n.getString( "name" ):</label><br><span id="nameField"></span></p>
@@ -113,6 +83,6 @@
var i18n_yes = '$encoder.jsEscape( $i18n.getString( "yes" ) , "'" )';
var i18n_no = '$encoder.jsEscape( $i18n.getString( "no" ), "'")';
var i18n_multiple_events_with_registration = '$encoder.jsEscape( $i18n.getString( "multiple_events_with_registration" ) , "'")';
- var i18n_single_event_with_registration = '$encoder.jsEscape( $i18n.getString( "single_event_with_registration" ) , "'")';
- var i18n_single_event_without_registration = '$encoder.jsEscape( $i18n.getString( "single_event_without_registration" ) , "'")';
+ var i18n_single_event_with_registration = '$encoder.jsEscape( $i18n.getString( "single_event_with_registration" ) , "'")';
+ var i18n_single_event_without_registration = '$encoder.jsEscape( $i18n.getString( "single_event_without_registration" ) , "'")';
</script>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programStage.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programStage.vm 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programStage.vm 2013-12-17 01:29:04 +0000
@@ -2,6 +2,17 @@
<h4>$program.displayName</h4>
+<div id="contextMenu" class="contextMenu">
+ <ul id="contextMenuItems" class="contextMenuItems">
+ <li><a data-target-fn="showUpdateProgramStageForm"><i class="fa fa-edit"></i> $i18n.getString( "edit" )</a></li>
+ <li><a data-target-fn="translateWithContext"><i class="fa fa-globe"></i> $i18n.getString( "translation_translate" )</a></li>
+ <li data-enabled="canRemove"><a data-target-fn="removeProgramStage"><i class="fa fa-trash-o"></i> $i18n.getString( "remove" )</a></li>
+ <li><a data-target-fn="showProgramStageDetails"><i class="fa fa-info-circle"></i> $i18n.getString( "show_details" )</a></li>
+ <li><a data-target-fn="programStageSectionList"><i class="fa fa-edit"></i> $i18n.getString( "section_management" )</a></li>
+ <li><a data-target-fn="viewDataEntryForm"><i class="fa fa-edit"></i> $i18n.getString( "design_data_entry_form" )</a></li>
+ </ul>
+</div>
+
<input type='hidden' id='id' name='id' value='$program.id'>
<table class="mainPageTable">
@@ -19,43 +30,31 @@
<table class="listTable" id="listTable">
<col>
<col>
- <col width="180">
<thead>
- <tr>
+ <tr>
<th>$i18n.getString( "name" )</th>
<th>$i18n.getString( "description" )</th>
- <th>$i18n.getString( "operations" )</th>
</tr>
</thead>
<tbody id="list">
- #set( $mark = false )
#foreach( $association in $associations )
- <tr id="tr${association.id}" #alternate( $mark )>
- <td onclick="showProgramStageDetails( $association.id )">$encoder.htmlEncode( $association.displayName )</td>
- <td onclick="showProgramStageDetails( $association.id )">$encoder.htmlEncode( $association.description )</td>
-
- <td style="text-align:center"#alternate( $mark )>
- <a href="showUpdateProgramStageForm.action?id=$association.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
- <a href="javascript:translate( 'ProgramStage', '$association.id' )" title="$i18n.getString( 'translation_translate' )"><img src="../images/i18n.png" alt="$i18n.getString( 'translation_translate' )"/></a>
- #if( $program.type=='1' )
- <a href="javascript:removeItem( '$association.id', '$encoder.jsEncode( $association.name )', i18n_confirm_delete , 'removeProgramStage.action' )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
- #end
- <a href="javascript:showProgramStageDetails( $association.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( 'show_details' )"></a>
- <a href="programStageSectionList.action?id=$association.id" title="$i18n.getString( 'section_management' )"><img src="images/sections.png" alt="$i18n.getString( 'section_management' )"></a>
- <a href="viewDataEntryForm.action?programStageId=$association.id" title="$i18n.getString( "design_data_entry_form" )"><img src="../images/edit_layout.png" alt="$i18n.getString( 'design_data_entry_form' )"></a>
- </td>
+ <tr id="tr${association.id}" data-id="$!association.id" data-uid="$!association.uid" data-type="ProgramStage" data-name="$encoder.htmlEncode( $!association.displayName )"
+ data-can-manage="$security.canManage( $association )"
+ data-can-update="$security.canUpdate( $association )"
+ data-can-delete="$security.canDelete( $association )"
+ data-can-remove="#if( $program.type=='1' )true#{else}false#end">
+ <td>$encoder.htmlEncode( $!association.displayName )</td>
+ <td>$encoder.htmlEncode( $!association.description )</td>
</tr>
- #set( $mark = !$mark )
#end
</tbody>
</table>
</td>
<td id="detailsData">
-
- <div id="detailsArea">
- <div id="hideDetailsArea">
+ <div id="detailsArea">
+ <div id="hideDetailsArea">
<a href="javascript:hideDetails()" title="$i18n.getString( 'hide_details' )"><img src="../images/hide.png" alt="$i18n.getString( 'hide_details' )"></a>
</div>
<p><label class="bold">$i18n.getString( "name" ):</label><br><span id="nameField"></span></p>
=== 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 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programValidationList.vm 2013-12-17 01:29:04 +0000
@@ -2,6 +2,14 @@
<h4>$program.displayName</h4>
+<div id="contextMenu" class="contextMenu">
+ <ul id="contextMenuItems" class="contextMenuItems">
+ <li><a data-target-fn="showUpdateSingleProgramValidationForm"><i class="fa fa-edit"></i> $i18n.getString( "edit" )</a></li>
+ <li><a data-target-fn="removeProgramValidation"><i class="fa fa-trash-o"></i> $i18n.getString( "remove" )</a></li>
+ <li><a data-target-fn="showProgramValidationDetails"><i class="fa fa-info-circle"></i> $i18n.getString( "show_details" )</a></li>
+ </ul>
+</div>
+
<table class="mainPageTable">
<tr>
<td style="vertical-align:top">
@@ -20,37 +28,30 @@
</td>
</tr>
</table>
+
<table class="listTable">
- <col>
- <col width="100">
+ <col>
+ <thead>
<tr>
- <td></td>
- <td></td>
- </tr>
- <tr>
<th>$i18n.getString( "name" )</th>
- <th colspan='2'>$i18n.getString( "operations" )</th>
</tr>
+ </thead>
+ <tbody id="list">
+ #foreach( $validation in $validations )
+ <tr id="tr${validation.id}" data-id="$!validation.id" data-uid="$!validation.uid" data-type="ProgramValidation" data-name="$encoder.htmlEncode( $!validation.displayName )"
+ data-can-manage="$security.canManage( $validation )"
+ data-can-update="$security.canUpdate( $validation )"
+ data-can-delete="$security.canDelete( $validation )">
+ <td>$encoder.htmlEncode( $!validation.displayName )</td>
+ </tr>
+ #end
+ </tbody>
+ </table>
+ </td>
- <tbody id="list">
- #foreach( $validation in $validations )
- <tr id="tr${validation.id}">
-
- <td onclick="showProgramValidationDetails( $validation.id )">$validation.name</td>
- <td>
- <a href="showUpdateSingleProgramValidationForm.action?validationId=$validation.id&id=$program.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
- <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>
- </tr>
- #end
- </tbody>
- </table>
- </td>
<td id="detailsData">
-
- <div id="detailsArea">
- <div id="hideDetailsArea">
+ <div id="detailsArea">
+ <div id="hideDetailsArea">
<a href="javascript:hideDetails()" title="$i18n.getString( 'hide_details' )"><img src="../images/hide.png" alt="$i18n.getString( 'hide_details' )"></a>
</div>
<p><label class="bold">$i18n.getString( "name" ):</label><br><span id="descriptionField"></span></p>
@@ -60,7 +61,6 @@
<p><label class="bold">$i18n.getString( "right_side_description" ):</label><br><span id="rightSideDescriptionField"></span></p>
<p><label class="bold">$i18n.getString( "right_side_expression" ):</label><br><span id="rightSideExpressionField"></span></p>
</div>
-
</td>
</tr>
</table>
@@ -68,13 +68,13 @@
<script type="text/javascript">
var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete_patient_attribute" ) , "'" )';
var i18n_none = '$encoder.jsEscape( $i18n.getString( "none" ), "'")';
- var i18n_yes = '$encoder.jsEscape( $i18n.getString( "yes" ) , "'")';
- var i18n_no = '$encoder.jsEscape( $i18n.getString( "no" ) , "'")';
- var i18n_number = '$encoder.jsEscape( $i18n.getString( "number" ) , "'")';
- var i18n_yes_no = '$encoder.jsEscape( $i18n.getString( "yes_no" ) , "'")';
- var i18n_text = '$encoder.jsEscape( $i18n.getString( "text" ) , "'")';
- var i18n_date = '$encoder.jsEscape( $i18n.getString( "date" ) , "'")';
- var i18n_combo = '$encoder.jsEscape( $i18n.getString( "combo" ) , "'")';
+ var i18n_yes = '$encoder.jsEscape( $i18n.getString( "yes" ) , "'")';
+ var i18n_no = '$encoder.jsEscape( $i18n.getString( "no" ) , "'")';
+ var i18n_number = '$encoder.jsEscape( $i18n.getString( "number" ) , "'")';
+ var i18n_yes_no = '$encoder.jsEscape( $i18n.getString( "yes_no" ) , "'")';
+ var i18n_text = '$encoder.jsEscape( $i18n.getString( "text" ) , "'")';
+ var i18n_date = '$encoder.jsEscape( $i18n.getString( "date" ) , "'")';
+ var i18n_combo = '$encoder.jsEscape( $i18n.getString( "combo" ) , "'")';
var i18n_processing = '$encoder.jsEscape( $i18n.getString( "processing" ) , "'")';
var i18n_done = '$encoder.jsEscape( $i18n.getString( "done" ) , "'")';
var i18n_left_side = '$encoder.jsEscape( $i18n.getString( "left_side" ) , "'")';
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/relationshipType.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/relationshipType.vm 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/relationshipType.vm 2013-12-17 01:29:04 +0000
@@ -1,56 +1,57 @@
<h3>$i18n.getString( "relationship_type_management" ) #openHelp( "relationship_type" )</h3>
+<div id="contextMenu" class="contextMenu">
+ <ul id="contextMenuItems" class="contextMenuItems">
+ <li><a data-target-fn="showUpdateRelationshipTypeForm"><i class="fa fa-edit"></i> $i18n.getString( "edit" )</a></li>
+ <li><a data-target-fn="translateWithContext"><i class="fa fa-globe"></i> $i18n.getString( "translation_translate" )</a></li>
+ <li><a data-target-fn="removeRelationshipType"><i class="fa fa-trash-o"></i> $i18n.getString( "remove" )</a></li>
+ <li><a data-target-fn="showRelationshipTypeDetails"><i class="fa fa-info-circle"></i> $i18n.getString( "show_details" )</a></li>
+ </ul>
+</div>
+
<table class="mainPageTable">
<tr>
<td style="vertical-align:top">
-
- <table class="listTable">
- <col>
- <col>
- <col width="120">
- <tr>
- <td></td>
- <td></td>
- <td colspan="3" style="text-align:right"><input type="button" value="$i18n.getString( "add_new" )" onclick="window.location.href='showAddRelationshipTypeForm.action'" style="width:70px"></td>
- </tr>
- <tr>
- <th>$i18n.getString( "relationship_type" )</th>
- <th>$i18n.getString( "name" )</th>
- <th>$i18n.getString( "operations" )</th>
+ <table width="100%">
+ <tr>
+ <td>
+ $i18n.getString( "filter_by_name" ): <input type="text" onkeyup="filterValues( this.value , 1)" style="width:250px"/>
+ </td>
+ <td colspan="3" style="text-align:right">
+ <input type="button" value="$i18n.getString( "add_new" )" onclick="window.location.href='showAddRelationshipTypeForm.action'" style="width:70px">
+ </td>
+ </tr>
+ </table>
+
+ <table class="listTable">
+ <tr>
+ <th>$i18n.getString( "relationship_type" )</th>
+ <th>$i18n.getString( "name" )</th>
+ </tr>
+ <tbody id="list">
+ #foreach( $relationshipType in $relationshipTypes )
+ <tr id="tr${relationshipType.id}" data-id="$!relationshipType.id" data-uid="$!relationshipType.uid" data-type="RelationshipType" data-name="$encoder.htmlEncode( $relationshipType.aIsToB )/$encoder.htmlEncode( $relationshipType.bIsToA )"
+ data-can-manage="$security.canManage( $relationshipType )"
+ data-can-update="$security.canUpdate( $relationshipType )"
+ data-can-delete="$security.canDelete( $relationshipType )">
+ <td>$encoder.htmlEncode( $relationshipType.aIsToB )/$encoder.htmlEncode( $relationshipType.bIsToA )</td>
+ <td>$encoder.htmlEncode( $!relationshipType.displayName )</td>
</tr>
-
- <tbody id="list">
- #foreach( $relationshipType in $relationshipTypes )
- <tr id="tr${relationshipType.id}">
-
- <td onclick="showRelationshipTypeDetails( $relationshipType.id )">$encoder.htmlEncode( $relationshipType.aIsToB )/$encoder.htmlEncode( $relationshipType.bIsToA )</td>
-
- <td onclick="showRelationshipTypeDetails( $relationshipType.id )">$encoder.htmlEncode( $relationshipType.displayName )</td>
-
- <td style="text-align:center"#alternate( $mark )>
- <a href="showUpdateRelationshipTypeForm.action?id=$relationshipType.id" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
- <a href="javascript:translate( 'RelationshipType', '$relationshipType.id' )" title="$i18n.getString( 'translation_translate' )"><img src="../images/i18n.png" alt="$i18n.getString( 'translation_translate' )"/></a>
- <a href="javascript:removeRelationshipType( '$relationshipType.id', '$encoder.jsEncode( $relationshipType.aIsToB )', '$encoder.jsEncode( $relationshipType.bIsToA )' )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
- <a href="javascript:showRelationshipTypeDetails( $relationshipType.id )" title="$i18n.getString( 'show_details' )"><img src="../images/information.png" alt="$i18n.getString( 'show_details' )"></a>
- </td>
-
- </tr>
- #end
-
- </tbody>
-
+ #end
+ </tbody>
</table>
</td>
+
<td id="detailsData">
- <div id="detailsArea">
- <div id="hideDetailsArea">
- <a href="javascript:hideDetails()" title="$i18n.getString( 'hide_details' )"><img src="../images/hide.png" alt="$i18n.getString( 'hide_details' )"></a>
- </div>
- <p><label class="bold">$i18n.getString( "a_is_to_b" ):</label><br><span id="aIsToBField"></span></p>
- <p><label class="bold">$i18n.getString( "b_is_to_a" ):</label><br><span id="bIsToAField"></span></p>
- <p><label class="bold">$i18n.getString( "description" ):</label><br><span id="descriptionField"></span></p>
- </div>
+ <div id="detailsArea">
+ <div id="hideDetailsArea">
+ <a href="javascript:hideDetails()" title="$i18n.getString( 'hide_details' )"><img src="../images/hide.png" alt="$i18n.getString( 'hide_details' )"></a>
+ </div>
+ <p><label class="bold">$i18n.getString( "a_is_to_b" ):</label><br><span id="aIsToBField"></span></p>
+ <p><label class="bold">$i18n.getString( "b_is_to_a" ):</label><br><span id="bIsToAField"></span></p>
+ <p><label class="bold">$i18n.getString( "description" ):</label><br><span id="descriptionField"></span></p>
+ </div>
</td>
</tr>
</table>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateCaseAggregation.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateCaseAggregation.vm 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateCaseAggregation.vm 2013-12-17 01:29:04 +0000
@@ -9,7 +9,7 @@
<h3>$i18n.getString( "edit_aggregation_query_builder" )</h3>
-<form id="updateCaseAggregationForm" action="updateCaseAggregation.action" method="post" onsubmit='setFieldValue("dataSetId",getFieldValue("dataSets") );' >
+<form id="updateCaseAggregationForm" action="updateCaseAggregation.action" method="post" onsubmit='setFieldValue("dataSetId",getFieldValue("dataSets") );' class="inputForm">
<input type='hidden' id='id' name='id' value='$caseAggregation.id'>
<input type='hidden' id='dataSetId' name='dataSetId' value='$dataSet.id'>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttibuteForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttibuteForm.vm 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttibuteForm.vm 2013-12-17 01:29:04 +0000
@@ -2,7 +2,7 @@
<h3>$i18n.getString( "edit_patient_attribute" )</h3>
-<form id="updatePatientAttributeForm" name="updatePatientAttributeForm" action="updatePatientAttribute.action" method="post" >
+<form id="updatePatientAttributeForm" name="updatePatientAttributeForm" action="updatePatientAttribute.action" method="post" class="inputForm">
<div style="display:inline">
<input type="hidden" id="id" name="id" value="$patientAttribute.id">
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttibuteGroupForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttibuteGroupForm.vm 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttibuteGroupForm.vm 2013-12-17 01:29:04 +0000
@@ -1,7 +1,7 @@
<script type="text/javascript" src="javascript/updatePatientAttributeGroupForm.js"></script>
<h3>$i18n.getString( "edit_patient_attribute_group" )</h3>
-<form id="updatePatientAttributeGroupForm" name="updatePatientAttributeGroupForm" action="updatePatientAttributeGroup.action" method="post" >
+<form id="updatePatientAttributeGroupForm" name="updatePatientAttributeGroupForm" action="updatePatientAttributeGroup.action" method="post" class="inputForm">
<div style="display:inline">
<input type="hidden" id="id" name="id" value="$!patientAttributeGroup.id"/>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientIdentifierType.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientIdentifierType.vm 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientIdentifierType.vm 2013-12-17 01:29:04 +0000
@@ -5,7 +5,7 @@
<h3>$i18n.getString( "edit_patient_identifier_type" )</h3>
-<form id="updatePatientIdentifierTypeForm" action="updatePatientIdentifierType.action" method="post" >
+<form id="updatePatientIdentifierTypeForm" action="updatePatientIdentifierType.action" method="post" class="inputForm">
<input type="hidden" id="id" name="id" value="$patientIdentifierType.id"/>
<table>
<thead>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm 2013-12-17 01:29:04 +0000
@@ -85,7 +85,7 @@
<h3>$i18n.getString( "edit_program" )</h3>
-<form id="updateProgramForm" name="updateProgramForm" action="updateProgram.action" method="post" onsubmit="selectAllById('selectedPropertyIds');" >
+<form id="updateProgramForm" name="updateProgramForm" action="updateProgram.action" method="post" onsubmit="selectAllById('selectedPropertyIds');" class="inputForm">
<select id='daysAllowedSendMessages' name="daysAllowedSendMessages" multiple="multiple" class="hidden"></select>
<select id='templateMessages' name="templateMessages" multiple="multiple" class="hidden"></select>
<select id='datesToCompare' name="datesToCompare" multiple="multiple" class="hidden"></select>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramIndicator.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramIndicator.vm 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramIndicator.vm 2013-12-17 01:29:04 +0000
@@ -13,7 +13,7 @@
<h3>$i18n.getString( "update_program_indicator" )</h3>
-<form id="programIndicatorForm" action="updateProgramIndicator.action" method="post" >
+<form id="programIndicatorForm" action="updateProgramIndicator.action" method="post" class="inputForm">
<input type='hidden' id='programId' name='programId' value='$program.id'>
<input type='hidden' id='id' name='id' value='$programIndicator.id'>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramStageForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramStageForm.vm 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramStageForm.vm 2013-12-17 01:29:04 +0000
@@ -12,7 +12,7 @@
<h4>$programStage.program.displayName</h4>
-<form id="updateProgramStageForm" name="updateProgramStageForm" action="updateProgramStage.action" method="post">
+<form id="updateProgramStageForm" name="updateProgramStageForm" action="updateProgramStage.action" method="post" class="inputForm">
<input type="hidden" id="id" name="id" value="$programStage.id"/>
<input type="hidden" id="programId" name="programId" value="$programStage.program.id"/>
<select id='daysAllowedSendMessages' name="daysAllowedSendMessages" multiple="multiple" class="hidden"></select>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramStageSectionForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramStageSectionForm.vm 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramStageSectionForm.vm 2013-12-17 01:29:04 +0000
@@ -19,7 +19,7 @@
<h4>$programStage.displayName</h4>
-<form id="programStageSectionForm" name="programStageSectionForm" action="updateProgramStageSection.action" method="post">
+<form id="programStageSectionForm" name="programStageSectionForm" action="updateProgramStageSection.action" method="post" class="inputForm">
<input type="hidden" id="programStageId" name="programStageId" value="$programStage.id"/>
<input type="hidden" id="id" name="id" value="$section.id"/>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateRelationshipTypeForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateRelationshipTypeForm.vm 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateRelationshipTypeForm.vm 2013-12-17 01:29:04 +0000
@@ -2,7 +2,7 @@
<h3>$i18n.getString( "edit_relationship_type" )</h3>
-<form id="updateRelationshipTypeForm" name="updateRelationshipTypeForm" action="updateRelationshipType.action" method="post">
+<form id="updateRelationshipTypeForm" name="updateRelationshipTypeForm" action="updateRelationshipType.action" method="post" class="inputForm">
<input type="hidden" id="id" name="id" value="$relationshipType.id"/>
=== modified 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 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateSingleProgramValidationForm.vm 2013-12-17 01:29:04 +0000
@@ -2,7 +2,7 @@
<h4>$validation.program.displayName</h4>
-<form id='programValidationForm' name='programValidationForm' method='post' action='updateProgramValidation.action'>
+<form id='programValidationForm' name='programValidationForm' method='post' action='updateProgramValidation.action' class="inputForm">
<input type='hidden' id='id' name='id' value='$validation.id'>
<input type='hidden' id='programId' name='programId' value='$validation.program.id'>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateValidationCriteria.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateValidationCriteria.vm 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateValidationCriteria.vm 2013-12-17 01:29:04 +0000
@@ -2,7 +2,7 @@
<h3>$i18n.getString( "edit_validation_criteria" )</h3>
-<form id="validationCriteriaForm" action="updateValidationCriteria.action" method="post" >
+<form id="validationCriteriaForm" action="updateValidationCriteria.action" method="post" class="inputForm">
<table>
<input type='hidden' id='id' name='id' value='$validationCriteria.id'/>
<tr>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/validationCriteria.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/validationCriteria.vm 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/validationCriteria.vm 2013-12-17 01:29:04 +0000
@@ -1,5 +1,15 @@
<h3>$i18n.getString( "validation_criteria_management" ) #openHelp( "validation_criteria" )</h3>
+<div id="contextMenu" class="contextMenu" style="width: 210px;">
+ <ul id="contextMenuItems" class="contextMenuItems">
+ <li><a data-target-fn="showProgramsForValidationCriteriaForm"><i class="fa fa-plus"></i> $i18n.getString( "assign_validation_for_programs" )</a></li>
+ <li><a data-target-fn="showUpdateValidationCriteriaForm"><i class="fa fa-edit"></i> $i18n.getString( "edit" )</a></li>
+ <li><a data-target-fn="translateWithContext"><i class="fa fa-globe"></i> $i18n.getString( "translation_translate" )</a></li>
+ <li><a data-target-fn="removeCriteria"><i class="fa fa-trash-o"></i> $i18n.getString( "remove" )</a></li>
+ <li><a data-target-fn="showValidationCriteriaDetails"><i class="fa fa-info-circle"></i> $i18n.getString( "show_details" )</a></li>
+ </ul>
+</div>
+
<table class="mainPageTable">
<tr>
<td style="vertical-align:top">
@@ -18,29 +28,24 @@
<thead>
<tr>
<th>$i18n.getString('name')</th>
- <th style="width:140px;" class="{sorter: false}">$i18n.getString('operator')</th>
</tr>
</thead>
<tbody id="list">
#foreach($criteria in $criterias)
- <tr id="tr${criteria.id}">
- <td onclick="javascript:showValidationCriteriaDetails( '$criteria.id' )">$criteria.displayName</td>
- <td>
- <a href="showProgramsForValidationCriteriaForm.action?criteriaId=$criteria.id" title="$i18n.getString( 'assign_validation_for_programs' )"><img src="../images/assign.png" alt="$i18n.getString( 'assign_validation_for_programs' )"></a>
- <a href="showUpdateValidationCriteriaForm.action?id=$criteria.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
- <a href="javascript:translate( 'ValidationCriteria', '$criteria.id' )" title="$i18n.getString( 'translation_translate' )"><img src="../images/i18n.png" alt="$i18n.getString( 'translation_translate' )"/></a>
- <a href="javascript:removeCriteria( '$criteria.id', '$encoder.jsEncode( $criteria.displayName )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
- <a href="javascript:showValidationCriteriaDetails( '$criteria.id' )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( 'show_details' )"></a>
- </td>
+ <tr id="tr${criteria.id}" data-id="$!criteria.id" data-uid="$!criteria.uid" data-type="ValidationCriteria" data-name="$encoder.htmlEncode( $!criteria.displayName )"
+ data-can-manage="$security.canManage( $criteria )"
+ data-can-update="$security.canUpdate( $criteria )"
+ data-can-delete="$security.canDelete( $criteria )">
+ <td>$encoder.htmlEncode( $!criteria.displayName )</td>
</tr>
#end
</tbody>
</table>
</td>
+
<td id="detailsData">
-
- <div id="detailsArea">
- <div id="hideDetailsArea">
+ <div id="detailsArea">
+ <div id="hideDetailsArea">
<a href="javascript:hideDetails()" title="$i18n.getString( 'hide_details' )"><img src="../images/hide.png" alt="$i18n.getString( 'hide_details' )"></a>
</div>
<p><label class="bold">$i18n.getString( "name" ):</label><br><span id='nameField'></span></p>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewDataEntryForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewDataEntryForm.vm 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewDataEntryForm.vm 2013-12-17 01:29:04 +0000
@@ -66,7 +66,7 @@
</style>
-<form id="saveDataEntryForm" name="saveDataEntryForm" action="saveDataEntryForm.action" method="post">
+<form id="saveDataEntryForm" name="saveDataEntryForm" action="saveDataEntryForm.action" method="post" class="inputForm">
<input type="hidden" name="programStageId" id="programStageId" uid="$!programStage.uid" value="$!programStage.id"/>
<h3>$i18n.getString( "dataentryform_management_for_program_stage" )</h3>
<h4>$programStage.displayName</h4>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewPatientRegistationForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewPatientRegistationForm.vm 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewPatientRegistationForm.vm 2013-12-17 01:29:04 +0000
@@ -48,7 +48,7 @@
}
</style>
-<form id="saveDataEntryForm" name="saveDataEntryForm" action="savePatientRegistrationForm.action" method="get">
+<form id="saveDataEntryForm" name="saveDataEntryForm" action="savePatientRegistrationForm.action" method="get" class="inputForm">
<input type="hidden" name="programId" id="programId" value="$!program.id"/>
<input type="hidden" name="dataEntryFormId" id="dataEntryFormId" value="$!registrationForm.dataEntryForm.id"/>
@@ -119,10 +119,36 @@
</tr>
<tr>
<td>
- <select id="fixedAttrSelector" multiple="multiple" style="width:450px;height:270px" ondblclick="insertElement( 'fixedAttr' )">
+ <select id="fixedAttrSelector" multiple="multiple" style="width:450px;height:270px" onclick='suggestionSelectorToggle()' ondblclick="insertElement( 'fixedAttr' )">
+ <option value="registrationDate">$i18n.getString('registration_date')</option>
+ <option value="fullName">$i18n.getString('full_name')</option>
+ <option value="gender">$i18n.getString('gender')</option>
+ <option value="birthDate">$i18n.getString('birth_date')</option>
+ <option value="age">$i18n.getString('age_years')</option>
<option value="phoneNumber">$i18n.getString('phone_number')</option>
- <option value="associate">$i18n.getString('health_worker')</option>
- </select>
+ <option value="deathDate">$i18n.getString('death_date')</option>
+ <option value="isDead">$i18n.getString('is_dead')</option>
+ <option value="healthWorker">$i18n.getString('health_worker')</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ $i18n.getString("default_value")
+ <input type='text' id='suggestedField' style='width:295px;'>
+ <select style='width:300px;display:none;' id='genderSelector'>
+ <option value="">[$i18n.getString( "please_select" )]</option>
+ <option value="M">$i18n.getString( "male" )</option>
+ <option value="F">$i18n.getString( "female" )</option>
+ <option value="T">$i18n.getString( "transgender" )</option>
+ </select>
+ <select style='width:300px;display:none;' id='dobTypeSelector'>
+ <option value="">[$i18n.getString( "please_select" )]</option>
+ <option value="V">$i18n.getString( "verified" )</option>
+ <option value="D">$i18n.getString( "declared" )</option>
+ <option value="A">$i18n.getString( "approximated" )</option>
+ </select>
+ <input type='checkbox' id='hiddenField'/>$i18n.getString("is_hidden")
</td>
</tr>
</table>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewScheduledCaseAggTasks.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewScheduledCaseAggTasks.vm 2013-12-16 04:39:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewScheduledCaseAggTasks.vm 2013-12-17 01:29:04 +0000
@@ -13,7 +13,7 @@
<input id="isRunning" type="hidden" value="${running}">
-<form id="schedulingForm" action="scheduleCaseAggTasks.action" method="post">
+<form id="schedulingForm" action="scheduleCaseAggTasks.action" method="post" class="inputForm">
<input type='hidden' id='execute' name='execute'/>
<table>