restart via API allows to copy description (#782)

This commit is contained in:
Kevin Papst
2019-05-13 17:32:01 +02:00
committed by GitHub
parent 1f5710eaba
commit bbe1f9beda
28 changed files with 250 additions and 118 deletions

View File

@@ -193,6 +193,9 @@
'lastYear': '{{ 'daterangepicker.lastYear'|trans({}, 'daterangepicker') }}',
'thisYear': '{{ 'daterangepicker.thisYear'|trans({}, 'daterangepicker') }}',
'customRange': '{{ 'daterangepicker.customRange'|trans({}, 'daterangepicker') }}',
'timesheet.start.success': '{{ 'timesheet.start.success'|trans({}, 'flashmessages') }}',
'timesheet.start.error': '{{ 'timesheet.start.error'|trans({}, 'flashmessages') }}',
'timesheet.start.exceeded_limit': '{{ 'timesheet.start.exceeded_limit'|trans({}, 'flashmessages') }}',
'timesheet.stop.success': '{{ 'timesheet.stop.success'|trans({}, 'flashmessages') }}',
'timesheet.stop.error': '{{ 'timesheet.stop.error'|trans({}, 'flashmessages') }}',
'action.update.success': '{{ 'action.update.success'|trans({}, 'flashmessages') }}',

View File

@@ -219,7 +219,7 @@
{% endif %}
{% if timesheet.end and is_granted('start', timesheet) %}
{% set actions = actions|merge({'repeat': path('timesheet_start', {'id' : timesheet.id})}) %}
{% set actions = actions|merge({'repeat': {'url': path('restart_timesheet', {'id' : timesheet.id}), 'class': 'api-link', 'attr': {'data-payload': '{"copy": "all"}', 'data-event': 'kimai.timesheetStart kimai.timesheetUpdate', 'data-method': 'PATCH', 'data-msg-error': 'timesheet.start.error', 'data-msg-success': 'timesheet.start.success'}}}) %}
{% endif %}
{% if is_granted('edit', timesheet) %}
@@ -274,7 +274,7 @@
{% endif %}
{% if timesheet.end and is_granted('start', timesheet) %}
{% set actions = actions|merge({'repeat': path('timesheet_start', {'id' : timesheet.id})}) %}
{% set actions = actions|merge({'repeat': {'url': path('restart_timesheet', {'id' : timesheet.id}), 'class': 'api-link', 'attr': {'data-payload': '{"copy": "all"}', 'data-event': 'kimai.timesheetStart kimai.timesheetUpdate', 'data-method': 'PATCH', 'data-msg-error': 'timesheet.start.error', 'data-msg-success': 'timesheet.start.success'}}}) %}
{% endif %}
{% if is_granted('edit', timesheet) %}

View File

@@ -253,8 +253,8 @@
target="{{ target }}"
{%- endif -%}
{%- if attr is not empty -%}
{%- for name, value in attr -%}
{{ name }}="{{ value }}"
{%- for name, value in attr %}
{{- ' ' ~ name }}={% if '"' in value %}'{{ value|raw }}'{% else %}"{{ value|raw }}"{% endif %}
{%- endfor -%}
{%- endif -%}
>{% if title is not null %}{{ title }}{% else %}{{ macro.icon(icon) }}{% endif %}</a>

View File

@@ -5,7 +5,7 @@
</a>
<ul class="dropdown-menu"
data-api="{{ path('recent_timesheet', {'size' : 10}) }}"
data-href="{{ path('timesheet_start', {'id' : '000'}) }}"
data-href="{{ path('restart_timesheet', {'id' : '000'}) }}"
data-icon="{{ 'start-small'|icon }}"
data-template="{{ 'recent.activities.format'|trans }}">
<li class="header">{{ 'recent.activities'|trans }}</li>