diff --git a/app/Http/Requests/StoreTrabalho.php b/app/Http/Requests/StoreTrabalho.php index 74fa0992f3234669c707a297177cf53d9856b0df..955db15103b58b929ab7bb7274b26c9a19ce0c86 100755 --- a/app/Http/Requests/StoreTrabalho.php +++ b/app/Http/Requests/StoreTrabalho.php @@ -59,8 +59,7 @@ class StoreTrabalho extends FormRequest $rules['media_do_curso.' . $value] = ['required', 'string']; } - - if($evento->tipo != "CONTINUO"){ + if($evento->tipo != "CONTINUO" && ($this->funcaoParticipante[$value] == "Voluntário" || $this->funcaoParticipante[$value] == "Bolsista")){ $rules['anexoPlanoTrabalho.'.$value] = ['required']; $rules['nomePlanoTrabalho.'.$value] = ['required', 'string']; } diff --git a/resources/views/evento/formulario/integrantes.blade.php b/resources/views/evento/formulario/integrantes.blade.php index a7d574ad2a940b1d7324559875f64de485e36cea..c90f525285f702abaee7d405c85d856cf08e098b 100644 --- a/resources/views/evento/formulario/integrantes.blade.php +++ b/resources/views/evento/formulario/integrantes.blade.php @@ -222,7 +222,6 @@ let modal_id = 0; function exibirUsuarioAdicionado(data) { - console.log(`${modal_id}`, data); $('#modalIntegrante').modal('hide'); document.getElementById(`nome${modal_id}`).value = data[0]['name']; document.getElementById(`nome${modal_id}`).setAttribute("readonly", ""); @@ -268,6 +267,16 @@ document.getElementById(`curso[${modal_id}]`).value = data[2]['curso']; document.getElementById(`curso[${modal_id}]`).setAttribute("readonly", ""); + + console.log(document.getElementById(`funcaoParticipante${modal_id}`)); + document.getElementById(`funcaoParticipante${modal_id}`).value = data[1]['nome']; + + if(data[1].nome != "Bolsista" && data[1].nome != "Voluntário"){ + document.getElementById(`plano-titulo${modal_id}`).setAttribute('hidden', ""); + document.getElementById(`plano-nome${modal_id}`).setAttribute('hidden', ""); + document.getElementById(`plano-anexo${modal_id}`).setAttribute('hidden', ""); + } + $(`#exampleModal${modal_id}`).modal('show'); } diff --git a/resources/views/evento/formulario/participantes.blade.php b/resources/views/evento/formulario/participantes.blade.php index accec510e6650f7ef671567882dda485a4c7dca0..e1d412fbe35c29e4e54d294c639682f18c02eefa 100755 --- a/resources/views/evento/formulario/participantes.blade.php +++ b/resources/views/evento/formulario/participantes.blade.php @@ -69,9 +69,9 @@
- +
-
Dados do discente
+
Dados do integrante
@component('componentes.input', ['label' => 'Nome completo']) @@ -354,10 +354,10 @@ @endif @if($edital->tipo != "CONTINUO") -
+
Plano de trabalho
-
+
@component('componentes.input', ['label' => 'Título']) @@ -369,7 +369,7 @@ @enderror @endcomponent
-
+
@component('componentes.input', ['label' => 'Anexo (.pdf)']) @error('anexoPlanoTrabalho.'.$i)