diff --git a/app/Livewire/Conducting/StudySelection/PaperModal.php b/app/Livewire/Conducting/StudySelection/PaperModal.php index 1bf5d3b7..5abf3d30 100644 --- a/app/Livewire/Conducting/StudySelection/PaperModal.php +++ b/app/Livewire/Conducting/StudySelection/PaperModal.php @@ -42,7 +42,6 @@ public function mount() $this->projectId = request()->segment(2); $this->currentProject = Project::findOrFail($this->projectId); } - #[On('showPaper')] public function showPaper($paper, $criterias) { @@ -309,6 +308,23 @@ private function determineNewStatus($inclusion, $exclusion, $old_status) } } + + public function nextPaper(){ + $this->paper = Papers::where('id_paper', '>', $this->paper['id_paper']) + ->where('data_base', $this->paper['data_base']) + ->orderBy('id_paper') + ->first(); + + if ($this->paper) { + $this->dispatch('close-paper'); + + $this->showPaper($this->paper, $this->criterias); + } else { + session()->flash('errorMessage', 'No more papers available.'); + } + } + + public function render() { return view('livewire.conducting.study-selection.paper-modal'); diff --git a/resources/views/livewire/conducting/study-selection/paper-modal.blade.php b/resources/views/livewire/conducting/study-selection/paper-modal.blade.php index f8fb4dd2..16c66d9c 100644 --- a/resources/views/livewire/conducting/study-selection/paper-modal.blade.php +++ b/resources/views/livewire/conducting/study-selection/paper-modal.blade.php @@ -140,6 +140,14 @@ +
+ + +
diff --git a/resources/views/livewire/conducting/study-selection/table.blade.php b/resources/views/livewire/conducting/study-selection/table.blade.php index 4fdb364b..1fb99ff4 100644 --- a/resources/views/livewire/conducting/study-selection/table.blade.php +++ b/resources/views/livewire/conducting/study-selection/table.blade.php @@ -72,6 +72,7 @@ class="list-group-item d-flex row w-100" >
+ {{ $paper['id'] }}
diff --git a/resources/views/livewire/reporting/study-selection.blade.php b/resources/views/livewire/reporting/study-selection.blade.php index e5b61a6b..804a32f1 100644 --- a/resources/views/livewire/reporting/study-selection.blade.php +++ b/resources/views/livewire/reporting/study-selection.blade.php @@ -12,6 +12,7 @@
+ @section('scripts') @parent @push('js')