WIP: Implement teamer document upload handling
This commit is contained in:
@@ -6,94 +6,78 @@
|
||||
<h1 class="text-2xl font-bold pb-8">
|
||||
Dokumentenübersicht
|
||||
</h1>
|
||||
<div class="data-table-wrapper">
|
||||
<div class="data-table-wrapper__inner">
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
{{ knp_pagination_sortable(pagination, 'Dateiname', 'upload.originalFilename') }}
|
||||
</th>
|
||||
<th>
|
||||
Dateigröße
|
||||
</th>
|
||||
<th>
|
||||
Upload am
|
||||
</th>
|
||||
<th>
|
||||
Upload von
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for document in pagination %}
|
||||
<div class="data-table-wrapper">
|
||||
<div class="data-table-wrapper__inner">
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>
|
||||
{{ document.displayName ? document.displayName : document.originalFilename }}
|
||||
</td>
|
||||
<td>
|
||||
{{ document.size|file_size }}
|
||||
</td>
|
||||
<td>
|
||||
{{ document.createdAt|date('d.m.Y') }}
|
||||
</td>
|
||||
<td>
|
||||
{{ document.createdBy }}
|
||||
</td>
|
||||
<td>
|
||||
<div class="flex items-center space-x-2 justify-end">
|
||||
<button type="button"
|
||||
class="text-red-500"
|
||||
{{ stimulus_controller('modal-button', [], [], {'confirmation-modal': '#confirmation-modal'}) }}
|
||||
{{ stimulus_action('modal-button', 'confirmation', null, {
|
||||
'title': 'Bist du sicher?',
|
||||
'content': 'Möchtest du das Dokument wirklich löschen?',
|
||||
'target-url': path('app_admin_document_delete', { 'uuid': document.uuid })
|
||||
}) }}>
|
||||
{{ icon('delete') }}
|
||||
</button>
|
||||
<button type="button"
|
||||
{{ stimulus_controller('modal-button', [], [], {'ajax-modal': '#ajax-modal'}) }}
|
||||
{{ stimulus_action('modal-button', 'ajax', null, {
|
||||
'title': 'Dokument ersetzen',
|
||||
'url': path('app_admin_document_replace', { 'uuid': document.uuid })
|
||||
}) }}>
|
||||
{{ icon('refresh') }}
|
||||
</button>
|
||||
<button type="button"
|
||||
{{ stimulus_controller('modal-button', [], [], {'ajax-modal': '#ajax-modal'}) }}
|
||||
{{ stimulus_action('modal-button', 'ajax', null, {
|
||||
'title': 'Dokument umbenennen',
|
||||
'url': path('app_admin_document_rename', { 'uuid': document.uuid })
|
||||
}) }}>
|
||||
{{ icon('edit') }}
|
||||
</button>
|
||||
<a href="{{ path('app_common_download', { 'uuid': document.uuid }) }}"
|
||||
title="Download">
|
||||
{{ icon('download') }}
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
<th>
|
||||
{{ knp_pagination_sortable(pagination, 'Einsatzzeitraum', 'destination.dateFrom') }}
|
||||
</th>
|
||||
<th>
|
||||
{{ knp_pagination_sortable(pagination, 'Jobprofil', 'job_profile.name') }}
|
||||
</th>
|
||||
<th>
|
||||
{{ knp_pagination_sortable(pagination, 'Destination', 'destination.product') }}
|
||||
</th>
|
||||
<th>
|
||||
{{ knp_pagination_sortable(pagination, 'Dokument', 'upload.type') }}
|
||||
</th>
|
||||
<th>
|
||||
{{ knp_pagination_sortable(pagination, 'Teamer', 'teamer.lastName') }}
|
||||
</th>
|
||||
<th>
|
||||
{{ knp_pagination_sortable(pagination, 'Status', 'disposition.status') }}
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
Keine Daten...
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for upload in pagination %}
|
||||
{% set disposition = upload.disposition %}
|
||||
{% set assignment = disposition.assignment %}
|
||||
<tr>
|
||||
<td>
|
||||
{{ assignment.destination.dateFrom|date('d.m.Y') }}
|
||||
-
|
||||
{{ assignment.destination.dateTo|date('d.m.Y') }}
|
||||
</td>
|
||||
<td>
|
||||
{{ assignment.jobProfile.name }}
|
||||
</td>
|
||||
<td>
|
||||
{{ assignment.destination.product }}
|
||||
<br>
|
||||
{{ assignment.destination.hotel }}
|
||||
</td>
|
||||
<td>
|
||||
{{ ('label.document.type.' ~ upload.type)|trans }}
|
||||
</td>
|
||||
<td>
|
||||
{{ disposition.teamer }}
|
||||
</td>
|
||||
<td>
|
||||
{{ ('label.document.status.' ~ upload.status)|trans }}
|
||||
</td>
|
||||
<td>
|
||||
<div class="flex items-center space-x-2">
|
||||
<a href="{{ path('app_common_download', { 'uuid': upload.uuid }) }}"
|
||||
title="Download"
|
||||
target="_blank">
|
||||
{{ icon('download') }}
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
Keine Daten...
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button"
|
||||
class="btn"
|
||||
{{ stimulus_controller('modal-button', [], [], {'ajax-modal': '#ajax-modal'}) }}
|
||||
{{ stimulus_action('modal-button', 'ajax', null, {
|
||||
'title': 'Dokumente hinzufügen',
|
||||
'url': path('app_admin_document_upload')
|
||||
}) }}>
|
||||
Dokumente hinzufügen
|
||||
</button>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,99 @@
|
||||
{% extends 'admin/layout.html.twig' %}
|
||||
|
||||
{% block title %}Dokumentenübersicht{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1 class="text-2xl font-bold pb-8">
|
||||
Dokumentenübersicht
|
||||
</h1>
|
||||
<div class="data-table-wrapper">
|
||||
<div class="data-table-wrapper__inner">
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
{{ knp_pagination_sortable(pagination, 'Dateiname', 'upload.originalFilename') }}
|
||||
</th>
|
||||
<th>
|
||||
Dateigröße
|
||||
</th>
|
||||
<th>
|
||||
Upload am
|
||||
</th>
|
||||
<th>
|
||||
Upload von
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for document in pagination %}
|
||||
<tr>
|
||||
<td>
|
||||
{{ document.displayName ? document.displayName : document.originalFilename }}
|
||||
</td>
|
||||
<td>
|
||||
{{ document.size|file_size }}
|
||||
</td>
|
||||
<td>
|
||||
{{ document.createdAt|date('d.m.Y') }}
|
||||
</td>
|
||||
<td>
|
||||
{{ document.createdBy }}
|
||||
</td>
|
||||
<td>
|
||||
<div class="flex items-center space-x-2 justify-end">
|
||||
<button type="button"
|
||||
class="text-red-500"
|
||||
{{ stimulus_controller('modal-button', [], [], {'confirmation-modal': '#confirmation-modal'}) }}
|
||||
{{ stimulus_action('modal-button', 'confirmation', null, {
|
||||
'title': 'Bist du sicher?',
|
||||
'content': 'Möchtest du das Dokument wirklich löschen?',
|
||||
'target-url': path('app_admin_system_document_delete', { 'uuid': document.uuid })
|
||||
}) }}>
|
||||
{{ icon('delete') }}
|
||||
</button>
|
||||
<button type="button"
|
||||
{{ stimulus_controller('modal-button', [], [], {'ajax-modal': '#ajax-modal'}) }}
|
||||
{{ stimulus_action('modal-button', 'ajax', null, {
|
||||
'title': 'Dokument ersetzen',
|
||||
'url': path('app_admin_system_document_replace', { 'uuid': document.uuid })
|
||||
}) }}>
|
||||
{{ icon('refresh') }}
|
||||
</button>
|
||||
<button type="button"
|
||||
{{ stimulus_controller('modal-button', [], [], {'ajax-modal': '#ajax-modal'}) }}
|
||||
{{ stimulus_action('modal-button', 'ajax', null, {
|
||||
'title': 'Dokument umbenennen',
|
||||
'url': path('app_admin_system_document_rename', { 'uuid': document.uuid })
|
||||
}) }}>
|
||||
{{ icon('edit') }}
|
||||
</button>
|
||||
<a href="{{ path('app_common_download', { 'uuid': document.uuid }) }}"
|
||||
title="Download">
|
||||
{{ icon('download') }}
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
Keine Daten...
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button"
|
||||
class="btn"
|
||||
{{ stimulus_controller('modal-button', [], [], {'ajax-modal': '#ajax-modal'}) }}
|
||||
{{ stimulus_action('modal-button', 'ajax', null, {
|
||||
'title': 'Dokumente hinzufügen',
|
||||
'url': path('app_admin_system_document_upload')
|
||||
}) }}>
|
||||
Dokumente hinzufügen
|
||||
</button>
|
||||
{% endblock %}
|
||||
@@ -20,29 +20,71 @@
|
||||
<br>
|
||||
{{ assignment.contact }}, <a href="mailto:{{ assignment.contact.email }}" class="underline">{{ assignment.contact.email }}</a>
|
||||
</p>
|
||||
<h3 class="text-xl font-bold pb-4">
|
||||
Hier findest du deinen Honorarvertrag
|
||||
</h3>
|
||||
<div class="pb-4">
|
||||
<a href="{{ path('app_teamer_disposition_contract', { 'uuid': disposition.uuid }) }}" target="_blank" class="inline-block">
|
||||
<img src="{{ asset('build/images/contract_thumb.jpg') }}" alt="Honorarvertrag" class="block w-32 h-auto shadow-md">
|
||||
</a>
|
||||
</div>
|
||||
<p class="pb-4">
|
||||
Bitte lade ihn unterschrieben hier wieder hoch:
|
||||
</p>
|
||||
{{ form_start(form) }}
|
||||
<div class="pb-4">
|
||||
{% include '_partials/_upload_collection_form.html.twig' with {
|
||||
'endpoint_upload': path('_uploader_upload_contract'),
|
||||
'accepted_files': 'image/jpg,image/jpeg,application/pdf',
|
||||
} %}
|
||||
</div>
|
||||
<button type="submit" class="btn">
|
||||
Aktualisieren
|
||||
</button>
|
||||
{{ form_rest(form) }}
|
||||
{{ form_end(form) }}
|
||||
{% if workflow_can(disposition, 'upload_contract') %}
|
||||
<h3 class="text-xl font-bold pb-4">
|
||||
Hier findest du deinen Honorarvertrag
|
||||
</h3>
|
||||
<div class="pb-4">
|
||||
<a href="{{ path('app_teamer_disposition_contractpdf', { 'uuid': disposition.uuid }) }}" target="_blank" class="inline-block">
|
||||
<img src="{{ asset('build/images/contract_thumb.jpg') }}" alt="Honorarvertrag" class="block w-32 h-auto shadow-md">
|
||||
</a>
|
||||
</div>
|
||||
<p class="pb-4">
|
||||
Bitte lade ihn unterschrieben hier wieder hoch:
|
||||
</p>
|
||||
{{ form_start(form) }}
|
||||
<div class="pb-4">
|
||||
{% include '_partials/_upload_collection_form.html.twig' with {
|
||||
'endpoint_upload': path('_uploader_upload_contract'),
|
||||
'accepted_files': 'image/jpg,image/jpeg,application/pdf',
|
||||
} %}
|
||||
</div>
|
||||
<button type="submit" class="btn">
|
||||
Aktualisieren
|
||||
</button>
|
||||
{{ form_rest(form) }}
|
||||
{{ form_end(form) }}
|
||||
{% elseif workflow_can(disposition, 'upload_invoice') %}
|
||||
<h3 class="text-xl font-bold pb-4">
|
||||
Hier findest du deine Honorarnote
|
||||
</h3>
|
||||
<div class="pb-4">
|
||||
<a href="{{ path('app_teamer_disposition_contractpdf', { 'uuid': disposition.uuid }) }}" target="_blank" class="inline-block">
|
||||
<img src="{{ asset('build/images/contract_thumb.jpg') }}" alt="Honorarvertrag" class="block w-32 h-auto shadow-md">
|
||||
</a>
|
||||
</div>
|
||||
<p class="pb-4">
|
||||
Bitte lade sie ausgefüllt und unterschrieben hier wieder hoch:
|
||||
</p>
|
||||
{{ form_start(form) }}
|
||||
<div class="pb-4">
|
||||
{% include '_partials/_upload_collection_form.html.twig' with {
|
||||
'endpoint_upload': path('_uploader_upload_invoice'),
|
||||
'accepted_files': 'image/jpg,image/jpeg,application/pdf',
|
||||
} %}
|
||||
</div>
|
||||
<button type="submit" class="btn">
|
||||
Aktualisieren
|
||||
</button>
|
||||
{{ form_rest(form) }}
|
||||
{{ form_end(form) }}
|
||||
{% elseif workflow_has_marked_place(disposition, 'checking_contract') %}
|
||||
<h3 class="text-xl font-bold pb-4">
|
||||
Danke für den Upload des Honorarvertrags
|
||||
</h3>
|
||||
{% elseif workflow_has_marked_place(disposition, 'checking_invoice') %}
|
||||
<h3 class="text-xl font-bold pb-4">
|
||||
Danke für den Upload der Honorarnote
|
||||
</h3>
|
||||
{% elseif workflow_has_marked_place(disposition, 'paid') %}
|
||||
<h3 class="text-xl font-bold pb-4">
|
||||
Dein Honorar wurde überwiesen
|
||||
</h3>
|
||||
{% else %}
|
||||
<h3 class="text-xl font-bold pb-4">
|
||||
Dein Einsatz ist abgeschlossen
|
||||
</h3>
|
||||
{% endif %}
|
||||
<div class="pt-4">
|
||||
<a href="{{ returnUrl }}" class="underline">
|
||||
zurück
|
||||
|
||||
Reference in New Issue
Block a user