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
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 .'/';
......
......@@ -317,13 +317,13 @@
@enderror
</select>
</div>
</div>
<div class="row">
<div class='col-sm-11'>
</div>
<div class="row">
<div class='col-sm-11'>
<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 naoPlano">Não</button>
<input type="hidden" name="semPlano[]" value="">
<button class="btn btn-primary mt-2 mb-2 naoPlano">Não</button>
<input type="hidden" name="semPlano[]" value="">
</div>
<div class="col-sm-1 deletarSemPlano" >
<a class="delete">
......@@ -331,12 +331,12 @@
</a>
</div>
</div>
<div id="planoHabilitado" >
<div id="planoHabilitado" >
@foreach ($arquivos as $arquivo)
@if($arquivo->participanteId === $participante->id)
<input type="hidden" class="exibirPlano">
<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="col-sm-12">
<div id="planoTrabalho">
......@@ -344,7 +344,7 @@
<div class="col-sm-4">
<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">
@error('nomePlanoTrabalho')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
......@@ -385,7 +385,7 @@
@endif
@endforeach
@endforeach
</div>
</div>
<a href="#" class="btn btn-primary" id="addCoautor" style="width:100%;margin-top:10px">Participantes +</a>
</div>
</div>
......@@ -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 "<div id="+"novoParticipante"+">" +
return "<div id="+"novoParticipante"+">" +
"<div class='row'>"+
"<div class='col-sm-9'>"+
"<br><h4>Dados do participante</h4>" +
"<div class="+"row"+">"+
"<div class="+"col-sm-5"+">"+
"<label>Nome Completo</label>"+
"<input"+" type="+'text'+" style="+"margin-bottom:10px"+" class="+'form-control' + " @error('nomeParticipante') is-invalid @enderror" + "name=" +'nomeParticipante[]'+" placeholder="+"Nome"+" required>"+
"@error('nomeParticipante')" +
"<span class='invalid-feedback'" + "role='alert'" + "style='overflow: visible; display:block'>" +
"<strong>{{ $message }}</strong>" +
"</span>" +
"@enderror" +
"</div>"+
"<div class="+"col-sm-4"+">"+
"<label>E-mail</label>"+
"<input type='email'" + "style='margin-bottom:10px'" + "class=" + "form-control @error('emailParticipante') is-invalid @enderror" + "name='emailParticipante[]'" + "placeholder='email' required>" +
"@error('emailParticipante')" +
"<span class='invalid-feedback'" + "role='alert'" + "style='overflow: visible; display:block'>" +
"<strong>{{ $message }}</strong>" +
"</span>" +
"@enderror" +
"</div>"+
"<div class='col-sm-3'>"+
"<label>Função:</label>"+
"<select class=" + "form-control @error('funcaoParticipante') is-invalid @enderror" + "name='funcaoParticipante[]'" + "id='funcaoParticipante'> " +
"<option value='' disabled selected hidden> Função </option>"+
"@foreach($funcaoParticipantes as $funcaoParticipante)"+
"<option value='{{$funcaoParticipante->id}}'>{{$funcaoParticipante->nome}}</option>"+
"@endforeach"+
"@error('funcaoParticipante')" +
"<span class='invalid-feedback'" + "role='alert'" + "style='overflow: visible; display:block'>" +
"<strong>{{ $message }}</strong>" +
"</span>" +
"@enderror" +
"</select>"+
"</div>"+
"</div>" +
"</div>"+
"<div class='col-sm-3'>"+
"</div>"+
"</div>"+
"<div class="+"row"+">"+
"<div class="+"col-sm-5"+">"+
"<label>Nome Completo*</label>"+
"<input"+" type="+'text'+" style="+"margin-bottom:10px"+" class="+'form-control' + " @error('nomeParticipante') is-invalid @enderror" + "name=" +'nomeParticipante[]'+" placeholder="+"Nome"+">"+
"@error('nomeParticipante')" +
"<span class='invalid-feedback'" + "role='alert'" + "style='overflow: visible; display:block'>" +
"<strong>{{ $message }}</strong>" +
"</span>" +
"@enderror" +
"</div>"+
"<div class="+"col-sm-4"+">"+
"<label>E-mail*</label>"+
"<input type='email'" + "style='margin-bottom:10px'" + "class=" + "form-control @error('emailParticipante') is-invalid @enderror" + "name='emailParticipante[]'" + "placeholder='email' >" +
"@error('emailParticipante')" +
"<span class='invalid-feedback'" + "role='alert'" + "style='overflow: visible; display:block'>" +
"<strong>{{ $message }}</strong>" +
"</span>" +
"@enderror" +
"</div>"+
"<div class='col-sm-3'>"+
"<label>Função*:</label>"+
"<select class=" + "form-control @error('funcaoParticipante') is-invalid @enderror" + "name='funcaoParticipante[]'" + "id='funcaoParticipante'> " +
"<option value='' disabled selected hidden> Função </option>"+
"@foreach($funcaoParticipantes as $funcaoParticipante)"+
"<option value='{{$funcaoParticipante->id}}'>{{$funcaoParticipante->nome}}</option>"+
"@endforeach"+
"@error('funcaoParticipante')" +
"<span class='invalid-feedback'" + "role='alert'" + "style='overflow: visible; display:block'>" +
"<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>" +
"<div class="+"row"+">"+
"<div class="+"col-sm-4"+">"+
"<label>Titulo</label>"+
"<input"+" type="+'text'+" style="+"margin-bottom:10px"+" class="+"form-control @error('nomePlanoTrabalho') is-invalid @enderror"+" name="+'nomePlanoTrabalho[]'+" placeholder="+"Nome"+" required>"+
"<label>Titulo*</label>"+
"<input"+" type="+'text'+" style="+"margin-bottom:10px"+" class="+"form-control @error('nomePlanoTrabalho') is-invalid @enderror"+" name="+'nomePlanoTrabalho[]'+" placeholder="+"Nome"+">"+
"@error('nomePlanoTrabalho')" +
"<span class='invalid-feedback'" + "role='alert'" + "style='overflow: visible; display:block'>" +
"<strong>{{ $message }}</strong>" +
......@@ -585,17 +574,17 @@
"@enderror" +
"</div>"+
"<div class="+"col-sm-7" +">"+
"<label for="+"nomeTrabalho"+">Anexo </label>"+
"<label for="+"nomeTrabalho"+">Anexo* </label>"+
"<div class="+"input-group"+">"+
"<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 class='custom-file'>"+
"<input type='file' class='custom-file-input @error('anexoPlanoTrabalho') is-invalid @enderror" + "id='anexoPlanoTrabalho'" + "aria-describedby='anexoPlanoTrabalho'" + "name='anexoPlanoTrabalho[]' required"+
"aria-describedby='inputGroupFileAddon01'>"+
"<input type='file' class='custom-file-input @error('anexoPlanoTrabalho') is-invalid @enderror" + "id='anexoPlanoTrabalho'"+
" 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>"+
"</div>"+
"</div>"+
"</div>"+
"@error('anexoPlanoTrabalho')"+
"<span class='invalid-feedback' role='alert' style='overflow: visible; display:block'>"+
......@@ -605,10 +594,13 @@
"</div>"+
"<div class="+"col-sm-1"+">"+
"<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>"+
"</div>"+
"</div>"+
"</div>"+
"<a href='#' class="+"'btn btn-danger mt-2 mb-2 delete'"+" style='width:100%;margin-top:10px'"+">Remover participante</a>"+
"</div>";
}
// function montarLinhaInputPlanoTrabalho(){
......@@ -636,7 +628,7 @@
// "<strong>{{ $message }}</strong>"+
// "</span>"+
// "@enderror"+
// "</div>"+
// "</div>"+
// "<div class="+"col-sm-1"+">"+
// "<a class="+"deletePlano"+">"+
// "<img src="+"/img/icons/user-times-solid.svg"+" style="+"width:25px;margin-top:35px"+">"+
......@@ -646,7 +638,7 @@
// }
function linhaPlanoTrabalho(){
return "<input"+" type="+"hidden"+" class="+"exibirPlano"+">"+
return "<input"+" type="+"hidden"+" class="+"exibirPlano"+">"+
"<h5>Dados do plano de trabalho</h5>" +
"<div class="+"row"+">"+
"<div class="+"col-sm-4"+">"+
......@@ -675,44 +667,44 @@
"<span class='invalid-feedback' role='alert' style='overflow: visible; display:block'>"+
"<strong>{{ $message }}</strong>"+
"</span>"+
"@enderror"+
"@enderror"+
"</div>"+
"<div class="+"col-sm-1"+">"+
"<a class="+"delete"+">"+
"<img src="+"{{ asset('/img/icons/user-times-solid.svg') }}"+" style="+"width:25px;margin-top:35px"+">"+
"</a>"+
"</div>"+
"</div>";
"</div>"+
"</div>";
}
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 = '<option selected disabled>-- Área --</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 += '<option selected value="' + obj.id + '">' + obj.nome + '</option>';
}else{
option += '<option value="' + obj.id + '">' + obj.nome + '</option>';
}
})
} else {
} else {
var option = "<option selected disabled>-- Área --</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 = '<option selected disabled>-- Sub Área --</option>';
}
$.each(dados, function(i, obj) {
$.each(dados, function(i, obj) {
if($('#oldSubArea').val() != null && $('#oldSubArea').val() == obj.id){
option += '<option selected value="' + obj.id + '">' + obj.nome + '</option>';
}else{
......@@ -756,4 +748,4 @@
}
</script>
@endsection
\ No newline at end of file
@endsection
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