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
+39
View File
@@ -0,0 +1,39 @@
<!doctype html>
<html lang="pl">
<head>
{% if app.environment == "prod" %}
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" />
{% endif %}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% block title %}Sprawozdania{% endblock %}</title>
{% block stylesheets %}
{# 'app' must match the first argument to addEntry() in webpack.config.js #}
{{ encore_entry_link_tags('app') }}
<!-- Renders a link tag (if your module requires any CSS)
<link rel="stylesheet" href="/build/app.css"> -->
{% endblock %}
{% block javascripts %}
{{ encore_entry_script_tags('app') }}
<!-- Renders app.js & a webpack runtime.js file
<script src="/build/runtime.js" defer></script>
<script src="/build/app.js" defer></script>
See note below about the "defer" attribute -->
{% endblock %}
</head>
<body>
{% block navigation %}
{% include "navigation/top.html.twig" %}
{% endblock %}
<div class="container-fluid" style="margin: 10px 0;">
{% block body %}{% endblock %}
</div>
</body>
</html>
+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 %}
+20
View File
@@ -0,0 +1,20 @@
{% extends 'base.html.twig' %}
{% block title %}Hello LoginController!{% endblock %}
{% block body %}
<style>
.example-wrapper { margin: 1em auto; max-width: 800px; width: 95%; font: 18px/1.5 sans-serif; }
.example-wrapper code { background: #F5F5F5; padding: 2px 6px; }
</style>
<div class="example-wrapper">
<h1>Hello {{ controller_name }}! ✅</h1>
This friendly message is coming from:
<ul>
<li>Your controller at <code>/home/ryjek/www/sprawozdania/project/src/Controller/LoginController.php</code></li>
<li>Your template at <code>/home/ryjek/www/sprawozdania/project/templates/login/index.html.twig</code></li>
</ul>
</div>
{% endblock %}
@@ -0,0 +1,19 @@
{% macro month_menu(routeName, months, currentMonth) %}
<div class="row row-cols-12 reports-months-all">
<div class="col">
<a href="{{ path(routeName, {monthId:-1}) }}" class="btn {% if currentMonth is null %}btn-success{% else %}btn-secondary{% endif %}">Zaległe</a>
</div>
{% for id,month in months %}
{% set isCurrent = currentMonth is not null and month | date("Y-m") == currentMonth | date("Y-m") %}
<div class="col">
<a href="{{ path(routeName,{monthId: id}) }}" class="btn {% if isCurrent %}btn-success{% else %}btn-secondary{% endif %}">
{% if routeName=='app_schedule' %}
{{ id }}
{% else %}
{{ month | date("Y-m") }}
{% endif %}
</a>
</div>
{% endfor %}
</div>
{% endmacro %}
@@ -0,0 +1,73 @@
{#<nav class="navbar navbar-inverse">#}
{# <div class="container-fluid">#}
{# <div class="navbar-header">#}
{# <a class="navbar-brand" href="{{ path('app_base') }}">WebSiteName</a>#}
{# </div>#}
{# <ul class="nav navbar-nav">#}
{# <li class="active"><a href="{{ path('app_base') }}">Home</a></li>#}
{# <li class="dropdown">#}
{# <a class="dropdown-toggle" data-toggle="dropdown" href="#">Klienci#}
{# <span class="caret"></span></a>#}
{# <ul class="dropdown-menu">#}
{# <li><a href="{{ path('app_customers_list') }}">Lista</a></li>#}
{# <li><a href="{{ path('app_base') }}">Dodaj klienta</a></li>#}
{# <li><a href="#">Page 1-3</a></li>#}
{# </ul>#}
{# </li>#}
{# <li><a href="#">Page 2</a></li>#}
{# <li><a href="#">Page 3</a></li>#}
{# </ul>#}
{# </div>#}
{#</nav>#}
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
<div class="container-fluid">
<a class="navbar-brand" href="{{ path('index') }}">CRM</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
{% if is_granted('reportView') %}
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="{{ path('app_base') }}">Sprawozdania</a>
</li>
{% endif %}
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="{{ path('app_schedule') }}">Harmonogramy</a>
</li>
{% if is_granted('clientView') %}
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="{{ path('app_customers_list') }}">Klienci</a>
</li>
{% endif %}
{# <li class="nav-item dropdown">#}
{# <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">#}
{# Klienci#}
{# </a>#}
{# <ul class="dropdown-menu" aria-labelledby="navbarDropdown">#}
{# <li><a class="dropdown-item" href="{{ path('app_customers_list') }}">Lista</a></li>#}
{# <li><a class="dropdown-item" href="{{ path('app_add_client') }}">Dodaj klienta</a></li>#}
{# <li><hr class="dropdown-divider"></li>#}
{# <li><a class="dropdown-item" href="#">Something else here</a></li>#}
{# </ul>#}
{# </li>#}
{# <li class="nav-item">#}
{# <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>#}
{# </li>#}
</ul>
{% if is_granted('clientAdd') %}
<div class="d-flex">
<a href="{{ path('app_add_client') }}" class="btn btn-success btn-outline-dark" type="submit">Dodaj klienta</a>
</div>
{% endif %}
<div class="d-flex">
<a href="{{ path('app_logout') }}" class="btn btn-primary btn-outline-dark" type="submit">Wyloguj</a>
</div>
{# <form class="d-flex">#}
{# <input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">#}
{# <button class="btn btn-outline-success" type="submit">Search</button>#}
{# </form>#}
</div>
</div>
</nav>
+58
View File
@@ -0,0 +1,58 @@
{% extends 'base.html.twig' %}
{% import 'navigation/switch_months.html.twig' as navigation %}
{% block body %}
{{ navigation.month_menu('app_base',months,currentMonth) }}
<div class="row row-cols-3 row-cols-md-3 g-3 reports-all">
{% for id,reports in reportsGroup %}
<div class="status-row" style="{% if currentMonth is null and id == 3 %}display:none{% endif %}">
<div class="col">
<div class="card text-center text-white bg-dark">
<div class="card-title"><h2>{{ reports.status.takeLang }}</h2></div>
</div>
</div>
{% for report in reports.reports %}
<div class="col">
<div class="card text-{{ reports.status.textColor }} bg-{{ reports.status.backgroundColor }} report-one">
<div class="report-number">
<div class="badge bg-info text-dark" data-toggle="tooltip" data-placement="bottom" title="Numer sprawozdania">{{ report.number }}</div>
</div>
{# <img src="..." class="card-img-top" alt="...">#}
<div class="card-body">
<h5 class="card-title"><a href="{{ path('app_client',{id: report.client.id}) }}" class="link-{{ reports.status.linkColor }}">{{ report.client.strName }}</a></h5>
{# <h6 class="card-subtitle text-muted">Numer sprawozdania: </h6>#}
<div class="card-text">
<form action="{{ path('app_set_status_todo') }}" method="post">
<input type="hidden" name="reportId" value="{{ report.id }}">
<input type="hidden" name="token" value="{{ csrf_token('report-status') }}">
<div class="btn-group" role="group" aria-label="Test">
{% for todo in reportToDoList %}
<input onchange="this.form.submit()"
name="{{ todo.value }}"
type="checkbox"
class="btn-check"
id="checkboxToDo{{ todo.value }}Id{{ report.id }}"
{% if report.isReportsTodo(todo) %}
checked="checked"
{% endif %}
{% if not is_granted('reportEdit') %}
disabled
{% endif %}
autocomplete="off"
>
<label class="btn btn-outline-{{ reports.status.checkboxColor }} d-flex align-items-center"
for="checkboxToDo{{ todo.value }}Id{{ report.id }}"
data-toggle="tooltip" data-placement="bottom" title="{{ todo.takeLang }}">
<i class="fa fa-solid fa-{{ todo.takeIcon }}"> </i>
</label>
{% endfor %}
</div>
</form>
</div>
</div>
</div>
</div>
{% endfor %}
</div>
{% endfor %}
</div>
{% endblock %}
@@ -0,0 +1,45 @@
{% extends 'base.html.twig' %}
{% import 'navigation/switch_months.html.twig' as navigation %}
{% block title %}Harmonogramy{% endblock %}
{% block body %}
{# {{ navigation.month_menu('app_schedule',months,currentMonth) }}#}
<div class="row row-cols-2 reports-months-all">
<div class="col">
<a href="{{ path('app_schedule', {typeId:2}) }}" class="card text-center text-white {% if typeId == 2 %}bg-primary{% else %}bg-secondary{% endif %}">
<div class="card-title"><h2>Zaległe</h2></div>
</a>
{# <a href="{{ path('app_schedule', {monthId:-1}) }}" class="btn {% if currentMonth is null %}btn-success{% else %}btn-secondary{% endif %}">Zaległe</a>#}
</div>
<div class="col">
<a href="{{ path('app_schedule', {typeId:1}) }}" class="card text-center text-white {% if typeId == 1 %}bg-primary{% else %}bg-secondary{% endif %}">
<div class="card-title"><h2>Aktualne</h2></div>
</a>
{# <a href="{{ path('app_schedule', {monthId:-1}) }}" class="btn {% if currentMonth is null %}btn-success{% else %}btn-secondary{% endif %}">Zaległe</a>#}
</div>
{# <div class="col">#}
{# <a href="{{ path('app_schedule', {monthId:1}) }}" class="btn {% if currentMonth is null %}btn-success{% else %}btn-secondary{% endif %}">Aktualne</a>#}
{# </div>#}
</div>
<div class="row row-cols-auto reports-all">
{% for schedule in schedules %}
<div class="col">
<div class="card text-white bg-{{ schedule.getStatus.backgroundColor }}">
<div class="card-body">
<h5 class="card-title">
<a href="{{ path('app_client',{id: schedule.client.id}) }}" class="link-dark">{{ schedule.client.strName }}</a>
</h5>
<h6 class="card-subtitle text-muted">Pozostały czas: {{ schedule.getTimeLeft }} dni</h6>
</div>
<div class="card-footer">
<form action="{{ path('app_schedule_status') }}" method="post">
<input type="hidden" name="token" value="{{ csrf_token('schedule-status') }}">
<input type="hidden" name="scheduleId" value="{{ schedule.id }}">
<button type="submit" class="btn btn-success">Wysłano</button>
</form>
</div>
</div>
</div>
{% endfor %}
</div>
{% endblock %}
@@ -0,0 +1,45 @@
{% extends 'base.html.twig' %}
{% block title %}Log in!{% endblock %}
{% block navigation %}{% endblock %}
{% block body %}
<div class="row justify-content-md-center">
<div class="col col-lg-2">
<form method="post">
{% if error %}
<div class="alert alert-danger">{{ error.messageKey|trans(error.messageData, 'security') }}</div>
{% endif %}
{% if app.user %}
<div class="mb-3">
You are logged in as {{ app.user.userIdentifier }}, <a href="{{ path('app_logout') }}">Logout</a>
</div>
{% endif %}
<h1 class="h3 mb-3 font-weight-normal">CRM</h1>
<label for="username">Login</label>
<input type="text" value="{{ last_username }}" name="_username" id="username" class="form-control" autocomplete="username" required autofocus>
<label for="password">Hasło</label>
<input type="password" name="_password" id="password" class="form-control" autocomplete="current-password" required>
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}">
{#
Uncomment this section and add a remember_me option below your firewall to activate remember me functionality.
See https://symfony.com/doc/current/security/remember_me.html
<div class="checkbox mb-3">
<input type="checkbox" name="_remember_me" id="_remember_me">
<label for="_remember_me">Remember me</label>
</div>
#}
<button class="btn btn-lg btn-primary" type="submit">
Zaloguj
</button>
</form>
</div>
</div>
{% endblock %}