Commit c2c5a599 authored by Yuri Resende's avatar Yuri Resende
Browse files

Alterando a edisão de submisão de editais

parent bdb5d654
......@@ -58,15 +58,20 @@ class UpdateTrabalho extends FormRequest
$rules['rg.'.$value] = ['required', 'string'];
$rules['data_de_nascimento.'.$value] = ['required', 'string'];
$rules['curso.'.$value] = ['required', 'string'];
$rules['turno.'.$value] = ['required', 'string'];
$rules['ordem_prioridade.'.$value] = ['required', 'string'];
$rules['periodo_atual.'.$value] = ['required', 'string'];
$rules['total_periodos.'.$value] = ['required', 'string'];
if($evento->tipo != "PIBEX") {
if($evento->tipo != "PIBEX" && $evento->tipo != "CONTINUO") {
$rules['media_do_curso.' . $value] = ['required', 'string'];
}
$rules['anexoPlanoTrabalho.'.$value] = [Rule::requiredIf($participante->planoTrabalho == null)];
$rules['nomePlanoTrabalho.'.$value] = ['required', 'string'];
if($evento->tipo != "CONTINUO"){
$rules['turno.'.$value] = ['required', 'string'];
$rules['ordem_prioridade.'.$value] = ['required', 'string'];
$rules['periodo_atual.'.$value] = ['required', 'string'];
$rules['total_periodos.'.$value] = ['required', 'string'];
$rules['anexoPlanoTrabalho.'.$value] = [Rule::requiredIf($participante->planoTrabalho == null)];
$rules['nomePlanoTrabalho.'.$value] = ['required', 'string'];
}
}
}
......@@ -113,7 +118,6 @@ class UpdateTrabalho extends FormRequest
$rules['anexoProjeto'] = [Rule::requiredIf($projeto->anexoProjeto == null), 'mimes:pdf'];
$rules['anexoDecisaoCONSU'] = [Rule::requiredIf($evento->consu && $projeto->anexoDecisaoCONSU == null), 'mimes:pdf'];
}
return $rules;
}
}
......
......@@ -157,6 +157,7 @@
}
function preencherUsuarioExistente() {
console.log(modal_id);
if(!document.getElementById(`exampleModal${modal_id}`)){
exibirModalNumeroMaximoDeIntegrantes();
return;
......@@ -264,7 +265,11 @@
$(document).ready(function() {
@foreach($trabalhos_user as $trabalho_user)
modal_id += 1;
if(<?php echo json_encode($trabalho_user) ?>['funcao']){
modal_id += 1;
}
$('#integrante').append(`
<div id="integrante{{$trabalho_user->id}}" class="col-md-6">
<div class="row">
......
......@@ -88,7 +88,7 @@
@if (isset(old('funcao')[$i]))
Função: {{ old('funcao')[$i] }}
@else
Função: {{ $participante->funcao }}
Função: {{ $trabalhos_user[$i]->funcao->nome }}
@endif
@endif
<h6>
......@@ -103,8 +103,7 @@
id="cancelar{{ $i }}"
class=" btn btn-danger btn-sm"
style="font-size: 12px"
onclick="desmarcar({{ $i }})"
@if (isset(old('marcado')[$i + 1])) disabled @endif>Excluir</button>
onclick="desmarcar({{ $i }})">Excluir</button>
</div>
</div>
......
......@@ -232,20 +232,20 @@
let cpf = document.getElementById("cpf"+id);
let funcao = document.getElementById("funcao_participante");
let email = document.getElementById("email"+id);
let funcaoParticipantes = <?php echo json_encode($funcaoParticipantes); ?>;
if(nome.value != ""){
if(planoTrabalho != null && planoTrabalho.value != ""){
linkNome.innerText = `Nome: ${nome.value} \n Plano: ${planoTrabalho.value} \n E-mail: ${email.value} \n CPF: ${cpf.value}\nFunção: ${funcao.value}`;
linkNome.innerText = `Nome: ${nome.value} \n Plano: ${planoTrabalho.value} \n E-mail: ${email.value} \n CPF: ${cpf.value}\nFunção: ${funcaoParticipantes[funcao.value -1].nome}`;
}else {
linkNome.innerText = `Nome: ${nome.value} \n E-mail: ${email.value} \n CPF: ${cpf.value}\nFunção: ${funcao.value}`;
linkNome.innerText = `Nome: ${nome.value} \n E-mail: ${email.value} \n CPF: ${cpf.value}\nFunção: ${funcaoParticipantes[funcao.value -1].nome}`;
}
}
if(id >=1){
document.getElementById("cancelar"+(id-1)).setAttribute("disabled", true);
}
console.log(document.getElementById("exampleModal"+id));
// if(id >=1){
// document.getElementById("cancelar"+(id-1)).setAttribute("disabled", true);
// }
// console.log(document.getElementById("exampleModal"+id));
document.getElementById("checkB"+id).checked = true;
// $("#atribuir1").attr('data-target','#exampleModal'+(id+1));
......@@ -256,14 +256,15 @@
function desmarcar(id){
if(id >= 1){
document.getElementById("cancelar"+(id-1)).removeAttribute("disabled");
}
// if(id >= 1){
// document.getElementById("cancelar"+(id-1)).removeAttribute("disabled");
// }
document.getElementById("checkB"+id).checked = false;
document.getElementById("part"+id).setAttribute("hidden",true);
// $("#atribuir1").attr('data-target','#exampleModal'+(id));
// document.getElementById("exampleModal"+id).modal('hide');
modal_id -= 1;
console.log(modal_id);
}
@endif
</script>
......
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