use of org.hisp.dhis.i18n.I18nFormat in project dhis2-core by dhis2.
the class EventVisualizationController method postProcessResponseEntity.
@Override
protected void postProcessResponseEntity(final EventVisualization eventVisualization, final WebOptions options, final Map<String, String> parameters) {
eventVisualization.populateAnalyticalProperties();
final User currentUser = currentUserService.getCurrentUser();
if (currentUser != null) {
final Set<OrganisationUnit> roots = currentUser.getDataViewOrganisationUnitsWithFallback();
for (OrganisationUnit organisationUnit : eventVisualization.getOrganisationUnits()) {
eventVisualization.getParentGraphMap().put(organisationUnit.getUid(), organisationUnit.getParentGraph(roots));
}
}
final I18nFormat format = i18nManager.getI18nFormat();
if (eventVisualization.getPeriods() != null && !eventVisualization.getPeriods().isEmpty()) {
for (final Period period : eventVisualization.getPeriods()) {
period.setName(format.formatPeriod(period));
}
}
}
use of org.hisp.dhis.i18n.I18nFormat in project dhis2-core by dhis2.
the class EventReportController method postProcessResponseEntity.
@Override
protected void postProcessResponseEntity(EventReport report, WebOptions options, Map<String, String> parameters) throws Exception {
report.populateAnalyticalProperties();
User currentUser = currentUserService.getCurrentUser();
if (currentUser != null) {
Set<OrganisationUnit> roots = currentUser.getDataViewOrganisationUnitsWithFallback();
for (OrganisationUnit organisationUnit : report.getOrganisationUnits()) {
report.getParentGraphMap().put(organisationUnit.getUid(), organisationUnit.getParentGraph(roots));
}
}
I18nFormat format = i18nManager.getI18nFormat();
if (report.getPeriods() != null && !report.getPeriods().isEmpty()) {
for (Period period : report.getPeriods()) {
period.setName(format.formatPeriod(period));
}
}
}
Aggregations