=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/MarkForFollowupAction.java' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/MarkForFollowupAction.java 2010-04-12 21:23:33 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/MarkForFollowupAction.java 2011-08-20 12:10:52 +0000 @@ -38,7 +38,7 @@ import org.hisp.dhis.organisationunit.OrganisationUnit; import org.hisp.dhis.organisationunit.OrganisationUnitService; import org.hisp.dhis.period.Period; -import org.hisp.dhis.period.PeriodService; +import org.hisp.dhis.period.PeriodType; import com.opensymphony.xwork2.Action; @@ -68,13 +68,6 @@ this.dataElementService = dataElementService; } - private PeriodService periodService; - - public void setPeriodService( PeriodService periodService ) - { - this.periodService = periodService; - } - private OrganisationUnitService organisationUnitService; public void setOrganisationUnitService( OrganisationUnitService organisationUnitService ) @@ -100,18 +93,18 @@ this.dataElementId = dataElementId; } - private Integer periodId; + private String periodId; - public void setPeriodId( Integer periodId ) + public void setPeriodId( String periodId ) { this.periodId = periodId; } - private Integer sourceId; + private int organisationUnitId; - public void setSourceId( Integer sourceId ) + public void setOrganisationUnitId( int organisationUnitId ) { - this.sourceId = sourceId; + this.organisationUnitId = organisationUnitId; } private Integer categoryOptionComboId; @@ -138,9 +131,9 @@ public String execute() { - DataElement dataElement = dataElementService.getDataElement( dataElementId ); - Period period = periodService.getPeriod( periodId ); - OrganisationUnit source = organisationUnitService.getOrganisationUnit( sourceId ); + DataElement dataElement = dataElementService.getDataElement( dataElementId ); + Period period = PeriodType.createPeriodExternalId( periodId ); + OrganisationUnit source = organisationUnitService.getOrganisationUnit( organisationUnitId ); DataElementCategoryOptionCombo categoryOptionCombo = categoryService.getDataElementCategoryOptionCombo( categoryOptionComboId ); DataValue dataValue = dataValueService.getDataValue( source, dataElement, period, categoryOptionCombo ); === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/RegisterCompleteDataSetAction.java' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/RegisterCompleteDataSetAction.java 2011-08-17 15:05:47 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/RegisterCompleteDataSetAction.java 2011-08-20 12:10:52 +0000 @@ -44,7 +44,6 @@ /** * @author Lars Helge Overland - * @version $Id$ */ public class RegisterCompleteDataSetAction implements Action === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/RemoveMinMaxLimitsAction.java' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/RemoveMinMaxLimitsAction.java 2011-08-20 11:10:50 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/RemoveMinMaxLimitsAction.java 2011-08-20 12:10:52 +0000 @@ -40,7 +40,6 @@ /** * @author Torgeir Lorange Ostby - * @version $Id: RemoveMinMaxLimitsAction.java 2869 2007-02-20 14:26:09Z andegje $ */ public class RemoveMinMaxLimitsAction implements Action === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SaveCommentAction.java' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SaveCommentAction.java 2011-08-20 11:33:08 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SaveCommentAction.java 2011-08-20 12:10:52 +0000 @@ -29,8 +29,6 @@ import java.util.Date; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.hisp.dhis.dataelement.DataElement; import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo; import org.hisp.dhis.dataelement.DataElementCategoryService; @@ -47,13 +45,10 @@ /** * @author Torgeir Lorange Ostby - * @version $Id: SaveCommentAction.java 3113 2007-03-19 20:47:10Z torgeilo $ */ public class SaveCommentAction implements Action { - private static final Log LOG = LogFactory.getLog( SaveCommentAction.class ); - // ------------------------------------------------------------------------- // Dependencies // ------------------------------------------------------------------------- @@ -180,8 +175,6 @@ { if ( commentValue != null ) { - LOG.info( "Adding DataValue, comment added " + commentValue ); - dataValue = new DataValue( dataElement, period, organisationUnit, null, storedBy, new Date(), commentValue, optionCombo ); @@ -190,8 +183,6 @@ } else { - LOG.info( "Updating DataValue, comment added/changed " + commentValue ); - dataValue.setComment( commentValue ); dataValue.setTimestamp( new Date() ); dataValue.setStoredBy( storedBy ); === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SaveMinMaxLimitsAction.java' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SaveMinMaxLimitsAction.java 2011-08-20 11:10:50 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SaveMinMaxLimitsAction.java 2011-08-20 12:10:52 +0000 @@ -40,7 +40,6 @@ /** * @author Torgeir Lorange Ostby - * @version $Id: SaveMinMaxLimitsAction.java 2869 2007-02-20 14:26:09Z andegje $ */ public class SaveMinMaxLimitsAction implements Action @@ -117,12 +116,26 @@ } // ------------------------------------------------------------------------- + // Output + // ------------------------------------------------------------------------- + + private int statusCode; + + public int getStatusCode() + { + return statusCode; + } + + // ------------------------------------------------------------------------- // Action implementation // ------------------------------------------------------------------------- public String execute() throws Exception { + minLimit = minLimit != null ? minLimit : 0; + maxLimit = maxLimit != null ? maxLimit : 0; + OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( organisationUnitId ); DataElement dataElement = dataElementService.getDataElement( dataElementId ); === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/META-INF/dhis/beans.xml 2011-08-17 13:41:04 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/META-INF/dhis/beans.xml 2011-08-20 12:10:52 +0000 @@ -111,7 +111,6 @@ scope="prototype"> - === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/org/hisp/dhis/de/i18n_module.properties' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/org/hisp/dhis/de/i18n_module.properties 2011-08-18 17:28:45 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/org/hisp/dhis/de/i18n_module.properties 2011-08-20 12:10:52 +0000 @@ -126,6 +126,7 @@ on = On value = Value no_response_from_server = No response from server, please check connectivity and try again +save = Save save_comment = Save comment operation_not_available_offline = This operation is not available in off-line mode online_notification = You are online === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/struts.xml 2011-08-18 10:12:25 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/struts.xml 2011-08-20 12:10:52 +0000 @@ -47,9 +47,7 @@ - - 204 - + /dhis-web-dataentry/status.vm plainTextError F_DATAELEMENT_MINMAX_ADD,F_DATAELEMENT_MINMAX_UPDATE === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/history.vm' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/history.vm 2011-08-13 17:51:36 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/history.vm 2011-08-20 12:10:52 +0000 @@ -14,9 +14,9 @@

$i18n.getString( "dataelement_comment" ) #if ( $dataValue && $dataValue.isFollowup() ) - $i18n.getString( 'mark_value_for_followup' ) + $i18n.getString( 'mark_value_for_followup' ) #elseif ( $dataValue ) - $i18n.getString( 'unmark_value_for_followup' ) + $i18n.getString( 'unmark_value_for_followup' ) #else #end @@ -30,26 +30,22 @@

$encoder.htmlEncode( $i18n.getString( "min_max_limits" ) )

+ + + + + - - - - - - @@ -60,7 +56,8 @@ - +
 $encoder.htmlEncode( $i18n.getString( "min_limit" ) ) + +
  $encoder.htmlEncode( $i18n.getString( "max_limit" ) ) +
 $encoder.htmlEncode( $i18n.getString( "min_limit" ) ) - -
  $encoder.htmlEncode( $i18n.getString( "average" ) ) ${average}
+
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js 2011-08-20 11:33:08 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js 2011-08-20 12:10:52 +0000 @@ -116,7 +116,7 @@ $( '#maxSpan' ).html( '' ); } - if ( eval( minValue ) > eval( maxValue ) ) + if ( new Number( minValue ) > new Number( maxValue ) ) { $( '#maxSpan' ).html( i18n_max_must_be_greater_than_min ); return; @@ -132,34 +132,52 @@ currentMinMaxValueMap[minId] = minValue; currentMinMaxValueMap[maxId] = maxValue; - $.get( 'saveMinMaxLimits.action', + $.ajax( { + url: 'saveMinMaxLimits.action', + data: { organisationUnitId: currentOrganisationUnitId, dataElementId: currentDataElementId, categoryOptionComboId: currentOptionComboId, minLimit: minValue, - maxValue: maxValue - }, - refreshChart ); + maxLimit: maxValue + }, + dataType: 'json', + cache: false, + success: function() { + $( '#minLimit' ).css( 'background-color', COLOR_GREEN ); + $( '#maxLimit' ).css( 'background-color', COLOR_GREEN ); + refreshChart(); + }, + error: function() { + + $( '#minLimit' ).css( 'background-color', COLOR_RED ); + $( '#maxLimit' ).css( 'background-color', COLOR_RED ); + } + } ); } function refreshChart() -{ +{ + var periodId = $( '#selectedPeriodId' ).val(); + var source = 'getHistoryChart.action?dataElementId=' + currentDataElementId + '&categoryOptionComboId=' + currentOptionComboId + '&periodId=' + periodId + '&organisationUnitId=' + currentOrganisationUnitId + '&r=' + Math.random(); $( '#historyChart' ).attr( 'src', source ); } -function markValueForFollowup( dataElementId, periodId, sourceId, categoryOptionComboId ) +function markValueForFollowup() { + var periodId = $( '#selectedPeriodId' ).val(); + $.ajax( { url: 'markValueForFollowup.action', data: { - dataElementId: dataElementId, + dataElementId: currentDataElementId, + categoryOptionComboId: currentOptionComboId, periodId: periodId, - sourceId: sourceId, - categoryOptionComboId: categoryOptionComboId + organisationUnitId: currentOrganisationUnitId }, cache: false, dataType: 'json',