timesheet export (#317)
* remove autocomplete for begin and end * fix minute display in timesheet-edit form * toolbar form label in separate row * added export action
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
|
||||
{% block page_title %}{{ 'timesheet.title'|trans }}{% endblock %}
|
||||
{% block page_subtitle %}{{ 'timesheet.subtitle'|trans }}{% endblock %}
|
||||
{% block page_actions %}{{ widgets.page_actions({'filter': '#collapseTimesheet', 'visibility': '#modal_timesheet', 'calendar': path('calendar'), 'create': path('timesheet_create')}) }}{% endblock %}
|
||||
{% block page_actions %}{{ widgets.page_actions({'filter': '#collapseTimesheet', 'download': 'onclick:return exportTimesheet()', 'visibility': '#modal_timesheet', 'calendar': path('calendar'), 'create': path('timesheet_create')}) }}{% endblock %}
|
||||
|
||||
{% block main_before %}
|
||||
{{ toolbar.toolbar(toolbarForm, 'collapseTimesheet') }}
|
||||
@@ -81,3 +81,17 @@
|
||||
{{ tables.data_table_footer(entries, 'timesheet_paginated') }}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
{{ parent() }}
|
||||
<script type="text/javascript">
|
||||
function exportTimesheet() {
|
||||
var form = $("div.toolbar form.navbar-form");
|
||||
var prevAction = form.attr('action');
|
||||
form.attr('target', '_blank').attr('action', '{{ path('timesheet_export') }}');
|
||||
form.submit();
|
||||
form.removeAttr('target').attr('action', prevAction);
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user