diff --git a/app/Services/Workflow/Manager.php b/app/Services/Workflow/Manager.php index 3d93454..ecd744f 100644 --- a/app/Services/Workflow/Manager.php +++ b/app/Services/Workflow/Manager.php @@ -3,7 +3,7 @@ namespace App\Services\Workflow; use App\Domain\ACL\Permission; -use App\Domain\Report\ReportStatus; +use App\Domain\Study\WorkflowLevel; use App\Models\Study; use App\Models\User; use Closure; @@ -42,28 +42,28 @@ public function can(Permission $permission): bool public function canAssignPhysician(): bool { - return $this->activeStudy(fn () => $this->study->report_status <= ReportStatus::Preliminary); + return $this->activeStudy(fn () => $this->study->workflow_level <= WorkflowLevel::DraftAvailable); } public function canStudyHistoryEdit(): bool { - return $this->activeStudy(fn () => $this->study->report_status <= ReportStatus::Preliminary); + return $this->activeStudy(fn () => $this->study->workflow_level <= WorkflowLevel::DraftAvailable); } public function canAttachmentUpload(): bool { - return $this->activeStudy(fn () => $this->study->report_status <= ReportStatus::Preliminary); + return $this->activeStudy(fn () => $this->study->workflow_level <= WorkflowLevel::DraftAvailable); } public function canReportDownload(): bool { - return $this->activeStudy(fn () => $this->study->report_status >= ReportStatus::Finalized); + return $this->activeStudy(fn () => $this->study->workflow_level >= WorkflowLevel::Finalized); } public function canReportEdit(): bool { return $this->activeStudy(fn () => $this->study->isUnlocked() && - $this->study->report_status <= ReportStatus::Preliminary && + $this->study->workflow_level <= WorkflowLevel::DraftAvailable && $this->study->isAssignedTo($this->user) ); } diff --git a/resources/views/staff/reports/popup.blade.php b/resources/views/staff/reports/popup.blade.php index 80a9ca0..933943f 100644 --- a/resources/views/staff/reports/popup.blade.php +++ b/resources/views/staff/reports/popup.blade.php @@ -4,7 +4,7 @@