=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserCredentials.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserCredentials.java 2011-07-22 20:43:53 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserCredentials.java 2011-09-15 13:30:54 +0000 @@ -168,6 +168,18 @@ return true; } + /** + * Return the name of this user credentials. More specifically, if this + * credentials has a user it will return the first name and surname of that + * user, if not it returns the username of this credentials. + * + * @return the name. + */ + public String getName() + { + return user != null ? user.getName() : username; + } + // ------------------------------------------------------------------------- // hashCode and equals // ------------------------------------------------------------------------- === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/HistoryAction.java' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/HistoryAction.java 2011-08-13 17:51:36 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/HistoryAction.java 2011-09-15 13:30:54 +0000 @@ -44,6 +44,8 @@ import org.hisp.dhis.organisationunit.OrganisationUnitService; import org.hisp.dhis.period.Period; import org.hisp.dhis.period.PeriodType; +import org.hisp.dhis.user.UserCredentials; +import org.hisp.dhis.user.UserService; import com.opensymphony.xwork2.Action; @@ -100,6 +102,13 @@ { this.organisationUnitService = organisationUnitService; } + + private UserService userService; + + public void setUserService( UserService userService ) + { + this.userService = userService; + } // ------------------------------------------------------------------------- // Input @@ -149,13 +158,13 @@ return dataElementHistory; } - private Boolean isHistoryValid = true; + private boolean historyInvalid; - public Boolean getIsHistoryValid() + public boolean isHistoryInvalid() { - return isHistoryValid; + return historyInvalid; } - + private DataValue dataValue; public DataValue getDataValue() @@ -176,7 +185,14 @@ { return dataValueAudits; } - + + private String storedBy; + + public String getStoredBy() + { + return storedBy; + } + // ------------------------------------------------------------------------- // Action implementation // ------------------------------------------------------------------------- @@ -204,13 +220,16 @@ dataValue = dataValueService.getDataValue( organisationUnit, dataElement, period, optionCombo ); + if ( dataValue != null ) + { + UserCredentials credentials = userService.getUserCredentialsByUsername( dataValue.getStoredBy() ); + storedBy = credentials != null ? credentials.getName() : dataValue.getStoredBy(); + } + dataElementHistory = historyRetriever.getHistory( dataElement, optionCombo, organisationUnit, period, HISTORY_LENGTH ); - if ( dataElementHistory == null ) - { - isHistoryValid = false; - } - + historyInvalid = dataElementHistory == null; + // --------------------------------------------------------------------- // Data Value Audit // --------------------------------------------------------------------- === 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-20 12:10:52 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/META-INF/dhis/beans.xml 2011-09-15 13:30:54 +0000 @@ -78,6 +78,7 @@ + \= -number=Number -move_down=Move down -export_entry_template=Export Entry screen as Excel -greater_than=> -min=Min -minimum=Minimum -the_following_values_violates_rules=The following values violates validation rules -cancel=Cancel -no_period_selected=No Period Selected -audit=\u12A0\u1265\u12EE\u1275 -multidimensional_data_entry=Multi-Dimensional Data Entry -run_validation=Run validation === 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-20 12:10:52 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/history.vm 2011-09-15 13:30:54 +0000 @@ -30,7 +30,7 @@

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

- + - + - + - - - - - - + + + + + + + + + + + +
   $encoder.htmlEncode( $i18n.getString( "min_limit" ) ) @@ -38,7 +38,7 @@
   $encoder.htmlEncode( $i18n.getString( "max_limit" ) ) @@ -46,30 +46,37 @@
   $encoder.htmlEncode( $i18n.getString( "average" ) ) ${average}
 $encoder.htmlEncode( $i18n.getString( "interpolation" ) ) $!{average}
$i18n.getString( "stored_by" )$!encoder.htmlEncode( $storedBy )
$i18n.getString( "stored_date" )$!format.formatDate( $dataValue.timestamp )
+ #if( $historyInvalid ) +

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

+ #else

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

- #if( !$isHistoryValid ) -

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

- #end + #end #if( $dataValueAuditSize > 0 )