Merge pull request #1884 from vmazurashu/master
#1872: contacting stats needs checking
This commit is contained in:
commit
73a63e4381
2 changed files with 8 additions and 8 deletions
|
|
@ -54,8 +54,10 @@ public class StartupApplicationListener implements ApplicationListener {
|
||||||
@Override
|
@Override
|
||||||
public void onApplicationEvent(ApplicationEvent event) {
|
public void onApplicationEvent(ApplicationEvent event) {
|
||||||
// Send data to server
|
// Send data to server
|
||||||
if (!SecurityUtils.isGatheredStatsAlreadySent &&
|
if (SecurityUtils.isGatheredStatsAlreadySent) {
|
||||||
configurationDAO.getConfigurationWithReadOnlyTransaction().isAllowToGatherUsageStatsEnabled()) {
|
return;
|
||||||
|
}
|
||||||
|
if (configurationDAO.getConfigurationWithReadOnlyTransaction() == null || configurationDAO.getConfigurationWithReadOnlyTransaction().isAllowToGatherUsageStatsEnabled()) {
|
||||||
GatheredUsageStats gatheredUsageStats = new GatheredUsageStats();
|
GatheredUsageStats gatheredUsageStats = new GatheredUsageStats();
|
||||||
|
|
||||||
gatheredUsageStats.setupNotAutowiredClasses(userDAO, orderModel, workReportModel, workerModel, machineModel,
|
gatheredUsageStats.setupNotAutowiredClasses(userDAO, orderModel, workReportModel, workerModel, machineModel,
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,6 @@ import org.apache.commons.logging.LogFactory;
|
||||||
import org.apache.cxf.jaxrs.client.WebClient;
|
import org.apache.cxf.jaxrs.client.WebClient;
|
||||||
import org.libreplan.business.calendars.entities.BaseCalendar;
|
import org.libreplan.business.calendars.entities.BaseCalendar;
|
||||||
import org.libreplan.business.common.daos.IConfigurationDAO;
|
import org.libreplan.business.common.daos.IConfigurationDAO;
|
||||||
import org.libreplan.business.common.entities.*;
|
|
||||||
import org.libreplan.business.common.exceptions.ValidationException;
|
import org.libreplan.business.common.exceptions.ValidationException;
|
||||||
import org.libreplan.business.costcategories.entities.TypeOfWorkHours;
|
import org.libreplan.business.costcategories.entities.TypeOfWorkHours;
|
||||||
import org.libreplan.business.users.entities.UserRole;
|
import org.libreplan.business.users.entities.UserRole;
|
||||||
|
|
@ -254,11 +253,10 @@ public class ConfigurationController extends GenericForwardComposer {
|
||||||
messages.showMessage(Level.INFO, _("Changes saved"));
|
messages.showMessage(Level.INFO, _("Changes saved"));
|
||||||
|
|
||||||
// Send data to server
|
// Send data to server
|
||||||
if ( !SecurityUtils.isGatheredStatsAlreadySent &&
|
if (!SecurityUtils.isGatheredStatsAlreadySent &&
|
||||||
configurationDAO.getConfigurationWithReadOnlyTransaction().isAllowedToGatherUsageStatsEnabled() ) {
|
configurationDAO.getConfigurationWithReadOnlyTransaction().isAllowedToGatherUsageStatsEnabled()) {
|
||||||
|
sendDataToServer();
|
||||||
sendDataToServer();
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ( getSelectedConnector() != null &&
|
if ( getSelectedConnector() != null &&
|
||||||
!configurationModel.scheduleOrUnscheduleJobs(getSelectedConnector())) {
|
!configurationModel.scheduleOrUnscheduleJobs(getSelectedConnector())) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue