=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java 2012-09-24 13:50:59 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java 2012-12-11 21:17:31 +0000 @@ -363,6 +363,11 @@ return 500; } + public boolean hasUserOrgUnit() + { + return userOrganisationUnit || userOrganisationUnitChildren; + } + // ------------------------------------------------------------------------- // Getters and setters // ------------------------------------------------------------------------- === modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/action/ProvideContentAction.java' --- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/action/ProvideContentAction.java 2012-06-03 16:26:12 +0000 +++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/action/ProvideContentAction.java 2012-12-11 21:17:31 +0000 @@ -37,6 +37,9 @@ import org.hisp.dhis.chart.ChartService; import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator; import org.hisp.dhis.dashboard.DashboardManager; +import org.hisp.dhis.organisationunit.OrganisationUnit; +import org.hisp.dhis.user.CurrentUserService; +import org.hisp.dhis.user.User; import com.opensymphony.xwork2.Action; import com.opensymphony.xwork2.ActionContext; @@ -65,6 +68,13 @@ { this.chartService = chartService; } + + private CurrentUserService currentUserService; + + public void setCurrentUserService( CurrentUserService currentUserService ) + { + this.currentUserService = currentUserService; + } // ------------------------------------------------------------------------- // Input @@ -101,6 +111,13 @@ { return chartAreas; } + + private OrganisationUnit organisationUnit; + + public OrganisationUnit getOrganisationUnit() + { + return organisationUnit; + } // ------------------------------------------------------------------------- // Action implementation @@ -133,7 +150,14 @@ chartAreas.add( chart ); } + + User user = currentUserService.getCurrentUser(); + if ( user != null ) + { + organisationUnit = user.getOrganisationUnit(); + } + return SUCCESS; } } === modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/META-INF/dhis/beans.xml 2012-10-14 18:31:58 +0000 +++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/META-INF/dhis/beans.xml 2012-12-11 21:17:31 +0000 @@ -15,6 +15,7 @@ scope="prototype"> + $i18n.getString( "close" ) $i18n.getString( "clear" ) #if( $chart ) - $i18n.getString( "view_full_size" ) + $i18n.getString( "view_full_size" ) $i18n.getString( "share" ) #end @@ -49,7 +49,8 @@ #if ( $chart ) - + #else
$i18n.getString( 'this_is_a_chart_area' )