Commit ad8c2e48 authored by unknown's avatar unknown
Browse files

Merge branch 'master' of https://github.com/antonioDurval/submeta

parents d797e153 f556479a
...@@ -805,15 +805,24 @@ class TrabalhoController extends Controller ...@@ -805,15 +805,24 @@ class TrabalhoController extends Controller
return back()->withErrors(['Proposta não encontrada']); return back()->withErrors(['Proposta não encontrada']);
} }
$trabalho->update($request->except([ if($evento->tipo=="PIBEX"){
'anexoProjeto', 'anexoDecisaoCONSU', 'anexoPlanilhaPontuacao', $trabalho->update($request->except([
'anexoLattesCoordenador', 'anexoGrupoPesquisa', 'justificativaAutorizacaoEtica', 'anexoAutorizacaoComiteEtica' 'anexoProjeto', 'anexoDecisaoCONSU','modalidade'
]));
}else{
$trabalho->update($request->except([
'anexoProjeto', 'anexoDecisaoCONSU', 'anexoPlanilhaPontuacao',
'anexoLattesCoordenador', 'anexoGrupoPesquisa', 'anexoAutorizacaoComiteEtica',
'justificativaAutorizacaoEtica','modalidade'
]));
}
]));
$pasta = 'trabalhos/' . $evento->id . '/' . $trabalho->id; $pasta = 'trabalhos/' . $evento->id . '/' . $trabalho->id;
$trabalho = $this->armazenarAnexosFinais($request, $pasta, $trabalho, $evento); $trabalho = $this->armazenarAnexosFinais($request, $pasta, $trabalho, $evento);
$trabalho->save(); $trabalho->save();
if ($request->marcado == null) { if ($request->marcado == null) {
$idExcluido = $trabalho->participantes->pluck('id'); $idExcluido = $trabalho->participantes->pluck('id');
...@@ -883,8 +892,11 @@ class TrabalhoController extends Controller ...@@ -883,8 +892,11 @@ class TrabalhoController extends Controller
$endereco = Endereco::create($data); $endereco = Endereco::create($data);
$endereco->user()->save($user); $endereco->user()->save($user);
$participante = Participante::create($data); $participante = Participante::create($data);
$participante->data_entrada = $participante->created_at;
$user->participantes()->save($participante); $user->participantes()->save($participante);
$trabalho->participantes()->save($participante); $trabalho->participantes()->save($participante);
$participante->trabalho_id = $trabalho->id;
$participante->save();
} else { } else {
// $user = $participante->user; // $user = $participante->user;
...@@ -905,10 +917,9 @@ class TrabalhoController extends Controller ...@@ -905,10 +917,9 @@ class TrabalhoController extends Controller
} }
if ($request->has('anexoPlanoTrabalho') && array_key_exists($part, $request->anexoPlanoTrabalho) && $request->nomePlanoTrabalho[$part] != null) {
if ($request->has('anexoPlanoTrabalho') && array_key_exists($part, $request->anexoPlanoTrabalho)) { if (Arquivo::where('participanteId', $participante->id)->where('trabalhoId', $trabalho->id)->count()) {
if (Arquivo::where('participanteId', $participante->id)->count()) { $arquivo = Arquivo::where('participanteId', $participante->id)->where('trabalhoId', $trabalho->id)->first();
$arquivo = Arquivo::where('participanteId', $participante->id)->first();
$path = 'trabalhos/' . $evento->id . '/' . $trabalho->id . '/'; $path = 'trabalhos/' . $evento->id . '/' . $trabalho->id . '/';
$nome = $data['nomePlanoTrabalho'] . ".pdf"; $nome = $data['nomePlanoTrabalho'] . ".pdf";
$titulo = $data['nomePlanoTrabalho']; $titulo = $data['nomePlanoTrabalho'];
......
<!-- Participantes --> <!-- Participantes -->
@php $cont= 0; @endphp
<div class="col-md-12" style="margin-top: 20px"> <div class="col-md-12" style="margin-top: 20px">
<div class="card" style="border-radius: 5px"> <div class="card" style="border-radius: 5px">
<div class="card-body" style="padding-top: 0.2rem;"> <div class="card-body" style="padding-top: 0.2rem;">
...@@ -25,7 +26,10 @@ ...@@ -25,7 +26,10 @@
</div> </div>
<div class="col-sm-8" style="display: flex; align-items: center;"> <div class="col-sm-8" style="display: flex; align-items: center;">
<a href="" style="" class="justify-content-center" data-toggle="modal" data-target="#exampleModal{{$i}}" id="nomePart{{$i+1}}"> <a href="" style="" class="justify-content-center" data-toggle="modal" data-target="#exampleModal{{$i}}" id="nomePart{{$i+1}}">
Discente {{$i+1}} @if(isset(old('marcado')[$i]))
@if(isset(old('name')[$i]))Nome: {{old('name')[$i]}} @else Discente {{$i+1}} @endif
@if(isset(old('nomePlanoTrabalho')[$i]))<br> Plano: {{old('nomePlanoTrabalho')[$i]}} @endif
@endif
</a> </a>
</div> </div>
</div> </div>
...@@ -363,7 +367,7 @@ ...@@ -363,7 +367,7 @@
</div> </div>
<div class="col-6"> <div class="col-6">
<button data-dismiss="modal" type="button" id="cancelar{{$i}}" class=" btn btn-danger" style="font-size: 16px" onclick="desmarcar({{$i}})">Cancelar</button> <button data-dismiss="modal" type="button" id="cancelar{{$i}}" class=" btn btn-danger" style="font-size: 16px" onclick="desmarcar({{$i}})" @if(isset(old('marcado')[$i+1])) disabled @endif>Cancelar</button>
</div> </div>
<div class="col-6"> <div class="col-6">
<button data-dismiss="modal" type="button" id="guardar{{$i}}" class="btn btn-success float-right" style="font-size: 16px" onclick="marcar({{$i}})">Salvar</button> <button data-dismiss="modal" type="button" id="guardar{{$i}}" class="btn btn-success float-right" style="font-size: 16px" onclick="marcar({{$i}})">Salvar</button>
......
...@@ -192,13 +192,17 @@ ...@@ -192,13 +192,17 @@
let linkNome = document.getElementById("nomePart"+(id+1)); let linkNome = document.getElementById("nomePart"+(id+1));
let linkTituloProj = document.getElementById("tituloProj"+(id+1)); let linkTituloProj = document.getElementById("tituloProj"+(id+1));
let planoTrabalho = document.getElementById("nomePlanoTrabalho"+id); let planoTrabalho = document.getElementById("nomePlanoTrabalho"+id);
if(nome.value != ""){ if(nome.value != ""){
if(planoTrabalho.value != ""){ if(planoTrabalho.value != ""){
linkNome.innerText = `Nome: ${nome.value} \n Plano: ${planoTrabalho.value}`; linkNome.innerText = `Nome: ${nome.value} \n Plano: ${planoTrabalho.value}`;
}else { }else {
linkNome.innerText = `Nome: ${nome.value}`; linkNome.innerText = `Nome: ${nome.value}`;
} }
}else{
linkNome.innerText = `Discente `+(id+1);
}
if(id >=1){
document.getElementById("cancelar"+(id-1)).setAttribute("disabled", true);
} }
document.getElementById("checkB"+id).checked = true; document.getElementById("checkB"+id).checked = true;
...@@ -210,7 +214,9 @@ ...@@ -210,7 +214,9 @@
} }
function desmarcar(id){ function desmarcar(id){
document.getElementById("arquivoPlano"+id).setAttribute("hidden", true); if(id >= 1){;
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));
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="card-body" style="padding-top: 0.2rem;"> <div class="card-body" style="padding-top: 0.2rem;">
<div class="container"> <div class="container">
<div class="form-row mt-3"> <div class="form-row mt-3">
<div class="col-md-12"><h5 style="color: #234B8B; font-weight: bold">Anexos</h5></div> <div class="col-md-12"><h5 style="color: #234B8B; font-weight: bold">Anexos do Projeto</h5></div>
</div> </div>
<hr style="border-top: 1px solid#1492E6; margin-bottom: 10px" > <hr style="border-top: 1px solid#1492E6; margin-bottom: 10px" >
......
This diff is collapsed.
...@@ -33,15 +33,11 @@ ...@@ -33,15 +33,11 @@
@include('projeto.editaFormulario.proponente') @include('projeto.editaFormulario.proponente')
@include('projeto.editaFormulario.anexos')
@include('projeto.editaFormulario.participantes') @include('projeto.editaFormulario.participantes')
{{-- @include('projeto.editaFormulario.participantes', ['estados' => $estados, 'enum_turno' => $enum_turno, 'edital'=>$edital, 'projeto' => $projeto])
--}} @include('projeto.editaFormulario.anexos')
@include('projeto.editaFormulario.finalizar') @include('projeto.editaFormulario.finalizar')
...@@ -222,7 +218,39 @@ ...@@ -222,7 +218,39 @@
}); });
function marcar(id){
let nome = document.getElementById("nome"+id);
let linkNome = document.getElementById("nomePart"+(id+1));
let linkTituloProj = document.getElementById("tituloProj"+(id+1));
let planoTrabalho = document.getElementById("nomePlanoTrabalho"+id);
if(nome.value != ""){
if(planoTrabalho.value != ""){
linkNome.innerText = `Nome: ${nome.value} \n Plano: ${planoTrabalho.value}`;
}else {
linkNome.innerText = `Nome: ${nome.value}`;
}
}
if(id >=1){
document.getElementById("cancelar"+(id-1)).setAttribute("disabled", true);
}
document.getElementById("checkB"+id).checked = true;
$("#atribuir1").attr('data-target','#exampleModal'+(id+1));
document.getElementById("part"+id).removeAttribute("hidden");
document.getElementById("exampleModal"+id).modal('hide');
}
function desmarcar(id){
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');
}
</script> </script>
......
...@@ -88,24 +88,28 @@ ...@@ -88,24 +88,28 @@
</a> </a>
<div class="dropdown-menu"> <div class="dropdown-menu">
@if($projeto->evento->inicioSubmissao <= $hoje && $hoje <= $projeto->evento->fimSubmissao)
<a href="{{ route('trabalho.editar', ['id' => $projeto->id]) }}" class="dropdown-item" style="text-align: center;">
Editar
</a>
<hr class="dropdown-hr">
@endif
@if( $projeto->status== 'aprovado') @if( $projeto->status== 'aprovado')
<a href="{{route('trabalho.trocaParticipante', ['evento_id' => $projeto->evento->id, 'projeto_id' => $projeto->id])}}" class="dropdown-item" style="text-align: center;"> <a href="{{route('trabalho.trocaParticipante', ['evento_id' => $projeto->evento->id, 'projeto_id' => $projeto->id])}}" class="dropdown-item" style="text-align: center;">
Solicitar Substituições Solicitar Substituições
</a> </a>
<hr class="dropdown-hr"> <hr class="dropdown-hr">
<a href="{{route('docComplementar.listar', ['projeto_id' => $projeto->id])}}" class="dropdown-item" style="text-align: center">
Documentos Complementares
</a>
{{--<hr class="dropdown-hr"> {{--<hr class="dropdown-hr">
<a href="" class="dropdown-item" style="text-align: center"> <a href="" class="dropdown-item" style="text-align: center">
Solicitar Certificado Solicitar Certificado
</a>--}} </a>--}}
<hr class="dropdown-hr">
@endif @endif
<a href="{{route('docComplementar.listar', ['projeto_id' => $projeto->id])}}" class="dropdown-item" style="text-align: center">
Documentos Complementares
</a>
<hr class="dropdown-hr">
<a href="{{ route('trabalho.show', ['id' => $projeto->id]) }}" class="dropdown-item" style="text-align: center"> <a href="{{ route('trabalho.show', ['id' => $projeto->id]) }}" class="dropdown-item" style="text-align: center">
Visualizar Visualizar
</a> </a>
...@@ -115,7 +119,6 @@ ...@@ -115,7 +119,6 @@
Relatórios Relatórios
</a> </a>
<hr class="dropdown-hr">
{{-- <a href="" class="dropdown-item" style="text-align: center"> {{-- <a href="" class="dropdown-item" style="text-align: center">
Recorrer Recorrer
</a> </a>
......
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