Merge pull request #1884 from vmazurashu/master

#1872: contacting stats needs checking
This commit is contained in:
Jeroen Baten 2018-09-11 17:26:04 +02:00 committed by GitHub
commit 73a63e4381
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View file

@ -54,8 +54,10 @@ public class StartupApplicationListener implements ApplicationListener {
@Override
public void onApplicationEvent(ApplicationEvent event) {
// Send data to server
if (!SecurityUtils.isGatheredStatsAlreadySent &&
configurationDAO.getConfigurationWithReadOnlyTransaction().isAllowToGatherUsageStatsEnabled()) {
if (SecurityUtils.isGatheredStatsAlreadySent) {
return;
}
if (configurationDAO.getConfigurationWithReadOnlyTransaction() == null || configurationDAO.getConfigurationWithReadOnlyTransaction().isAllowToGatherUsageStatsEnabled()) {
GatheredUsageStats gatheredUsageStats = new GatheredUsageStats();
gatheredUsageStats.setupNotAutowiredClasses(userDAO, orderModel, workReportModel, workerModel, machineModel,

View file

@ -27,7 +27,6 @@ import org.apache.commons.logging.LogFactory;
import org.apache.cxf.jaxrs.client.WebClient;
import org.libreplan.business.calendars.entities.BaseCalendar;
import org.libreplan.business.common.daos.IConfigurationDAO;
import org.libreplan.business.common.entities.*;
import org.libreplan.business.common.exceptions.ValidationException;
import org.libreplan.business.costcategories.entities.TypeOfWorkHours;
import org.libreplan.business.users.entities.UserRole;
@ -254,11 +253,10 @@ public class ConfigurationController extends GenericForwardComposer {
messages.showMessage(Level.INFO, _("Changes saved"));
// Send data to server
if ( !SecurityUtils.isGatheredStatsAlreadySent &&
configurationDAO.getConfigurationWithReadOnlyTransaction().isAllowedToGatherUsageStatsEnabled() ) {
sendDataToServer();
}
if (!SecurityUtils.isGatheredStatsAlreadySent &&
configurationDAO.getConfigurationWithReadOnlyTransaction().isAllowedToGatherUsageStatsEnabled()) {
sendDataToServer();
}
if ( getSelectedConnector() != null &&
!configurationModel.scheduleOrUnscheduleJobs(getSelectedConnector())) {