diff --git a/app/Http/Controllers/TrabalhoController.php b/app/Http/Controllers/TrabalhoController.php index 56163aa1291c5723935b524d7271877bcafb2f4e..8336fa0fece681bae3859487d33f7556ec7a99f9 100755 --- a/app/Http/Controllers/TrabalhoController.php +++ b/app/Http/Controllers/TrabalhoController.php @@ -805,15 +805,24 @@ class TrabalhoController extends Controller return back()->withErrors(['Proposta não encontrada']); } - $trabalho->update($request->except([ - 'anexoProjeto', 'anexoDecisaoCONSU', 'anexoPlanilhaPontuacao', - 'anexoLattesCoordenador', 'anexoGrupoPesquisa', 'justificativaAutorizacaoEtica', 'anexoAutorizacaoComiteEtica' + if($evento->tipo=="PIBEX"){ + $trabalho->update($request->except([ + 'anexoProjeto', 'anexoDecisaoCONSU','modalidade' + ])); + }else{ + $trabalho->update($request->except([ + 'anexoProjeto', 'anexoDecisaoCONSU', 'anexoPlanilhaPontuacao', + 'anexoLattesCoordenador', 'anexoGrupoPesquisa', 'anexoAutorizacaoComiteEtica', + 'justificativaAutorizacaoEtica','modalidade' + ])); + } - ])); $pasta = 'trabalhos/' . $evento->id . '/' . $trabalho->id; + $trabalho = $this->armazenarAnexosFinais($request, $pasta, $trabalho, $evento); $trabalho->save(); + if ($request->marcado == null) { $idExcluido = $trabalho->participantes->pluck('id'); @@ -883,8 +892,11 @@ class TrabalhoController extends Controller $endereco = Endereco::create($data); $endereco->user()->save($user); $participante = Participante::create($data); + $participante->data_entrada = $participante->created_at; $user->participantes()->save($participante); $trabalho->participantes()->save($participante); + $participante->trabalho_id = $trabalho->id; + $participante->save(); } else { // $user = $participante->user; @@ -905,10 +917,9 @@ class TrabalhoController extends Controller } - - if ($request->has('anexoPlanoTrabalho') && array_key_exists($part, $request->anexoPlanoTrabalho)) { - if (Arquivo::where('participanteId', $participante->id)->count()) { - $arquivo = Arquivo::where('participanteId', $participante->id)->first(); + if ($request->has('anexoPlanoTrabalho') && array_key_exists($part, $request->anexoPlanoTrabalho) && $request->nomePlanoTrabalho[$part] != null) { + if (Arquivo::where('participanteId', $participante->id)->where('trabalhoId', $trabalho->id)->count()) { + $arquivo = Arquivo::where('participanteId', $participante->id)->where('trabalhoId', $trabalho->id)->first(); $path = 'trabalhos/' . $evento->id . '/' . $trabalho->id . '/'; $nome = $data['nomePlanoTrabalho'] . ".pdf"; $titulo = $data['nomePlanoTrabalho']; diff --git a/resources/views/evento/formulario/participantes.blade.php b/resources/views/evento/formulario/participantes.blade.php index d865b31b0c64e30b394785240fdd335e0b690787..d6ba56aa98bf71424f811a45805862b710ebca42 100755 --- a/resources/views/evento/formulario/participantes.blade.php +++ b/resources/views/evento/formulario/participantes.blade.php @@ -1,4 +1,5 @@ +@php $cont= 0; @endphp
@@ -25,7 +26,10 @@
@@ -363,7 +367,7 @@
- +
diff --git a/resources/views/evento/submeterTrabalho.blade.php b/resources/views/evento/submeterTrabalho.blade.php index 41efa83460c87805840f48e89df2c4f4e453d50d..099b42a5484eaaacd5f332e91478bc017fd6a370 100755 --- a/resources/views/evento/submeterTrabalho.blade.php +++ b/resources/views/evento/submeterTrabalho.blade.php @@ -192,13 +192,17 @@ 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}`; } + }else{ + linkNome.innerText = `Discente `+(id+1); + } + if(id >=1){ + document.getElementById("cancelar"+(id-1)).setAttribute("disabled", true); } document.getElementById("checkB"+id).checked = true; @@ -210,7 +214,9 @@ } 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("part"+id).setAttribute("hidden",true); $("#atribuir1").attr('data-target','#exampleModal'+(id)); diff --git a/resources/views/projeto/editaFormulario/anexos.blade.php b/resources/views/projeto/editaFormulario/anexos.blade.php index 7dd5d984e56921281a19297792242cd39cf804d3..6f31fa28fcd0f16f99c872416ed011a96858b13c 100755 --- a/resources/views/projeto/editaFormulario/anexos.blade.php +++ b/resources/views/projeto/editaFormulario/anexos.blade.php @@ -4,7 +4,7 @@
-
Anexos
+
Anexos do Projeto

diff --git a/resources/views/projeto/editaFormulario/participantes.blade.php b/resources/views/projeto/editaFormulario/participantes.blade.php old mode 100755 new mode 100644 index 48cb96d6ed65d9146a20eddb344161d15f04ecf3..5049d91f06f3fbca1cae728a330da588505c1799 --- a/resources/views/projeto/editaFormulario/participantes.blade.php +++ b/resources/views/projeto/editaFormulario/participantes.blade.php @@ -1,713 +1,424 @@ -

4º Passo

-
Área do(s) discente(s)
-
-
-
-
-
Discente(s)
-
- {{-- --}} - {{-- --}} - Marque a caixa ao lado do discente que queira adicionar -
-
-

-
-
    -
  1. -
    -
    - @for($i = 0; $i < $edital->numParticipantes; $i++) - @php - $p = null; - if ($projeto->participantes->keys()->contains($i)) { - $p = $projeto->participantes[$i]; - } - - @endphp - - @if($p) -
    -
    - +
    +
    +
    +
    +
    +
    Dados do(s) Discente(s)
    + -
    - {{-- --}} - -
    -
    -
    -
    -
    - - -
    Dados do discente
    -
    - @component('componentes.input', ['label' => 'Nome completo']) - - - @error("name.".$i) - +
    +
    +
    +
      +
    1. +
      +
      + @for($i = 0; $i < $edital->numParticipantes; $i++) + @php + $participante = null; + if ($projeto->participantes->keys()->contains($i)) { + $participante = $projeto->participantes[$i]; + } + + @endphp + + + + -
      - -
    2. -
    +
  2. -
+ + +
+
+
+
- + + diff --git a/resources/views/projeto/editar.blade.php b/resources/views/projeto/editar.blade.php index 34f065cd4efcdcf1d003381903952a9acb64d0fb..757402d588a1782ea6b3630e5b4d8906225b912a 100755 --- a/resources/views/projeto/editar.blade.php +++ b/resources/views/projeto/editar.blade.php @@ -33,15 +33,11 @@ @include('projeto.editaFormulario.proponente') - - - @include('projeto.editaFormulario.anexos') - - + @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') @@ -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'); + } diff --git a/resources/views/proponente/projetos.blade.php b/resources/views/proponente/projetos.blade.php index 57599287e9842658aa6c3c771c928281be79fc25..46dc6c04376a61de4773a3835802b9904c35e09c 100755 --- a/resources/views/proponente/projetos.blade.php +++ b/resources/views/proponente/projetos.blade.php @@ -88,24 +88,28 @@