=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/dataentryform/ViewPatientRegistrationFormAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/dataentryform/ViewPatientRegistrationFormAction.java 2013-02-04 03:48:00 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/dataentryform/ViewPatientRegistrationFormAction.java 2013-02-26 07:29:59 +0000 @@ -40,6 +40,7 @@ import org.hisp.dhis.patient.PatientRegistrationFormService; import org.hisp.dhis.program.Program; import org.hisp.dhis.program.ProgramService; +import org.hisp.dhis.setting.SystemSettingManager; import com.opensymphony.xwork2.Action; @@ -83,6 +84,13 @@ this.patientRegistrationFormService = patientRegistrationFormService; } + private SystemSettingManager systemSettingManager; + + public void setSystemSettingManager( SystemSettingManager systemSettingManager ) + { + this.systemSettingManager = systemSettingManager; + } + // ------------------------------------------------------------------------- // Getters & Setters // ------------------------------------------------------------------------- @@ -134,6 +142,13 @@ return program; } + private List flags; + + public List getFlags() + { + return flags; + } + // ------------------------------------------------------------------------- // Action implementation // ------------------------------------------------------------------------- @@ -172,6 +187,12 @@ } } + // --------------------------------------------------------------------- + // Get images + // --------------------------------------------------------------------- + + flags = systemSettingManager.getFlags(); + return SUCCESS; } } === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml 2013-02-19 06:54:22 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml 2013-02-26 07:29:59 +0000 @@ -551,6 +551,9 @@ + + + === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties 2013-02-26 04:24:48 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties 2013-02-26 07:29:59 +0000 @@ -354,4 +354,6 @@ assign_program_to_userroles = Assign program to userroles property_is_inserted = The property is inserted please_insert_all_required_fields = Please insert all required fields -required_fields_valivation = Required fields validation \ No newline at end of file +required_fields_valivation = Required fields validation +insert_properties = Insert properties +insert_images = Insert images \ No newline at end of file === 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 2013-02-20 09:08:47 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml 2013-02-26 07:29:59 +0000 @@ -574,6 +574,11 @@ /dhis-web-commons/ajax/jsonResponseSuccess.vm + + + patientRegistrationForm.action + === 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-02-26 04:24:48 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/viewPatientRegistationForm.js 2013-02-26 07:29:59 +0000 @@ -1,6 +1,30 @@ +$( document ).ready( function() +{ + $(":button").button(); + $(":submit").button(); + $("#saveButton").button("option", "icons", { primary: "ui-icon-disk" }); + $("#cancelButton").button("option", "icons", { primary: "ui-icon-cancel" }); + $("#deleteButton").button("option", "icons", { primary: "ui-icon-trash" }); + $("#insertButton").button("option", "icons", { primary: "ui-icon-plusthick" }); + $("#propertiesButton").button("option", "icons", { primary: "ui-icon-newwin" }); + $("#insertImagesButton").button("option", "icons", { primary: "ui-icon-newwin" }); + + $("#imageDialog").bind("dialogopen", function(event, ui) { + $("#insertImagesButton").button("disable"); + }) + $("#imageDialog").bind("dialogclose", function(event, ui) { + $("#insertImagesButton").button("enable"); + }) + + $("#insertImagesButton").click(function() { + $("#imageDialog").dialog(); + }); +}); + function openPropertiesSelector() -{ +{ + $("#propertiesButton").addClass("ui-state-active2"); $('#selectionDialog' ).dialog( { title:i18n_properties, @@ -9,12 +33,23 @@ modal:false, overlay:{background:'#000000', opacity:0.1}, width:500, - height:460 + height:460, + close: function(ev, ui) { + $("#propertiesButton").removeClass("ui-state-active2"); + } }); } function fixAttrOnClick() { + $("#insertButton").click(function() { + insertElement( 'fixedAttr' ); + }); + + $("#fixAttrButton").addClass("ui-state-active2"); + $("#identifierTypeButton").removeClass("ui-state-active2"); + $("#attributesButton").removeClass("ui-state-active2"); + $("#programAttrButton").removeClass("ui-state-active2"); hideById('attributeTab'); hideById('identifierTypeTab'); hideById('programAttrTab'); @@ -23,6 +58,14 @@ function identifierTypeOnClick() { + $("#insertButton").click(function() { + insertElement( 'iden' ) + }); + + $("#fixAttrButton").removeClass("ui-state-active2"); + $("#identifierTypeButton").addClass("ui-state-active2"); + $("#attributesButton").removeClass("ui-state-active2"); + $("#programAttrButton").removeClass("ui-state-active2"); hideById('attributeTab'); hideById('fixedAttrTab'); hideById('programAttrTab'); @@ -31,6 +74,14 @@ function attributesOnClick() { + $("#insertButton").click(function() { + insertElement( 'attr' ); + }); + + $("#fixAttrButton").removeClass("ui-state-active2"); + $("#identifierTypeButton").removeClass("ui-state-active2"); + $("#attributesButton").addClass("ui-state-active2"); + $("#programAttrButton").removeClass("ui-state-active2"); hideById('identifierTypeTab'); hideById('fixedAttrTab'); hideById('programAttrTab'); @@ -39,6 +90,14 @@ function programAttrOnClick() { + $("#insertButton").click(function() { + insertElement( 'prg' ); + }); + + $("#fixAttrButton").removeClass("ui-state-active2"); + $("#identifierTypeButton").removeClass("ui-state-active2"); + $("#attributesButton").removeClass("ui-state-active2"); + $("#programAttrButton").addClass("ui-state-active2"); hideById('attributeTab'); hideById('identifierTypeTab'); hideById('fixedAttrTab'); @@ -175,23 +234,32 @@ { var id = ''; var value = ''; + if( type == 'fixedAttr' ){ var element = jQuery('#fixedAttrSelector option:selected'); + if( element.length == 0 ) return; + id = 'fixedattributeid="' + element.attr('value') + '"'; value = element.text(); } else if( type == 'iden' ){ var element = jQuery('#identifiersSelector option:selected'); + if( element.length == 0 ) return; + id = 'identifierid="' + element.attr('value') + '"'; value = element.text(); } else if( type == 'attr' ){ var element = jQuery('#attributesSelector option:selected'); + if( element.length == 0 ) return; + id = 'attributeid="' + element.attr('value') + '"'; value = element.text(); } else if( type == 'prg' ){ var element = jQuery('#programAttrSelector option:selected'); + if( element.length == 0 ) return; + id = 'programid="' + element.attr('value') + '"'; value = element.text(); } @@ -208,3 +276,19 @@ } } + +function deleteRegistrationForm( id, name ) +{ + var result = window.confirm( i18n_confirm_delete + '\n\n' + name ); + if ( result ) + { + window.location.href = 'delRegistrationEntryFormAction.action?id=' + id; + } +} + +function insertImage() { + var image = $("#imageDialog :selected").val(); + var html = ""; + var oEditor = $("#designTextarea").ckeditorGet(); + oEditor.insertHtml( html ); +} \ 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/viewPatientRegistationForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewPatientRegistationForm.vm 2013-02-26 04:24:48 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewPatientRegistationForm.vm 2013-02-26 07:29:59 +0000 @@ -1,3 +1,13 @@ + + + + + + + + + +