#1891: fix version inconsistency which caused runtime error

This commit is contained in:
vmazurashu 2018-09-25 17:48:12 +03:00
parent b7ec362648
commit bc5ceeb64d
5 changed files with 23 additions and 12 deletions

View file

@ -57,10 +57,8 @@ public class StartupApplicationListener implements ApplicationListener {
if (SecurityUtils.isGatheredStatsAlreadySent) {
return;
}
if (configurationDAO.getConfigurationWithReadOnlyTransaction() == null || configurationDAO.getConfigurationWithReadOnlyTransaction().isAllowToGatherUsageStatsEnabled()) {
GatheredUsageStats gatheredUsageStats = new GatheredUsageStats();
gatheredUsageStats.setupNotAutowiredClasses(userDAO, orderModel, workReportModel, workerModel, machineModel,
if (configurationDAO.getConfigurationWithReadOnlyTransaction() == null || configurationDAO.getConfigurationWithReadOnlyTransaction().isAllowedToGatherUsageStatsEnabled()) {
GatheredUsageStats gatheredUsageStats = new GatheredUsageStats(userDAO, orderModel, workReportModel, workerModel, machineModel,
expenseSheetModel, materialsModel, assignedQualityFormsModel);
gatheredUsageStats.sendGatheredUsageStatsToServer();

View file

@ -27,6 +27,7 @@ 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;
@ -253,10 +254,9 @@ 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() == null || configurationDAO.getConfigurationWithReadOnlyTransaction().isAllowedToGatherUsageStatsEnabled())) {
sendDataToServer();
}
if ( getSelectedConnector() != null &&
!configurationModel.scheduleOrUnscheduleJobs(getSelectedConnector())) {

View file

@ -155,6 +155,20 @@ public class GatheredUsageStats {
initialize();
}
public GatheredUsageStats(IUserDAO userDAO, IOrderModel orderModel, IWorkReportModel workReportModel, IWorkerModel workerModel,
IMachineModel machineModel, IExpenseSheetModel expenseSheetModel, IMaterialsModel materialsModel, IAssignedTaskQualityFormsToOrderElementModel assignedTaskQualityFormsToOrderElementModel) {
this.userDAO = userDAO;
this.orderModel = orderModel;
this.workReportModel = workReportModel;
this.workerModel = workerModel;
this.machineModel = machineModel;
this.expenseSheetModel = expenseSheetModel;
this.materialsModel = materialsModel;
this.assignedTaskQualityFormsToOrderElementModel = assignedTaskQualityFormsToOrderElementModel;
initialize();
}
private String generateID() {
String ip = null;
String hostname = null;

View file

@ -506,9 +506,8 @@ public class MultipleTabsPlannerController implements Composer, IGlobalViewEntry
}
// Send data to server
if ( !SecurityUtils.isGatheredStatsAlreadySent &&
configurationDAO.getConfiguration().isAllowedToGatherUsageStatsEnabled() ) {
if (!SecurityUtils.isGatheredStatsAlreadySent
&& (configurationDAO.getConfigurationWithReadOnlyTransaction() == null || configurationDAO.getConfigurationWithReadOnlyTransaction().isAllowedToGatherUsageStatsEnabled())) {
sendDataToServer();
}

View file

@ -469,7 +469,7 @@
<dependency>
<groupId>org.zkoss.common</groupId>
<artifactId>zweb</artifactId>
<version>5.0.11</version>
<version>8.0.1.1</version>
</dependency>
<!-- JGraphT -->