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
1f7fe929
Commit
1f7fe929
authored
Jul 14, 2020
by
Gabriel-31415
Browse files
Merge branch 'fixQtdParticipante' of
https://github.com/lmts-ufape/submeta
into master-test
merged
parents
89ee0f39
7486f122
Changes
2
Show whitespace changes
Inline
Side-by-side
app/Http/Controllers/TrabalhoController.php
View file @
1f7fe929
...
@@ -208,7 +208,6 @@ class TrabalhoController extends Controller
...
@@ -208,7 +208,6 @@ class TrabalhoController extends Controller
if
(
$request
->
emailParticipante
!=
null
){
if
(
$request
->
emailParticipante
!=
null
){
foreach
(
$request
->
emailParticipante
as
$key
=>
$value
)
{
foreach
(
$request
->
emailParticipante
as
$key
=>
$value
)
{
$userParticipante
=
User
::
where
(
'email'
,
$value
)
->
first
();
$userParticipante
=
User
::
where
(
'email'
,
$value
)
->
first
();
$participante
=
new
Participante
();
$participante
=
new
Participante
();
if
(
$userParticipante
==
null
){
if
(
$userParticipante
==
null
){
...
@@ -240,9 +239,7 @@ class TrabalhoController extends Controller
...
@@ -240,9 +239,7 @@ class TrabalhoController extends Controller
$participante
->
save
();
$participante
->
save
();
$userParticipante
->
participantes
()
->
save
(
$participante
);
$userParticipante
->
participantes
()
->
save
(
$participante
);
$userParticipante
->
save
();
$userParticipante
->
save
();
$participante
->
trabalhos
()
->
save
(
$trabalho
);
$participante
->
trabalhos
()
->
save
(
$trabalho
);
$subject
=
"Participante de Projeto"
;
$subject
=
"Participante de Projeto"
;
$email
=
$value
;
$email
=
$value
;
Mail
::
to
(
$email
)
Mail
::
to
(
$email
)
...
@@ -276,7 +273,6 @@ class TrabalhoController extends Controller
...
@@ -276,7 +273,6 @@ class TrabalhoController extends Controller
$pasta
=
'trabalhos/'
.
$request
->
editalId
.
'/'
.
$trabalho
->
id
;
$pasta
=
'trabalhos/'
.
$request
->
editalId
.
'/'
.
$trabalho
->
id
;
$trabalho
=
$this
->
armazenarAnexosFinais
(
$request
,
$pasta
,
$trabalho
,
$evento
);
$trabalho
=
$this
->
armazenarAnexosFinais
(
$request
,
$pasta
,
$trabalho
,
$evento
);
$subject
=
"Submissão de Trabalho"
;
$subject
=
"Submissão de Trabalho"
;
$autor
=
Auth
()
->
user
();
$autor
=
Auth
()
->
user
();
$evento
=
$evento
;
$evento
=
$evento
;
...
@@ -430,78 +426,6 @@ class TrabalhoController extends Controller
...
@@ -430,78 +426,6 @@ class TrabalhoController extends Controller
$trabalho
->
update
();
$trabalho
->
update
();
//Planos de trabalho
//Envia email com senha temp para cada participante do projeto
if
(
$request
->
emailParticipante
!=
null
){
foreach
(
$request
->
emailParticipante
as
$key
=>
$value
)
{
$userParticipante
=
User
::
where
(
'email'
,
$value
)
->
first
();
$participante
=
new
Participante
();
// Se participante ainda não existe
if
(
$userParticipante
==
null
){
$passwordTemporario
=
Str
::
random
(
8
);
// Mail::to($value)->send(new EmailParaUsuarioNaoCadastrado(Auth()->user()->name, ' ', 'Participante', $evento->nome, $passwordTemporario));
$usuario
=
User
::
create
([
'email'
=>
$value
,
'password'
=>
bcrypt
(
$passwordTemporario
),
'usuarioTemp'
=>
true
,
'name'
=>
$request
->
nomeParticipante
[
$key
],
'tipo'
=>
'participante'
,
]);
$participante
->
user_id
=
$usuario
->
id
;
$participante
->
trabalho_id
=
$trabalho
->
id
;
$participante
->
funcao_participante_id
=
$request
->
funcaoParticipante
[
$key
];
$participante
->
save
();
$usuario
->
participantes
()
->
save
(
$participante
);
$usuario
->
save
();
$participante
->
trabalhos
()
->
save
(
$trabalho
);
}
else
{
$participante
->
user_id
=
$userParticipante
->
id
;
$participante
->
trabalho_id
=
$trabalho
->
id
;
$participante
->
funcao_participante_id
=
$request
->
funcaoParticipante
[
$key
];
$participante
->
save
();
$userParticipante
->
participantes
()
->
save
(
$participante
);
$userParticipante
->
save
();
$participante
->
trabalhos
()
->
save
(
$trabalho
);
$subject
=
"Participante de Projeto"
;
$email
=
$value
;
// Mail::to($email)
// ->send(new SubmissaoTrabalho($userParticipante, $subject, $evento, $trabalho));
}
if
(
$request
->
nomePlanoTrabalho
[
$key
]
!=
null
){
$usuario
=
User
::
where
(
'email'
,
$value
)
->
first
();
$participante
=
Participante
::
where
([[
'user_id'
,
'='
,
$usuario
->
id
],
[
'trabalho_id'
,
'='
,
$trabalho
->
id
]])
->
first
();
$path
=
'trabalhos/'
.
$request
->
editalId
.
'/'
.
$trabalho
->
id
.
'/'
;
$nome
=
$request
->
nomePlanoTrabalho
[
$key
]
.
".pdf"
;
$file
=
$request
->
anexoPlanoTrabalho
[
$key
];
Storage
::
putFileAs
(
$path
,
$file
,
$nome
);
$mytime
=
Carbon
::
now
(
'America/Recife'
);
$mytime
=
$mytime
->
toDateString
();
$arquivo
=
new
Arquivo
();
$arquivo
->
titulo
=
$request
->
nomePlanoTrabalho
[
$key
];
$arquivo
->
nome
=
$path
.
$nome
;
$arquivo
->
trabalhoId
=
$trabalho
->
id
;
$arquivo
->
data
=
$mytime
;
$arquivo
->
participanteId
=
$participante
->
id
;
$arquivo
->
versaoFinal
=
true
;
$arquivo
->
save
();
}
}
}
return
$trabalho
;
return
$trabalho
;
}
}
/**
/**
...
...
resources/views/evento/submeterTrabalho.blade.php
View file @
1f7fe929
...
@@ -106,6 +106,7 @@
...
@@ -106,6 +106,7 @@
@else
@else
value=""
value=""
@endif >
@endif >
<small>Exemplo: http://lattes.cnpq.br/8363536830656923</small>
@error('linkLattesEstudante')
@error('linkLattesEstudante')
<span class="
invalid
-
feedback
" role="
alert
" style="
overflow
:
visible
;
display
:
block
">
<span class="
invalid
-
feedback
" role="
alert
" style="
overflow
:
visible
;
display
:
block
">
...
@@ -129,6 +130,7 @@
...
@@ -129,6 +130,7 @@
<input class="
form
-
control
@
error
(
'linkGrupo'
)
is
-
invalid
@
enderror
" type="
text
" name="
linkGrupo
"
<input class="
form
-
control
@
error
(
'linkGrupo'
)
is
-
invalid
@
enderror
" type="
text
" name="
linkGrupo
"
value="
{{
old
(
'linkGrupo'
)
!==
null
?
old
(
'linkGrupo'
)
:
(
isset
(
$rascunho
)
?
$rascunho
->
linkGrupoPesquisa
:
''
)}}
">
value="
{{
old
(
'linkGrupo'
)
!==
null
?
old
(
'linkGrupo'
)
:
(
isset
(
$rascunho
)
?
$rascunho
->
linkGrupoPesquisa
:
''
)}}
">
<small>Exemplo: http://dgp.cnpq.br/dgp/espelhogrupo/228363</small>
@error('linkGrupo')
@error('linkGrupo')
<span class="
invalid
-
feedback
" role="
alert
" style="
overflow
:
visible
;
display
:
block
">
<span class="
invalid
-
feedback
" role="
alert
" style="
overflow
:
visible
;
display
:
block
">
<strong>{{
$message
}}</strong>
<strong>{{
$message
}}</strong>
...
...
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