billable timesheets, inactive projects report, bookmark export search (#2503)
This commit is contained in:
@@ -4,10 +4,10 @@
|
||||
{{ widgets.page_actions(event.actions) }}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro activity(activity, view, options) %}
|
||||
{% macro activity(activity, view, isTable) %}
|
||||
{% import "macros/widgets.html.twig" as widgets %}
|
||||
{% set event = actions(app.user, 'activity', view, {'activity': activity}) %}
|
||||
{% if view == 'index' or view == 'custom' %}
|
||||
{% if view == 'index' or view == 'custom' or isTable is not null %}
|
||||
{{ widgets.table_actions(event.actions) }}
|
||||
{% else %}
|
||||
{{ widgets.page_actions(event.actions) }}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
{% import "activity/actions.html.twig" as actions %}
|
||||
|
||||
{% block page_title %}{{ 'admin_activity.title'|trans }}{% endblock %}
|
||||
{% block page_actions %}{{ actions.activity(activity, 'details') }}{% endblock %}
|
||||
{% block page_actions %}{{ actions.activity(activity, 'activity_details') }}{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
{% set can_edit = is_granted('edit', activity) %}
|
||||
@@ -42,7 +42,7 @@
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if not activity.global %}
|
||||
<tr class="{{ widgets.class_customer_row(activity.project.customer, now) }}">
|
||||
<tr {{ widgets.customer_row_attr(activity.project.customer, now) }}>
|
||||
<th>{{ 'label.customer'|trans }}</th>
|
||||
<td>
|
||||
{{ widgets.label_customer(activity.project.customer) }}
|
||||
@@ -54,7 +54,7 @@
|
||||
{{ customerActions.customer(activity.project.customer, 'custom') }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="{{ widgets.class_project_row(activity.project, now) }}">
|
||||
<tr {{ widgets.project_row_attr(activity.project, now) }}>
|
||||
<th>{{ 'label.project'|trans }}</th>
|
||||
<td>
|
||||
{{ widgets.label_project(activity.project) }}
|
||||
@@ -78,7 +78,11 @@
|
||||
{% endembed %}
|
||||
|
||||
{% if stats is not null %}
|
||||
{{ include('activity/embed_budget.html.twig', {'activity': activity, 'stats': stats}) }}
|
||||
{% set currency = null %}
|
||||
{% if activity.project is not null %}
|
||||
{% set currency = activity.project.customer.currency %}
|
||||
{% endif %}
|
||||
{{ include('embeds/budgets.html.twig', {'entity': activity, 'stats': stats, 'currency': currency}) }}
|
||||
{% endif %}
|
||||
|
||||
{% if can_edit %}
|
||||
@@ -102,7 +106,7 @@
|
||||
{{ parent() }}
|
||||
<script type="text/javascript">
|
||||
document.addEventListener('kimai.initialized', function() {
|
||||
KimaiReloadPageWidget.create('kimai.activityUpdate kimai.teamUpdate kimai.activityTeamUpdate kimai.projectTeamUpdate kimai.customerTeamUpdate kimai.projectUpdate kimai.rateUpdate');
|
||||
KimaiReloadPageWidget.create('kimai.activityUpdate kimai.teamUpdate kimai.activityTeamUpdate kimai.projectTeamUpdate kimai.customerTeamUpdate kimai.customerUpdate kimai.projectUpdate kimai.rateUpdate');
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
{% embed '@AdminLTE/Widgets/box-widget.html.twig' %}
|
||||
{% import "macros/progressbar.html.twig" as progress %}
|
||||
{% block box_title %}{{ 'label.budget'|trans }}{% endblock %}
|
||||
{% block box_attributes %}id="budget_box"{% endblock %}
|
||||
{% block box_body %}
|
||||
{% set params = {
|
||||
'%activity%': activity.name,
|
||||
'%project%': '-',
|
||||
'%customer%': '-',
|
||||
'%records%': stats.recordAmount,
|
||||
'%duration%': stats.recordDuration|duration
|
||||
} %}
|
||||
|
||||
{% set currency = null %}
|
||||
{% if activity.project is not null %}
|
||||
{% set currency = activity.project.customer.currency %}
|
||||
{% endif %}
|
||||
|
||||
{% if activity.project is not null %}
|
||||
{% set params = params|merge({
|
||||
'%project%': activity.project.name,
|
||||
'%customer%': activity.project.customer.name,
|
||||
}) %}
|
||||
{% endif %}
|
||||
|
||||
<p>
|
||||
{{ 'admin_activity.short_stats'|trans(params) }}
|
||||
{{ 'label.rate_internal'|trans }}: {{ stats.recordInternalRate|money(currency) }}.
|
||||
</p>
|
||||
|
||||
{{ progress.progressbar(activity.budget, stats.recordRate, 'label.budget'|trans, stats.recordRate|money(currency) ~ ' / ' ~ activity.budget|money(currency) ) }}
|
||||
{{ progress.progressbar(activity.timeBudget, stats.recordDuration, 'label.timeBudget'|trans, stats.recordDuration|duration ~ ' / ' ~ activity.timeBudget|duration ) }}
|
||||
{% endblock %}
|
||||
{% endembed %}
|
||||
@@ -37,16 +37,10 @@
|
||||
{% if entries.count == 0 %}
|
||||
{{ widgets.nothing_found('kimai.activityUpdate') }}
|
||||
{% else %}
|
||||
{{ tables.datatable_header(tableName, columns, query, {'reload': 'kimai.activityUpdate kimai.activityTeamUpdate'}) }}
|
||||
{{ tables.datatable_header(tableName, columns, query, {'reload': 'kimai.activityUpdate kimai.activityDelete kimai.activityTeamUpdate'}) }}
|
||||
|
||||
{% for entry in entries %}
|
||||
{% set class = widgets.class_activity_row(entry, now) %}
|
||||
{% set dataHref = '' %}
|
||||
{% if is_granted('view', entry) %}
|
||||
{% set class = class ~ ' alternative-link open-edit' %}
|
||||
{% set dataHref = path('activity_details', {'id': entry.id}) %}
|
||||
{% endif %}
|
||||
<tr class="{{ class }}" data-href="{{ dataHref }}">
|
||||
<tr {{ widgets.activity_row_attr(entry, now) }}>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'name') }}">{{ widgets.label_color_dot('activity', true, entry.name, null, entry.color) }}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'project') }}">
|
||||
{# only none-global activities have a project and customer assigned #}
|
||||
|
||||
Reference in New Issue
Block a user