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