From d6bb053cb4764084757a27c7c2da5663ecf6e488 Mon Sep 17 00:00:00 2001 From: Gabriel-31415 Date: Sat, 11 Jul 2020 16:38:18 +0000 Subject: [PATCH] add parametros no envio de email --- app/Http/Controllers/TrabalhoController.php | 4 +- resources/views/projeto/editar.blade.php | 208 ++++++++++---------- 2 files changed, 102 insertions(+), 110 deletions(-) diff --git a/app/Http/Controllers/TrabalhoController.php b/app/Http/Controllers/TrabalhoController.php index 964f06f..a9383c2 100644 --- a/app/Http/Controllers/TrabalhoController.php +++ b/app/Http/Controllers/TrabalhoController.php @@ -679,7 +679,7 @@ class TrabalhoController extends Controller if($userParticipante == null){ $passwordTemporario = Str::random(8); $subject = "Participante de Projeto"; - Mail::to($value)->send(new EmailParaUsuarioNaoCadastrado(Auth()->user()->name, ' ', 'Participante', $evento->nome, $passwordTemporario, $subject)); + Mail::to($value)->send(new EmailParaUsuarioNaoCadastrado(Auth()->user()->name, ' ', 'Participante', $evento->nome, $passwordTemporario, $sube)); $usuario = User::create([ 'email' => $value, 'password' => bcrypt($passwordTemporario), @@ -706,7 +706,7 @@ class TrabalhoController extends Controller $subject = "Participante de Projeto"; $email = $value; Mail::to($email) - ->send(new SubmissaoTrabalho($userParticipante, $subject)); + ->send(new SubmissaoTrabalho($userParticipante, $subject, $evento, $trabalho)); } $path = 'trabalhos/' . $request->editalId . '/' . $trabalho->id .'/'; diff --git a/resources/views/projeto/editar.blade.php b/resources/views/projeto/editar.blade.php index 161cc7b..21d9ffc 100644 --- a/resources/views/projeto/editar.blade.php +++ b/resources/views/projeto/editar.blade.php @@ -317,13 +317,13 @@ @enderror - -
-
+
+
+
Possui plano de trabalho?
- - + +
-
+
@foreach ($arquivos as $arquivo) @if($arquivo->participanteId === $participante->id)
Dados do plano de trabalho
- Plano de trabalho atual + Plano de trabalho atual
@@ -344,7 +344,7 @@
- + @error('nomePlanoTrabalho') {{ $message }} @@ -385,7 +385,7 @@ @endif @endforeach @endforeach -
+
Participantes +
@@ -429,7 +429,7 @@ } }); - + // $('#addPlanoTrabalho').click(function(e) { // e.preventDefault(); // if (qtdLinhas < 4) { @@ -465,7 +465,7 @@ //replace the "Choose a file" label $(this).next('#custom-file-label').html(fileName); }) - + $('#buttonSim').on('click', function(e) { e.preventDefault(); $('#inputEtica').prop('disabled', false); @@ -474,52 +474,30 @@ $('#buttonNao').on('click', function(e) { e.preventDefault(); $('#inputEtica').prop('disabled', true); - $('#inputJustificativa').prop('disabled', false); + $('#inputJustificativa').prop('disabled', false); }); - // Habilitando / desabilitando plano de trabalho - $('.simPlano').click(function(e) { - e.preventDefault(); - var possuiPlano = $(this).parent().parent().next(); - - //se o participante não tem plano, adicionar; se ele já tem, apenas exibir - if(possuiPlano[0].firstElementChild == null){ - linha = linhaPlanoTrabalho(); - possuiPlano.append(linha); - possuiPlano[0].style.display = 'block'; - }else if(possuiPlano[0].firstElementChild.className == 'exibirPlano'){ - possuiPlano[0].style.display = 'block'; - } - - //esconder a imagem de deletar - deletar = $(this).parent().next()[0]; - deletar.style.display = "none"; - + // Habilitando / desabilitando plano de trabalho + $(document).on('click', '.simPlano', function(e) { + e.preventDefault(); + var plano = $(this).next().next()[0]; + plano.style.display = 'block'; }); - - // se não há plano de trabalho, esconder a div planoHabilitado e exibir imagem de deletar $(document).on('click', '.naoPlano', function(e) { e.preventDefault(); - var plano = $(this).parent().parent().next()[0]; - plano.style.display = 'none'; - - deletar = $(this).parent().next()[0] - deletar.style.display = "block"; - - //comunicar ao controller para deletar somente o plano - $(this).next().val('sim'); - + var plano = $(this).next()[0]; + plano.style.display = 'none'; }); - + //se há plano de trabalho, esconder a imagem de deletar - $(function() { + $(function() { var simPlano = document.getElementsByClassName('simPlano'); for(var i=0; i< simPlano.length;i++){ - var planoHabilitado = simPlano[i].parentElement.parentElement.nextElementSibling; + var planoHabilitado = simPlano[i].parentElement.parentElement.nextElementSibling; if(planoHabilitado.firstElementChild != null && planoHabilitado.firstElementChild.className == 'exibirPlano'){ - simPlano[i].parentElement.nextElementSibling.style.display = "none"; - } - } + simPlano[i].parentElement.nextElementSibling.style.display = "none"; + } + } }); }); // Remover Coautor @@ -537,47 +515,58 @@ function montarLinhaInput() { - return "
" + + return "
" + + "
"+ + "
"+ "

Dados do participante

" + - "
"+ - "
"+ - ""+ - ""+ - "@error('nomeParticipante')" + - "" + - "{{ $message }}" + - "" + - "@enderror" + - "
"+ - "
"+ - ""+ - "" + - "@error('emailParticipante')" + - "" + - "{{ $message }}" + - "" + - "@enderror" + - "
"+ - "
"+ - ""+ - ""+ - "
"+ - "
" + + "
"+ + "
"+ + + "
"+ + "
"+ + "
"+ + "
"+ + ""+ + ""+ + "@error('nomeParticipante')" + + "" + + "{{ $message }}" + + "" + + "@enderror" + + "
"+ + "
"+ + ""+ + "" + + "@error('emailParticipante')" + + "" + + "{{ $message }}" + + "" + + "@enderror" + + "
"+ + "
"+ + ""+ + ""+ + "
"+ + "
" + + "
Possui plano de trabalho?
"+ + ""+ + ""+ + "
" + "
Dados do plano de trabalho
" + "
"+ "
"+ - ""+ - ""+ + ""+ + ""+ "@error('nomePlanoTrabalho')" + "" + "{{ $message }}" + @@ -585,17 +574,17 @@ "@enderror" + "
"+ "
"+ - ""+ + ""+ "
"+ "
"+ - "Selecione um arquivo:"+ + "Selecione um arquivo:"+ "
"+ "
"+ - ""+ + ""+ ""+ - "
"+ + "
"+ "
"+ "@error('anexoPlanoTrabalho')"+ ""+ @@ -605,10 +594,13 @@ "
"+ ""+ "
"+ + "
"+ + + "Remover participante"+ "
"; } // function montarLinhaInputPlanoTrabalho(){ @@ -636,7 +628,7 @@ // "{{ $message }}"+ // ""+ // "@enderror"+ - // "
"+ + // "
"+ // ""+ + "
"; } - function areas() { + function areas() { var grandeArea = $('#grandeArea').val(); $.ajax({ type: 'POST', url: '{{ route('area.consulta') }}', data: 'id='+grandeArea , - headers: + headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }, success: (dados) => { - - if (dados.length > 0) { - if($('#oldArea').val() == null || $('#oldArea').val() == ""){ + + if (dados.length > 0) { + if($('#oldArea').val() == null || $('#oldArea').val() == ""){ var option = ''; } - $.each(dados, function(i, obj) { - if($('#oldArea').val() != null && $('#oldArea').val() == obj.id){ + $.each(dados, function(i, obj) { + if($('#oldArea').val() != null && $('#oldArea').val() == obj.id){ option += ''; }else{ option += ''; } }) - } else { + } else { var option = ""; } - $('#area').html(option).show(); - subareas(); + $('#area').html(option).show(); + subareas(); }, error: (data) => { console.log(data); @@ -727,7 +719,7 @@ type: 'POST', url: '{{ route('subarea.consulta') }}', data: 'id='+area , - headers: + headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }, @@ -736,7 +728,7 @@ if($('#oldSubArea').val() == null || $('#oldSubArea').val() == ""){ var option = ''; } - $.each(dados, function(i, obj) { + $.each(dados, function(i, obj) { if($('#oldSubArea').val() != null && $('#oldSubArea').val() == obj.id){ option += ''; }else{ @@ -756,4 +748,4 @@ } -@endsection \ No newline at end of file +@endsection -- GitLab