dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #12123
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3644: Load Beneficiary Attribute Group, Identifier Type and Relationship Type modules by ajax ( patient...
------------------------------------------------------------
revno: 3644
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2011-05-18 08:07:51 +0700
message:
Load Beneficiary Attribute Group, Identifier Type and Relationship Type modules by ajax ( patient module ).
added:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttributeGroupList.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/relationshipTypeList.vm
modified:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/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/addRelationshipTypeForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/commons.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/relationship.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/listPatientIdentifierType.vm
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/relationshipType.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/updateRelationshipTypeForm.vm
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml 2011-05-16 06:44:39 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml 2011-05-18 01:07:51 +0000
@@ -22,14 +22,19 @@
<result name="success" type="velocity">/main.vm</result>
<param name="page">/dhis-web-maintenance-patient/relationshipType.vm</param>
<param name="menu">/dhis-web-maintenance-patient/patientAndProgramMenu.vm</param>
- <param name="javascripts">javascript/relationship.js</param>
+ <param name="javascripts">javascript/commons.js,javascript/relationship.js</param>
+ </action>
+
+ <action name="relationshipTypeList"
+ class="org.hisp.dhis.patient.action.relationship.GetRelationshipTypeListAction">
+ <result name="success" type="velocity">/content.vm</result>
+ <param name="page">/dhis-web-maintenance-patient/relationshipTypeList.vm</param>
</action>
<action name="getRelationshipType"
class="org.hisp.dhis.patient.action.relationship.GetRelationshipTypeAction">
<result name="success" type="velocity-xml">
/dhis-web-maintenance-patient/responseRelationshipType.vm</result>
- <param name="onExceptionReturn">plainTextError</param>
</action>
<action name="removeRelationshipType"
@@ -41,32 +46,28 @@
<action name="addRelationshipType"
class="org.hisp.dhis.patient.action.relationship.AddRelationshipTypeAction">
- <result name="success" type="redirect">relationshipType.action
- </result>
+ <result name="success" type="velocity-json">
+ /dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
<param name="requiredAuthorities">F_RELATIONSHIPTYPE_ADD</param>
</action>
<action name="showAddRelationshipTypeForm" class="org.hisp.dhis.patient.action.NoAction">
- <result name="success" type="velocity">/main.vm</result>
+ <result name="success" type="velocity">/content.vm</result>
<param name="page">/dhis-web-maintenance-patient/addRelationshipTypeForm.vm</param>
- <param name="menu">/dhis-web-maintenance-patient/patientAndProgramMenu.vm</param>
- <param name="javascripts">javascript/relationship.js</param>
<param name="requiredAuthorities">F_RELATIONSHIPTYPE_ADD</param>
</action>
<action name="showUpdateRelationshipTypeForm"
class="org.hisp.dhis.patient.action.relationship.GetRelationshipTypeAction">
- <result name="success" type="velocity">/main.vm</result>
+ <result name="success" type="velocity">/content.vm</result>
<param name="page">/dhis-web-maintenance-patient/updateRelationshipTypeForm.vm</param>
- <param name="menu">/dhis-web-maintenance-patient/patientAndProgramMenu.vm</param>
- <param name="javascripts">javascript/relationship.js</param>
<param name="requiredAuthorities">F_PATIENTATTRIBUTE_UPDATE</param>
</action>
<action name="updateRelationshipType"
class="org.hisp.dhis.patient.action.relationship.UpdateRelationshipTypeAction">
- <result name="success" type="redirect">relationshipType.action
- </result>
+ <result name="success" type="velocity-json">
+ /dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
<param name="requiredAuthorities">F_RELATIONSHIPTYPE_UPDATE</param>
</action>
@@ -815,7 +816,13 @@
<result name="success" type="velocity">/main.vm</result>
<param name="page">/dhis-web-maintenance-patient/patientAttributeGroup.vm</param>
<param name="menu">/dhis-web-maintenance-patient/patientAndProgramMenu.vm</param>
- <param name="javascripts">javascript/patientAttributeGroup.js</param>
+ <param name="javascripts">javascript/commons.js,javascript/patientAttributeGroup.js</param>
+ </action>
+
+ <action name="patientAttributeGroupList"
+ class="org.hisp.dhis.patient.action.patientattributegroup.GetPatientAttributeGroupListAction">
+ <result name="success" type="velocity">/content.vm</result>
+ <param name="page">/dhis-web-maintenance-patient/patientAttributeGroupList.vm</param>
</action>
<action name="getPatientAttributeGroup"
@@ -823,7 +830,6 @@
<result name="success" type="velocity-xml">
/dhis-web-maintenance-patient/responsePatientAttributeGroup.vm
</result>
- <param name="onExceptionReturn">plainTextError</param>
</action>
<action name="removePatientAttributeGroup"
@@ -835,34 +841,29 @@
<action name="addPatientAttributeGroup"
class="org.hisp.dhis.patient.action.patientattributegroup.AddPatientAttributeGroupAction">
- <result name="success" type="redirect">patientAttributeGroup.action
- </result>
+ <result name="success" type="velocity-json">
+ /dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
<param name="requiredAuthorities">F_PATIENTATTRIBUTE_ADD</param>
</action>
<action name="showAddPatientAttributeGroupForm"
class="org.hisp.dhis.patient.action.patientattribute.GetPatientAttributesWithdoutGroupAction">
- <result name="success" type="velocity">/main.vm</result>
+ <result name="success" type="velocity">/content.vm</result>
<param name="page">/dhis-web-maintenance-patient/addPatientAttributeGroupForm.vm</param>
- <param name="menu">/dhis-web-maintenance-patient/patientAndProgramMenu.vm</param>
- <param name="javascripts">javascript/patientAttributeGroup.js</param>
- <param name="stylesheets">style/basic.css</param>
<param name="requiredAuthorities">F_PATIENTATTRIBUTE_ADD</param>
</action>
<action name="showUpdatePatientAttributeGroupForm"
class="org.hisp.dhis.patient.action.patientattributegroup.GetPatientAttributeGroupAction">
- <result name="success" type="velocity">/main.vm</result>
+ <result name="success" type="velocity">/content.vm</result>
<param name="page">/dhis-web-maintenance-patient/updatePatientAttibuteGroupForm.vm</param>
- <param name="menu">/dhis-web-maintenance-patient/patientAndProgramMenu.vm</param>
- <param name="javascripts">javascript/patientAttributeGroup.js</param>
<param name="requiredAuthorities">F_PATIENTATTRIBUTE_UPDATE</param>
</action>
<action name="updatePatientAttributeGroup"
class="org.hisp.dhis.patient.action.patientattributegroup.UpdatePatientAttributeGroupAction">
- <result name="success" type="redirect">patientAttributeGroup.action
- </result>
+ <result name="success" type="velocity-json">
+ /dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
<param name="requiredAuthorities">F_PATIENTATTRIBUTE_UPDATE</param>
</action>
@@ -876,14 +877,29 @@
/dhis-web-commons/ajax/jsonResponseInput.vm</result>
<param name="onExceptionReturn">plainTextError</param>
</action>
+
<!-- Patient Identifier Type -->
+ <action name="patientIdentifierType"
+ class="org.hisp.dhis.patient.action.patientidentifiertype.GetPatientIdentifierTypeListAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">
+ /dhis-web-maintenance-patient/patientIdentifierType.vm</param>
+ <param name="menu">/dhis-web-maintenance-patient/patientAndProgramMenu.vm</param>
+ <param name="javascripts">javascript/commons.js,javascript/patientIdentifierType.js</param>
+ </action>
+
+ <action name="patientIdentifierTypeList"
+ class="org.hisp.dhis.patient.action.patientidentifiertype.GetPatientIdentifierTypeListAction">
+ <result name="success" type="velocity">/content.vm</result>
+ <param name="page">
+ /dhis-web-maintenance-patient/listPatientIdentifierType.vm</param>
+ </action>
+
<action name="showAddPatientIdentifierTypeForm" class="org.hisp.dhis.patient.action.NoAction">
- <result name="success" type="velocity">/main.vm</result>
+ <result name="success" type="velocity">/content.vm</result>
<param name="page">
/dhis-web-maintenance-patient/addPatientIdentifierTypeForm.vm</param>
- <param name="menu">/dhis-web-maintenance-patient/patientAndProgramMenu.vm</param>
- <param name="javascripts">javascript/patientIdentifierType.js</param>
<param name="requiredAuthorities">F_PATIENTIDENTIFIERTYPE_ADD</param>
</action>
@@ -900,29 +916,17 @@
<action name="showUpdatePatientIdentifierTypeForm"
class="org.hisp.dhis.patient.action.patientidentifiertype.GetPatientIdentifierTypeAction">
- <result name="success" type="velocity">/main.vm</result>
+ <result name="success" type="velocity">/content.vm</result>
<param name="page">
/dhis-web-maintenance-patient/updatePatientIdentifierType.vm</param>
- <param name="menu">/dhis-web-maintenance-patient/patientAndProgramMenu.vm</param>
- <param name="javascripts">javascript/patientIdentifierType.js</param>
<param name="requiredAuthorities">F_PATIENTIDENTIFIERTYPE_UPDATE</param>
</action>
- <action name="patientIdentifierType"
- class="org.hisp.dhis.patient.action.patientidentifiertype.GetPatientIdentifierTypeListAction">
- <result name="success" type="velocity">/main.vm</result>
- <param name="page">
- /dhis-web-maintenance-patient/listPatientIdentifierType.vm</param>
- <param name="menu">/dhis-web-maintenance-patient/patientAndProgramMenu.vm</param>
- <param name="javascripts">javascript/patientIdentifierType.js</param>
- </action>
-
<action name="getPatientIdentifierType"
class="org.hisp.dhis.patient.action.patientidentifiertype.GetPatientIdentifierTypeAction">
<result name="success" type="velocity-xml">
/dhis-web-maintenance-patient/responsePatientIdentifierType.vm
</result>
- <param name="onExceptionReturn">plainTextError</param>
</action>
<action name="removePatientIdentifierType"
@@ -936,15 +940,15 @@
<action name="addPatientIdentifierType"
class="org.hisp.dhis.patient.action.patientidentifiertype.AddPatientIdentifierTypeAction">
- <result name="success" type="redirect">patientIdentifierType.action
- </result>
+ <result name="success" type="velocity-json">
+ /dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
<param name="requiredAuthorities">F_PATIENTIDENTIFIERTYPE_ADD</param>
</action>
<action name="updatePatientIdentifierType"
class="org.hisp.dhis.patient.action.patientidentifiertype.UpdatePatientIdentifierTypeAction">
- <result name="success" type="redirect">patientIdentifierType.action
- </result>
+ <result name="success" type="velocity-json">
+ /dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
<param name="requiredAuthorities">F_PATIENTIDENTIFIERTYPE_UPDATE</param>
</action>
=== 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 2011-04-28 08:15:18 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientAttributeGroupForm.vm 2011-05-18 01:07:51 +0000
@@ -1,12 +1,10 @@
<script>
- var i18n_remove_option = '$encoder.jsEscape( $i18n.getString( "remove_option" ) , "'") ';
-
- jQuery(document).ready( function(){
+ jQuery("#addPatientAttributeGroupForm").ready( function(){
jQuery('name').focus();
validation( 'addPatientAttributeGroupForm', function(form){
- form.submit();
+ addPatientAttributeGroup();
}, function()
{
beforeSubmit();
@@ -15,7 +13,10 @@
checkValueIsExist( "name", "validatePatientAttributeGroup.action");
});
</script>
-
+
+<input type="button" value="$i18n.getString( 'back' )" onclick="javascript:onClickBackBtn();" style="width:10em">
+<p></p>
+
<h3>$i18n.getString( "add_new_patient_attribute_group" )</h3>
<div id="tooltip"></div>
<form id="addPatientAttributeGroupForm" action="addPatientAttributeGroup.action" method="post" >
@@ -76,7 +77,6 @@
<p>
<input type="submit" value="$i18n.getString( 'add' )" style="width:10em"/>
- <input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='patientAttributeGroup.action'" style="width:10em"/>
</p>
</form>
\ 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/addPatientIdentifierTypeForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientIdentifierTypeForm.vm 2011-04-28 08:15:18 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientIdentifierTypeForm.vm 2011-05-18 01:07:51 +0000
@@ -4,16 +4,19 @@
jQuery('name').focus();
validation( 'addPatientIdentifierTypeForm', function(form){
- form.submit();
+ addPatientIdentifierType();
});
checkValueIsExist( "name", "validatePatientIdentifierType.action");
});
</script>
+
+<input type="button" value="$i18n.getString( 'back' )" onclick="javascript:onClickBackBtn();" style="width:10em">
+<p></p>
<h3>$i18n.getString( "add_new_patient_identifier_type" )</h3>
-
+
<form id="addPatientIdentifierTypeForm" name="addPatientIdentifierTypeForm" action="addPatientIdentifierType.action" method="post" >
<table>
@@ -82,7 +85,6 @@
<td></td>
<td>
<input type="submit" value="$i18n.getString( 'add' )" style="width:10em"/>
- <input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='program.action'" style="width:10em"/>
</td>
</tr>
</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 2011-04-28 08:15:18 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addRelationshipTypeForm.vm 2011-05-18 01:07:51 +0000
@@ -9,6 +9,9 @@
});
</script>
+<input type="button" value="$i18n.getString( 'back' )" onclick="javascript:onClickBackBtn();" style="width:10em">
+<p></p>
+
<h3>$i18n.getString( "add_new_relationship_type" )</h3>
<form id="addRelationshipTypeForm" name="addRelationshipTypeForm" action="addRelationshipType.action" method="post">
@@ -33,7 +36,6 @@
<p>
<input type="submit" value="$i18n.getString( 'add' )" style="width:10em"/>
- <input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='relationshipType.action'" style="width:10em"/>
</p>
</form>
\ 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/commons.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/commons.js 2011-05-13 09:11:13 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/commons.js 2011-05-18 01:07:51 +0000
@@ -101,10 +101,20 @@
if( $(this).attr('type') != 'button' )
{
var elementId = $(this).attr('id');
- params += elementId + "="+ jQuery(this).val() + "&";
+
+ if( jQuery(this).context.multiple )
+ {
+ for ( var i in jQuery(this).val() )
+ {
+ params += elementId + "="+ jQuery(this).val()[i] + "&";
+ }
+ }else
+ {
+ params += elementId + "="+ jQuery(this).val() + "&";
+ }
}
});
-
+
return params;
}
=== 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 2011-05-16 09:29:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientAttribute.js 2011-05-18 01:07:51 +0000
@@ -151,7 +151,6 @@
showById('editPatientAttributeForm');
jQuery('#loaderDiv').hide();
});
-
}
function updatePatientAttribute()
=== 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 2010-09-27 07:33:12 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientAttributeGroup.js 2011-05-18 01:07:51 +0000
@@ -39,10 +39,6 @@
removeItem( patientAttributeGroupId, name, i18n_confirm_delete, 'removePatientAttributeGroup.action' );
}
-// -----------------------------------------------------------------------------
-// Show and Hide tooltip
-// -----------------------------------------------------------------------------
-
function patientAttributeGroupAssociation(){
selectAllById('selectedAttributeGroups');
var form = document.getElementById( 'patientAttributeGroupAssociationForm' );
@@ -50,6 +46,92 @@
}
// -----------------------------------------------------------------------------
+// Add Attribute-Group
+// -----------------------------------------------------------------------------
+
+function showAddPatientAttributeGroupForm( )
+{
+ hideById('attributeGroupList');
+ jQuery('#loaderDiv').show();
+ jQuery('#editAttributeGroupForm').load('showAddPatientAttributeGroupForm.action',
+ {
+ }, function()
+ {
+ showById('editAttributeGroupForm');
+ jQuery('#loaderDiv').hide();
+ });
+}
+
+function addPatientAttributeGroup()
+{
+ $.ajax({
+ type: "POST",
+ url: 'addPatientAttributeGroup.action',
+ data: getParamsForDiv('addPatientAttributeGroupForm'),
+ success: function( json ) {
+ if( json.response == 'success')
+ {
+ onClickBackBtn();
+ }
+ }
+ });
+
+ return false;
+}
+
+// -----------------------------------------------------------------------------
+// Update Attribute-Group
+// -----------------------------------------------------------------------------
+
+function showUpdatePatientAttributeGroupForm( attributeId )
+{
+ hideById('attributeGroupList');
+ jQuery('#loaderDiv').show();
+ jQuery('#editAttributeGroupForm').load('showUpdatePatientAttributeGroupForm.action',
+ {
+ id:attributeId
+ }, function()
+ {
+ showById('editAttributeGroupForm');
+ jQuery('#loaderDiv').hide();
+ });
+}
+
+function updatePatientAttributeGroup()
+{
+ $.ajax({
+ type: "POST",
+ url: 'updatePatientAttributeGroup.action',
+ data: getParamsForDiv('updatePatientAttributeGroupForm'),
+ success: function( json ) {
+ if( json.response == 'success')
+ {
+ onClickBackBtn();
+ }
+ }
+ });
+
+ return false;
+}
+
+// ------------------------------------------------------------------
+// Click Back button
+// ------------------------------------------------------------------
+
+function onClickBackBtn()
+{
+ hideById('editAttributeGroupForm');
+ jQuery('#loaderDiv').show();
+ jQuery('#attributeGroupList').load('patientAttributeGroupList.action',
+ {
+ }, function()
+ {
+ showById('attributeGroupList');
+ jQuery('#loaderDiv').hide();
+ });
+}
+
+// -----------------------------------------------------------------------------
// Show and Hide tooltip
// -----------------------------------------------------------------------------
=== 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 2010-09-27 07:33:12 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientIdentifierType.js 2011-05-18 01:07:51 +0000
@@ -26,4 +26,91 @@
function removePatientIdentifierType( patientIdentifierTypeId, name )
{
removeItem( patientIdentifierTypeId, name, i18n_confirm_delete, 'removePatientIdentifierType.action' );
-}
\ No newline at end of file
+}
+
+// -----------------------------------------------------------------------------
+// Add Patient Identifier Type
+// -----------------------------------------------------------------------------
+
+function showAddPatientIdentifierTypeForm( )
+{
+ hideById('identifierTypeList');
+ jQuery('#loaderDiv').show();
+ jQuery('#editIdentifierTypeForm').load('showAddPatientIdentifierTypeForm.action',
+ {
+ }, function()
+ {
+ showById('editIdentifierTypeForm');
+ jQuery('#loaderDiv').hide();
+ });
+}
+
+function addPatientIdentifierType()
+{
+ $.ajax({
+ type: "POST",
+ url: 'addPatientIdentifierType.action',
+ data: getParamsForDiv('addPatientIdentifierTypeForm'),
+ success: function( json ) {
+ if( json.response == 'success')
+ {
+ onClickBackBtn();
+ }
+ }
+ });
+
+ return false;
+}
+
+// -----------------------------------------------------------------------------
+// Update Patient Identifier Type
+// -----------------------------------------------------------------------------
+
+function showUpdatePatientIdentifierTypeForm( identifierTypeId )
+{
+ hideById('identifierTypeList');
+ jQuery('#loaderDiv').show();
+ jQuery('#editIdentifierTypeForm').load('showUpdatePatientIdentifierTypeForm.action',
+ {
+ id:identifierTypeId
+ }, function()
+ {
+ showById('editIdentifierTypeForm');
+ jQuery('#loaderDiv').hide();
+ });
+}
+
+function updatePatientIdentifierType()
+{
+ $.ajax({
+ type: "POST",
+ url: 'updatePatientIdentifierType.action',
+ data: getParamsForDiv('updatePatientIdentifierTypeForm'),
+ success: function( json ) {
+ if( json.response == 'success')
+ {
+ onClickBackBtn();
+ }
+ }
+ });
+
+ return false;
+}
+
+// ------------------------------------------------------------------
+// Click Back button
+// ------------------------------------------------------------------
+
+function onClickBackBtn()
+{
+ hideById('editIdentifierTypeForm');
+ jQuery('#loaderDiv').show();
+ jQuery('#identifierTypeList').load('patientIdentifierTypeList.action',
+ {
+ }, function()
+ {
+ showById('identifierTypeList');
+ jQuery('#loaderDiv').hide();
+ });
+}
+
=== 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 2011-05-13 09:11:13 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/relationship.js 2011-05-18 01:07:51 +0000
@@ -21,87 +21,6 @@
}
// -----------------------------------------------------------------------------
-// Add RelationshipType
-// -----------------------------------------------------------------------------
-
-function validateAddRelationshipType()
-{
- $.postJSON(
- '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( "i18n_adding_patient_atttibute_failed + ':' + '\n'" +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( "i18n_adding_patient_atttibute_failed + ':' + '\n'" +json.message );
- }
- }
- );
-}
-
-function updateValidationCompleted( messageElement )
-{
- var type = messageElement.getAttribute( 'type' );
- var message = messageElement.firstChild.nodeValue;
-
- if( type == 'success' )
- {
- var form = document.getElementById( 'updateRelationshipTypeForm' );
- form.submit();
- }
- else if( type == 'error' )
- {
- window.alert( i18n_saving_program_failed + ':' + '\n' + message );
- }
- else if( type == 'input' )
- {
- setHeaderMessage( message );
- }
-}
-
-// -----------------------------------------------------------------------------
// Remove RelationshipType
// -----------------------------------------------------------------------------
@@ -267,38 +186,6 @@
}
}
-
-/*function removeRelationship( relationshipId, patientA, aIsToB, patientB )
-{
-
- var result = window.confirm( i18n_confirm_delete_relationship + '\n\n' + patientA + ' is ' + aIsToB + ' to ' + patientB );
-
- if( result )
- {
- var request = new Request();
- request.setResponseTypeXML( 'message' );
- request.setCallbackSuccess( removeRelationshipCompleted );
- request.send( 'removeRelationship.action?relationshipId=' + relationshipId );
- }
-}
-
-function removeRelationshipCompleted( messageElement )
-{
- var type = messageElement.getAttribute( 'type' );
- var message = messageElement.firstChild.nodeValue;
-
- if( type == 'success' )
- {
- window.location = "getRelationshipList.action";
- }
- else if( type = 'error' )
- {
- setInnerHTML( 'warningField', message );
-
- showWarning();
- }
-}*/
-
//------------------------------------------------------------------------------
// Relationship partner
//------------------------------------------------------------------------------
@@ -439,3 +326,144 @@
setHeaderMessage( message );
}
}
+
+// -----------------------------------------------------------------------------
+// Add Relationship Type
+// -----------------------------------------------------------------------------
+
+function showAddRelationshipTypeForm()
+{
+ hideById('relationshipTypeList');
+ jQuery('#loaderDiv').show();
+ jQuery('#editRelationshipTypeForm').load('showAddRelationshipTypeForm.action',
+ {
+ }, function()
+ {
+ showById('editRelationshipTypeForm');
+ jQuery('#loaderDiv').hide();
+ });
+}
+
+
+function validateAddRelationshipType()
+{
+ $.postJSON(
+ 'validateRelationshipType.action',
+ {
+ "aIsToB": getFieldValue( 'aIsToB' ),
+ "bIsToA": getFieldValue( 'bIsToA' )
+ },
+ function( json )
+ {
+ if ( json.response == "success" )
+ {
+ addRelationshipType();
+ }else if ( json.response == "input" )
+ {
+ setHeaderMessage( json.message );
+ }
+ else if ( json.response == "error" )
+ {
+ setHeaderMessage( "i18n_adding_patient_atttibute_failed + ':' + '\n'" +json.message );
+ }
+ }
+ );
+}
+
+function addRelationshipType()
+{
+ $.ajax({
+ type: "POST",
+ url: 'addRelationshipType.action',
+ data: getParamsForDiv('addRelationshipTypeForm'),
+ success: function( json ) {
+ if( json.response == 'success')
+ {
+ onClickBackBtn();
+ }
+ }
+ });
+
+ return false;
+}
+
+// -----------------------------------------------------------------------------
+// Update Relationship Type
+// -----------------------------------------------------------------------------
+
+function showUpdateRelationshipTypeForm( relationshipTypeId )
+{
+ hideById('relationshipTypeList');
+ jQuery('#loaderDiv').show();
+ jQuery('#editRelationshipTypeForm').load('showUpdateRelationshipTypeForm.action',
+ {
+ id:relationshipTypeId
+ }, function()
+ {
+ showById('editRelationshipTypeForm');
+ jQuery('#loaderDiv').hide();
+ });
+}
+
+
+function validateUpdateRelationshipType()
+{
+ $.postJSON(
+ 'validateRelationshipType.action',
+ {
+ "id": getFieldValue( 'id' ),
+ "aIsToB": getFieldValue( 'aIsToB' ),
+ "bIsToA": getFieldValue( 'bIsToA' )
+ },
+ function( json )
+ {
+ if ( json.response == "success" )
+ {
+ updatePatientIdentifierType();
+ }else if ( json.response == "input" )
+ {
+ setMessage( json.message );
+ }
+ else if ( json.response == "error" )
+ {
+ setMessage( "i18n_adding_patient_atttibute_failed + ':' + '\n'" +json.message );
+ }
+ }
+ );
+}
+
+function updatePatientIdentifierType()
+{
+ $.ajax({
+ type: "POST",
+ url: 'updateRelationshipType.action',
+ data: getParamsForDiv('updateRelationshipTypeForm'),
+ success: function( json ) {
+ if( json.response == 'success')
+ {
+ onClickBackBtn();
+ }
+ }
+ });
+
+ return false;
+}
+
+// ------------------------------------------------------------------
+// Click Back button
+// ------------------------------------------------------------------
+
+function onClickBackBtn()
+{
+ hideById('editRelationshipTypeForm');
+ jQuery('#loaderDiv').show();
+ jQuery('#relationshipTypeList').load('relationshipTypeList.action',
+ {
+ }, function()
+ {
+ showById('relationshipTypeList');
+ jQuery('#loaderDiv').hide();
+ });
+}
+
+
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/listPatientIdentifierType.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/listPatientIdentifierType.vm 2010-10-05 11:58:15 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/listPatientIdentifierType.vm 2011-05-18 01:07:51 +0000
@@ -9,36 +9,37 @@
<col>
<col width="20">
<col width="20">
- <col width="20">
<col width="20">
<tr>
<td></td>
- <td colspan="5" style="text-align:right"><input type="button" value="$i18n.getString( "add_new" )" onclick="window.location.href='showAddPatientIdentifierTypeForm.action'" style="width:70px"></td>
+ <td colspan="4" style="text-align:right"><input type="button" value="$i18n.getString( "add_new" )" onclick="javascript:showAddPatientIdentifierTypeForm();" style="width:70px"></td>
</tr>
<tr>
<th>$i18n.getString( "name" )</th>
- <th colspan="5">$i18n.getString( "operations" )</th>
+ <th colspan="4">$i18n.getString( "operations" )</th>
</tr>
<tbody id="list">
+ #set( $mark = false )
#foreach( $identifierType in $identifierTypes )
- <tr id="tr${identifierType.id}">
+ <tr id="tr${identifierType.id}" #alternate( $mark ) >
<td>$encoder.htmlEncode( $identifierType.name )</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>
+ <td style="text-align:center">
+ <a href="javascript:showUpdatePatientIdentifierTypeForm('$identifierType.id');" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
</td>
- <td style="text-align:center"#alternate( $mark )>
+ <td style="text-align:center">
<a href="javascript:removePatientIdentifierType( '$identifierType.id', '$encoder.jsEncode( $identifierType.name )' )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
</td>
- <td style="text-align:center"#alternate( $mark )>
+ <td style="text-align:center">
<a href="javascript:showPatientIdentifierTypeDetails( $identifierType.id )" title="$i18n.getString( 'show_details' )"><img src="../images/information.png" alt="$i18n.getString( 'show_details' )"></a>
</td>
</tr>
+ #set( $mark = !$mark)
#end
</tbody>
@@ -58,10 +59,3 @@
</td>
</tr>
</table>
-
-<script type="text/javascript">
- var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete_patientIdentifierType" ) , "'" )';
- var i18n_adding_program_failed = '$encoder.jsEscape( $i18n.getString( "adding_patientIdentifierType_failed" ), "'")';
- var i18n_updating_program_failed = '$encoder.jsEscape( $i18n.getString( "updating_patientIdentifierType_failed" ), "'")';
- var i18n_none = '$encoder.jsEscape( $i18n.getString( "none" ), "'")';
-</script>
=== 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 2011-05-16 09:29:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttribute.vm 2011-05-18 01:07:51 +0000
@@ -5,8 +5,6 @@
#parse( "/dhis-web-commons/loader/loader.vm" )
<div id='editPatientAttributeForm'></div>
-<p></p>
-<span id='message' style='display:none;' onclick="hideById(this.id)"> $i18n.getString( "save_success" )</span>
<script type="text/javascript">
var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete_patient_attribute" ) , "'" )';
=== 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 2010-09-26 11:49:41 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttributeGroup.vm 2011-05-18 01:07:51 +0000
@@ -1,64 +1,11 @@
-
-<h3>$i18n.getString( "patient_attribute_group_management" )</h3>
-
-<table class="mainPageTable">
- <tr>
- <td style="vertical-align:top">
-
- <table class="listTable">
- <col>
- <col width="20">
- <col width="20">
- <col width="20">
- <tr>
- <td></td>
- <td colspan="3" style="text-align:right"><input type="button" value="$i18n.getString( "add_new" )" onclick="window.location.href='showAddPatientAttributeGroupForm.action'" style="width:70px"></td>
- </tr>
- <tr>
- <th>$i18n.getString( "attribute_name" )</th>
- <th colspan="3">$i18n.getString( "operations" )</th>
- </tr>
-
- <tbody id="list">
- #foreach( $patientAttributeGroup in $patientAttributeGroups )
- <tr id="tr${patientAttributeGroup.id}">
-
- <td>$encoder.htmlEncode( $patientAttributeGroup.name )</td>
-
- <td style="text-align:center"#alternate( $mark )>
- <a href="showUpdatePatientAttributeGroupForm.action?id=$patientAttributeGroup.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a>
- </td>
-
- <td style="text-align:center"#alternate( $mark )>
- <a href="javascript:removePatientAttributeGroup( '$patientAttributeGroup.id', '$encoder.jsEncode( $patientAttributeGroup.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a>
- </td>
-
- <td style="text-align:center"#alternate( $mark )>
- <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>
- </td>
- <td style="width:20em; padding-left:2em; vertical-align:top">
-
- <div id="detailsArea" style="display:none">
- <div style="float:right">
- <a href="javascript:hideDetails()" title="$i18n.getString( "hide_details" )"><img src="../images/close.png" alt="$i18n.getString( "hide_details" )"></a>
- </div>
- <p><label>$i18n.getString( "id" ):</label><br><span id="idField"></span></p>
- <p><label>$i18n.getString( "name" ):</label><br><span id="nameField"></span></p>
- <p><label>$i18n.getString( "description" ):</label><br><span id="descriptionField"></span></p>
- <p><label>$i18n.getString( "number_of_attribute" ):</label><br><span id="noAttributeField"></span></p>
- </div>
-
- </td>
- </tr>
-</table>
+<div id='attributeGroupList'>
+ #parse( "/dhis-web-maintenance-patient/patientAttributeGroupList.vm" )
+</div>
+
+#parse( "/dhis-web-commons/loader/loader.vm" )
+
+<div id='editAttributeGroupForm'></div>
+<p></p>
<script type="text/javascript">
var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete_patient_attribute" ) , "'" )';
@@ -71,4 +18,5 @@
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_remove_option = '$encoder.jsEscape( $i18n.getString( "remove_option" ) , "'") ';
</script>
=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttributeGroupList.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttributeGroupList.vm 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttributeGroupList.vm 2011-05-18 01:07:51 +0000
@@ -0,0 +1,63 @@
+
+<h3>$i18n.getString( "patient_attribute_group_management" )</h3>
+
+<table class="mainPageTable">
+ <tr>
+ <td style="vertical-align:top">
+
+ <table class="listTable">
+ <col>
+ <col width="20">
+ <col width="20">
+ <col width="20">
+ <tr>
+ <td></td>
+ <td colspan="3" style="text-align:right"><input type="button" value="$i18n.getString( "add_new" )" onclick="javascript: showAddPatientAttributeGroupForm();" style="width:70px"></td>
+ </tr>
+ <tr>
+ <th>$i18n.getString( "attribute_name" )</th>
+ <th colspan="3">$i18n.getString( "operations" )</th>
+ </tr>
+
+ <tbody id="list">
+ #set( $mark = false )
+ #foreach( $patientAttributeGroup in $patientAttributeGroups )
+ <tr id="tr${patientAttributeGroup.id}" #alternate( $mark )>
+
+ <td>$encoder.htmlEncode( $patientAttributeGroup.name )</td>
+
+ <td style="text-align:center"#alternate( $mark )>
+ <a href="javascript:showUpdatePatientAttributeGroupForm('$patientAttributeGroup.id')" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a>
+ </td>
+
+ <td style="text-align:center"#alternate( $mark )>
+ <a href="javascript:removePatientAttributeGroup( '$patientAttributeGroup.id', '$encoder.jsEncode( $patientAttributeGroup.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a>
+ </td>
+
+ <td style="text-align:center"#alternate( $mark )>
+ <a href="javascript:showPatientAttributeGroupDetails( $patientAttributeGroup.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a>
+ </td>
+
+ </tr>
+ #set( $mark = !$mark)
+ #end
+
+ </tbody>
+
+ </table>
+ </td>
+ <td style="width:20em; padding-left:2em; vertical-align:top">
+
+ <div id="detailsArea" style="display:none">
+ <div style="float:right">
+ <a href="javascript:hideDetails()" title="$i18n.getString( "hide_details" )"><img src="../images/close.png" alt="$i18n.getString( "hide_details" )"></a>
+ </div>
+ <p><label>$i18n.getString( "id" ):</label><br><span id="idField"></span></p>
+ <p><label>$i18n.getString( "name" ):</label><br><span id="nameField"></span></p>
+ <p><label>$i18n.getString( "description" ):</label><br><span id="descriptionField"></span></p>
+ <p><label>$i18n.getString( "number_of_attribute" ):</label><br><span id="noAttributeField"></span></p>
+ </div>
+
+ </td>
+ </tr>
+</table>
=== added 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 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientIdentifierType.vm 2011-05-18 01:07:51 +0000
@@ -0,0 +1,16 @@
+<div id='identifierTypeList'>
+ #parse( "/dhis-web-maintenance-patient/listPatientIdentifierType.vm" )
+</div>
+
+#parse( "/dhis-web-commons/loader/loader.vm" )
+
+<div id='editIdentifierTypeForm'></div>
+<p></p>
+
+
+<script type="text/javascript">
+ var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete_patientIdentifierType" ) , "'" )';
+ var i18n_adding_program_failed = '$encoder.jsEscape( $i18n.getString( "adding_patientIdentifierType_failed" ), "'")';
+ var i18n_updating_program_failed = '$encoder.jsEscape( $i18n.getString( "updating_patientIdentifierType_failed" ), "'")';
+ var i18n_none = '$encoder.jsEscape( $i18n.getString( "none" ), "'")';
+</script>
=== 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 2010-10-04 13:31:37 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/relationshipType.vm 2011-05-18 01:07:51 +0000
@@ -1,67 +1,13 @@
-
-<h3>$i18n.getString( "relationship_type_management" )</h3>
-
-<table class="mainPageTable">
- <tr>
- <td style="vertical-align:top">
-
- <table class="listTable">
- <col>
- <col>
- <col width="20">
- <col width="20">
- <col width="20">
- <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( "description" )</th>
- <th colspan="3">$i18n.getString( "operations" )</th>
- </tr>
-
- <tbody id="list">
- #foreach( $relationshipType in $relationshipTypes )
- <tr id="tr${relationshipType.id}">
-
- <td>$encoder.htmlEncode( $relationshipType.aIsToB )/$encoder.htmlEncode( $relationshipType.bIsToA )</td>
-
- <td>$encoder.htmlEncode( $relationshipType.description )</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>
- </td>
-
- <td style="text-align:center"#alternate( $mark )>
- <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>
- </td>
-
- <td style="text-align:center"#alternate( $mark )>
- <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>
-
- </table>
- </td>
- <td style="width:20em; padding-left:2em; vertical-align:top">
- <div id="detailsArea" style="display:none; position:absolute; overflow:auto; right: 10px">
- <div style="float:right;">
- <a href="javascript:hideDetails()" title="$i18n.getString( "hide_details" )"><img src="../images/close.png" alt="$i18n.getString( "hide_details" )"></a>
- </div>
- <p><label>$i18n.getString( "id" ):</label><br><span id="idField"></span></p>
- <p><label>$i18n.getString( "a_is_to_b" ):</label><br><span id="aIsToBField"></span></p>
- <p><label>$i18n.getString( "b_is_to_a" ):</label><br><span id="bIsToAField"></span></p>
- <p><label>$i18n.getString( "description" ):</label><br><span id="descriptionField"></span></p>
- </div>
- </td>
- </tr>
-</table>
+<div id='relationshipTypeList'>
+ #parse( "/dhis-web-maintenance-patient/relationshipTypeList.vm" )
+</div>
+
+#parse( "/dhis-web-commons/loader/loader.vm" )
+
+<div id='editRelationshipTypeForm'></div>
+<p></p>
+
+<span id='message'></span>
<script type="text/javascript">
var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete_relationship_type" ) , "'" )';
=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/relationshipTypeList.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/relationshipTypeList.vm 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/relationshipTypeList.vm 2011-05-18 01:07:51 +0000
@@ -0,0 +1,67 @@
+
+<h3>$i18n.getString( "relationship_type_management" )</h3>
+
+<table class="mainPageTable">
+ <tr>
+ <td style="vertical-align:top">
+
+ <table class="listTable">
+ <col>
+ <col>
+ <col width="20">
+ <col width="20">
+ <col width="20">
+ <tr>
+ <td></td>
+ <td></td>
+ <td colspan="3" style="text-align:right"><input type="button" value="$i18n.getString( "add_new" )" onclick="javascript:showAddRelationshipTypeForm()" style="width:70px"></td>
+ </tr>
+ <tr>
+ <th>$i18n.getString( "relationship_type" )</th>
+ <th>$i18n.getString( "description" )</th>
+ <th colspan="3">$i18n.getString( "operations" )</th>
+ </tr>
+
+ <tbody id="list">
+ #set( $mark = false )
+ #foreach( $relationshipType in $relationshipTypes )
+ <tr id="tr${relationshipType.id}" #alternate( $mark ) >
+
+ <td>$encoder.htmlEncode( $relationshipType.aIsToB )/$encoder.htmlEncode( $relationshipType.bIsToA )</td>
+
+ <td>$encoder.htmlEncode( $relationshipType.description )</td>
+
+ <td style="text-align:center"#alternate( $mark )>
+ <a href="javascript:showUpdateRelationshipTypeForm('$relationshipType.id')" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a>
+ </td>
+
+ <td style="text-align:center"#alternate( $mark )>
+ <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>
+ </td>
+
+ <td style="text-align:center"#alternate( $mark )>
+ <a href="javascript:showRelationshipTypeDetails( $relationshipType.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a>
+ </td>
+
+ </tr>
+ #set( $mark = !$mark)
+ #end
+
+ </tbody>
+
+ </table>
+ </td>
+ <td style="width:20em; padding-left:2em; vertical-align:top">
+ <div id="detailsArea" style="display:none; position:absolute; overflow:auto; right: 10px">
+ <div style="float:right;">
+ <a href="javascript:hideDetails()" title="$i18n.getString( "hide_details" )"><img src="../images/close.png" alt="$i18n.getString( "hide_details" )"></a>
+ </div>
+ <p><label>$i18n.getString( "id" ):</label><br><span id="idField"></span></p>
+ <p><label>$i18n.getString( "a_is_to_b" ):</label><br><span id="aIsToBField"></span></p>
+ <p><label>$i18n.getString( "b_is_to_a" ):</label><br><span id="bIsToAField"></span></p>
+ <p><label>$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/updatePatientAttibuteGroupForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttibuteGroupForm.vm 2011-04-28 08:15:18 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttibuteGroupForm.vm 2011-05-18 01:07:51 +0000
@@ -1,12 +1,12 @@
<script>
var i18n_remove_option = '$encoder.jsEscape( $i18n.getString( "remove_option" ) , "'") ';
- jQuery(document).ready( function(){
+ jQuery("#updatePatientAttributeGroupForm").ready( function(){
jQuery('name').focus();
validation( 'updatePatientAttributeGroupForm', function(form){
- form.submit();
+ updatePatientAttributeGroup();
}, function()
{
beforeSubmit();
@@ -15,8 +15,12 @@
checkValueIsExist( "name", "validatePatientAttributeGroup.action", {id:getFieldValue('id')});
});
</script>
+
+<input type="button" value="$i18n.getString( 'back' )" onclick="javascript:onClickBackBtn();" style="width:10em">
+<p></p>
+
<h3>$i18n.getString( "update_patient_attribute_group" )</h3>
-<form id="updatePatientAttributeGroupForm" name="updatePatientAttributeGroupForm" action="updatePatientAttributeGroup.action" method="post" onsubmit="return validateUpdatePatientAttributeGroup();">
+<form id="updatePatientAttributeGroupForm" name="updatePatientAttributeGroupForm" action="updatePatientAttributeGroup.action" method="post">
<div style="display:inline">
<input type="hidden" id="id" name="id" value="$!patientAttributeGroup.id"/>
@@ -84,7 +88,6 @@
<p>
<input type="submit" value="$i18n.getString( 'update' )" style="width:10em"/>
- <input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='patientAttributeGroup.action'" style="width:10em"/>
</p>
</form>
=== 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 2011-04-28 08:15:18 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientIdentifierType.vm 2011-05-18 01:07:51 +0000
@@ -1,16 +1,18 @@
<script>
- jQuery(document).ready( function(){
+ jQuery("updatePatientIdentifierTypeForm").ready( function(){
jQuery('name').focus();
validation( 'updatePatientIdentifierTypeForm', function(form){
- form.submit();
+ updatePatientIdentifierType();
});
checkValueIsExist( "name", "validatePatientIdentifierType.action", {id:getFieldValue('id')});
});
</script>
+<input type="button" value="$i18n.getString( 'back' )" onclick="javascript:onClickBackBtn();" style="width:10em">
+<p></p>
<h3>$i18n.getString( "update_patient_identifier_type" )</h3>
=== 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 2011-04-28 08:15:18 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateRelationshipTypeForm.vm 2011-05-18 01:07:51 +0000
@@ -10,6 +10,9 @@
});
</script>
+<input type="button" value="$i18n.getString( 'back' )" onclick="javascript:onClickBackBtn();" style="width:10em">
+<p></p>
+
<h3>$i18n.getString( "update_relationship_type" )</h3>
<form id="updateRelationshipTypeForm" name="updateRelationshipTypeForm" action="updateRelationshipType.action" method="post">
@@ -44,7 +47,6 @@
<p>
<input type="submit" value="$i18n.getString( 'update' )" style="width:10em"/>
- <input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='relationshipType.action'" style="width:10em"/>
</p>
</form>