diff --git a/app/Http/Controllers/TrabalhoController.php b/app/Http/Controllers/TrabalhoController.php index e219498790443401d1e83e57ee7b68f67714c61f..a6d80aaddc52cf1eeb7fc72744364eb7fe34d4d0 100644 --- a/app/Http/Controllers/TrabalhoController.php +++ b/app/Http/Controllers/TrabalhoController.php @@ -104,7 +104,8 @@ class TrabalhoController extends Controller 'funcaoParticipante.*' => ['required', 'string'], 'nomePlanoTrabalho.*' => ['required', 'string'], 'anexoProjeto' => ['required', 'file', 'mimes:pdf', 'max:2000000'], - //'anexoCONSU' => ['required', 'file', 'mimes:pdf', 'max:2000000'], + 'anexoCONSU' => ['required', 'file', 'mimes:pdf', 'max:2000000'], + 'anexoComiteEtica' => ['required', 'file', 'mimes:pdf', 'max:2000000'], 'anexoLatterCoordenador' => ['required', 'file', 'mimes:pdf', 'max:2000000'], 'anexoPlanilha' => ['required', 'file', 'mimes:pdf', 'max:2000000'], 'anexoPlanoTrabalho.*' => ['required', 'file', 'mimes:pdf', 'max:2000000'], @@ -125,7 +126,7 @@ class TrabalhoController extends Controller 'avaliado' => 0, 'proponente_id' => $proponente->id, //Anexos - 'anexoDecisaoCONSU' => $request->anexoCONSU, + 'anexoCONSU' => $request->anexoCONSU, 'anexoProjeto' => $request->anexoProjeto, 'anexoAutorizacaoComiteEtica' => $request->anexoComiteEtica, 'justificativaAutorizacaoEtica' => $request->justificativaAutorizacaoEtica, diff --git a/resources/views/evento/submeterTrabalho.blade.php b/resources/views/evento/submeterTrabalho.blade.php index c3a0d40d9cd3b958eb4b075d328656c5b8ca351a..83d4aa1fc94e0a7bdb68019ec701b8fe9caed8b4 100644 --- a/resources/views/evento/submeterTrabalho.blade.php +++ b/resources/views/evento/submeterTrabalho.blade.php @@ -16,10 +16,10 @@ {{-- Nome do Projeto --}} <div class="row justify-content-center"> <div class="col-sm-12"> - <label for="nomeTrabalho" class="col-form-label">{{ __('Nome do Projeto:') }}</label> - <input id="nomeTrabalho" type="text" class="form-control @error('nomeTrabalho') is-invalid @enderror" name="nomeProjeto" value="{{ old('nomeTrabalho') }}" required autocomplete="nomeTrabalho" autofocus> + <label for="nomeProjeto" class="col-form-label">{{ __('Nome do Projeto:') }}</label> + <input id="nomeProjeto" type="text" class="form-control @error('nomeProjeto') is-invalid @enderror" name="nomeProjeto" value="{{ old('nomeProjeto') }}" required autocomplete="nomeProjeto" autofocus> - @error('nomeTrabalho') + @error('nomeProjeto') <span class="invalid-feedback" role="alert"> <strong>{{ $message }}</strong> </span> @@ -140,7 +140,7 @@ {{-- Arquivo --}} <div class="col-sm-6"> <label for="anexoProjeto" class="col-form-label">{{ __('Anexo Projeto:') }}</label> - + <div class="input-group"> <div class="custom-file"> @@ -408,11 +408,16 @@ return false; } }); - $('#anexoProjeto').on('change', function() { - //get the file name - var fileName = $(this).val(); - //replace the "Choose a file" label - $(this).next('#custom-file-label').html(fileName); + $('.custom-file-input').on('change', function() { + var fieldVal = $(this).val(); + + // Change the node's value by removing the fake path (Chrome) + fieldVal = fieldVal.replace("C:\\fakepath\\", ""); + + if (fieldVal != undefined || fieldVal != "") { + $(this).next(".custom-file-label").attr('data-content', fieldVal); + $(this).next(".custom-file-label").text(fieldVal); + } }) // F $('#buttonSim').on('click', function(e) {