Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Walter Felipe
submeta
Commits
3de5b15b
Commit
3de5b15b
authored
5 years ago
by
alinetenorio
Browse files
Options
Download
Email Patches
Plain Diff
salvando dados de submissão de projetos temporariamente
parent
364df050
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
app/Http/Controllers/TrabalhoController.php
+178
-95
app/Http/Controllers/TrabalhoController.php
database/migrations/2020_06_15_160417_create_anexos_temps_table.php
+0
-41
...igrations/2020_06_15_160417_create_anexos_temps_table.php
resources/views/evento/submeterTrabalho.blade.php
+8
-5
resources/views/evento/submeterTrabalho.blade.php
routes/web.php
+1
-0
routes/web.php
with
187 additions
and
141 deletions
+187
-141
app/Http/Controllers/TrabalhoController.php
View file @
3de5b15b
...
@@ -95,7 +95,7 @@ class TrabalhoController extends Controller
...
@@ -95,7 +95,7 @@ class TrabalhoController extends Controller
}
}
//--Salvando os anexos da submissão temporariamente
//--Salvando os anexos da submissão temporariamente
$this
->
armazenar
Anexos
Temp
(
$request
,
Auth
::
user
()
->
id
);
$trabalho
=
$this
->
armazenar
Info
Temp
(
$request
,
$proponente
);
//O anexo de Decisão do CONSU dependo do tipo de edital
//O anexo de Decisão do CONSU dependo do tipo de edital
if
(
$evento
->
tipo
==
'PIBIC'
||
$evento
->
tipo
==
'PIBIC-EM'
){
if
(
$evento
->
tipo
==
'PIBIC'
||
$evento
->
tipo
==
'PIBIC-EM'
){
...
@@ -125,28 +125,28 @@ class TrabalhoController extends Controller
...
@@ -125,28 +125,28 @@ class TrabalhoController extends Controller
]);
]);
//dd($request->all());
//dd($request->all());
$trabalho
=
Trabalho
::
create
([
//
$trabalho = Trabalho::create([
'titulo'
=
>
$request
->
nomeProjeto
,
$trabalho
[
'titulo'
]
=
$request
->
nomeProjeto
;
'coordenador_id'
=
>
$coordenador
->
id
,
$trabalho
[
'coordenador_id'
]
=
$coordenador
->
id
;
'grande_area_id'
=
>
$request
->
grandeArea
,
$trabalho
[
'grande_area_id'
]
=
$request
->
grandeArea
;
'area_id'
=
>
$request
->
area
,
$trabalho
[
'area_id'
]
=
$request
->
area
;
'sub_area_id'
=
>
$request
->
subArea
,
$trabalho
[
'sub_area_id'
]
=
$request
->
subArea
;
'pontuacaoPlanilha'
=
>
$request
->
pontuacaoPlanilha
,
$trabalho
[
'pontuacaoPlanilha'
]
=
$request
->
pontuacaoPlanilha
;
'linkGrupoPesquisa'
=
>
$request
->
linkGrupo
,
$trabalho
[
'linkGrupoPesquisa'
]
=
$request
->
linkGrupo
;
'linkLattesEstudante'
=
>
$request
->
linkLattesEstudante
,
$trabalho
[
'linkLattesEstudante'
]
=
$request
->
linkLattesEstudante
;
'data'
=
>
$mytime
,
$trabalho
[
'data'
]
=
$mytime
;
'evento_id'
=
>
$request
->
editalId
,
$trabalho
[
'evento_id'
]
=
$request
->
editalId
;
'avaliado'
=
>
0
,
$trabalho
[
'avaliado'
]
=
0
;
'status'
=
>
'Submetido'
,
$trabalho
[
'status'
]
=
'Submetido'
;
'proponente_id'
=
>
$proponente
->
id
,
$trabalho
[
'proponente_id'
]
=
$proponente
->
id
;
//Anexos
//Anexos
'anexoCONSU'
=
>
$request
->
anexoCONSU
!=
null
?
$request
->
anexoCONSU
:
""
,
$trabalho
[
'anexoCONSU'
]
=
$request
->
anexoCONSU
!=
null
?
$request
->
anexoCONSU
:
""
;
'anexoProjeto'
=
>
$request
->
anexoProjeto
!=
null
?
$request
->
anexoProjeto
:
""
,
$trabalho
[
'anexoProjeto'
]
=
$request
->
anexoProjeto
!=
null
?
$request
->
anexoProjeto
:
""
;
'anexoAutorizacaoComiteEtica'
=
>
$request
->
anexoComiteEtica
!=
null
?
$request
->
anexoComiteEtica
:
""
,
$trabalho
[
'anexoAutorizacaoComiteEtica'
]
=
$request
->
anexoComiteEtica
!=
null
?
$request
->
anexoComiteEtica
:
""
;
'justificativaAutorizacaoEtica'
=
>
$request
->
justificativaAutorizacaoEtica
!=
null
?
$request
->
justificativaAutorizacaoEtica
:
""
,
$trabalho
[
'justificativaAutorizacaoEtica'
]
=
$request
->
justificativaAutorizacaoEtica
!=
null
?
$request
->
justificativaAutorizacaoEtica
:
""
;
'anexoLattesCoordenador'
=
>
$request
->
anexoLattesCoordenador
!=
null
?
$request
->
anexoLattesCoordenador
:
""
,
$trabalho
[
'anexoLattesCoordenador'
]
=
$request
->
anexoLattesCoordenador
!=
null
?
$request
->
anexoLattesCoordenador
:
""
;
'anexoPlanilhaPontuacao'
=
>
$request
->
anexoPlanilha
!=
null
?
$request
->
anexoPlanilha
:
""
,
$trabalho
[
'anexoPlanilhaPontuacao'
]
=
$request
->
anexoPlanilha
!=
null
?
$request
->
anexoPlanilha
:
""
;
]);
//dd($trabalho);
//dd($trabalho);
}
else
{
}
else
{
//Caso em que o anexo da Decisão do CONSU não necessário
//Caso em que o anexo da Decisão do CONSU não necessário
...
@@ -169,28 +169,27 @@ class TrabalhoController extends Controller
...
@@ -169,28 +169,27 @@ class TrabalhoController extends Controller
'anexoPlanoTrabalho.*'
=>
[
'nullable'
,
'file'
,
'mimes:pdf'
,
'max:2000000'
],
'anexoPlanoTrabalho.*'
=>
[
'nullable'
,
'file'
,
'mimes:pdf'
,
'max:2000000'
],
]);
]);
$trabalho
=
Trabalho
::
create
([
//
$trabalho = Trabalho::create([
'titulo'
=
>
$request
->
nomeProjeto
,
$trabalho
[
'titulo'
]
=
$request
->
nomeProjeto
;
'coordenador_id'
=
>
$coordenador
->
id
,
$trabalho
[
'coordenador_id'
]
=
$coordenador
->
id
;
'grande_area_id'
=
>
$request
->
grandeArea
,
$trabalho
[
'grande_area_id'
]
=
$request
->
grandeArea
;
'area_id'
=
>
$request
->
area
,
$trabalho
[
'area_id'
]
=
$request
->
area
;
'sub_area_id'
=
>
$request
->
subArea
,
$trabalho
[
'sub_area_id'
]
=
$request
->
subArea
;
'pontuacaoPlanilha'
=
>
$request
->
pontuacaoPlanilha
,
$trabalho
[
'pontuacaoPlanilha'
]
=
$request
->
pontuacaoPlanilha
;
'linkGrupoPesquisa'
=
>
$request
->
linkGrupo
,
$trabalho
[
'linkGrupoPesquisa'
]
=
$request
->
linkGrupo
;
'linkLattesEstudante'
=
>
$request
->
linkLattesEstudante
,
$trabalho
[
'linkLattesEstudante'
]
=
$request
->
linkLattesEstudante
;
'data'
=
>
$mytime
,
$trabalho
[
'data'
]
=
$mytime
;
'evento_id'
=
>
$request
->
editalId
,
$trabalho
[
'evento_id'
]
=
$request
->
editalId
;
'avaliado'
=
>
0
,
$trabalho
[
'avaliado'
]
=
0
;
'status'
=
>
'Submetido'
,
$trabalho
[
'status'
]
=
'Submetido'
;
'proponente_id'
=
>
$proponente
->
id
,
$trabalho
[
'proponente_id'
]
=
$proponente
->
id
;
//Anexos
//Anexos
'anexoProjeto'
=>
$request
->
anexoProjeto
,
$trabalho
[
'anexoProjeto'
]
=
$request
->
anexoProjeto
;
'anexoAutorizacaoComiteEtica'
=>
$request
->
anexoComiteEtica
,
$trabalho
[
'anexoAutorizacaoComiteEtica'
]
=
$request
->
anexoComiteEtica
;
'justificativaAutorizacaoEtica'
=>
$request
->
justificativaAutorizacaoEtica
,
$trabalho
[
'justificativaAutorizacaoEtica'
]
=
$request
->
justificativaAutorizacaoEtica
;
'anexoLattesCoordenador'
=>
$request
->
anexoLattesCoordenador
,
$trabalho
[
'anexoLattesCoordenador'
]
=
$request
->
anexoLattesCoordenador
;
'anexoPlanilhaPontuacao'
=>
$request
->
anexoPlanilha
,
$trabalho
[
'anexoPlanilhaPontuacao'
]
=
$request
->
anexoPlanilha
;
]);
}
}
//Envia email com senha temp para cada participante do projeto
//Envia email com senha temp para cada participante do projeto
...
@@ -257,19 +256,7 @@ class TrabalhoController extends Controller
...
@@ -257,19 +256,7 @@ class TrabalhoController extends Controller
$pasta
=
'trabalhos/'
.
$request
->
editalId
.
'/'
.
$trabalho
->
id
;
$pasta
=
'trabalhos/'
.
$request
->
editalId
.
'/'
.
$trabalho
->
id
;
//-- Se existem anexos temporários, utilizá-los
$trabalho
=
$this
->
armazenarAnexosFinais
(
$request
,
$pasta
,
$trabalho
,
$evento
);
$anexosTemp
=
AnexosTemp
::
where
(
'eventoId'
,
$request
->
editalId
)
->
where
(
'proponenteId'
,
Auth
::
user
()
->
id
)
->
orderByDesc
(
'updated_at'
)
->
first
();
if
(
$anexosTemp
!=
null
){
$this
->
armazenarAnexosFinais
(
$anexosTemp
,
$request
,
$pasta
,
$trabalho
,
$evento
);
}
$trabalho
->
update
();
//Deletando arquivos temporários
Storage
::
deleteDirectory
(
'anexosTemp/'
.
$request
->
editalId
.
'/'
.
Auth
::
user
()
->
id
);
$anexosTemp
->
delete
();
$subject
=
"Submissão de Trabalho"
;
$subject
=
"Submissão de Trabalho"
;
$autor
=
Auth
()
->
user
();
$autor
=
Auth
()
->
user
();
...
@@ -281,91 +268,187 @@ class TrabalhoController extends Controller
...
@@ -281,91 +268,187 @@ class TrabalhoController extends Controller
return
redirect
()
->
route
(
'evento.visualizar'
,[
'id'
=>
$request
->
editalId
]);
return
redirect
()
->
route
(
'evento.visualizar'
,[
'id'
=>
$request
->
editalId
]);
}
}
public
function
storeParcial
(
Request
$request
){
// dd($request->all());
$mytime
=
Carbon
::
now
(
'America/Recife'
);
$mytime
=
$mytime
->
toDateString
();
$evento
=
Evento
::
find
(
$request
->
editalId
);
$coordenador
=
CoordenadorComissao
::
find
(
$evento
->
coordenadorId
);
//Relaciona o projeto criado com o proponente que criou o projeto
$proponente
=
Proponente
::
where
(
'user_id'
,
Auth
::
user
()
->
id
)
->
first
();
$trabalho
=
"trabalho"
;
//--Salvando os anexos da submissão temporariamente
$this
->
armazenarAnexosTemp
(
$request
,
Auth
::
user
()
->
id
);
$trabalho
=
Trabalho
::
create
([
'titulo'
=>
$request
->
nomeProjeto
!=
null
?
$request
->
nomeProjeto
:
""
,
'coordenador_id'
=>
$coordenador
->
id
!=
null
?
$request
->
coordenador
->
id
:
""
,
'grande_area_id'
=>
$request
->
grandeArea
!=
null
?
$request
->
grandeArea
:
""
,
'area_id'
=>
$request
->
area
!=
null
?
$request
->
area
:
""
,
'sub_area_id'
=>
$request
->
subArea
!=
null
?
$request
->
subArea
:
""
,
'pontuacaoPlanilha'
=>
$request
->
pontuacaoPlanilha
!=
null
?
$request
->
pontuacaoPlanilha
:
""
,
'linkGrupoPesquisa'
=>
$request
->
linkGrupo
!=
null
?
$request
->
linkGrupo
:
""
,
'linkLattesEstudante'
=>
$request
->
linkLattesEstudante
!=
null
?
$request
->
linkLattesEstudante
:
""
,
'data'
=>
$mytime
,
'evento_id'
=>
$request
->
editalId
!=
null
?
$request
->
editalId
:
""
,
'avaliado'
=>
0
,
'status'
=>
'Rascunho'
,
'proponente_id'
=>
$proponente
->
id
!=
null
?
$request
->
nomeProjeto
:
""
,
//Anexos
'anexoCONSU'
=>
$request
->
anexoCONSU
!=
null
?
$request
->
anexoCONSU
:
""
,
'anexoProjeto'
=>
$request
->
anexoProjeto
!=
null
?
$request
->
anexoProjeto
:
""
,
'anexoAutorizacaoComiteEtica'
=>
$request
->
anexoComiteEtica
!=
null
?
$request
->
anexoComiteEtica
:
""
,
'justificativaAutorizacaoEtica'
=>
$request
->
justificativaAutorizacaoEtica
!=
null
?
$request
->
justificativaAutorizacaoEtica
:
""
,
'anexoLattesCoordenador'
=>
$request
->
anexoLattesCoordenador
!=
null
?
$request
->
anexoLattesCoordenador
:
""
,
'anexoPlanilhaPontuacao'
=>
$request
->
anexoPlanilha
!=
null
?
$request
->
anexoPlanilha
:
""
,
]);
// Anexo Projeto
if
(
(
!
isset
(
$request
->
anexoProjeto
)
&&
$request
->
anexoProjetoPreenchido
==
'sim'
)
||
isset
(
$request
->
anexoProjeto
)){
Storage
::
putFileAs
(
$anexosTemp
->
anexoProjeto
,
$pasta
.
'/Projeto.pdf'
);
$trabalho
->
anexoProjeto
=
$pasta
.
'/Projeto.pdf'
;
}
//Anexo Decisão CONSU
if
(
$evento
->
tipo
==
'PIBIC'
||
$evento
->
tipo
==
'PIBIC-EM'
)
{
if
(
(
!
isset
(
$request
->
anexoCONSU
)
&&
$request
->
anexoConsuPreenchido
==
'sim'
)
||
isset
(
$request
->
anexoCONSU
)){
Storage
::
putFileAs
(
$anexosTemp
->
anexoDecisaoCONSU
,
$pasta
.
'/CONSU.pdf'
);
$trabalho
->
anexoDecisaoCONSU
=
$pasta
.
'/CONSU.pdf'
;
}
}
//Autorização ou Justificativa
if
(
(
!
isset
(
$request
->
anexoComiteEtica
)
&&
$request
->
anexoComitePreenchido
==
'sim'
)
||
isset
(
$request
->
anexoComiteEtica
)){
Storage
::
putFileAs
(
$anexosTemp
->
anexoAutorizacaoComiteEtica
,
$pasta
.
'/Comite_de_etica.pdf'
);
$trabalho
->
anexoAutorizacaoComiteEtica
=
$pasta
.
'/Comite_de_etica.pdf'
;
}
elseif
(
(
!
isset
(
$request
->
justificativaAutorizacaoEtica
)
&&
$request
->
anexoJustificativaPreenchido
==
'sim'
)
||
isset
(
$request
->
justificativaAutorizacaoEtica
)){
Storage
::
putFileAs
(
$anexosTemp
->
justificativaAutorizacaoEtica
,
$pasta
.
'/Justificativa.pdf'
);
$trabalho
->
justificativaAutorizacaoEtica
=
$pasta
.
'/Justificativa.pdf'
;
}
//Anexo Lattes
if
(
(
!
isset
(
$request
->
anexoLattesCoordenador
)
&&
$request
->
anexoLattesPreenchido
==
'sim'
)
||
isset
(
$request
->
anexoLattesCoordenador
)){
Storage
::
putFileAs
(
$anexosTemp
->
anexoLattesCoordenador
,
$pasta
.
'/Latter_Coordenador.pdf'
);
$trabalho
->
anexoLattesCoordenador
=
$pasta
.
'/Latter_Coordenador.pdf'
;
}
//Anexo Planilha
if
(
(
!
isset
(
$request
->
anexoPlanilha
)
&&
$request
->
anexoPlanilhaPreenchido
==
'sim'
)
||
isset
(
$request
->
anexoPlanilha
)){
Storage
::
putFileAs
(
$anexosTemp
->
anexoPlanilhaPontuacao
,
$pasta
.
'/Planilha.pdf'
);
$trabalho
->
anexoPlanilhaPontuacao
=
$pasta
.
'/Planilha.pdf'
;
}
}
//Armazena temporariamente anexos da submissão, no banco de dados e no storage
//Armazena temporariamente anexos da submissão, no banco de dados e no storage
public
function
armazenar
Anexos
Temp
(
Request
$request
,
$proponente
Id
){
public
function
armazenar
Info
Temp
(
Request
$request
,
$proponente
){
//---Anexos do Projeto
//---Anexos do Projeto
$
anexosTemp
=
AnexosTemp
::
where
(
'evento
I
d'
,
$request
->
editalId
)
->
where
(
'
proponenteId'
,
$proponenteId
)
$
trabalho
=
Trabalho
::
where
(
'proponente_id'
,
$proponente
->
id
)
->
where
(
'evento
_i
d'
,
$request
->
editalId
)
->
where
(
'
status'
,
'Rascunho'
)
->
orderByDesc
(
'updated_at'
)
->
first
();
->
orderByDesc
(
'updated_at'
)
->
first
();
// dd($trabalho);
if
(
$anexosTemp
==
null
){
if
(
$trabalho
==
null
){
$anexosTemp
=
new
AnexosTemp
();
$trabalho
=
new
Trabalho
();
$jaExiste
=
false
;
$trabalho
->
proponente_id
=
$proponente
->
id
;
}
else
{
$trabalho
->
evento_id
=
$request
->
editalId
;
$jaExiste
=
true
;
$trabalho
->
status
=
'Rascunho'
;
$stringKeys
=
[
'titulo'
,
'linkGrupoPesquisa'
,
'linkLattesEstudante'
,
'pontuacaoPlanilha'
,
'anexoProjeto'
,
'anexoPlanilhaPontuacao'
,
'anexoLattesCoordenador'
];
$intKeys
=
[
'grande_area_id'
,
'area_id'
,
'sub_area_id'
,
'coordenador_id'
];
$trabalho
->
fill
(
array_fill_keys
(
$stringKeys
,
""
)
+
array_fill_keys
(
$intKeys
,
1
)
)
->
save
();
// dd($trabalho);
}
if
(
!
(
is_null
(
$request
->
nomeProjeto
))
)
{
$trabalho
->
titulo
=
$request
->
nomeProjeto
;
}
if
(
!
(
is_null
(
$request
->
grandeArea
))){
$trabalho
->
grande_area_id
=
$request
->
grandeArea
;
}
if
(
!
(
is_null
(
$request
->
area
))){
$trabalho
->
area_id
=
$request
->
area
;
}
if
(
!
(
is_null
(
$request
->
subArea
))){
$trabalho
->
sub_area_id
=
$request
->
subArea
;
}
if
(
!
(
is_null
(
$request
->
pontuacaoPlanilha
))){
$trabalho
->
pontuacaoPlanilha
=
$request
->
pontuacaoPlanilha
;
}
if
(
!
(
is_null
(
$request
->
linkGrupo
))){
$trabalho
->
linkGrupoPesquisa
=
$request
->
linkGrupo
;
}
}
$pasta
=
'anexosTemp/'
.
$request
->
editalId
.
'/'
.
$proponenteId
;
//Anexos do projeto
$pasta
=
'trabalhos/'
.
$request
->
editalId
.
'/'
.
$trabalho
->
id
;
if
(
!
(
is_null
(
$request
->
anexoCONSU
))
)
{
if
(
!
(
is_null
(
$request
->
anexoCONSU
))
)
{
$
anexosTemp
->
anexoDecisaoCONSU
=
Storage
::
putFileAs
(
$pasta
,
$request
->
anexoCONSU
,
"CONSU.pdf"
);
$
trabalho
->
anexoDecisaoCONSU
=
Storage
::
putFileAs
(
$pasta
,
$request
->
anexoCONSU
,
"CONSU.pdf"
);
}
}
if
(
!
(
is_null
(
$request
->
anexoComiteEtica
)))
{
if
(
!
(
is_null
(
$request
->
anexoComiteEtica
)))
{
$
anexosTemp
->
anexoAutorizacaoComiteEtica
=
Storage
::
putFileAs
(
$pasta
,
$request
->
anexoComiteEtica
,
"Comite_de_etica.pdf"
);
$
trabalho
->
anexoAutorizacaoComiteEtica
=
Storage
::
putFileAs
(
$pasta
,
$request
->
anexoComiteEtica
,
"Comite_de_etica.pdf"
);
}
}
if
(
!
(
is_null
(
$request
->
justificativaAutorizacaoEtica
)))
{
if
(
!
(
is_null
(
$request
->
justificativaAutorizacaoEtica
)))
{
$
anexosTemp
->
justificativaAutorizacaoEtica
=
Storage
::
putFileAs
(
$pasta
,
$request
->
justificativaAutorizacaoEtica
,
"Justificativa.pdf"
);
$
trabalho
->
justificativaAutorizacaoEtica
=
Storage
::
putFileAs
(
$pasta
,
$request
->
justificativaAutorizacaoEtica
,
"Justificativa.pdf"
);
}
}
if
(
!
(
is_null
(
$request
->
anexoProjeto
)))
{
if
(
!
(
is_null
(
$request
->
anexoProjeto
)))
{
$
anexosTemp
->
anexoProjeto
=
Storage
::
putFileAs
(
$pasta
,
$request
->
anexoProjeto
,
"Projeto.pdf"
);
$
trabalho
->
anexoProjeto
=
Storage
::
putFileAs
(
$pasta
,
$request
->
anexoProjeto
,
"Projeto.pdf"
);
}
}
if
(
!
(
is_null
(
$request
->
anexoLattesCoordenador
)))
{
if
(
!
(
is_null
(
$request
->
anexoLattesCoordenador
)))
{
$
anexosTemp
->
anexoLattesCoordenador
=
Storage
::
putFileAs
(
$pasta
,
$request
->
anexoLattesCoordenador
,
"Latter_Coordenador.pdf"
);
$
trabalho
->
anexoLattesCoordenador
=
Storage
::
putFileAs
(
$pasta
,
$request
->
anexoLattesCoordenador
,
"Latter_Coordenador.pdf"
);
}
}
if
(
!
(
is_null
(
$request
->
anexoPlanilha
)))
{
if
(
!
(
is_null
(
$request
->
anexoPlanilha
)))
{
$anexosTemp
->
anexoPlanilhaPontuacao
=
Storage
::
putFileAs
(
$pasta
,
$request
->
anexoPlanilha
,
"Planilha.pdf"
);
$trabalho
->
anexoPlanilhaPontuacao
=
Storage
::
putFileAs
(
$pasta
,
$request
->
anexoPlanilha
,
"Planilha.pdf"
);
}
$anexosTemp
->
eventoId
=
$request
->
editalId
;
$anexosTemp
->
proponenteId
=
$proponenteId
;
if
(
!
$jaExiste
){
$anexosTemp
->
save
();
}
else
{
$anexosTemp
->
update
();
}
}
$trabalho
->
update
();
//---Anexos planos de trabalho
//---Anexos planos de trabalho
return
$trabalho
;
}
}
public
function
armazenarAnexosFinais
(
$anexosTemp
,
$request
,
$pasta
,
$trabalho
,
$evento
){
public
function
armazenarAnexosFinais
(
$request
,
$pasta
,
$trabalho
,
$evento
){
// Anexo Projeto
// Anexo Projeto
if
(
(
!
isset
(
$request
->
anexoProjeto
)
&&
$request
->
anexoProjetoPreenchido
==
'sim'
)
||
isset
(
$request
->
anexoProjeto
)){
if
(
(
!
isset
(
$request
->
anexoProjeto
)
&&
$request
->
anexoProjetoPreenchido
==
'sim'
)
||
isset
(
$request
->
anexoProjeto
)){
Storage
::
move
(
$anexosTemp
->
anexoProjeto
,
$pasta
.
'/Projeto.pdf'
);
$trabalho
->
anexoProjetoStorage
::
putFileAs
(
$pasta
,
$request
->
anexoProjeto
,
'Projeto.pdf'
);
$trabalho
->
anexoProjeto
=
$pasta
.
'/Projeto.pdf'
;
}
}
//Anexo Decisão CONSU
//Anexo Decisão CONSU
if
(
$evento
->
tipo
==
'PIBIC'
||
$evento
->
tipo
==
'PIBIC-EM'
)
{
if
(
$evento
->
tipo
==
'PIBIC'
||
$evento
->
tipo
==
'PIBIC-EM'
)
{
if
(
(
!
isset
(
$request
->
anexoCONSU
)
&&
$request
->
anexoConsuPreenchido
==
'sim'
)
||
isset
(
$request
->
anexoCONSU
)){
if
(
(
!
isset
(
$request
->
anexoCONSU
)
&&
$request
->
anexoConsuPreenchido
==
'sim'
)
||
isset
(
$request
->
anexoCONSU
)){
Storage
::
move
(
$anexosTemp
->
anexoDecisaoCONSU
,
$pasta
.
'/CONSU.pdf'
);
$trabalho
->
anexoDecisaoCONSUStorage
::
putFileAs
(
$pasta
,
$request
->
anexoDecisaoCONSU
,
'CONSU.pdf'
);
$trabalho
->
anexoDecisaoCONSU
=
$pasta
.
'/CONSU.pdf'
;
}
}
}
}
//Autorização ou Justificativa
//Autorização ou Justificativa
if
(
(
!
isset
(
$request
->
anexoComiteEtica
)
&&
$request
->
anexoComitePreenchido
==
'sim'
)
||
isset
(
$request
->
anexoComiteEtica
)){
if
(
(
!
isset
(
$request
->
anexoComiteEtica
)
&&
$request
->
anexoComitePreenchido
==
'sim'
)
||
isset
(
$request
->
anexoComiteEtica
)){
Storage
::
move
(
$anexosTemp
->
anexoAutorizacaoComiteEtica
,
$pasta
.
'/Comite_de_etica.pdf'
);
$trabalho
->
anexoAutorizacaoComiteEtica
=
Storage
::
putFileAs
(
$pasta
,
$request
->
anexoAutorizacaoComiteEtica
,
'Comite_de_etica.pdf'
);
$trabalho
->
anexoAutorizacaoComiteEtica
=
$pasta
.
'/Comite_de_etica.pdf'
;
}
elseif
(
(
!
isset
(
$request
->
justificativaAutorizacaoEtica
)
&&
$request
->
anexoJustificativaPreenchido
==
'sim'
)
||
isset
(
$request
->
justificativaAutorizacaoEtica
)){
}
elseif
(
(
!
isset
(
$request
->
justificativaAutorizacaoEtica
)
&&
$request
->
anexoJustificativaPreenchido
==
'sim'
)
||
isset
(
$request
->
justificativaAutorizacaoEtica
)){
Storage
::
move
(
$anexosTemp
->
justificativaAutorizacaoEtica
,
$pasta
.
'/Justificativa.pdf'
);
$trabalho
->
justificativaAutorizacaoEtica
=
Storage
::
putFileAs
(
$pasta
,
$request
->
justificativaAutorizacaoEtica
,
'Justificativa.pdf'
);
$trabalho
->
justificativaAutorizacaoEtica
=
$pasta
.
'/Justificativa.pdf'
;
}
}
//Anexo Lattes
//Anexo Lattes
if
(
(
!
isset
(
$request
->
anexoLattesCoordenador
)
&&
$request
->
anexoLattesPreenchido
==
'sim'
)
||
isset
(
$request
->
anexoLattesCoordenador
)){
if
(
(
!
isset
(
$request
->
anexoLattesCoordenador
)
&&
$request
->
anexoLattesPreenchido
==
'sim'
)
||
isset
(
$request
->
anexoLattesCoordenador
)){
Storage
::
move
(
$anexosTemp
->
anexoLattesCoordenador
,
$pasta
.
'/Latter_Coordenador.pdf'
);
$trabalho
->
anexoLattesCoordenadorStorage
::
putFileAs
(
$pasta
,
$request
->
anexoLattesCoordenador
,
'Latter_Coordenador.pdf'
);
$trabalho
->
anexoLattesCoordenador
=
$pasta
.
'/Latter_Coordenador.pdf'
;
}
}
//Anexo Planilha
//Anexo Planilha
if
(
(
!
isset
(
$request
->
anexoPlanilha
)
&&
$request
->
anexoPlanilhaPreenchido
==
'sim'
)
||
isset
(
$request
->
anexoPlanilha
)){
if
(
(
!
isset
(
$request
->
anexoPlanilha
)
&&
$request
->
anexoPlanilhaPreenchido
==
'sim'
)
||
isset
(
$request
->
anexoPlanilha
)){
Storage
::
move
(
$anexosTemp
->
anexoPlanilhaPontuacao
,
$pasta
.
'/Planilha.pdf'
);
$trabalho
->
anexoPlanilhaPontuacao
=
Storage
::
putFileAs
(
$pasta
,
$request
->
anexoPlanilhaPontuacao
,
'Planilha.pdf'
);
$trabalho
->
anexoPlanilhaPontuacao
=
$pasta
.
'/Planilha.pdf'
;
}
}
$trabalho
->
update
();
return
$trabalho
;
}
}
/**
/**
* Display the specified resource.
* Display the specified resource.
...
...
This diff is collapsed.
Click to expand it.
database/migrations/2020_06_15_160417_create_anexos_temps_table.php
deleted
100644 → 0
View file @
364df050
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
class
CreateAnexosTempsTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
create
(
'anexos_temps'
,
function
(
Blueprint
$table
)
{
$table
->
bigIncrements
(
'id'
);
$table
->
timestamps
();
$table
->
string
(
'anexoProjeto'
)
->
nullable
();
$table
->
string
(
'anexoDecisaoCONSU'
)
->
nullable
();
$table
->
string
(
'anexoPlanilhaPontuacao'
)
->
nullable
();
$table
->
string
(
'anexoLattesCoordenador'
)
->
nullable
();
$table
->
string
(
'anexoAutorizacaoComiteEtica'
)
->
nullable
();
$table
->
string
(
'justificativaAutorizacaoEtica'
)
->
nullable
();
$table
->
integer
(
'eventoId'
);
$table
->
integer
(
'proponenteId'
);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
dropIfExists
(
'anexos_temps'
);
}
}
This diff is collapsed.
Click to expand it.
resources/views/evento/submeterTrabalho.blade.php
View file @
3de5b15b
...
@@ -388,14 +388,17 @@
...
@@ -388,14 +388,17 @@
</
p
>
</
p
>
<
div
class
=
"row justify-content-center"
>
<
div
class
=
"row justify-content-center"
>
<
div
class
=
"col-md-6"
>
<
div
class
=
"col-md-6"
>
<
a
href
=
"
{
{route('evento.visualizar',['id'=>$edital->id])}
}
"
class
=
"btn btn-secondary"
style
=
"width:100%"
>
Cancelar
</
a
>
<
button
type
=
"submit"
formaction
=
"
{
{route('trabalho.storeParcial')}
}
"
class
=
"btn btn-primary"
style
=
"width:100%;margin-bottom:10px"
>
</
div
>
{{
__
(
'Salvar como Rascunho'
)
}}
<
div
class
=
"col-md-6"
>
</
button
>
</
div
>
<
div
class
=
"col-md-6"
>
<
button
type
=
"submit"
class
=
"btn btn-primary"
style
=
"width:100%"
>
<
button
type
=
"submit"
class
=
"btn btn-primary"
style
=
"width:100%"
>
{{
__
(
'Enviar'
)
}}
{{
__
(
'Enviar
Projeto
'
)
}}
</
button
>
</
button
>
</
div
>
</
div
>
</
div
>
</
div
>
<
a
href
=
"
{
{route('evento.visualizar',['id'=>$edital->id])}
}
"
class
=
"btn btn-secondary"
style
=
"width:100%"
>
Cancelar
</
a
>
</
form
>
</
form
>
</
div
>
</
div
>
</
div
>
</
div
>
...
...
This diff is collapsed.
Click to expand it.
routes/web.php
View file @
3de5b15b
...
@@ -94,6 +94,7 @@ Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function(){
...
@@ -94,6 +94,7 @@ Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function(){
Route
::
get
(
'/trabalho/visualizar/{id}'
,
'TrabalhoController@show'
)
->
name
(
'trabalho.show'
);
Route
::
get
(
'/trabalho/visualizar/{id}'
,
'TrabalhoController@show'
)
->
name
(
'trabalho.show'
);
Route
::
post
(
'/trabalho/novaVersao'
,
'TrabalhoController@novaVersao'
)
->
name
(
'trabalho.novaVersao'
);
Route
::
post
(
'/trabalho/novaVersao'
,
'TrabalhoController@novaVersao'
)
->
name
(
'trabalho.novaVersao'
);
Route
::
post
(
'/trabalho/criar'
,
'TrabalhoController@store'
)
->
name
(
'trabalho.store'
);
Route
::
post
(
'/trabalho/criar'
,
'TrabalhoController@store'
)
->
name
(
'trabalho.store'
);
Route
::
post
(
'/trabalho/criarRascunho'
,
'TrabalhoController@storeParcial'
)
->
name
(
'trabalho.storeParcial'
);
Route
::
get
(
'/edital/{id}/projetos'
,
'TrabalhoController@projetosDoEdital'
)
->
name
(
'projetos.edital'
);
Route
::
get
(
'/edital/{id}/projetos'
,
'TrabalhoController@projetosDoEdital'
)
->
name
(
'projetos.edital'
);
Route
::
get
(
'/projeto/{id}/visualizar'
,
'TrabalhoController@show'
)
->
name
(
'trabalho.show'
);
Route
::
get
(
'/projeto/{id}/visualizar'
,
'TrabalhoController@show'
)
->
name
(
'trabalho.show'
);
Route
::
get
(
'/projeto/{id}/editar'
,
'TrabalhoController@edit'
)
->
name
(
'trabalho.editar'
);
Route
::
get
(
'/projeto/{id}/editar'
,
'TrabalhoController@edit'
)
->
name
(
'trabalho.editar'
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment