This commit is contained in:
2024-08-02 13:37:48 +02:00
parent 9b549fa9e7
commit fa3b766634
3 changed files with 81 additions and 60 deletions
+5 -5
View File
@@ -119,6 +119,11 @@ class Reports
return $return;
}
public function isDone(): bool
{
return $this->isReportsTodo(ReportTodoEnum::COMPLETE);
}
public function countTodoReports(): int
{
$count = 0;
@@ -171,11 +176,6 @@ class Reports
$this->numberOfReport = $numberOfReport;
}
public function isDone(): bool
{
return $this->isDone;
}
public function setDone(bool $isDone): static
{
$this->isDone = $isDone;
+15 -6
View File
@@ -8,6 +8,7 @@ enum ReportStatus: int {
public function checkboxColor() : string
{
return 'primary';
return match ($this)
{
ReportStatus::INSERT => 'primary',
@@ -19,8 +20,8 @@ enum ReportStatus: int {
{
return match ($this)
{
ReportStatus::INSERT => 'light',
ReportStatus::WORKING => 'warning',
ReportStatus::INSERT => 'info',
ReportStatus::WORKING => 'primary',
ReportStatus::COMPLETE => 'success',
};
}
@@ -29,8 +30,7 @@ enum ReportStatus: int {
{
return match ($this)
{
ReportStatus::WORKING, ReportStatus::INSERT => 'dark',
ReportStatus::COMPLETE => 'white',
ReportStatus::WORKING, ReportStatus::INSERT, ReportStatus::COMPLETE => 'dark',
};
}
@@ -38,8 +38,7 @@ enum ReportStatus: int {
{
return match ($this)
{
ReportStatus::WORKING, ReportStatus::INSERT => 'dark',
ReportStatus::COMPLETE => 'light',
ReportStatus::WORKING, ReportStatus::INSERT, ReportStatus::COMPLETE => 'dark',
};
}
@@ -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
{
return ReportStatus::tryFrom($this->value+1);