initial commit

This commit is contained in:
2024-07-25 10:54:27 +02:00
parent 3a922fd5bc
commit d2ae809b98
113 changed files with 19295 additions and 2522 deletions
+34
View File
@@ -0,0 +1,34 @@
{% extends 'base.html.twig' %}
{% form_theme form 'bootstrap_5_layout.html.twig' %}
{% block body %}
{% if state %}
{% if state.success %}
<div class="alert alert-success">
Poprawnie dodano nowego klienta!
</div>
{% endif %}
{% endif %}
<div class="row row-cols-3 align-items-center">
<div class="card text-center bg-light-subtle">
{{ form(form) }}
</div>
{% if isEdit %}
<div class="card text-center bg-light-subtle">
<div class="card-header">
Termin pierwszego sprawozdania
</div>
<div class="card-body">
<form action="{{ path('app_edit_first_report') }}" method="post">
<input type="hidden" name="clientId" value="{{ client.id }}">
<input type="hidden" name="token" value="{{ csrf_token('edit-first-report') }}">
<input type="date" name="newDate" class="form-control">
<button type="submit" class="btn btn-primary">Ustaw termin pierwszego sprawozdania</button>
</form>
</div>
</div>
{% endif %}
</div>
{% endblock %}
@@ -0,0 +1,6 @@
{% extends 'base.html.twig' %}
{% form_theme form 'bootstrap_5_layout.html.twig' %}
{% block body %}
{{ form(form) }}
{% endblock %}
@@ -0,0 +1,45 @@
{% extends 'base.html.twig' %}
{% block body %}
<div class="row place customers_list justify-content-md-center row" data-controller="customers">
{% if customers %}
<div class="col-xl-8 col-lg-10 card">
<div class="card-header">
<div class="form-floating">
<input type="text" class="form-control" placeholder="Szukaj..." id="customerListSearch">
<label for="customerListSearch">Szukaj...</label>
</div>
</div>
<div class="table-responsive card-body">
<table class="table table-hover table-bordered">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Imię i nazwisko</th>
<th scope="col">Adres</th>
{# <th scope="col">NIP</th>#}
{# <th scope="col">E-mail</th>#}
<th scope="col">Data prawomocnosci</th>
<th scope="col">Data obwieszczenia</th>
{# <th scope="col">Akcja</th>#}
</tr>
</thead>
<tbody id="customerListTable" class="">
{% for customer in customers %}
<tr>
<th scope="row">{{ loop.index }}</th>
<td><a href="{{ path('app_client',{id: customer.id}) }}">{{ customer.strName }}</a></td>
<td>{{ customer.strAddress }}</td>
{# <td>{{ customer.intNIP }}</td>#}
{# <td>{{ customer.strEmail }}</td>#}
<td>{{ customer.dateLegitimacy | date("d-m-Y") }}</td>
<td>{{ customer.dateProclamation | date("d-m-Y") }}</td>
{# <td></td>#}
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endif %}
</div>
{% endblock %}
+132
View File
@@ -0,0 +1,132 @@
{% extends 'base.html.twig' %}
{% block body %}
{% if client.isComplete %}
<div class="alert alert-warning"><i class="fa-solid fa-circle-info"></i> Zakończono generowanie sprawozdań!</div>
{% endif %}
<div class="row row-cols-1 row-cols-md-2 g-2">
<div class="col">
<div class="card text-center">
<div class="card-header">
<h2>{{ client.strName }}</h2>
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item"><span style="font-weight: bold">Adres: </span>{{ client.strAddress }}</li>
<li class="list-group-item"><span style="font-weight: bold">NIP: </span>{{ client.intNIP }}</li>
<li class="list-group-item"><span style="font-weight: bold">E-mail: </span>{{ client.strEmail }}</li>
<li class="list-group-item"><span style="font-weight: bold">Telefon: </span>{{ client.intPhone | phone }}</li>
<li class="list-group-item"><span style="font-weight: bold">Data prawomocności: </span>{{ client.dateLegitimacy | date("d-m-Y") }}</li>
<li class="list-group-item"><span style="font-weight: bold">Data obwieszczenia: </span>{{ client.dateProclamation | date("d-m-Y") }}</li>
{% if schedules %}
<li class="list-group-item list-group-item-{{ schedules.getStatus.backgroundColor }}">
<span style="font-weight: bold">Harmonogram: </span>
{% if schedules.isDone %}
wysłano: {{ schedules.getDateDone | date("d-m-Y H:i") }}
{% else %}
Pozostały czas: <span style="font-size: 1.2em">{{ schedules.getTimeLeft }}</span> dni
{% endif %}
</li>
{% endif %}
</ul>
<div class="card-footer" style="display: inline-flex;margin: auto;">
{% if is_granted('reportEdit') %}
<form action="{{ path('app_set_complete',{id: client.id}) }}" method="post" style="padding: 0 5px;">
<input type="hidden" name="isComplete" value="1">
<input type="hidden" name="token" value="{{ csrf_token("set-complete-item") }}">
<button class="btn btn-warning" type="submit">
{% if client.isComplete %}
Wznów
{% else %}
Zakończ
{% endif %}
</button>
</form>
{% endif %}
{% if not client.isComplete and is_granted('clientEdit') %}
<a href="{{ path('app_add_client',{id: client.id}) }}" class="btn btn-success">Edytuj</a>
{% endif %}
{% if is_granted('clientDelete') %}
<button class="btn btn-danger" type="button" data-bs-toggle="modal" data-bs-target="#removeConfirmModal">Usuń</button>
{% endif %}
</div>
</div>
{% if is_granted('reportView') %}
<div class="card text-center bg-light-subtle">
<div class="card-header">
<h2>Sprawozdania</h2>
{% if not client.isComplete and is_granted('reportEdit') %}
<form action="{{ path('app_add_next_report') }}" method="post">
<input type="hidden" name="clientId" value="{{ client.id }}">
<input type="hidden" name="token" value="{{ csrf_token('add-next-report') }}">
<button type="submit" class="btn btn-primary">Dodaj następne sprawozdanie</button>
</form>
{% endif %}
</div>
<div class="card-body">
<ul class="list-group list-group-flush">
{% for report in reports %}
<li class="list-group-item d-flex align-items-center">
<span class="badge rounded-pill text-bg-primary">{{ report.number }}</span>
<span class="badge rounded-pill text-bg-light">{{ report.getDateStart | date("Y-m-d") }}</span>
{% for todo in report.getReportsTodos %}
{% if report.isReportsTodo(todo.getName) %}
<span class="badge rounded-pill text-bg-{{ todo.getName.backgroundColor }}">
<i class="fa fa-solid fa-{{ todo.getName.takeIcon }}"> </i> {{ todo.getName.takeLang }}
</span>
{% endif %}
{% endfor %}
</li>
{% endfor %}
</ul>
</div>
</div>
{% endif %}
</div>
<div class="col">
<div class="card">
<div class="card-header text-center"><h2>Notatka</h2></div>
{% if notes %}
<div class="card-body">
<p>
{% apply markdown_to_html %}
{{ notes.description }}
{% endapply %}
</p>
</div>
{% endif %}
{% if not client.isComplete and is_granted('clientEdit') %}
<div class="card-footer text-center">
<a href="{{ path('app_edit_client_note',{clientId: client.id}) }}" class="btn btn-success">Edytuj</a>
</div>
{% endif %}
</div>
</div>
</div>
<div class="modal fade" id="removeConfirmModal" tabindex="-1" aria-labelledby="removeConfirmModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="removeConfirmModalLabel">Czy na pewno chcesz usunąć tego klienta?</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
Usunięcie klienta spowoduje wyczyszczenie wszystkich informacji z nim związanych (w tym sprawozdania, harmonogramy).<br>
<h3>Tej operacji nie można cofnąć!</h3>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<form action="{{ path('app_client',{id:client.id}) }}" method="post">
<input type="hidden" name="token" value="{{ csrf_token('delete-item') }}">
<input type="hidden" name="toDelete" value="1">
<input type="hidden" name="backUrl" value="{{ backUrl }}">
<button type="submit" class="btn btn-danger">Usuń</button>
</form>
</div>
</div>
</div>
</div>
{% endblock %}