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