diff --git a/src/Controller/ActivityController.php b/src/Controller/ActivityController.php
index 80b9a76e..c14c5a6a 100644
--- a/src/Controller/ActivityController.php
+++ b/src/Controller/ActivityController.php
@@ -92,6 +92,7 @@ final class ActivityController extends AbstractController
'query' => $query,
'toolbarForm' => $form->createView(),
'metaColumns' => $this->findMetaColumns($query),
+ 'defaultCurrency' => $this->configuration->getCustomerDefaultCurrency()
]);
}
diff --git a/src/Widget/Type/UserTeamProjects.php b/src/Widget/Type/UserTeamProjects.php
index 7c82b080..330a8355 100644
--- a/src/Widget/Type/UserTeamProjects.php
+++ b/src/Widget/Type/UserTeamProjects.php
@@ -62,7 +62,10 @@ class UserTeamProjects extends SimpleWidget implements AuthorizedWidget, UserWid
foreach ($projects as $id => $project) {
if ($project->getBudget() > 0 || $project->getTimeBudget() > 0) {
- $stats[] = $this->repository->getProjectStatistics($project);
+ $stats[] = [
+ 'project' => $project,
+ 'stats' => $this->repository->getProjectStatistics($project),
+ ];
}
}
diff --git a/templates/activity/index.html.twig b/templates/activity/index.html.twig
index 8cbeb3e8..774864ed 100644
--- a/templates/activity/index.html.twig
+++ b/templates/activity/index.html.twig
@@ -15,6 +15,8 @@
}) %}
{% endfor %}
{% set columns = columns|merge({
+ 'budget': {'class': 'hidden-xs hidden-sm hidden', 'title': 'label.budget'|trans},
+ 'timeBudget': {'class': 'hidden-xs hidden-sm hidden', 'title': 'label.timeBudget'|trans},
'team': {'class': 'text-center w-min', 'orderBy': false},
'visible': {'class': 'text-center hidden w-min'},
'actions': {'class': 'actions alwaysVisible'},
@@ -58,6 +60,8 @@
{{ tables.datatable_meta_column(entry, field) }}
{% endfor %}
+
{{ entry.budget|money((entry.project is null ? defaultCurrency : entry.project.customer.currency)) }} |
+ {{ entry.timeBudget|duration }} |
{{ widgets.badge_team_access(entry.teams) }} |
{{ widgets.label_visible(entry.visible) }} |
{{ actions.activity(entry, 'index') }} |
diff --git a/templates/customer/index.html.twig b/templates/customer/index.html.twig
index 135f8fb0..8867bc1b 100644
--- a/templates/customer/index.html.twig
+++ b/templates/customer/index.html.twig
@@ -26,6 +26,8 @@
}) %}
{% endfor %}
{% set columns = columns|merge({
+ 'budget': {'class': 'hidden-xs hidden-sm hidden', 'title': 'label.budget'|trans},
+ 'timeBudget': {'class': 'hidden-xs hidden-sm hidden', 'title': 'label.timeBudget'|trans},
'team': {'class': 'text-center w-min', 'orderBy': false},
'visible': {'class': 'text-center hidden w-min'},
'actions': {'class': 'actions alwaysVisible'},
@@ -69,6 +71,8 @@
{{ tables.datatable_meta_column(entry, field) }}
{% endfor %}
+ {{ entry.budget|money(entry.currency) }} |
+ {{ entry.timeBudget|duration }} |
{{ widgets.badge_team_access(entry.teams) }} |
{{ widgets.label_visible(entry.visible) }} |
{{ actions.customer(entry, 'index') }} |
diff --git a/templates/project/index.html.twig b/templates/project/index.html.twig
index 8e31bca8..d8934006 100644
--- a/templates/project/index.html.twig
+++ b/templates/project/index.html.twig
@@ -19,6 +19,8 @@
}) %}
{% endfor %}
{% set columns = columns|merge({
+ 'budget': {'class': 'hidden-xs hidden-sm hidden', 'title': 'label.budget'|trans},
+ 'timeBudget': {'class': 'hidden-xs hidden-sm hidden', 'title': 'label.timeBudget'|trans},
'team': {'class': 'text-center w-min', 'orderBy': false},
'visible': {'class': 'text-center hidden w-min'},
'actions': {'class': 'actions alwaysVisible'},
@@ -55,6 +57,8 @@
{{ tables.datatable_meta_column(entry, field) }}
{% endfor %}
+ {{ entry.budget|money(entry.customer.currency) }} |
+ {{ entry.timeBudget|duration }} |
{{ widgets.badge_team_access(entry.teams) }} |
{{ widgets.label_visible(entry.visible) }} |
{{ actions.project(entry, 'index') }} |
diff --git a/templates/widget/widget-userteamprojects.html.twig b/templates/widget/widget-userteamprojects.html.twig
index 609bf75f..b601d89d 100644
--- a/templates/widget/widget-userteamprojects.html.twig
+++ b/templates/widget/widget-userteamprojects.html.twig
@@ -16,13 +16,14 @@
{% block box_body %}
- {% for stats in projectStats|sort((a, b) => a.project.name <=> b.project.name) %}
- {% set project = stats.project %}
-
+ {% for row in projectStats|sort((a, b) => a.project.name <=> b.project.name) %}
+ {% set stats = row.stats %}
+ {% set project = row.project %}
+
- {{ widgets.label_project(stats.project) }}
+ {{ widgets.label_project(project) }}
- {{ widgets.label_customer(stats.project.customer) }}
+ {{ widgets.label_customer(project.customer) }}
|
{% for team in project.teams %}
diff --git a/tests/Controller/TimesheetControllerTest.php b/tests/Controller/TimesheetControllerTest.php
index dd035113..fd05c697 100644
--- a/tests/Controller/TimesheetControllerTest.php
+++ b/tests/Controller/TimesheetControllerTest.php
@@ -455,6 +455,7 @@ class TimesheetControllerTest extends ControllerBaseTest
'hourlyRate' => 100,
'begin' => '2020-02-18 01:00',
'end' => '2020-02-18 02:10',
+ 'duration' => '01:10',
'project' => 1,
'activity' => $activity->getId(),
]
|