File: /home/timetracker.panomity.com/tm.old/Resources/views/details.html.twig
{% extends 'base.html.twig' %}
{% import "macros/widgets.html.twig" as widgets %}
{% import "@TaskManagement/actions.html.twig" as actions %}
{% import "macros/datatables.html.twig" as tables %}
{% import "timesheet/actions.html.twig" as timesheetActions %}
{% block page_title %}{{ 'Tasks'|trans }}{% endblock %}
{% block page_actions %}
{{ actions.task(task, 'details') }}
{% endblock %}
{% block main %}
{% embed '@AdminLTE/Widgets/box-widget.html.twig' %}
{% import "macros/widgets.html.twig" as widgets %}
{% import "customer/actions.html.twig" as customerActions %}
{% import "project/actions.html.twig" as projectActions %}
{% import "activity/actions.html.twig" as activityActions %}
{% block box_attributes %}id="task_details_box"{% endblock %}
{% block box_title %}
{{ task.title }}
{% if task.closed %}
{{ widgets.label(('task.status.' ~ task.status)|trans, 'danger') }}
{% endif %}
{% endblock %}
{% block box_tools %}
{% if is_granted('task_edit', task) %}
<a class="modal-ajax-form open-edit btn btn-default btn-sm" data-href="{{ path('tasks_edit', {'id': task.id}) }}" data-toggle="tooltip" data-placement="top" title="{{ 'action.edit'|trans }}"><i class="{{ 'edit'|icon }}"></i></a>
{% endif %}
{% endblock %}
{% block box_body_class %}no-padding{% endblock %}
{% block box_body %}
{% if task.todo is not empty %}
<div class="comment">
{{ task.todo|comment2html(true) }}
</div>
{% endif %}
<table class="table table-hover dataTable">
<tr {{ widgets.customer_row_attr(task.project.customer, now) }}>
<th>{{ 'label.customer'|trans }}</th>
<td>
{{ widgets.label_customer(task.project.customer) }}
</td>
<td class="w-min">
{{ widgets.badge_team_access(task.project.customer.teams) }}
</td>
<td class="actions">
{{ customerActions.customer(task.project.customer, 'custom') }}
</td>
</tr>
<tr {{ widgets.project_row_attr(task.project, now) }}>
<th>{{ 'label.project'|trans }}</th>
<td>
{{ widgets.label_project(task.project) }}
</td>
<td class="w-min">
{{ widgets.badge_team_access(task.project.teams) }}
</td>
<td class="actions">
{{ projectActions.project(task.project, 'custom') }}
</td>
</tr>
{% if task.activity is not null %}
<tr {{ widgets.activity_row_attr(task.activity, now) }}>
<th>{{ 'label.activity'|trans }}</th>
<td>
{{ widgets.label_activity(task.activity) }}
</td>
<td class="w-min">
{{ widgets.badge_team_access(task.activity.teams) }}
</td>
<td class="actions">
{{ activityActions.activity(task.activity, 'custom') }}
</td>
</tr>
{% endif %}
{% if task.end %}
<tr>
<th>{{ 'label.end'|trans }}</th>
<td colspan="3">
{{ task.end|date_full }}
</td>
</tr>
{% endif %}
{% if task.timesheets.count > 0 %}
<tr>
<th>{{ 'label.duration'|trans }}</th>
<td colspan="3">
{{ task.duration|duration }}
</td>
</tr>
{% endif %}
{% if task.user is not null %}
<tr {{ widgets.user_row_attr(task.user) }}>
<th>{{ 'label.user'|trans }}</th>
<td colspan="3">
{{ widgets.label_user(task.user) }}
</td>
</tr>
{% endif %}
{% if task.team is not null %}
<tr>
<th>{{ 'label.team'|trans }}</th>
<td colspan="3">
{{ widgets.label_team(task.team) }}
</td>
</tr>
{% endif %}
</table>
{% endblock %}
{% endembed %}
{% set estimation = task.estimation %}
{% if estimation is not null %}
{% set duration = task.duration %}
{% embed '@AdminLTE/Widgets/box-widget.html.twig' %}
{% import "macros/progressbar.html.twig" as progress %}
{% block box_title %}{{ 'label.estimation'|trans }}{% endblock %}
{% block box_attributes %}id="budget_box"{% endblock %}
{% block box_body %}
{{ progress.progressbar(estimation, duration|default(0), duration|duration ~ ' / ' ~ estimation|duration, '') }}
{% endblock %}
{% endembed %}
{% endif %}
{% if comments is not null %}
{% set options = {'form': commentForm, 'comments': comments, 'route_delete': 'tasks_comment_delete', 'delete_by_user': true, 'csrf_delete': 'comment.delete', 'csrf_pin': 'comment.pin'} %}
{{ include('embeds/comments.html.twig', options) }}
{% endif %}
{% if timesheets.count == 0 %}
{{ widgets.nothing_found('kimai.timesheetUpdate') }}
{% else %}
{% set columns = {
'date': {'class': 'w-min alwaysVisible', 'orderBy': false},
'starttime': {'class': 'w-min hidden-xs', 'orderBy': false},
'endtime': {'class': 'w-min hidden-xs', 'orderBy': false},
'duration': {'class': 'w-min alwaysVisible', 'orderBy': false},
'description': {'class': 'hidden-xs hidden-sm'},
'username': {'class': '', 'orderBy': false},
'tags': {'class': 'hidden-xs hidden-sm', 'orderBy': false},
'exported': {'class': 'w-min hidden-xs hidden-sm text-center'},
'actions': {'class': 'actions alwaysVisible'},
} %}
{% set tableName = 'task_details' %}
{{ tables.datatable_header(tableName, columns, null, {'reload': 'kimai.timesheetUpdate'}) }}
{% for entry in timesheets %}
<tr{% if is_granted('edit', entry) %} class="modal-ajax-form open-edit" data-href="{{ path('timesheet_edit', {'id': entry.id}) }}"{% endif %}>
<td class="text-nowrap {{ tables.data_table_column_class(tableName, columns, 'date') }}">{{ entry.begin|date_short }}</td>
<td class="text-nowrap {{ tables.data_table_column_class(tableName, columns, 'starttime') }}">{{ entry.begin|time }}</td>
<td class="text-nowrap {{ tables.data_table_column_class(tableName, columns, 'endtime') }}">
{% if entry.end %}
{{ entry.end|time }}
{% else %}
‐
{% endif %}
</td>
{% if entry.end %}
<td class="text-nowrap {{ tables.data_table_column_class(tableName, columns, 'duration') }}">{{ entry.duration|duration }}</td>
{% else %}
<td class="text-nowrap {{ tables.data_table_column_class(tableName, columns, 'duration') }}">
<i data-since="{{ entry.begin.format(constant('DATE_ISO8601')) }}" data-format="{{ get_format_duration() }}">{{ entry|duration }}</i>
</td>
{% endif %}
<td class="{{ tables.data_table_column_class(tableName, columns, 'description') }} timesheet-description">
{{ entry.description|desc2html }}
</td>
<td class="{{ tables.data_table_column_class(tableName, columns, 'username') }}">
{{ widgets.label_user(entry.user) }}
</td>
<td class="{{ tables.data_table_column_class(tableName, columns, 'tags') }}">
{{ widgets.tag_list(entry.tags) }}
</td>
<td class="{{ tables.data_table_column_class(tableName, columns, 'exported') }} text-center">
{{ widgets.label_boolean(entry.exported) }}
</td>
<td class="{{ tables.data_table_column_class(tableName, columns, 'actions') }}">
{{- timesheetActions.timesheet(entry, 'custom') -}}
</td>
</tr>
{% endfor %}
{{ tables.data_table_footer(timesheets, null) }}
<div class="navigation text-center no-print">
{{ pagination(timesheets, { routeName: 'tasks_detail', routeParams: { id: task.id } }) }}
</div>
{% endif %}
{% endblock %}
{% block javascripts %}
{{ parent() }}
<script type="text/javascript">
document.addEventListener('kimai.initialized', function() {
KimaiReloadPageWidget.create(
'kimai.activityUpdate kimai.activityTeamUpdate kimai.projectUpdate kimai.projectTeamUpdate kimai.customerUpdate kimai.customerTeamUpdate kimai.timesheetUpdate kimai.taskUnassign kimai.taskAssign kimai.taskReopen kimai.taskClose kimai.taskUpdate',
true
);
});
</script>
{% endblock %}