minor
This commit is contained in:
parent
2a38df9383
commit
302b02e025
@ -26,11 +26,7 @@ public function edit()
|
|||||||
$this->decodeKeys();
|
$this->decodeKeys();
|
||||||
$study = Study::findOrFail($this->key);
|
$study = Study::findOrFail($this->key);
|
||||||
|
|
||||||
if (in_array($study->report_status->value, [
|
if ($study->isReportReady()) {
|
||||||
ReportStatus::Finalized->value,
|
|
||||||
ReportStatus::Approved->value,
|
|
||||||
],
|
|
||||||
true)) {
|
|
||||||
return view('content.pages.notice', [
|
return view('content.pages.notice', [
|
||||||
'title' => 'Study Locked',
|
'title' => 'Study Locked',
|
||||||
'color' => 'danger',
|
'color' => 'danger',
|
||||||
|
@ -450,6 +450,17 @@ public function hasReports(): bool
|
|||||||
return $this->reports->isNotEmpty();
|
return $this->reports->isNotEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isReportReady(): bool
|
||||||
|
{
|
||||||
|
return ($this->report_status->value == ReportStatus::Finalized->value) ||
|
||||||
|
($this->report_status->value == ReportStatus::Approved->value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function isStudyComplete(): bool
|
||||||
|
{
|
||||||
|
return $this->report_status->value >= ReportStatus::Finalized->value;
|
||||||
|
}
|
||||||
|
|
||||||
protected function casts(): array
|
protected function casts(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
Loading…
Reference in New Issue
Block a user