diff --git a/axelor-project/src/main/java/com/axelor/apps/project/module/ProjectModule.java b/axelor-project/src/main/java/com/axelor/apps/project/module/ProjectModule.java index 18efee9f930..a83fe12715c 100644 --- a/axelor-project/src/main/java/com/axelor/apps/project/module/ProjectModule.java +++ b/axelor-project/src/main/java/com/axelor/apps/project/module/ProjectModule.java @@ -79,6 +79,8 @@ import com.axelor.apps.project.service.batch.ProjectBatchInitServiceImpl; import com.axelor.apps.project.service.config.ProjectConfigService; import com.axelor.apps.project.service.config.ProjectConfigServiceImpl; +import com.axelor.apps.project.service.dashboard.ProjectManagementDashboardService; +import com.axelor.apps.project.service.dashboard.ProjectManagementDashboardServiceImpl; import com.axelor.apps.project.service.roadmap.ProjectVersionRemoveService; import com.axelor.apps.project.service.roadmap.ProjectVersionRemoveServiceImpl; import com.axelor.apps.project.service.roadmap.ProjectVersionService; @@ -138,5 +140,6 @@ protected void configure() { bind(SprintGetService.class).to(SprintGetServiceImpl.class); bind(ProjectVersionService.class).to(ProjectVersionServiceImpl.class); bind(ProjectBatchInitService.class).to(ProjectBatchInitServiceImpl.class); + bind(ProjectManagementDashboardService.class).to(ProjectManagementDashboardServiceImpl.class); } } diff --git a/axelor-project/src/main/java/com/axelor/apps/project/service/dashboard/ProjectManagementDashboardService.java b/axelor-project/src/main/java/com/axelor/apps/project/service/dashboard/ProjectManagementDashboardService.java new file mode 100644 index 00000000000..83c44b66230 --- /dev/null +++ b/axelor-project/src/main/java/com/axelor/apps/project/service/dashboard/ProjectManagementDashboardService.java @@ -0,0 +1,26 @@ +/* + * Axelor Business Solutions + * + * Copyright (C) 2005-2025 Axelor (). + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package com.axelor.apps.project.service.dashboard; + +import java.util.Map; + +public interface ProjectManagementDashboardService { + + Map getDate(); +} diff --git a/axelor-project/src/main/java/com/axelor/apps/project/service/dashboard/ProjectManagementDashboardServiceImpl.java b/axelor-project/src/main/java/com/axelor/apps/project/service/dashboard/ProjectManagementDashboardServiceImpl.java new file mode 100644 index 00000000000..10a3441bd71 --- /dev/null +++ b/axelor-project/src/main/java/com/axelor/apps/project/service/dashboard/ProjectManagementDashboardServiceImpl.java @@ -0,0 +1,48 @@ +/* + * Axelor Business Solutions + * + * Copyright (C) 2005-2025 Axelor (). + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package com.axelor.apps.project.service.dashboard; + +import com.axelor.apps.project.db.repo.ProjectRepository; +import com.axelor.apps.project.db.repo.ProjectTaskRepository; +import com.google.inject.Inject; +import java.time.LocalDate; +import java.util.HashMap; +import java.util.Map; + +public class ProjectManagementDashboardServiceImpl implements ProjectManagementDashboardService { + protected ProjectTaskRepository projectTaskRepo; + protected ProjectRepository projectRepo; + + @Inject + public ProjectManagementDashboardServiceImpl( + ProjectTaskRepository projectTaskRepo, ProjectRepository projectRepo) { + this.projectTaskRepo = projectTaskRepo; + this.projectRepo = projectRepo; + } + + @Override + public Map getDate() { + Map dataMap = new HashMap<>(); + LocalDate todayDate = LocalDate.now(); + dataMap.put("$fromDate", todayDate); + dataMap.put("$toDate", todayDate.plusDays(7)); + + return dataMap; + } +} diff --git a/axelor-project/src/main/java/com/axelor/apps/project/web/ProjectManagementDashboardController.java b/axelor-project/src/main/java/com/axelor/apps/project/web/ProjectManagementDashboardController.java new file mode 100644 index 00000000000..43001525e0a --- /dev/null +++ b/axelor-project/src/main/java/com/axelor/apps/project/web/ProjectManagementDashboardController.java @@ -0,0 +1,39 @@ +/* + * Axelor Business Solutions + * + * Copyright (C) 2005-2025 Axelor (). + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package com.axelor.apps.project.web; + +import com.axelor.apps.base.service.exception.TraceBackService; +import com.axelor.apps.project.service.dashboard.ProjectManagementDashboardService; +import com.axelor.inject.Beans; +import com.axelor.rpc.ActionRequest; +import com.axelor.rpc.ActionResponse; +import com.google.inject.Singleton; + +@Singleton +public class ProjectManagementDashboardController { + + public void getDates(ActionRequest request, ActionResponse response) { + + try { + response.setValues(Beans.get(ProjectManagementDashboardService.class).getDate()); + } catch (Exception e) { + TraceBackService.trace(response, e); + } + } +} diff --git a/axelor-project/src/main/java/com/axelor/apps/project/web/SprintController.java b/axelor-project/src/main/java/com/axelor/apps/project/web/SprintController.java index 003907fead5..856237d33f7 100644 --- a/axelor-project/src/main/java/com/axelor/apps/project/web/SprintController.java +++ b/axelor-project/src/main/java/com/axelor/apps/project/web/SprintController.java @@ -123,6 +123,6 @@ public void computeSprintDomainDashboard(ActionRequest request, ActionResponse r String domain = Beans.get(SprintGeneratorService.class).getSprintDomain(projectRepo.find(projectId)); - response.setAttr("sprint", "domain", domain); + response.setAttr("$sprint", "domain", domain); } } diff --git a/axelor-project/src/main/resources/views/Dashboard.xml b/axelor-project/src/main/resources/views/Dashboard.xml index 967f1b9d8c2..f259fcfae91 100644 --- a/axelor-project/src/main/resources/views/Dashboard.xml +++ b/axelor-project/src/main/resources/views/Dashboard.xml @@ -328,99 +328,4 @@ method="showTasksPerCategory"/> - - - - - - - - - - - - - - - - - - - - - (self.taskDate <= :toDate and self.taskDate >= :fromDate ) - and - (self.project=:project OR :project IS NULL) - - - - - - (( date(self.startDateTime) <= date(:toDate) and date(self.startDateTime) >= - date(:fromDate) )or - (date(self.endDateTime) <= date(:toDate) and date(self.endDateTime) - >= date(:fromDate) )) - and - (self.project=:project OR :project IS NULL) - - - - - - (( date(self.period.fromDate ) <= date(:toDate) and date(self.period.fromDate ) - >= - date(:fromDate) )or - (date(self.period.toDate) <= date(:toDate) and - date(self.period.toDate) - >= date(:fromDate) )) - and - (self.project=:project OR :project IS NULL) - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/axelor-project/src/main/resources/views/Menu.xml b/axelor-project/src/main/resources/views/Menu.xml index 20b3555ec70..33b367309c9 100644 --- a/axelor-project/src/main/resources/views/Menu.xml +++ b/axelor-project/src/main/resources/views/Menu.xml @@ -247,12 +247,12 @@ - - - - + + + \ No newline at end of file diff --git a/axelor-project/src/main/resources/views/ProjectWizard.xml b/axelor-project/src/main/resources/views/ProjectWizard.xml new file mode 100644 index 00000000000..aa5196d32ae --- /dev/null +++ b/axelor-project/src/main/resources/views/ProjectWizard.xml @@ -0,0 +1,113 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + (self.taskDate <= :toDate and self.taskDate >= :fromDate ) + and + (self.project=:project OR :project IS NULL) + + + + + + (( date(self.startDateTime) <= date(:toDate) and date(self.startDateTime) >= + date(:fromDate) )or + (date(self.endDateTime) <= date(:toDate) and date(self.endDateTime) + >= date(:fromDate) )) + and + (self.project=:project OR :project IS NULL) + + + + + + (( date(self.period.fromDate ) <= date(:toDate) and date(self.period.fromDate ) + >= + date(:fromDate) )or + (date(self.period.toDate) <= date(:toDate) and + date(self.period.toDate) + >= date(:fromDate) )) + and + (self.project=:project OR :project IS NULL) + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file