=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceService.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceService.java 2013-02-27 14:39:27 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceService.java 2013-03-04 09:38:55 +0000 @@ -111,7 +111,21 @@ Collection orgunitIds, Date startDate, Date endDate, int status, Integer max, Integer min ); Grid getAggregateReport( int position, ProgramStage programStage, Collection orgunitIds, - String facilityLB, Integer deGroupBy, Integer deSum, Map> deFilters, List periods, - String aggregateType, Integer limit, Boolean useCompletedEvents, I18nFormat format, I18n i18n ); + String facilityLB, Integer deGroupBy, Integer deSum, Map> deFilters, + List periods, String aggregateType, Integer limit, Boolean useCompletedEvents, I18nFormat format, + I18n i18n ); + + // ------------------------------------------------------------------------- + // Activity plans + // ------------------------------------------------------------------------- + + List activityPlanList( Program program, Collection orgunitIds, Date startDate, Date endDate, + Collection statusList, Integer min, Integer max ); + + Grid activityPlans( Program program, Collection orgunitIds, Date startDate, Date endDate, + Collection statusList, Integer min, Integer max, I18n i18n ); + + int getActiveInstanceCount( Program program, Collection orgunitIds, Date startDate, Date endDate, + Collection statusList ); } === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceStore.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceStore.java 2013-02-27 14:39:27 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceStore.java 2013-03-04 09:38:55 +0000 @@ -105,4 +105,14 @@ String facilityLB, Integer deGroupBy, Integer deSum, Map> deFilters, List periods, String aggregateType, Integer limit, Boolean useCompletedEvents, I18nFormat format, I18n i18n ); + // ------------------------------------------------------------------------- + // Activity plans + // ------------------------------------------------------------------------- + + List getActiveInstance( Program program, Collection orgunitIds, Date startDate, + Date endDate, Collection statusList, Integer max, Integer min ); + + int getActiveInstanceCount( Program program, Collection orgunitIds, Date startDate, + Date endDate, Collection statusList ); + } === modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java' --- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java 2013-02-27 14:39:27 +0000 +++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java 2013-03-04 09:38:55 +0000 @@ -48,6 +48,7 @@ import org.hisp.dhis.period.Period; import org.hisp.dhis.sms.outbound.OutboundSms; import org.hisp.dhis.system.grid.ListGrid; +import org.hisp.dhis.system.util.DateUtils; import org.springframework.transaction.annotation.Transactional; /** @@ -355,4 +356,49 @@ deSum, deFilters, periods, aggregateType, limit, useCompletedEvents, format, i18n ); } + public List activityPlanList( Program program, Collection orgunitIds, + Date startDate, Date endDate, Collection statusList, Integer min, Integer max ) + { + return programStageInstanceStore.getActiveInstance( program, orgunitIds, startDate, endDate, statusList, max, + min ); + } + + @Override + public Grid activityPlans( Program program, Collection orgunitIds, Date startDate, Date endDate, + Collection statusList, Integer min, Integer max, I18n i18n ) + { + List stageInstances = programStageInstanceStore.getActiveInstance( program, orgunitIds, + startDate, endDate, statusList, max, min ); + + Grid grid = new ListGrid(); + grid.setTitle( program.getDisplayName() ); + + // Header + grid.addHeader( new GridHeader( i18n.getString( "full_name" ), false, false ) ); + grid.addHeader( new GridHeader( i18n.getString( "date_scheduled" ), false, false ) ); + + String programStage = ""; + for ( ProgramStageInstance stageInstance : stageInstances ) + { + String eventName = stageInstance.getProgramStage().getDisplayName(); + if ( !programStage.equals( eventName ) ) + { + grid.addRow(); + grid.addValue( eventName ); + grid.addValue( "" ); + programStage = eventName; + } + grid.addRow(); + grid.addValue( stageInstance.getProgramInstance().getPatient().getFullName() ); + grid.addValue( DateUtils.getMediumDateString( stageInstance.getDueDate() ) ); + } + + return grid; + } + + public int getActiveInstanceCount( Program program, Collection orgunitIds, Date startDate, Date endDate, + Collection statusList ) + { + return programStageInstanceStore.getActiveInstanceCount( program, orgunitIds, startDate, endDate, statusList ); + } } === modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java' --- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java 2013-02-27 14:39:27 +0000 +++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java 2013-03-04 09:38:55 +0000 @@ -41,6 +41,7 @@ import org.hibernate.Criteria; import org.hibernate.Query; +import org.hibernate.criterion.Disjunction; import org.hibernate.criterion.Order; import org.hibernate.criterion.Projections; import org.hibernate.criterion.Restrictions; @@ -61,6 +62,7 @@ import org.hisp.dhis.patientreport.PatientAggregateReport; import org.hisp.dhis.patientreport.TabularReportColumn; import org.hisp.dhis.period.Period; +import org.hisp.dhis.program.Program; import org.hisp.dhis.program.ProgramInstance; import org.hisp.dhis.program.ProgramStage; import org.hisp.dhis.program.ProgramStageInstance; @@ -683,6 +685,24 @@ return grid; } + @SuppressWarnings( "unchecked" ) + public List getActiveInstance( Program program, Collection orgunitIds, + Date startDate, Date endDate, Collection statusList, Integer max, Integer min ) + { + return getActiveInstanceCriteria( program, orgunitIds, startDate, endDate, statusList, max, min ).list(); + } + + @SuppressWarnings( "unchecked" ) + public int getActiveInstanceCount( Program program, Collection orgunitIds, Date startDate, Date endDate, + Collection statusList ) + { + Criteria criteria = getActiveInstanceCriteria( program, orgunitIds, startDate, endDate, statusList, null, null ); + + List list = criteria.list(); + + return list != null ? list.size() : 0; + } + // ------------------------------------------------------------------------- // Supportive methods // ------------------------------------------------------------------------- @@ -1752,7 +1772,7 @@ return orgunitIds; } - public void fillDataInGrid( Grid grid, SqlRowSet rs, I18n i18n ) + private void fillDataInGrid( Grid grid, SqlRowSet rs, I18n i18n ) { int cols = rs.getMetaData().getColumnCount(); int dataCols = 0; @@ -1920,4 +1940,61 @@ } } + public Criteria getActiveInstanceCriteria( Program program, Collection orgunitIds, Date startDate, + Date endDate, Collection statusList, Integer max, Integer min ) + { + Criteria criteria = getCriteria(); + criteria.createAlias( "programInstance", "programInstance" ); + criteria.createAlias( "programStage", "programStage" ); + criteria.createAlias( "programInstance.patient", "patient" ); + criteria.createAlias( "patient.organisationUnit", "regOrgunit" ); + criteria.add( Restrictions.eq( "programInstance.program", program ) ); + criteria.add( Restrictions.isNull( "programInstance.endDate" ) ); + + Disjunction disjunction = Restrictions.disjunction(); + + for ( Integer status : statusList ) + { + switch ( status ) + { + case ProgramStageInstance.COMPLETED_STATUS: + disjunction.add( Restrictions.and( Restrictions.eq( "completed", true ), + Restrictions.between( "executionDate", startDate, endDate ), + Restrictions.in( "organisationUnit.id", orgunitIds ) ) ); + break; + case ProgramStageInstance.VISITED_STATUS: + disjunction.add( Restrictions.and( Restrictions.eq( "completed", false ), + Restrictions.between( "executionDate", startDate, endDate ), + Restrictions.in( "organisationUnit.id", orgunitIds ) ) ); + break; + case ProgramStageInstance.FUTURE_VISIT_STATUS: + disjunction.add( Restrictions.and( + Restrictions.isNull( "executionDate" ), + Restrictions.between( "dueDate", new Date(), endDate ), + Restrictions.in( "regOrgunit.id", orgunitIds ) ) ); + break; + case ProgramStageInstance.LATE_VISIT_STATUS: + disjunction.add( Restrictions.and( + Restrictions.isNull( "executionDate" ), + Restrictions.between( "dueDate", startDate, new Date() ), + Restrictions.in( "regOrgunit.id", orgunitIds ) ) ); + break; + default: + break; + } + } + + criteria.add( disjunction ); + + if ( min != null && max != null ) + { + criteria.setFirstResult( min ); + criteria.setMaxResults( max ); + } + + criteria.addOrder( Order.asc( "programStage.minDaysFromStart" ) ); + criteria.addOrder( Order.desc( "dueDate" ) ); + + return criteria; + } } === added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetActivityPlansAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetActivityPlansAction.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetActivityPlansAction.java 2013-03-04 09:38:55 +0000 @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2004-2009, University of Oslo + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of the HISP project nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package org.hisp.dhis.caseentry.action.caseentry; + +import java.util.Collection; +import java.util.HashSet; +import java.util.List; + +import org.hisp.dhis.caseentry.state.SelectedStateManager; +import org.hisp.dhis.common.Grid; +import org.hisp.dhis.i18n.I18n; +import org.hisp.dhis.i18n.I18nFormat; +import org.hisp.dhis.organisationunit.OrganisationUnit; +import org.hisp.dhis.paging.ActionPagingSupport; +import org.hisp.dhis.program.Program; +import org.hisp.dhis.program.ProgramService; +import org.hisp.dhis.program.ProgramStageInstance; +import org.hisp.dhis.program.ProgramStageInstanceService; + +/** + * @author Chau Thu Tran + * + * @version GetActivityPlansAction.java 7:10:29 PM Mar 4, 2013 $ + */ +public class GetActivityPlansAction + extends ActionPagingSupport +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private SelectedStateManager selectedStateManager; + + public void setSelectedStateManager( SelectedStateManager selectedStateManager ) + { + this.selectedStateManager = selectedStateManager; + } + + private ProgramService programService; + + public void setProgramService( ProgramService programService ) + { + this.programService = programService; + } + + private ProgramStageInstanceService programStageInstanceService; + + public void setProgramStageInstanceService( ProgramStageInstanceService programStageInstanceService ) + { + this.programStageInstanceService = programStageInstanceService; + } + + private I18n i18n; + + public void setI18n( I18n i18n ) + { + this.i18n = i18n; + } + + private I18nFormat format; + + public void setFormat( I18nFormat format ) + { + this.format = format; + } + + // ------------------------------------------------------------------------- + // Input/output + // ------------------------------------------------------------------------- + + private Integer programId; + + public void setProgramId( Integer programId ) + { + this.programId = programId; + } + + private Collection statusList; + + public void setStatusList( Collection statusList ) + { + this.statusList = statusList; + } + + private String startDate; + + public void setStartDate( String startDate ) + { + this.startDate = startDate; + } + + private String endDate; + + public void setEndDate( String endDate ) + { + this.endDate = endDate; + } + + private String type; + + public void setType( String type ) + { + this.type = type; + } + + private Integer total; + + public Integer getTotal() + { + return total; + } + + private Program program; + + public Program getProgram() + { + return program; + } + + private List programStageInstances; + + public List getProgramStageInstances() + { + return programStageInstances; + } + + private Grid grid; + + public Grid getGrid() + { + return grid; + } + + // ------------------------------------------------------------------------- + // Implementation Action + // ------------------------------------------------------------------------- + + public String execute() + throws Exception + { + OrganisationUnit orgunit = selectedStateManager.getSelectedOrganisationUnit(); + + Collection orgunitIds = new HashSet(); + orgunitIds.add( orgunit.getId() ); + + program = programService.getProgram( programId ); + + // --------------------------------------------------------------------- + // Program instances for the selected program + // --------------------------------------------------------------------- + + if ( type == null ) + { + total = programStageInstanceService.getActiveInstanceCount( program, orgunitIds, + format.parseDate( startDate ), format.parseDate( endDate ), statusList ); + + this.paging = createPaging( total ); + + programStageInstances = programStageInstanceService.activityPlanList( program, orgunitIds, + format.parseDate( startDate ), format.parseDate( endDate ), statusList, paging.getStartPos(), + paging.getPageSize() ); + } + else + { + grid = programStageInstanceService.activityPlans( program, orgunitIds, format.parseDate( startDate ), + format.parseDate( endDate ), statusList, null, null, i18n ); + } + return type == null ? SUCCESS : type; + } +} === 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-03-01 14:09:05 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2013-03-04 09:38:55 +0000 @@ -1095,5 +1095,17 @@ + + + + + + + + === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties 2013-03-02 06:07:36 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties 2013-03-04 09:38:55 +0000 @@ -567,4 +567,6 @@ enter_a_value_greater_than_or_equal_to_nagetive_90 = Please enter a value greater than or equal to -90. enter_values_for_longitude_and_latitude_fields = Please enter values for both longitude and latitude fields enter_a_valid_number = Please enter a valid number. -enter_a_number = Enter a number \ No newline at end of file +enter_a_number = Enter a number +for = For +date_scheduled = Date scheduled \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml 2013-03-01 14:09:05 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml 2013-03-04 09:38:55 +0000 @@ -1067,10 +1067,12 @@ + class="org.hisp.dhis.caseentry.action.caseentry.GetActivityPlansAction"> /content.vm /dhis-web-caseentry/activityPlanRecords.vm style/style.css + +   $!total - #if( $patients && $patients.size()>0 ) - #parse( "/dhis-web-caseentry/colorHelp.vm" ) - #end -#if( $patients && $patients.size()>0 ) - - #set( $mark = false ) - #foreach( $patient in $patients ) - #set( $programInstance = '') - #set( $programInstance = $programInstanceMap.get( $patient ) ) - - - - #set( $programStageInstances = $programInstance.programStageInstances ) - - - #if( $mark ) - #set( $mark = false ) - #else - #set( $mark = true ) - #end +#if( $programStageInstances && $programStageInstances.size()>0 ) +
+
- #set( $value="") - #foreach( $identifierType in $programInstance.program.patientIdentifierTypes ) - #foreach( $pIdentifier in $patient.identifiers ) - #if($identifierType.personDisplayName=="true" && $identifierType.id==$pIdentifier.identifierType.id) - #set($value=$value + $pIdentifier.identifier + " " ) - #end - #end - #end - #if($value=="") - #set($value=$patient.getFullName()) - #end - - - » - - - - - - - - -
-
 
-
-
- - - #set( $flag = "false" ) - #set( $idx = 0) - #foreach( $programStageInstance in $programStageInstances ) - #set( $idx = $idx + 1) - - - #end - -
- #set($title="") - #set($index = 0) - #foreach( $comment in $programStageInstance.patientComments) - #if( $index < 5) - #set( $title= $title + "$format.formatDate( $comment.createdDate ) - $comment.creator - $comment.commentText " ) - #set( $index = $index + 1 ) - #end - #end - #set($valueDate=$format.formatDate( $programStageInstance.dueDate )) - #if($!programStageInstance.executionDate) - #set($valueDate=$format.formatDate( $programStageInstance.executionDate )) - #end - - -
-
-
 
-
-
+ + + + #set( $programStage = '' ) + #foreach( $programStageInstance in $programStageInstances ) + #set( $eventName = $programStageInstance.programStage.displayName ) + #if( $eventName != $programStage) + + + + + + #set( $mark = false ) + #set( $nr = 0 ) + #set( $programStage = $eventName ) + #end + + + + + + #set( $mark = !$mark ) #end -
$i18n.getString('for') $eventName
#$i18n.getString('full_name')$i18n.getString('date_scheduled')
+ #set( $nr = $nr + 1 ) + $nr + $programStageInstance.programInstance.patient.getFullName() + #if($!programStageInstance.executionDate) + $format.formatDate($!programStageInstance.executionDate) + #else + $format.formatDate($!programStageInstance.dueDate) + #end + +
#parse( "/dhis-web-commons/paging/paging.vm" )
- -
+ + +
+ #end - - \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanSelect.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanSelect.vm 2013-01-23 10:27:28 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanSelect.vm 2013-03-04 09:38:55 +0000 @@ -19,7 +19,6 @@ - === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/cacheManifest.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/cacheManifest.vm 2013-03-02 15:09:06 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/cacheManifest.vm 2013-03-04 09:38:55 +0000 @@ -1,5 +1,5 @@ CACHE MANIFEST -# 2.11-SNAPSHOT V25 +# 2.11-SNAPSHOT V27 NETWORK: * CACHE: === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/activityPlan.js' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/activityPlan.js 2013-02-28 09:23:38 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/activityPlan.js 2013-03-04 09:38:55 +0000 @@ -47,22 +47,21 @@ setFieldValue('listAll', "true"); hideById('listPatientDiv'); contentDiv = 'listPatientDiv'; + + var statusList = ""; + var statusEvent = getFieldValue('statusEvent').split('_'); + for( var i in statusEvent){ + statusList += "&statusList=" + statusEvent[i]; + } + $('#contentDataRecord').html(''); - var programId = getFieldValue('programIdAddPatient'); - var searchTexts = "stat_" + programId - + "_" + getFieldValue('startDueDate') - + "_" + getFieldValue('endDueDate') - + "_" + getFieldValue('orgunitId') - + "_false" - + "_" + getFieldValue('statusEvent'); showLoader(); - jQuery('#listPatientDiv').load('getActivityPlanRecords.action', + jQuery('#listPatientDiv').load('getActivityPlanRecords.action?' + statusList, { - programId:programId, - listAll:false, - searchBySelectedOrgunit: false, - searchTexts: searchTexts + programId:getFieldValue('programIdAddPatient'), + startDate:getFieldValue('startDueDate'), + endDue:getFieldValue('endDueDate') }, function() { @@ -75,19 +74,12 @@ function exportActitityList( type ) { - var programId = getFieldValue('programIdAddPatient'); - var searchTexts = "stat_" + programId - + "_" + getFieldValue('startDueDate') - + "_" + getFieldValue('endDueDate') - + "_" + getFieldValue('orgunitId') - + "_false" - + "_" + getFieldValue('statusEvent'); - var params = "searchTexts=" + searchTexts; - params += "&listAll=fase"; - params += "&type=" + type; - params += "&programId=" + getFieldValue('programIdAddPatient'); - params += "&searchBySelectedOrgunit=false"; - + var params = "programId=" + getFieldValue('programIdAddPatient'); + params += "&startDate=" + getFieldValue('startDueDate'); + params += "&endDue=" + getFieldValue('endDueDate'); + for( var i in statusEvent){ + params += "&statusList=" + statusEvent[i]; + } var url = "exportActitityList.action?" + params; window.location.href = url; } @@ -98,16 +90,11 @@ function loadDataEntry( programStageInstanceId ) { - jQuery("#patientList input[name='programStageBtn']").each(function(i,item){ - jQuery(item).removeClass('stage-object-selected'); - }); - jQuery( '#' + prefixId + programStageInstanceId ).addClass('stage-object-selected'); - setFieldValue('programStageInstanceId', programStageInstanceId); - $('#contentDataRecord' ).load("viewProgramStageRecords.action", { programStageInstanceId: programStageInstanceId - }, function(){ + }, function(){ + showById('reportDateDiv'); showById('patientInforTB'); showById('postCommentTbl'); showById('entryForm'); @@ -124,32 +111,6 @@ }); } -function statusEventOnChange() -{ - if( !byId('useCalendar').checked ) - { - var statusEvent = getFieldValue("statusEvent"); - - if( statusEvent == '1_2_3_4' - || statusEvent == '3_4' - || statusEvent == '2_3_4' ){ - enable('showEventSince'); - enable('showEventUpTo'); - setDateRange(); - } - else if( statusEvent == '3' ){ - disable('showEventSince'); - enable('showEventUpTo'); - setDateRange(); - } - else{ - enable('showEventSince'); - disable('showEventUpTo'); - setDateRange(); - } - } -} - function setDateRange() { var statusEvent = getFieldValue("statusEvent"); @@ -240,81 +201,4 @@ var y= date.getFullYear(); } -// -------------------------------------------------------------------- -// Cosmetic UI -// -------------------------------------------------------------------- - -function reloadRecordList() -{ - var startDate = getFieldValue('startDueDate'); - var endDate = getFieldValue('endDueDate'); - var arrStatus = getFieldValue('statusEvent').split('_'); - var paddingIndex = 1; - - jQuery("#patientList .stage-object").each( function(){ - var id = this.id.split('_')[1]; - var dueDate = jQuery(this).attr('dueDate'); - var statusEvent = jQuery(this).attr('status'); - var programInstanceId = jQuery(this).attr('programInstanceId'); - if( dueDate >= startDate && dueDate <= endDate - && jQuery.inArray(statusEvent, arrStatus) > -1) - { - if( jQuery("#tb_" + programInstanceId + " .searched").length == 0 ) - { - jQuery("#arrow_" + id ).addClass("displayed"); - var index = eval(jQuery("#ps_" + id ).attr("index")); - if( paddingIndex < index ){ - paddingIndex = index; - } - } - jQuery("#ps_" + id ).addClass("stage-object-selected searched"); - } - hideById('arrow_' + id ); - hideById('ps_' + id ); - }); - - jQuery(".table-flow").each( function(){ - var scheduledEvent = jQuery(this).find("[status='3']:first"); - scheduledEvent.addClass("stage-scheduled"); - scheduledEvent.css('border-color', MARKED_VISIT_COLOR); - scheduledEvent.focus(); - - var firstEvent = jQuery(this).find(".searched:first"); - firstEvent.show(); - var id = firstEvent.attr("id").split('_')[1]; - showById('arrow_' + id ); - var index = firstEvent.attr("index"); - if( index0) - { - var id = jQuery("#tb_" + programInstanceId + " .searched").attr('id').split('_')[1]; - showById("arrow_" + id); - showById("ps_" + id ); - } - - jQuery("#tb_" + programInstanceId + " .table-flow").each( function(){ - var scheduledEvent = jQuery(this).find("[status='3']:first"); - scheduledEvent.focus(); - }); - - resize(); -} +function entryFormContainerOnReady (){} === 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-03-02 05:09:13 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js 2013-03-04 09:38:55 +0000 @@ -5,8 +5,12 @@ function saveVal( dataElementId ) { - if( jQuery('#entryFormContainer [id=programStageId]') == null) return; + var programStageId = jQuery('.stage-object-selected').attr('psid'); + if(programStageId==undefined){ + if( jQuery('#entryFormContainer [id=programStageId]') == null) return; + else programStageId = jQuery('#entryFormContainer [id=programStageId]').val(); + } var fieldId = programStageId + '-' + dataElementId + '-val'; === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/reportDataEntryForm.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/reportDataEntryForm.vm 2013-03-02 15:09:06 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/reportDataEntryForm.vm 2013-03-04 09:38:55 +0000 @@ -53,6 +53,7 @@ +

#parse( "dhis-web-commons/loader/loader.vm" ) === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.css' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.css 2013-03-02 15:09:06 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.css 2013-03-04 09:38:55 +0000 @@ -526,4 +526,23 @@ .coordinates2{ width: 150px; -} \ No newline at end of file +} + + +.visit-schedule +{ + overflow-y: auto; + overflow-x:hidden; +} + +.visit-schedule table +{ + width:100%; +} + +.visit-schedule td +{ + padding-top:3px; + padding-bottom:3px; + border-bottom:1px solid #cad5e5; +}