=== 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-19 08:12:45 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml 2011-05-19 08:13:38 +0000 @@ -586,15 +586,9 @@ /main.vm - /dhis-web-maintenance-patient/programAttribute.vm - /dhis-web-maintenance-patient/patientAndProgramMenu.vm - javascript/commons.js,javascript/programAttribute.js - - - - /content.vm /dhis-web-maintenance-patient/programAttributeList.vm + /dhis-web-maintenance-patient/patientAndProgramMenu.vm + javascript/programAttribute.js - - /dhis-web-commons/ajax/jsonResponseSuccess.vm + programAttribute.action + F_PROGRAM_ATTRIBUTE_ADD - - /dhis-web-commons/ajax/jsonResponseSuccess.vm + programAttribute.action + F_PROGRAM_ATTRIBUTE_UPDATE @@ -637,18 +631,23 @@ - /content.vm + /main.vm /dhis-web-maintenance-patient/addProgramAttributeForm.vm + /dhis-web-maintenance-patient/patientAndProgramMenu.vm + javascript/programAttribute.js F_PROGRAM_ATTRIBUTE_ADD - /content.vm + /main.vm /dhis-web-maintenance-patient/updateProgramAttributeForm.vm + /dhis-web-maintenance-patient/patientAndProgramMenu.vm + javascript/programAttribute.js F_PROGRAM_ATTRIBUTE_UPDATE + @@ -960,19 +959,16 @@ /main.vm /dhis-web-maintenance-patient/caseAggregation.vm /dhis-web-maintenance-patient/patientAndProgramMenu.vm - javascript/commons.js,javascript/caseaggregation.js - - - - /content.vm - /dhis-web-maintenance-patient/caseAggregationList.vm + javascript/caseaggregation.js - /content.vm + /main.vm /dhis-web-maintenance-patient/addCaseAggregation.vm + /dhis-web-maintenance-patient/patientAndProgramMenu.vm + javascript/commons.js, + javascript/caseaggregation.js - /content.vm + /main.vm /dhis-web-maintenance-patient/updateCaseAggregation.vm /dhis-web-maintenance-patient/patientAndProgramMenu.vm javascript/commons.js, === 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 2011-05-18 03:07:12 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientAttributeForm.vm 2011-05-19 08:13:38 +0000 @@ -34,7 +34,6 @@ -

$i18n.getString( "add_new_patient_attribute" )

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramAttributeForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramAttributeForm.vm 2011-05-19 08:12:45 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramAttributeForm.vm 2011-05-19 08:13:38 +0000 @@ -4,30 +4,20 @@ var i18n_at_least_2_option = '$encoder.jsEscape( $i18n.getString( "at_least_2_option" ) , "'") '; var isSubmit = true; - jQuery('#addProgramAttributeForm').ready( function(){ - - validation( 'addProgramAttributeForm', function(form){ - if( isSubmit ) - { - addProgramAttribute(); + jQuery(document).ready( function(){ + + validation( 'addProgramAttributeForm', function(form){ + if( isSubmit && ATTRIBUTE_OPTION.checkOnSubmit() ) { + form.submit(); } }, function(){ - isSubmit = ATTRIBUTE_OPTION.checkOnSubmit(); - - if( isSubmit ) - { - var fields = $("#addProgramAttributeForm").serializeArray(); - jQuery.each(fields, function(i, field) { - if( field.name.match("^attrOption")=='attrOption' && field.value == ""){ - setInnerHTML( "attrMessage", i18n_field_is_required ); - isSubmit = false; - } - }); - - }else - { - setInnerHTML( "attrMessage", i18n_at_least_2_option ); - } + isSubmit = true; + jQuery.each($('#addProgramAttributeForm').serializeArray(), function(i, field) { + if( field.value == ""){ + setInnerHTML("attrMessage", i18n_field_is_required); + isSubmit = false; + } + }); }); jQuery("#attributeComboRow").hide(); @@ -35,9 +25,7 @@ checkValueIsExist( "name", "validateProgramAttribute.action"); }); - - -

+

$i18n.getString( "add_new_program_attribute" )

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programAttribute.js' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programAttribute.js 2011-05-18 03:07:12 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programAttribute.js 2011-05-19 08:13:38 +0000 @@ -27,7 +27,6 @@ // ----------------------------------------------------------------------------- // Remove Program Attribute // ----------------------------------------------------------------------------- - function removeProgramAttribute( programAttributeId, name ) { removeItem( programAttributeId, name, i18n_confirm_delete, 'removeProgramAttribute.action' ); @@ -62,6 +61,7 @@ }); if( $("input","#attrOptionContainer").length < 2) { + alert(i18n_at_least_2_option); return false; }else return true; } @@ -99,92 +99,6 @@ }, createInput : function () { - return "[ - ]"; + return "[ - ]"; } -} - -// ----------------------------------------------------------------------------- -// Add Program Attribute -// ----------------------------------------------------------------------------- - -function showAddProgramAttributeForm() -{ - hideById('programAttributeList'); - jQuery('#loaderDiv').show(); - jQuery('#editProgramAttributeForm').load('showAddProgramAttributeForm.action', - { - }, function() - { - showById('editProgramAttributeForm'); - jQuery('#loaderDiv').hide(); - }); -} - -function addProgramAttribute() -{ - $.ajax({ - type: "POST", - url: 'addProgramAttribute.action', - data: getParamsForDiv('addProgramAttributeForm'), - success: function( json ) { - if( json.response == 'success') - { - onClickBackBtn(); - } - } - }); - - return false; -} - -// ----------------------------------------------------------------------------- -// Update Program Attribute -// ----------------------------------------------------------------------------- - -function showUpdateProgramAttributeForm( programAttributeId ) -{ - hideById('programAttributeList'); - jQuery('#loaderDiv').show(); - jQuery('#editProgramAttributeForm').load('showUpdateProgramAttributeForm.action', - { - id:programAttributeId - }, function() - { - showById('editProgramAttributeForm'); - jQuery('#loaderDiv').hide(); - }); -} - -function updateProgramAttribute() -{ - $.ajax({ - type: "POST", - url: 'updateProgramAttribute.action', - data: getParamsForDiv('updateProgramAttributeForm'), - success: function( json ) { - if( json.response == 'success') - { - onClickBackBtn(); - } - } - }); - - return false; -} - -// ------------------------------------------------------------------ -// Click Back button -// ------------------------------------------------------------------ - -function onClickBackBtn() -{ - hideById('editProgramAttributeForm'); - jQuery('#loaderDiv').show(); - jQuery('#programAttributeList').load('programAttributeList.action', - { - }, function() - { - showById('programAttributeList'); - jQuery('#loaderDiv').hide(); - }); -} +} \ No newline at end of file === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programAttribute.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programAttribute.vm 2011-05-18 03:07:12 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programAttribute.vm 1970-01-01 00:00:00 +0000 @@ -1,30 +0,0 @@ -
- #parse( "/dhis-web-maintenance-patient/programAttributeList.vm" ) -
- -#parse( "/dhis-web-commons/loader/loader.vm" ) - -
-

- - - - - === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programAttributeList.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programAttributeList.vm 2011-05-18 03:07:12 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programAttributeList.vm 2011-05-19 08:13:38 +0000 @@ -9,7 +9,7 @@ - + $i18n.getString( "name" ) @@ -17,14 +17,13 @@ - #set( $mark = false ) #foreach( $programAttribute in $programAttributes ) - + $programAttribute.name - $i18n.getString( + $i18n.getString( @@ -32,14 +31,14 @@ - $i18n.getString( + $i18n.getString( - #set( $mark = !$mark) #end + - + @@ -57,3 +56,21 @@ + + + + === 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 2011-05-18 03:07:12 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttibuteForm.vm 2011-05-19 08:13:38 +0000 @@ -13,7 +13,7 @@ if( isSubmit ) { - var fields = $("#updatePatientAttributeForm").serializeArray(); + var fields = $("#addPatientAttributeForm").serializeArray(); jQuery.each(fields, function(i, field) { if( field.name.match("^attrOption")=='attrOption' && field.value == ""){ setInnerHTML( "attrMessage", i18n_field_is_required ); === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramAttributeForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramAttributeForm.vm 2011-05-19 08:12:45 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramAttributeForm.vm 2011-05-19 08:13:38 +0000 @@ -1,38 +1,28 @@ - - -

+

$i18n.getString( "update_new_program_attribute" )