new view
This commit is contained in:
@@ -119,6 +119,11 @@ class Reports
|
|||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isDone(): bool
|
||||||
|
{
|
||||||
|
return $this->isReportsTodo(ReportTodoEnum::COMPLETE);
|
||||||
|
}
|
||||||
|
|
||||||
public function countTodoReports(): int
|
public function countTodoReports(): int
|
||||||
{
|
{
|
||||||
$count = 0;
|
$count = 0;
|
||||||
@@ -171,11 +176,6 @@ class Reports
|
|||||||
$this->numberOfReport = $numberOfReport;
|
$this->numberOfReport = $numberOfReport;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isDone(): bool
|
|
||||||
{
|
|
||||||
return $this->isDone;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setDone(bool $isDone): static
|
public function setDone(bool $isDone): static
|
||||||
{
|
{
|
||||||
$this->isDone = $isDone;
|
$this->isDone = $isDone;
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ enum ReportStatus: int {
|
|||||||
|
|
||||||
public function checkboxColor() : string
|
public function checkboxColor() : string
|
||||||
{
|
{
|
||||||
|
return 'primary';
|
||||||
return match ($this)
|
return match ($this)
|
||||||
{
|
{
|
||||||
ReportStatus::INSERT => 'primary',
|
ReportStatus::INSERT => 'primary',
|
||||||
@@ -19,8 +20,8 @@ enum ReportStatus: int {
|
|||||||
{
|
{
|
||||||
return match ($this)
|
return match ($this)
|
||||||
{
|
{
|
||||||
ReportStatus::INSERT => 'light',
|
ReportStatus::INSERT => 'info',
|
||||||
ReportStatus::WORKING => 'warning',
|
ReportStatus::WORKING => 'primary',
|
||||||
ReportStatus::COMPLETE => 'success',
|
ReportStatus::COMPLETE => 'success',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -29,8 +30,7 @@ enum ReportStatus: int {
|
|||||||
{
|
{
|
||||||
return match ($this)
|
return match ($this)
|
||||||
{
|
{
|
||||||
ReportStatus::WORKING, ReportStatus::INSERT => 'dark',
|
ReportStatus::WORKING, ReportStatus::INSERT, ReportStatus::COMPLETE => 'dark',
|
||||||
ReportStatus::COMPLETE => 'white',
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,8 +38,7 @@ enum ReportStatus: int {
|
|||||||
{
|
{
|
||||||
return match ($this)
|
return match ($this)
|
||||||
{
|
{
|
||||||
ReportStatus::WORKING, ReportStatus::INSERT => 'dark',
|
ReportStatus::WORKING, ReportStatus::INSERT, ReportStatus::COMPLETE => 'dark',
|
||||||
ReportStatus::COMPLETE => 'light',
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,6 +51,16 @@ enum ReportStatus: int {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function takeBadgeBg(): string
|
||||||
|
{
|
||||||
|
return 'info';
|
||||||
|
return match ($this) {
|
||||||
|
ReportStatus::INSERT => 'info',
|
||||||
|
ReportStatus::WORKING => 'primary',
|
||||||
|
ReportStatus::COMPLETE => 'info'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
public function next() : ?ReportStatus
|
public function next() : ?ReportStatus
|
||||||
{
|
{
|
||||||
return ReportStatus::tryFrom($this->value+1);
|
return ReportStatus::tryFrom($this->value+1);
|
||||||
|
|||||||
@@ -12,59 +12,71 @@
|
|||||||
>
|
>
|
||||||
{% for id,reports in reportsGroup %}
|
{% for id,reports in reportsGroup %}
|
||||||
<div class="status-row" style="{% if isOverdue and id == 3 %}display:none{% endif %}">
|
<div class="status-row" style="{% if isOverdue and id == 3 %}display:none{% endif %}">
|
||||||
<div class="col">
|
<div class="card border-{{ reports.status.backgroundColor }} ">
|
||||||
<div class="card text-center text-white bg-dark">
|
<h3 class="card-header">{{ reports.status.takeLang }}</h3>
|
||||||
<div class="card-title"><h2>{{ reports.status.takeLang }}</h2></div>
|
<div class="card-body">
|
||||||
</div>
|
{% for report in reports.reports %}
|
||||||
</div>
|
<div class="card text-{{ reports.status.textColor }} border-dark report-one">
|
||||||
{% for report in reports.reports %}
|
<div class="report-number">
|
||||||
<div class="col">
|
<div class="badge bg-{{ reports.status.takeBadgeBg }} text-dark" data-toggle="tooltip" data-placement="bottom" title="Numer sprawozdania">{{ report.number }}</div>
|
||||||
<div class="card text-{{ reports.status.textColor }} bg-{{ reports.status.backgroundColor }} report-one">
|
</div>
|
||||||
<div class="report-number">
|
<div class="card-header">
|
||||||
<div class="badge bg-info text-dark" data-toggle="tooltip" data-placement="bottom" title="Numer sprawozdania">{{ report.number }}</div>
|
<h5 class="card-title">
|
||||||
</div>
|
{% if is_granted('clientView') %}
|
||||||
{# <img src="..." class="card-img-top" alt="...">#}
|
<a href="{{ path('app_client',{id: report.client.id}) }}" class="link-{{ reports.status.linkColor }}">{{ report.client.strName }}</a>
|
||||||
<div class="card-body">
|
{% else %}
|
||||||
<h5 class="card-title">
|
{{ report.client.strName }}
|
||||||
{% if is_granted('clientView') %}
|
{% endif %}
|
||||||
<a href="{{ path('app_client',{id: report.client.id}) }}" class="link-{{ reports.status.linkColor }}">{{ report.client.strName }}</a>
|
</h5>
|
||||||
{% else %}
|
</div>
|
||||||
{{ report.client.strName }}
|
<div class="card-body">
|
||||||
{% endif %}
|
<p class="card-text">
|
||||||
</h5>
|
<form action="{{ path('app_set_status_todo') }}" method="post">
|
||||||
{# <h6 class="card-subtitle text-muted">Numer sprawozdania: </h6>#}
|
<input type="hidden" name="reportId" value="{{ report.id }}">
|
||||||
<div class="card-text">
|
<input type="hidden" name="token" value="{{ csrf_token('report-status') }}">
|
||||||
<form action="{{ path('app_set_status_todo') }}" method="post">
|
<div class="btn-group" role="group" aria-label="Todos">
|
||||||
<input type="hidden" name="reportId" value="{{ report.id }}">
|
{% for todo in reportToDoList %}
|
||||||
<input type="hidden" name="token" value="{{ csrf_token('report-status') }}">
|
<input onchange="this.form.submit()"
|
||||||
<div class="btn-group" role="group" aria-label="Todos">
|
name="{{ todo.value }}"
|
||||||
{% for todo in reportToDoList %}
|
type="checkbox"
|
||||||
<input onchange="this.form.submit()"
|
class="btn-check"
|
||||||
name="{{ todo.value }}"
|
id="checkboxToDo{{ todo.value }}Id{{ report.id }}"
|
||||||
type="checkbox"
|
{% if report.isReportsTodo(todo) %}
|
||||||
class="btn-check"
|
checked="checked"
|
||||||
id="checkboxToDo{{ todo.value }}Id{{ report.id }}"
|
{% endif %}
|
||||||
{% if report.isReportsTodo(todo) %}
|
{% if not is_granted('reportEdit') %}
|
||||||
checked="checked"
|
disabled
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if not is_granted('reportEdit') %}
|
autocomplete="off"
|
||||||
disabled
|
>
|
||||||
{% endif %}
|
<label class="btn btn-outline-{{ reports.status.checkboxColor }} d-flex align-items-center"
|
||||||
autocomplete="off"
|
for="checkboxToDo{{ todo.value }}Id{{ report.id }}"
|
||||||
>
|
data-toggle="tooltip" data-placement="bottom" title="{{ todo.takeLang }}">
|
||||||
<label class="btn btn-outline-{{ reports.status.checkboxColor }} d-flex align-items-center"
|
<i class="fa fa-solid fa-{{ todo.takeIcon }}"> </i>
|
||||||
for="checkboxToDo{{ todo.value }}Id{{ report.id }}"
|
</label>
|
||||||
data-toggle="tooltip" data-placement="bottom" title="{{ todo.takeLang }}">
|
{% endfor %}
|
||||||
<i class="fa fa-solid fa-{{ todo.takeIcon }}"> </i>
|
</div>
|
||||||
</label>
|
</form>
|
||||||
{% endfor %}
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="card-footer bg-transparent">
|
||||||
|
<div class="progress">
|
||||||
|
{% set percentageProgress = report.isDone ? 100 : report.countTodoReports / reportToDoList|length * 100 %}
|
||||||
|
<div class="progress-bar progress-bar-striped bg-info"
|
||||||
|
role="progressbar"
|
||||||
|
aria-valuenow="{{ report.countTodoReports }}"
|
||||||
|
aria-valuemin="0"
|
||||||
|
aria-valuemax="{{ reportToDoList|length }}"
|
||||||
|
style="width: {{ percentageProgress }}%"
|
||||||
|
>
|
||||||
|
<strong>{{ percentageProgress }}%</strong>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user