-
Notifications
You must be signed in to change notification settings - Fork 694
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7f6d071
commit 3bb8015
Showing
8 changed files
with
235 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...ain/java/com/axelor/apps/project/service/dashboard/ProjectManagementDashboardService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Axelor Business Solutions | ||
* | ||
* Copyright (C) 2005-2025 Axelor (<http://axelor.com>). | ||
* | ||
* 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 <https://www.gnu.org/licenses/>. | ||
*/ | ||
package com.axelor.apps.project.service.dashboard; | ||
|
||
import java.util.Map; | ||
|
||
public interface ProjectManagementDashboardService { | ||
|
||
Map<String, Object> getDate(); | ||
} |
48 changes: 48 additions & 0 deletions
48
...java/com/axelor/apps/project/service/dashboard/ProjectManagementDashboardServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Axelor Business Solutions | ||
* | ||
* Copyright (C) 2005-2025 Axelor (<http://axelor.com>). | ||
* | ||
* 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 <https://www.gnu.org/licenses/>. | ||
*/ | ||
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<String, Object> getDate() { | ||
Map<String, Object> dataMap = new HashMap<>(); | ||
LocalDate todayDate = LocalDate.now(); | ||
dataMap.put("$fromDate", todayDate); | ||
dataMap.put("$toDate", todayDate.plusDays(7)); | ||
|
||
return dataMap; | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
...oject/src/main/java/com/axelor/apps/project/web/ProjectManagementDashboardController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Axelor Business Solutions | ||
* | ||
* Copyright (C) 2005-2025 Axelor (<http://axelor.com>). | ||
* | ||
* 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 <https://www.gnu.org/licenses/>. | ||
*/ | ||
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); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
113 changes: 113 additions & 0 deletions
113
axelor-project/src/main/resources/views/ProjectWizard.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<object-views xmlns="http://axelor.com/xml/ns/object-views" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://axelor.com/xml/ns/object-views http://axelor.com/xml/ns/object-views/object-views_7.2.xsd"> | ||
|
||
<form name="project-wizard-form" title="Project Dashboard" model="com.axelor.utils.db.Wizard" | ||
width="large" onNew="action-method-project-set-date" canNew="false" canDelete="false"> | ||
<panel name="filtersPanel"> | ||
<field name="$project" title="Project" colSpan="12" type="many-to-one" | ||
onChange="action-project-record-empty-sprint,action-attrs-refresh-dashlets" | ||
target="com.axelor.apps.project.db.Project"/> | ||
<field name="$fromDate" title="From Date" colSpan="3" type="date" | ||
onChange="action-project-record-empty-sprint-period,action-attrs-refresh-dashlets" | ||
required="true"/> | ||
<field name="$toDate" title="To Date" colSpan="3" type="date" | ||
onChange="action-project-record-empty-sprint-period,action-attrs-refresh-dashlets" | ||
required="true"/> | ||
<field name="$period" title="Allocation period" colSpan="3" type="many-to-one" | ||
onChange="action-project-record-set-period-date,action-attrs-refresh-dashlets" | ||
target="com.axelor.apps.base.db.Period" | ||
domain="self.year.typeSelect = 4 AND self.toDate > :__date__ "/> | ||
<field name="$sprint" title="Sprint" readonlyIf="!$project" colSpan="3" | ||
type="many-to-one" | ||
onChange="action-project-record-set-sprint-date,action-attrs-refresh-dashlets" | ||
onSelect="action-project-method-compute-sprint-domain" | ||
target="com.axelor.apps.project.db.Sprint"/> | ||
</panel> | ||
<panel-dashlet name="project-project-task-action-dashlet" colSpan="12" | ||
height="350" action="action-project-view-project-task" canSearch="true"/> | ||
<panel-dashlet | ||
if="__config__.app.isApp('employee') && __config__.app.getApp('project')?.enablePlanification" | ||
if-module="axelor-human-resource" name="project-planning-time-dashboard-action-dashlet" | ||
colSpan="12" height="350" action="action-project-view-planning-time-dashboard" | ||
canSearch="true"/> | ||
<panel-dashlet name="project-allocation-line-action-dashlet" colSpan="12" | ||
height="350" action="action-project-view-allocation-line" canSearch="true"/> | ||
</form> | ||
<action-method model="com.axelor.utils.db.Wizard" | ||
name="action-method-project-set-date"> | ||
<call class="com.axelor.apps.project.web.ProjectManagementDashboardController" | ||
method="getDates"/> | ||
</action-method> | ||
|
||
<action-view name="action-project-view-project-task" | ||
model="com.axelor.apps.project.db.ProjectTask" title="Project tasks"> | ||
<view name="project-task-dashboard-grid" type="grid"/> | ||
<view name="project-task-form" type="form"/> | ||
<view-param name="popup" value="true"/> | ||
<domain> (self.taskDate <= :toDate and self.taskDate >= :fromDate ) | ||
and | ||
(self.project=:project OR :project IS NULL)</domain> | ||
</action-view> | ||
<action-view name="action-project-view-planning-time-dashboard" | ||
model="com.axelor.apps.project.db.ProjectPlanningTime" title="Project planning tasks"> | ||
<view name="project-planning-time-dashboard-grid" type="grid"/> | ||
<view name="project-planning-time-form" type="form"/> | ||
<view-param name="popup" value="true"/> | ||
<domain> (( 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)</domain> | ||
</action-view> | ||
<action-view name="action-project-view-allocation-line" | ||
model="com.axelor.apps.hr.db.AllocationLine" title="Project allocation lines"> | ||
<view name="project-allocation-line-grid" type="grid"/> | ||
<view name="allocation-line-form" type="form"/> | ||
<view-param name="popup" value="true"/> | ||
<domain> (( 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)</domain> | ||
</action-view> | ||
|
||
<action-record name="action-project-record-empty-sprint" | ||
model="com.axelor.apps.project.db.Project"> | ||
<field name="$sprint" expr="eval: null"/> | ||
</action-record> | ||
<action-record name="action-project-record-empty-sprint-period" | ||
model="com.axelor.apps.project.db.Project"> | ||
<field name="$sprint" expr="eval: null"/> | ||
<field name="$period" expr="eval: null"/> | ||
</action-record> | ||
|
||
<action-record model="com.axelor.apps.base.db.Period" | ||
name="action-project-record-set-period-date"> | ||
<field name="$fromDate" expr="eval:__repo__(Period).find(period.id).fromDate" if="period"/> | ||
<field name="$toDate" expr="eval: __repo__(Period).find(period.id).toDate" if="period"/> | ||
<field name="$sprint" expr="eval: null"/> | ||
</action-record> | ||
<action-record model="com.axelor.apps.project.db.Sprint" | ||
name="action-project-record-set-sprint-date"> | ||
<field name="$fromDate" expr="eval:__repo__(Sprint).find(sprint.id).fromDate" if="sprint"/> | ||
<field name="$toDate" expr="eval: __repo__(Sprint).find(sprint.id).toDate" if="sprint"/> | ||
<field name="$period" expr="eval: null"/> | ||
</action-record> | ||
<action-method name="action-project-method-compute-sprint-domain"> | ||
<call class="com.axelor.apps.project.web.SprintController" | ||
method="computeSprintDomainDashboard"/> | ||
</action-method> | ||
<action-attrs name="action-attrs-refresh-dashlets"> | ||
<attribute name="refresh" expr="eval: true" for="project-project-task-action-dashlet"/> | ||
<attribute name="refresh" expr="eval: true" | ||
for="project-planning-time-dashboard-action-dashlet"/> | ||
<attribute name="refresh" expr="eval: true" | ||
for="project-allocation-line-action-dashlet"/> | ||
</action-attrs> | ||
</object-views> |