=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ValidateProgramInstanceAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ValidateProgramInstanceAction.java 2013-10-09 19:10:40 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ValidateProgramInstanceAction.java 2013-10-16 10:03:02 +0000 @@ -28,19 +28,20 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import com.opensymphony.xwork2.Action; -import org.hisp.dhis.caseentry.state.SelectedStateManager; -import org.hisp.dhis.program.ProgramStageInstance; -import org.hisp.dhis.program.ProgramValidation; -import org.hisp.dhis.program.ProgramValidationResult; -import org.hisp.dhis.program.ProgramValidationService; - import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.hisp.dhis.program.ProgramStageInstance; +import org.hisp.dhis.program.ProgramStageInstanceService; +import org.hisp.dhis.program.ProgramValidation; +import org.hisp.dhis.program.ProgramValidationResult; +import org.hisp.dhis.program.ProgramValidationService; + +import com.opensymphony.xwork2.Action; + /** * @author Chau Thu Tran * @version $ ValidateProgramInstanceAction.java Apr 28, 2011 10:56:10 AM $ @@ -52,11 +53,12 @@ // Dependencies // ------------------------------------------------------------------------- - private SelectedStateManager selectedStateManager; - - public void setSelectedStateManager( SelectedStateManager selectedStateManager ) + private ProgramStageInstanceService programStageInstanceService; + + + public void setProgramStageInstanceService( ProgramStageInstanceService programStageInstanceService ) { - this.selectedStateManager = selectedStateManager; + this.programStageInstanceService = programStageInstanceService; } private ProgramValidationService programValidationService; @@ -67,9 +69,11 @@ } // ------------------------------------------------------------------------- - // Output + // Input && Output // ------------------------------------------------------------------------- + private Integer programStageInstanceId; + private Collection programValidationResults; private Map leftsideFormulaMap = new HashMap(); @@ -85,6 +89,11 @@ return leftsideFormulaMap; } + public void setProgramStageInstanceId( Integer programStageInstanceId ) + { + this.programStageInstanceId = programStageInstanceId; + } + public Map getRightsideFormulaMap() { return rightsideFormulaMap; @@ -100,11 +109,12 @@ // ------------------------------------------------------------------------- @Override - public String execute() throws Exception + public String execute() + throws Exception { programValidationResults = new ArrayList(); - ProgramStageInstance programStageInstance = selectedStateManager.getSelectedProgramStageInstance(); + ProgramStageInstance programStageInstance = programStageInstanceService.getProgramStageInstance( programStageInstanceId ); List validation = new ArrayList( programValidationService.getProgramValidation( programStageInstance.getProgramStage() ) ); === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2013-10-15 10:28:59 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2013-10-16 10:03:02 +0000 @@ -367,8 +367,8 @@ id="org.hisp.dhis.caseentry.action.caseentry.ValidateProgramInstanceAction" class="org.hisp.dhis.caseentry.action.caseentry.ValidateProgramInstanceAction" scope="prototype"> - + === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js 2013-10-16 08:56:30 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js 2013-10-16 10:03:02 +0000 @@ -433,7 +433,7 @@ autoScroll: true, overflowX: 'hidden', overflowY: 'auto', - width: TR.conf.layout.west_fieldset_width - 16 + width: TR.conf.layout.west_fieldset_width - 15 }; Ext.getCmp(p).add(panel); subPanel = Ext.getCmp(panelid); @@ -449,7 +449,7 @@ id: 'filter_lb_' + fieldid, text:name, style: 'padding-left:2px', - width:(TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor) / 2 - 76 + width:(TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor) / 2 - 93 }; var opt = ""; @@ -556,7 +556,7 @@ params.cls = 'tr-textfield-alt1'; params.style = 'margin-bottom:2px'; params.emptyText = TR.i18n.filter_value; - params.width = (TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor) / 2 - 70; + params.width = (TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor) / 2 - 50; xtype = xtype.toLowerCase(); if( valueType=='GENDER'){ params.xtype = 'combobox'; === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js 2013-10-10 11:07:46 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js 2013-10-16 10:03:02 +0000 @@ -869,10 +869,11 @@ hideById( 'listDiv' ); hideById( 'offlineListDiv' ); setFieldValue( 'programStageInstanceId', programStageInstanceId ); - setInnerHTML( 'dataEntryFormDiv', '' ); + setInnerHTML( 'dataEntryFormDiv', '' ); showLoader(); service.displayProgramStage( getFieldValue( 'programStageId' ), programStageInstanceId, getFieldValue( 'orgunitId' ) ); + jQuery('.stage-object-selected').attr('id', 'ps_' + programStageInstanceId); } function backEventList() { @@ -1021,10 +1022,8 @@ if ( json.response == 'success' ) { $( "#executionDate" ).css( 'background-color', SUCCESS_COLOR ); setFieldValue( 'programStageInstanceId', json.message ); - - if ( programStageInstanceId != json.message ) { - showUpdateEvent( json.message ); - } + jQuery('.stage-object-selected').attr('id', json.message ); + showUpdateEvent( json.message ); } else { $( "#executionDate" ).css( 'background-color', ERROR_COLOR ); === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js 2013-10-14 01:22:01 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js 2013-10-16 10:03:02 +0000 @@ -501,7 +501,10 @@ $("#loading-bar").siblings(".ui-dialog-titlebar").hide(); - $.get( 'validateProgram.action').done(function(html){ + $.get( 'validateProgram.action', + { + programStageInstanceId: jQuery('.stage-object-selected').attr('id').split('_')[1] + }).done(function(html){ $("#loading-bar").dialog("close"); $('#validateProgramDiv').html(html); if( getFieldValue('violateValidation') == 'true' ) { @@ -970,7 +973,11 @@ }); $("#loading-bar").siblings(".ui-dialog-titlebar").hide(); + var programStageInstanceId = jQuery('.stage-object-selected').attr('id').split('_')[1]; $('#validateProgramDiv' ).load( 'validateProgram.action', + { + programStageInstanceId: programStageInstanceId + }, function(){ $( "#loading-bar" ).dialog( "close" );