Commit d6bb053c authored by Gabriel-31415's avatar Gabriel-31415
Browse files

add parametros no envio de email

parent bb51a3fe
...@@ -679,7 +679,7 @@ class TrabalhoController extends Controller ...@@ -679,7 +679,7 @@ class TrabalhoController extends Controller
if($userParticipante == null){ if($userParticipante == null){
$passwordTemporario = Str::random(8); $passwordTemporario = Str::random(8);
$subject = "Participante de Projeto"; $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([ $usuario = User::create([
'email' => $value, 'email' => $value,
'password' => bcrypt($passwordTemporario), 'password' => bcrypt($passwordTemporario),
...@@ -706,7 +706,7 @@ class TrabalhoController extends Controller ...@@ -706,7 +706,7 @@ class TrabalhoController extends Controller
$subject = "Participante de Projeto"; $subject = "Participante de Projeto";
$email = $value; $email = $value;
Mail::to($email) Mail::to($email)
->send(new SubmissaoTrabalho($userParticipante, $subject)); ->send(new SubmissaoTrabalho($userParticipante, $subject, $evento, $trabalho));
} }
$path = 'trabalhos/' . $request->editalId . '/' . $trabalho->id .'/'; $path = 'trabalhos/' . $request->editalId . '/' . $trabalho->id .'/';
......
...@@ -317,13 +317,13 @@ ...@@ -317,13 +317,13 @@
@enderror @enderror
</select> </select>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class='col-sm-11'> <div class='col-sm-11'>
<h6 class="mb-1">Possui plano de trabalho?</h6> <h6 class="mb-1">Possui plano de trabalho?</h6>
<button class="btn btn-primary mt-2 mb-2 simPlano" id="simPlano">Sim</button> <button class="btn btn-primary mt-2 mb-2 simPlano" id="simPlano">Sim</button>
<button class="btn btn-primary mt-2 mb-2 naoPlano">Não</button> <button class="btn btn-primary mt-2 mb-2 naoPlano">Não</button>
<input type="hidden" name="semPlano[]" value=""> <input type="hidden" name="semPlano[]" value="">
</div> </div>
<div class="col-sm-1 deletarSemPlano" > <div class="col-sm-1 deletarSemPlano" >
<a class="delete"> <a class="delete">
...@@ -331,12 +331,12 @@ ...@@ -331,12 +331,12 @@
</a> </a>
</div> </div>
</div> </div>
<div id="planoHabilitado" > <div id="planoHabilitado" >
@foreach ($arquivos as $arquivo) @foreach ($arquivos as $arquivo)
@if($arquivo->participanteId === $participante->id) @if($arquivo->participanteId === $participante->id)
<input type="hidden" class="exibirPlano"> <input type="hidden" class="exibirPlano">
<h5>Dados do plano de trabalho</h5> <h5>Dados do plano de trabalho</h5>
<a href="{{ route('baixar.plano', ['id' => $arquivo->id]) }}">Plano de trabalho atual</a> <a href="{{ route('baixar.plano', ['id' => $arquivo->id]) }}">Plano de trabalho atual</a>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
<div id="planoTrabalho"> <div id="planoTrabalho">
...@@ -344,7 +344,7 @@ ...@@ -344,7 +344,7 @@
<div class="col-sm-4"> <div class="col-sm-4">
<label>Titulo </label> <label>Titulo </label>
<input type="text" value="{{$arquivo->titulo}}" style="margin-bottom:10px" class="form-control @error('nomePlanoTrabalho') is-invalid @enderror" name="nomePlanoTrabalho[]" placeholder="Nome"> <input type="text" value="{{$arquivo->titulo}}" style="margin-bottom:10px" class="form-control @error('nomePlanoTrabalho') is-invalid @enderror" name="nomePlanoTrabalho[]" placeholder="Nome">
@error('nomePlanoTrabalho') @error('nomePlanoTrabalho')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block"> <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong> <strong>{{ $message }}</strong>
...@@ -385,7 +385,7 @@ ...@@ -385,7 +385,7 @@
@endif @endif
@endforeach @endforeach
@endforeach @endforeach
</div> </div>
<a href="#" class="btn btn-primary" id="addCoautor" style="width:100%;margin-top:10px">Participantes +</a> <a href="#" class="btn btn-primary" id="addCoautor" style="width:100%;margin-top:10px">Participantes +</a>
</div> </div>
</div> </div>
...@@ -429,7 +429,7 @@ ...@@ -429,7 +429,7 @@
} }
}); });
// $('#addPlanoTrabalho').click(function(e) { // $('#addPlanoTrabalho').click(function(e) {
// e.preventDefault(); // e.preventDefault();
// if (qtdLinhas < 4) { // if (qtdLinhas < 4) {
...@@ -465,7 +465,7 @@ ...@@ -465,7 +465,7 @@
//replace the "Choose a file" label //replace the "Choose a file" label
$(this).next('#custom-file-label').html(fileName); $(this).next('#custom-file-label').html(fileName);
}) })
$('#buttonSim').on('click', function(e) { $('#buttonSim').on('click', function(e) {
e.preventDefault(); e.preventDefault();
$('#inputEtica').prop('disabled', false); $('#inputEtica').prop('disabled', false);
...@@ -474,52 +474,30 @@ ...@@ -474,52 +474,30 @@
$('#buttonNao').on('click', function(e) { $('#buttonNao').on('click', function(e) {
e.preventDefault(); e.preventDefault();
$('#inputEtica').prop('disabled', true); $('#inputEtica').prop('disabled', true);
$('#inputJustificativa').prop('disabled', false); $('#inputJustificativa').prop('disabled', false);
}); });
// Habilitando / desabilitando plano de trabalho // Habilitando / desabilitando plano de trabalho
$('.simPlano').click(function(e) { $(document).on('click', '.simPlano', function(e) {
e.preventDefault(); e.preventDefault();
var possuiPlano = $(this).parent().parent().next(); var plano = $(this).next().next()[0];
plano.style.display = 'block';
//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";
}); });
// se não há plano de trabalho, esconder a div planoHabilitado e exibir imagem de deletar
$(document).on('click', '.naoPlano', function(e) { $(document).on('click', '.naoPlano', function(e) {
e.preventDefault(); e.preventDefault();
var plano = $(this).parent().parent().next()[0]; var plano = $(this).next()[0];
plano.style.display = 'none'; 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');
}); });
//se há plano de trabalho, esconder a imagem de deletar //se há plano de trabalho, esconder a imagem de deletar
$(function() { $(function() {
var simPlano = document.getElementsByClassName('simPlano'); var simPlano = document.getElementsByClassName('simPlano');
for(var i=0; i< simPlano.length;i++){ 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'){ if(planoHabilitado.firstElementChild != null && planoHabilitado.firstElementChild.className == 'exibirPlano'){
simPlano[i].parentElement.nextElementSibling.style.display = "none"; simPlano[i].parentElement.nextElementSibling.style.display = "none";
} }
} }
}); });
}); });
// Remover Coautor // Remover Coautor
...@@ -537,47 +515,58 @@ ...@@ -537,47 +515,58 @@
function montarLinhaInput() { function montarLinhaInput() {
return "<div id="+"novoParticipante"+">" + return "<div id="+"novoParticipante"+">" +
"<div class='row'>"+
"<div class='col-sm-9'>"+
"<br><h4>Dados do participante</h4>" + "<br><h4>Dados do participante</h4>" +
"<div class="+"row"+">"+ "</div>"+
"<div class="+"col-sm-5"+">"+ "<div class='col-sm-3'>"+
"<label>Nome Completo</label>"+
"<input"+" type="+'text'+" style="+"margin-bottom:10px"+" class="+'form-control' + " @error('nomeParticipante') is-invalid @enderror" + "name=" +'nomeParticipante[]'+" placeholder="+"Nome"+" required>"+ "</div>"+
"@error('nomeParticipante')" + "</div>"+
"<span class='invalid-feedback'" + "role='alert'" + "style='overflow: visible; display:block'>" + "<div class="+"row"+">"+
"<strong>{{ $message }}</strong>" + "<div class="+"col-sm-5"+">"+
"</span>" + "<label>Nome Completo*</label>"+
"@enderror" + "<input"+" type="+'text'+" style="+"margin-bottom:10px"+" class="+'form-control' + " @error('nomeParticipante') is-invalid @enderror" + "name=" +'nomeParticipante[]'+" placeholder="+"Nome"+">"+
"</div>"+ "@error('nomeParticipante')" +
"<div class="+"col-sm-4"+">"+ "<span class='invalid-feedback'" + "role='alert'" + "style='overflow: visible; display:block'>" +
"<label>E-mail</label>"+ "<strong>{{ $message }}</strong>" +
"<input type='email'" + "style='margin-bottom:10px'" + "class=" + "form-control @error('emailParticipante') is-invalid @enderror" + "name='emailParticipante[]'" + "placeholder='email' required>" + "</span>" +
"@error('emailParticipante')" + "@enderror" +
"<span class='invalid-feedback'" + "role='alert'" + "style='overflow: visible; display:block'>" + "</div>"+
"<strong>{{ $message }}</strong>" + "<div class="+"col-sm-4"+">"+
"</span>" + "<label>E-mail*</label>"+
"@enderror" + "<input type='email'" + "style='margin-bottom:10px'" + "class=" + "form-control @error('emailParticipante') is-invalid @enderror" + "name='emailParticipante[]'" + "placeholder='email' >" +
"</div>"+ "@error('emailParticipante')" +
"<div class='col-sm-3'>"+ "<span class='invalid-feedback'" + "role='alert'" + "style='overflow: visible; display:block'>" +
"<label>Função:</label>"+ "<strong>{{ $message }}</strong>" +
"<select class=" + "form-control @error('funcaoParticipante') is-invalid @enderror" + "name='funcaoParticipante[]'" + "id='funcaoParticipante'> " + "</span>" +
"<option value='' disabled selected hidden> Função </option>"+ "@enderror" +
"@foreach($funcaoParticipantes as $funcaoParticipante)"+ "</div>"+
"<option value='{{$funcaoParticipante->id}}'>{{$funcaoParticipante->nome}}</option>"+ "<div class='col-sm-3'>"+
"@endforeach"+ "<label>Função*:</label>"+
"@error('funcaoParticipante')" + "<select class=" + "form-control @error('funcaoParticipante') is-invalid @enderror" + "name='funcaoParticipante[]'" + "id='funcaoParticipante'> " +
"<span class='invalid-feedback'" + "role='alert'" + "style='overflow: visible; display:block'>" + "<option value='' disabled selected hidden> Função </option>"+
"<strong>{{ $message }}</strong>" + "@foreach($funcaoParticipantes as $funcaoParticipante)"+
"</span>" + "<option value='{{$funcaoParticipante->id}}'>{{$funcaoParticipante->nome}}</option>"+
"@enderror" + "@endforeach"+
"</select>"+ "@error('funcaoParticipante')" +
"</div>"+ "<span class='invalid-feedback'" + "role='alert'" + "style='overflow: visible; display:block'>" +
"</div>" + "<strong>{{ $message }}</strong>" +
"</span>" +
"@enderror" +
"</select>"+
"</div>"+
"</div>" +
"<h6 class='mb-1'>Possui plano de trabalho?</h6>"+
"<button class="+"'btn btn-primary mt-2 mb-2 mr-1 simPlano'"+">Sim</button>"+
"<button class="+"'btn btn-primary mt-2 mb-2 mr-1 naoPlano'"+">Não</button>"+
"<div id="+"planoHabilitado"+" style="+"'display:none;'"+">" +
"<h5>Dados do plano de trabalho</h5>" + "<h5>Dados do plano de trabalho</h5>" +
"<div class="+"row"+">"+ "<div class="+"row"+">"+
"<div class="+"col-sm-4"+">"+ "<div class="+"col-sm-4"+">"+
"<label>Titulo</label>"+ "<label>Titulo*</label>"+
"<input"+" type="+'text'+" style="+"margin-bottom:10px"+" class="+"form-control @error('nomePlanoTrabalho') is-invalid @enderror"+" name="+'nomePlanoTrabalho[]'+" placeholder="+"Nome"+" required>"+ "<input"+" type="+'text'+" style="+"margin-bottom:10px"+" class="+"form-control @error('nomePlanoTrabalho') is-invalid @enderror"+" name="+'nomePlanoTrabalho[]'+" placeholder="+"Nome"+">"+
"@error('nomePlanoTrabalho')" + "@error('nomePlanoTrabalho')" +
"<span class='invalid-feedback'" + "role='alert'" + "style='overflow: visible; display:block'>" + "<span class='invalid-feedback'" + "role='alert'" + "style='overflow: visible; display:block'>" +
"<strong>{{ $message }}</strong>" + "<strong>{{ $message }}</strong>" +
...@@ -585,17 +574,17 @@ ...@@ -585,17 +574,17 @@
"@enderror" + "@enderror" +
"</div>"+ "</div>"+
"<div class="+"col-sm-7" +">"+ "<div class="+"col-sm-7" +">"+
"<label for="+"nomeTrabalho"+">Anexo </label>"+ "<label for="+"nomeTrabalho"+">Anexo* </label>"+
"<div class="+"input-group"+">"+ "<div class="+"input-group"+">"+
"<div class='input-group-prepend'>"+ "<div class='input-group-prepend'>"+
"<span class='input-group-text' id='inputGroupFileAddon01'>Selecione um arquivo:</span>"+ "<span class='input-group-text' id='anexoPlanoTrabalho'>Selecione um arquivo:</span>"+
"</div>"+ "</div>"+
"<div class='custom-file'>"+ "<div class='custom-file'>"+
"<input type='file' class='custom-file-input @error('anexoPlanoTrabalho') is-invalid @enderror" + "id='anexoPlanoTrabalho'" + "aria-describedby='anexoPlanoTrabalho'" + "name='anexoPlanoTrabalho[]' required"+ "<input type='file' class='custom-file-input @error('anexoPlanoTrabalho') is-invalid @enderror" + "id='anexoPlanoTrabalho'"+
"aria-describedby='inputGroupFileAddon01'>"+ " aria-describedby='anexoPlanoTrabalho' name='anexoPlanoTrabalho[]'>"+
"<label class='custom-file-label' id='custom-file-label' for='inputGroupFile01'>O arquivo deve ser no formato PDF de até 2mb.</label>"+ "<label class='custom-file-label' id='custom-file-label' for='inputGroupFile01'>O arquivo deve ser no formato PDF de até 2mb.</label>"+
"</div>"+ "</div>"+
"</div>"+ "</div>"+
"@error('anexoPlanoTrabalho')"+ "@error('anexoPlanoTrabalho')"+
"<span class='invalid-feedback' role='alert' style='overflow: visible; display:block'>"+ "<span class='invalid-feedback' role='alert' style='overflow: visible; display:block'>"+
...@@ -605,10 +594,13 @@ ...@@ -605,10 +594,13 @@
"</div>"+ "</div>"+
"<div class="+"col-sm-1"+">"+ "<div class="+"col-sm-1"+">"+
"<a class="+"delete"+">"+ "<a class="+"delete"+">"+
"<img src="+"/img/icons/user-times-solid.svg"+" style="+"width:25px;margin-top:35px"+">"+ "<img src="+"{{ asset('/img/icons/user-times-solid.svg') }}"+" style="+"width:25px;margin-top:35px"+">"+
"</a>"+ "</a>"+
"</div>"+ "</div>"+
"</div>"+ "</div>"+
"</div>"+
"<a href='#' class="+"'btn btn-danger mt-2 mb-2 delete'"+" style='width:100%;margin-top:10px'"+">Remover participante</a>"+
"</div>"; "</div>";
} }
// function montarLinhaInputPlanoTrabalho(){ // function montarLinhaInputPlanoTrabalho(){
...@@ -636,7 +628,7 @@ ...@@ -636,7 +628,7 @@
// "<strong>{{ $message }}</strong>"+ // "<strong>{{ $message }}</strong>"+
// "</span>"+ // "</span>"+
// "@enderror"+ // "@enderror"+
// "</div>"+ // "</div>"+
// "<div class="+"col-sm-1"+">"+ // "<div class="+"col-sm-1"+">"+
// "<a class="+"deletePlano"+">"+ // "<a class="+"deletePlano"+">"+
// "<img src="+"/img/icons/user-times-solid.svg"+" style="+"width:25px;margin-top:35px"+">"+ // "<img src="+"/img/icons/user-times-solid.svg"+" style="+"width:25px;margin-top:35px"+">"+
...@@ -646,7 +638,7 @@ ...@@ -646,7 +638,7 @@
// } // }
function linhaPlanoTrabalho(){ function linhaPlanoTrabalho(){
return "<input"+" type="+"hidden"+" class="+"exibirPlano"+">"+ return "<input"+" type="+"hidden"+" class="+"exibirPlano"+">"+
"<h5>Dados do plano de trabalho</h5>" + "<h5>Dados do plano de trabalho</h5>" +
"<div class="+"row"+">"+ "<div class="+"row"+">"+
"<div class="+"col-sm-4"+">"+ "<div class="+"col-sm-4"+">"+
...@@ -675,44 +667,44 @@ ...@@ -675,44 +667,44 @@
"<span class='invalid-feedback' role='alert' style='overflow: visible; display:block'>"+ "<span class='invalid-feedback' role='alert' style='overflow: visible; display:block'>"+
"<strong>{{ $message }}</strong>"+ "<strong>{{ $message }}</strong>"+
"</span>"+ "</span>"+
"@enderror"+ "@enderror"+
"</div>"+ "</div>"+
"<div class="+"col-sm-1"+">"+ "<div class="+"col-sm-1"+">"+
"<a class="+"delete"+">"+ "<a class="+"delete"+">"+
"<img src="+"{{ asset('/img/icons/user-times-solid.svg') }}"+" style="+"width:25px;margin-top:35px"+">"+ "<img src="+"{{ asset('/img/icons/user-times-solid.svg') }}"+" style="+"width:25px;margin-top:35px"+">"+
"</a>"+ "</a>"+
"</div>"+ "</div>"+
"</div>"; "</div>";
} }
function areas() { function areas() {
var grandeArea = $('#grandeArea').val(); var grandeArea = $('#grandeArea').val();
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
url: '{{ route('area.consulta') }}', url: '{{ route('area.consulta') }}',
data: 'id='+grandeArea , data: 'id='+grandeArea ,
headers: headers:
{ {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}, },
success: (dados) => { success: (dados) => {
if (dados.length > 0) { if (dados.length > 0) {
if($('#oldArea').val() == null || $('#oldArea').val() == ""){ if($('#oldArea').val() == null || $('#oldArea').val() == ""){
var option = '<option selected disabled>-- Área --</option>'; var option = '<option selected disabled>-- Área --</option>';
} }
$.each(dados, function(i, obj) { $.each(dados, function(i, obj) {
if($('#oldArea').val() != null && $('#oldArea').val() == obj.id){ if($('#oldArea').val() != null && $('#oldArea').val() == obj.id){
option += '<option selected value="' + obj.id + '">' + obj.nome + '</option>'; option += '<option selected value="' + obj.id + '">' + obj.nome + '</option>';
}else{ }else{
option += '<option value="' + obj.id + '">' + obj.nome + '</option>'; option += '<option value="' + obj.id + '">' + obj.nome + '</option>';
} }
}) })
} else { } else {
var option = "<option selected disabled>-- Área --</option>"; var option = "<option selected disabled>-- Área --</option>";
} }
$('#area').html(option).show(); $('#area').html(option).show();
subareas(); subareas();
}, },
error: (data) => { error: (data) => {
console.log(data); console.log(data);
...@@ -727,7 +719,7 @@ ...@@ -727,7 +719,7 @@
type: 'POST', type: 'POST',
url: '{{ route('subarea.consulta') }}', url: '{{ route('subarea.consulta') }}',
data: 'id='+area , data: 'id='+area ,
headers: headers:
{ {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}, },
...@@ -736,7 +728,7 @@ ...@@ -736,7 +728,7 @@
if($('#oldSubArea').val() == null || $('#oldSubArea').val() == ""){ if($('#oldSubArea').val() == null || $('#oldSubArea').val() == ""){
var option = '<option selected disabled>-- Sub Área --</option>'; var option = '<option selected disabled>-- Sub Área --</option>';
} }
$.each(dados, function(i, obj) { $.each(dados, function(i, obj) {
if($('#oldSubArea').val() != null && $('#oldSubArea').val() == obj.id){ if($('#oldSubArea').val() != null && $('#oldSubArea').val() == obj.id){
option += '<option selected value="' + obj.id + '">' + obj.nome + '</option>'; option += '<option selected value="' + obj.id + '">' + obj.nome + '</option>';
}else{ }else{
...@@ -756,4 +748,4 @@ ...@@ -756,4 +748,4 @@
} }
</script> </script>
@endsection @endsection
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment