Commit 0cc7d27b authored by carlos's avatar carlos
Browse files

Merge branch 'master-test' of https://github.com/lmts-ufape/submeta into master-test

parents 3efb6588 23b38064
......@@ -93,7 +93,7 @@ class TrabalhoController extends Controller
// return view('proponente.cadastro');
// }
//$trabalho->proponentes()->save($proponente);
//dd($proponente);
$trabalho = "trabalho";
if($evento->inicioSubmissao > $mytime){
if($mytime >= $evento->fimSubmissao){
......@@ -131,7 +131,7 @@ class TrabalhoController extends Controller
'anexoPlanilha' => [($request->anexoPlanilhaPreenchido!=='sim'?'required':''), 'file', 'mimes:pdf,xls,xlsx', 'max:2048'],
'anexoPlanoTrabalho.*' => ['nullable', 'file', 'mimes:pdf', 'max:2048'],
]);
dd($request->all());
if(gettype($this->validarAnexosRascunho($request, $trabalho)) != 'integer'){
return $this->validarAnexosRascunho($request, $trabalho);
}
......@@ -680,7 +680,8 @@ class TrabalhoController extends Controller
$userParticipante = User::where('email', $value)->first();
if($userParticipante == null){
$passwordTemporario = Str::random(8);
Mail::to($value)->send(new EmailParaUsuarioNaoCadastrado(Auth()->user()->name, ' ', 'Participante', $evento->nome, $passwordTemporario));
$subject = "Participante de Projeto";
Mail::to($value)->send(new EmailParaUsuarioNaoCadastrado(Auth()->user()->name, ' ', 'Participante', $evento->nome, $passwordTemporario, $subject));
$usuario = User::create([
'email' => $value,
'password' => bcrypt($passwordTemporario),
......@@ -707,7 +708,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 .'/';
......
......@@ -68,7 +68,7 @@ return [
'numeric' => ':Attribute deve ser :size.',
'file' => ':Attribute deve ter :size kilobytes.',
'string' => ':Attribute deve ter :size caracteres.',
'array' => ':Attribute deve conter :size itens.',
'array' => 'Preencha todos os campos.',
],
'string' => ':Attribute deve ser uma string',
'timezone' => ':Attribute deve ser uma timezone válida.',
......
......@@ -69,7 +69,7 @@ return [
'numeric' => ':Attribute deve ser :size.',
'file' => ':Attribute deve ter :size kilobytes.',
'string' => ':Attribute deve ter :size caracteres.',
'array' => ':Attribute deve conter :size itens.',
'array' => 'Preencha todos os campos.',
],
'string' => ':Attribute deve ser uma string',
'timezone' => ':Attribute deve ser uma timezone válida.',
......
......@@ -437,7 +437,7 @@
@if (Auth()->user()->administradors != null)
<a href="{{ route('admin.editais') }}" class="btn btn-secondary" style="width:100%">Cancelar</a>
@else
<a href="{{ route('projetos.edital', ['id' => $edital->id]) }}" class="btn btn-secondary" style="width:100%">Cancelar</a>
<a href="{{ route('proponente.projetosEdital', ['id' => $edital->id]) }}" class="btn btn-secondary" style="width:100%">Cancelar</a>
@endif
</form>
</div>
......
......@@ -478,37 +478,15 @@
});
// Habilitando / desabilitando plano de trabalho
$('.simPlano').click(function(e) {
$(document).on('click', '.simPlano', 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";
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];
var plano = $(this).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');
});
//se há plano de trabalho, esconder a imagem de deletar
......@@ -538,11 +516,18 @@
function montarLinhaInput() {
return "<div id="+"novoParticipante"+">" +
"<div class='row'>"+
"<div class='col-sm-9'>"+
"<br><h4>Dados do participante</h4>" +
"</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"+" required>"+
"<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>" +
......@@ -550,8 +535,8 @@
"@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>" +
"<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>" +
......@@ -559,7 +544,7 @@
"@enderror" +
"</div>"+
"<div class='col-sm-3'>"+
"<label>Função:</label>"+
"<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)"+
......@@ -573,11 +558,15 @@
"</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,15 +574,15 @@
"@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>"+
......@@ -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(){
......
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